mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-03 06:47:55 +00:00

* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
48 lines
1.8 KiB
TypeScript
48 lines
1.8 KiB
TypeScript
import Component from '@ember/component';
|
|
import { set } from '@ember/object';
|
|
import { task } from 'ember-concurrency';
|
|
import { readUpstreamDatasetsByUrn } from 'datahub-web/utils/api/datasets/lineage';
|
|
import { DatasetLineageList } from '@datahub/metadata-types/types/entity/dataset/lineage';
|
|
import { containerDataSource } from '@datahub/utils/api/data-source';
|
|
import { ETaskPromise } from '@datahub/utils/types/concurrency';
|
|
import { IDatasetLineage } from '@datahub/metadata-types/types/entity/dataset/lineage';
|
|
import { map } from '@ember/object/computed';
|
|
|
|
@containerDataSource<DatasetLineageUpstreamsContainer>('getDatasetUpstreamsTask', ['urn'])
|
|
export default class DatasetLineageUpstreamsContainer extends Component {
|
|
/**
|
|
* Urn string for the related dataset, supplied as an external attribute
|
|
* @type {string}
|
|
* @memberof DatasetLineageUpstreamsContainer
|
|
*/
|
|
urn!: string;
|
|
|
|
/**
|
|
* List of upstream datasets for this urn
|
|
* @memberof DatasetLineageUpstreamsContainer
|
|
*/
|
|
upstreams: DatasetLineageList = [];
|
|
|
|
/**
|
|
* A map returning the dataset urns from the upstreams list
|
|
*/
|
|
@map('upstreams', (upstream: IDatasetLineage): string => upstream.dataset.uri)
|
|
upstreamUrns!: Array<string>;
|
|
|
|
/**
|
|
* Task to request and set dataset upstreams for this urn
|
|
* @type {TaskProperty<Promise<Relationships>> & {perform: (a?: {} | undefined) => TaskInstance<Promise<Relationships>>}}
|
|
* @memberof DatasetLineageUpstreamsContainer
|
|
*/
|
|
@task(function*(this: DatasetLineageUpstreamsContainer): IterableIterator<Promise<DatasetLineageList>> {
|
|
let upstreams: DatasetLineageList = [];
|
|
|
|
try {
|
|
upstreams = ((yield readUpstreamDatasetsByUrn(this.urn)) as unknown) as DatasetLineageList;
|
|
} finally {
|
|
set(this, 'upstreams', upstreams);
|
|
}
|
|
})
|
|
getDatasetUpstreamsTask!: ETaskPromise<DatasetLineageList>;
|
|
}
|