mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-29 17:59:24 +00:00
adds the browser-rail header. fixes issue with aborted navigation dropping tasks to update browse lists
This commit is contained in:
parent
5f8b048a11
commit
3037028bd6
@ -1,5 +1,6 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import { get, set } from '@ember/object';
|
import { get, set } from '@ember/object';
|
||||||
|
import { alias } from '@ember/object/computed';
|
||||||
import { task } from 'ember-concurrency';
|
import { task } from 'ember-concurrency';
|
||||||
import { DatasetPlatform, nodeToQueryParams } from 'wherehows-web/constants';
|
import { DatasetPlatform, nodeToQueryParams } from 'wherehows-web/constants';
|
||||||
import { IBrowserRouteParams } from 'wherehows-web/routes/browse/entity';
|
import { IBrowserRouteParams } from 'wherehows-web/routes/browse/entity';
|
||||||
@ -65,6 +66,12 @@ export default class BrowserRail extends Component {
|
|||||||
*/
|
*/
|
||||||
params: IBrowserRouteParams;
|
params: IBrowserRouteParams;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text to be displayed at the top of the rail
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
header = alias('params.platform');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maintains a list the nodes platforms or prefixes available in the selected entity
|
* Maintains a list the nodes platforms or prefixes available in the selected entity
|
||||||
* @type {Array<IRailNode>}
|
* @type {Array<IRailNode>}
|
||||||
@ -87,12 +94,14 @@ export default class BrowserRail extends Component {
|
|||||||
* @type {TaskProperty<Promise<string[]>> & {perform: (a?: {} | undefined) => TaskInstance<Promise<string[]>>}}
|
* @type {TaskProperty<Promise<string[]>> & {perform: (a?: {} | undefined) => TaskInstance<Promise<string[]>>}}
|
||||||
* @memberof BrowserRail
|
* @memberof BrowserRail
|
||||||
*/
|
*/
|
||||||
getNodesTask = task(function*(this: BrowserRail): IterableIterator<Promise<Array<string>>> {
|
getNodesTask = task(function*(
|
||||||
|
this: BrowserRail
|
||||||
|
): IterableIterator<Promise<Array<string>> | Promise<Array<IRailNode>>> {
|
||||||
const { prefix, platform, entity } = get(this, 'params');
|
const { prefix, platform, entity } = get(this, 'params');
|
||||||
const nodes: Array<IRailNode> = mapNodeToRoute(<DatasetPlatform>platform, entity)(
|
const nodes: Array<IRailNode> = mapNodeToRoute(<DatasetPlatform>platform, entity)(
|
||||||
yield readPlatforms({ platform, prefix })
|
yield readPlatforms({ platform, prefix })
|
||||||
);
|
);
|
||||||
|
|
||||||
set(this, 'nodes', nodes);
|
set(this, 'nodes', nodes);
|
||||||
}).drop();
|
}).restartable();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,7 +97,7 @@ export default class BrowserViewport extends Component {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}).drop();
|
}).restartable();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Async requests for the list of entities and sets the value on class
|
* Async requests for the list of entities and sets the value on class
|
||||||
@ -113,7 +113,7 @@ export default class BrowserViewport extends Component {
|
|||||||
yield (<IGetEntityTaskStrategy>{
|
yield (<IGetEntityTaskStrategy>{
|
||||||
datasets: get(this, 'getDatasetsTask').perform('set', offset)
|
datasets: get(this, 'getDatasetsTask').perform('set', offset)
|
||||||
})[entity];
|
})[entity];
|
||||||
});
|
}).restartable();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The max possible entities that can currently be requested up to this.count
|
* The max possible entities that can currently be requested up to this.count
|
||||||
|
|||||||
@ -36,7 +36,8 @@ $pad-width: 16px;
|
|||||||
.nacho-filter-card {
|
.nacho-filter-card {
|
||||||
@include restyle(filter-card);
|
@include restyle(filter-card);
|
||||||
max-height: 625px;
|
max-height: 625px;
|
||||||
overflow: scroll;
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
{{browser/browser-rail nodes=nodes nodesTask=getNodesTask}}
|
{{browser/browser-rail nodes=nodes nodesTask=getNodesTask header=header}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user