Skip to content

Commit

Permalink
ENG-4525 Update guid-file and guid-node/metadata page titles to inclu…
Browse files Browse the repository at this point in the history
…de file name/project name (#2192)

-   Ticket: [ENG-4525](https://openscience.atlassian.net/browse/ENG-4525)
-   Feature flag: n/a

## Purpose

Update guid-file and guid-node/metadata page titles to include file name/project name

## Summary of Changes
- Modified the analytics charts to display titles from the API instead of GUIDs
- Removed aggregation logic for chart data processing

Co-authored-by: Uditi Mehta <uditimehta@COSs-MacBook-Pro.local>
  • Loading branch information
uditijmehta and Uditi Mehta committed Apr 12, 2024
1 parent 237ffa0 commit 24feb68
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,13 @@ export default class AnalyticsChart extends Component<AnalyticsChartArgs> {
} else {
const data: PopularPageDatum[] = this.args.chartsDataTaskInstance.value!.popular_pages as any;
const aggregatedResults: { [name: string]: PopularPageDisplay } = {};

data.forEach(datum => {
const displayDatum = this.popularPageDisplay(datum);
const priorDisplay = aggregatedResults[displayDatum.name];
if (priorDisplay) {
priorDisplay.count += displayDatum.count;
const cleanTitle = datum.title.replace(/^OSF \| /, '');
const displayDatum = { name: cleanTitle, count: datum.count };

if (aggregatedResults[displayDatum.name]) {
aggregatedResults[displayDatum.name].count += displayDatum.count;
} else {
aggregatedResults[displayDatum.name] = displayDatum;
}
Expand Down

0 comments on commit 24feb68

Please sign in to comment.