| 
									
										
										
										
											2018-03-12 17:35:01 -07:00
										 |  |  | import Component from '@ember/component'; | 
					
						
							| 
									
										
										
										
											2019-09-04 21:46:02 -07:00
										 |  |  | import { task } from 'ember-concurrency'; | 
					
						
							| 
									
										
										
										
											2018-03-12 17:35:01 -07:00
										 |  |  | import { get, set } from '@ember/object'; | 
					
						
							|  |  |  | import { IDatasetView } from 'wherehows-web/typings/api/datasets/dataset'; | 
					
						
							|  |  |  | import { readDatasetByUrn } from 'wherehows-web/utils/api/datasets/dataset'; | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | import { containerDataSource } from '@datahub/utils/api/data-source'; | 
					
						
							| 
									
										
										
										
											2019-09-04 21:46:02 -07:00
										 |  |  | import { ETaskPromise } from '@datahub/utils/types/concurrency'; | 
					
						
							| 
									
										
										
										
											2018-03-12 17:35:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | @containerDataSource('getUpstreamPropertiesTask', ['upstreamUrn']) | 
					
						
							| 
									
										
										
										
											2018-03-12 17:35:01 -07:00
										 |  |  | export default class UpstreamOwners extends Component { | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * urn for the parent dataset | 
					
						
							|  |  |  |    * @type {string} | 
					
						
							|  |  |  |    * @memberof UpstreamOwners | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   upstreamUrn: string; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * The name of the upstream dataset | 
					
						
							|  |  |  |    * @type {IDatasetView.nativeName} | 
					
						
							|  |  |  |    * @memberof UpstreamOwners | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   nativeName: IDatasetView['nativeName']; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * Task to get properties for the upstream dataset | 
					
						
							|  |  |  |    * @memberof UpstreamOwners | 
					
						
							|  |  |  |    */ | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  |   @task(function*(this: UpstreamOwners): IterableIterator<Promise<IDatasetView>> { | 
					
						
							| 
									
										
										
										
											2018-03-12 17:35:01 -07:00
										 |  |  |     const { nativeName }: IDatasetView = yield readDatasetByUrn(get(this, 'upstreamUrn')); | 
					
						
							|  |  |  |     set(this, 'nativeName', nativeName); | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  |   }) | 
					
						
							| 
									
										
										
										
											2019-09-04 21:46:02 -07:00
										 |  |  |   getUpstreamPropertiesTask!: ETaskPromise<IDatasetView>; | 
					
						
							| 
									
										
										
										
											2018-03-12 17:35:01 -07:00
										 |  |  | } |