[develop | DONE | CHANGED]: Updated parsing and display for usage counts per data source to show datasource names.
1. resultLandingInfo.ts: Added field datasourceName: string in interface MetricPerDatasource. 2. parsingFunctions.class.ts: In method "parseMeasures()", updated parsing for usage counts per data source (countsPerDatasource) to parse datasourceId and datasourceName from datasource field of response (split by ||). 3. resultLanding.component.html: On display of countsPerDatasource in table, show datasource names.
This commit is contained in:
parent
fa61b8bef4
commit
c7c1aec26e
|
@ -894,7 +894,7 @@ export class ParsingFunctions {
|
|||
countsPerDatasource[datasourcePosition.get(element.datasource)].views = element.count;
|
||||
} else {
|
||||
datasourcePosition.set(element.datasource, countsPerDatasource.length);
|
||||
countsPerDatasource.push({"datasourceId": element.datasource, "views": element.count, "downloads": 0})
|
||||
countsPerDatasource.push({"datasourceId": element.datasource.split("||")[0], "datasourceName": element.datasource.split("||")[1], "views": element.count, "downloads": 0})
|
||||
}
|
||||
}
|
||||
// measure.views = element.count;
|
||||
|
@ -907,7 +907,7 @@ export class ParsingFunctions {
|
|||
countsPerDatasource[datasourcePosition.get(element.datasource)].downloads = element.count;
|
||||
} else {
|
||||
datasourcePosition.set(element.datasource, countsPerDatasource.length);
|
||||
countsPerDatasource.push({"datasourceId": element.datasource, "views": 0, "downloads": element.count})
|
||||
countsPerDatasource.push({"datasourceId": element.datasource.split("||")[0], "datasourceName": element.datasource.split("||")[1], "views": 0, "downloads": element.count})
|
||||
}
|
||||
}
|
||||
// measure.downloads = element.count;
|
||||
|
|
|
@ -1251,7 +1251,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let datasource of resultLandingInfo.measure.countsPerDatasource">
|
||||
<td class="uk-text-truncate"><a [routerLink]="properties.searchLinkToDataProvider.split('?')[0]" [queryParams]="{'datasourceId': datasource.datasourceId}">{{datasource.datasourceId}}</a></td>
|
||||
<td class="uk-text-truncate"><a [routerLink]="properties.searchLinkToDataProvider.split('?')[0]" [queryParams]="{'datasourceId': datasource.datasourceId}">{{datasource.datasourceName}}</a></td>
|
||||
<td class="uk-text-center">{{datasource.views}}</td>
|
||||
<td class="uk-text-center">{{datasource.downloads}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -49,7 +49,7 @@ export interface Measure {
|
|||
|
||||
export interface MetricPerDatasource {
|
||||
datasourceId: string,
|
||||
// datasourceName: string,
|
||||
datasourceName: string,
|
||||
views: number,
|
||||
downloads: number
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue