mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-16 19:38:26 +00:00
Merge pull request #1265 from theseyi/bb-rebase
adds option to retry failed request for data system. propagates error…
This commit is contained in:
commit
52d77b8f17
@ -90,9 +90,16 @@ export default class DataSystemsContainer extends Component {
|
||||
*/
|
||||
getDataSystemsNodesTask = task(function*(this: DataSystemsContainer): IterableIterator<Promise<Array<string>>> {
|
||||
const { prefix = '', platform, entity } = get(this, 'params');
|
||||
const nodes = mapDataSystemsPathToLinkNode(<DatasetPlatform>platform, entity)(
|
||||
yield readPlatforms({ platform, prefix })
|
||||
);
|
||||
let nodes: Array<IDynamicLinkNode> = [];
|
||||
|
||||
try {
|
||||
nodes = mapDataSystemsPathToLinkNode(<DatasetPlatform>platform, entity)(
|
||||
yield readPlatforms({ platform, prefix })
|
||||
);
|
||||
} catch (e) {
|
||||
set(this, 'nodes', nodes);
|
||||
throw e;
|
||||
}
|
||||
|
||||
set(this, 'nodes', nodes);
|
||||
}).restartable();
|
||||
|
@ -1,9 +1,5 @@
|
||||
.data-systems-container {
|
||||
// additional offset to compensate for browser lack of respect for the margin-top value on the breadcrumbs component
|
||||
// margin-top value overlaps container padding
|
||||
// not an ideal solution
|
||||
$breadcrumbs-margin-offset: 5px;
|
||||
margin-top: item-spacing(5) + $breadcrumbs-margin-offset;
|
||||
margin-top: item-spacing(5);
|
||||
|
||||
&__navbar {
|
||||
display: flex;
|
||||
@ -58,3 +54,10 @@
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.data-systems-retry {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -5,40 +5,61 @@
|
||||
{{#if dataSystemsContainer.getDataSystemsNodesTask.isRunning}}
|
||||
{{pendulum-ellipsis-animation}}
|
||||
{{else}}
|
||||
{{#if dataSystemsContainer.requestParams.platform}}
|
||||
<section class="data-systems-container">
|
||||
<div class="data-systems-container__navbar">
|
||||
<div class="data-systems-container__navbar__breadcrumbs">
|
||||
{{datasets/urn-breadcrumbs urn=dataSystemsContainer.urn}}
|
||||
</div>
|
||||
{{#if dataSystemsContainer.getDataSystemsNodesTask.last.isError}}
|
||||
|
||||
<div class="data-systems-container__navbar__count">
|
||||
{{#datasets/containers/data-systems-count urn=dataSystemsContainer.urn as |countContainer|}}
|
||||
<span class="data-system-count-pill">
|
||||
{{pluralize countContainer.count 'dataset'}}
|
||||
</span>
|
||||
{{/datasets/containers/data-systems-count}}
|
||||
</div>
|
||||
</div>
|
||||
{{empty-state
|
||||
heading="We encountered an error"
|
||||
subHead=dataSystemsContainer.getDataSystemsNodesTask.last.error
|
||||
}}
|
||||
|
||||
<div class="data-systems-retry">
|
||||
<button
|
||||
class="nacho-button nacho-button--large-inverse"
|
||||
onclick={{perform dataSystemsContainer.getDataSystemsNodesTask}}>
|
||||
{{#if dataSystemsContainer.getDataSystemsNodesTask.isRunning}}
|
||||
{{pendulum-ellipsis-animation}}
|
||||
{{else}}
|
||||
Retry
|
||||
{{/if}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{browser/data-systems nodes=dataSystemsContainer.nodes}}
|
||||
</section>
|
||||
{{else}}
|
||||
{{#each dataSystemsContainer.nodes as |node|}}
|
||||
<div class="col-md-3">
|
||||
<div class="data-platform-container">
|
||||
<div class="data-platform">
|
||||
{{#browser/containers/data-platform platformParams=node as |platformContainer|}}
|
||||
{{browser/data-platform
|
||||
platform=platformContainer.platformProps
|
||||
node=node
|
||||
platformTask=platformContainer.getDataPlatformTask
|
||||
}}
|
||||
{{/browser/containers/data-platform}}
|
||||
{{#if dataSystemsContainer.requestParams.platform}}
|
||||
<section class="data-systems-container">
|
||||
<div class="data-systems-container__navbar">
|
||||
<div class="data-systems-container__navbar__breadcrumbs">
|
||||
{{datasets/urn-breadcrumbs urn=dataSystemsContainer.urn}}
|
||||
</div>
|
||||
|
||||
<div class="data-systems-container__navbar__count">
|
||||
{{#datasets/containers/data-systems-count urn=dataSystemsContainer.urn as |countContainer|}}
|
||||
<span class="data-system-count-pill">
|
||||
{{pluralize countContainer.count 'dataset'}}
|
||||
</span>
|
||||
{{/datasets/containers/data-systems-count}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{browser/data-systems nodes=dataSystemsContainer.nodes}}
|
||||
</section>
|
||||
{{else}}
|
||||
{{#each dataSystemsContainer.nodes as |node|}}
|
||||
<div class="col-md-3">
|
||||
<div class="data-platform-container">
|
||||
<div class="data-platform">
|
||||
{{#browser/containers/data-platform platformParams=node as |platformContainer|}}
|
||||
{{browser/data-platform
|
||||
platform=platformContainer.platformProps
|
||||
node=node
|
||||
platformTask=platformContainer.getDataPlatformTask
|
||||
}}
|
||||
{{/browser/containers/data-platform}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/browser/containers/data-systems}}
|
||||
|
@ -37,9 +37,7 @@ const platformsUrl = ({ platform, prefix }: IReadDatasetsOptionBag): string => {
|
||||
*/
|
||||
const readPlatforms = async ({ platform, prefix }: IReadDatasetsOptionBag): Promise<Array<string>> => {
|
||||
const url = platformsUrl({ platform, prefix });
|
||||
const response = await getJSON<Array<string>>({ url });
|
||||
|
||||
return response || [];
|
||||
return await getJSON<Array<string>>({ url });
|
||||
};
|
||||
|
||||
export { readPlatforms };
|
||||
|
Loading…
x
Reference in New Issue
Block a user