mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 01:18:20 +00:00
Merge pull request #1432 from cptran777/move-from-get-helper
Start migrating code in dataset health components away from get helper
This commit is contained in:
commit
0f144c5422
@ -1,5 +1,5 @@
|
||||
import Component from '@ember/component';
|
||||
import { get, computed, setProperties, getProperties } from '@ember/object';
|
||||
import { computed, setProperties, getProperties, get } from '@ember/object';
|
||||
import { task } from 'ember-concurrency';
|
||||
import ComputedProperty from '@ember/object/computed';
|
||||
import { IChartDatum } from 'wherehows-web/typings/app/visualization/charts';
|
||||
@ -145,7 +145,7 @@ export default class DatasetHealthContainer extends Component {
|
||||
* @type {Task<TaskInstance<Promise<any>>, (a?: any) => TaskInstance<TaskInstance<Promise<any>>>>}
|
||||
*/
|
||||
getContainerDataTask = task(function*(this: DatasetHealthContainer): IterableIterator<Promise<IDatasetHealth>> {
|
||||
const health: IDatasetHealth = yield readDatasetHealthByUrn(get(this, 'urn'));
|
||||
const health: IDatasetHealth = yield readDatasetHealthByUrn(this.urn);
|
||||
|
||||
const details = health.validations || [];
|
||||
const total = details.length;
|
||||
|
||||
@ -33,7 +33,7 @@ export default class HealthScoreGauge extends Component {
|
||||
* @type {Task<TaskInstance<Promise<any>>, (a?: any) => TaskInstance<TaskInstance<Promise<any>>>>}
|
||||
*/
|
||||
getHealthScoreTask = task(function*(this: HealthScoreGauge): IterableIterator<Promise<IDatasetHealth>> {
|
||||
const health: IDatasetHealth = yield readDatasetHealthByUrn(get(this, 'urn'));
|
||||
const health: IDatasetHealth = yield readDatasetHealthByUrn(this.urn);
|
||||
set(this, 'healthScore', health.score * 100 || 0);
|
||||
}).restartable();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user