Skip to content

Conversation

@mkovalua
Copy link
Contributor

@mkovalua mkovalua commented Oct 30, 2025

Purpose

The analytics tab for registrations is meant to help users understand how viewers are using and accessing their registration. One of those metrics is popular pages. However, as you can see in the image below, there are two of the same name, which makes it confusing to understand what viewers are looking at.

Summary of Changes

If we are clicking over navigation in details of registration and project title saving is as expected, if go to some tab by link
it return osf handle it to have proper title and render data in chart with row names showing what title tab was clicked

Screenshot(s)

image image
98cf-7ac2-4806-aa08-935ab316dc33.mp4

Side Effects

it is rendered an old title name taken from Elastic if we update

image

maybe it will be worth to apply some backend logic to the newest title version or implement additional requests for title taking on rendering that may be time consuming

(have also tried to compare it with staging5 but for some reason popular pages is not rendering now
image , locally I had some issues with docker elastic and M1 Max chip to compare
)

  1. Maybe it is worth to keep for angular too like it for ember

provider_id: routeMetricsMetadata.providerId,
action_labels: this._getPageviewActionLabels(routeMetricsMetadata),
client_session_id: this._sessionId,

not confident about correct usage #732 (comment)

image image

QA Notes

@mkovalua mkovalua marked this pull request as ready for review October 31, 2025 16:11
@nsemets
Copy link
Collaborator

nsemets commented Oct 31, 2025

@mkovalua Fix unit tests and linting.

Comment on lines +20 to +22
const all_attrs = { item_guid: resource?.id } as const;
const attributes = Object.fromEntries(
Object.entries(all_attrs).filter(([_, value]: [unknown, unknown]) => typeof value !== 'undefined')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a purpose of this code? Just pass guid same as before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be it generic like it is implemented for ember also

image

also I have tried to investigate about _sessionId passing for count usage but not understand how it is possible to do properly because we have already the following

 const expireDate = new Date('9999-12-31T23:59:59Z');
 this.cookies.set(this.cookieName, 'true', expireDate, '/');

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need it. Currently you are passing only 1 param.

@mkovalua mkovalua requested a review from nsemets November 3, 2025 14:21
import { inject, Injectable } from '@angular/core';

import { ENVIRONMENT } from '@core/provider/environment.provider';
import { JsonApiService } from '@osf/shared/services/json-api.service';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is needed to work good with existing codebase and the import is using all over the project

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { JsonApiService } from './json-api.service';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use such import, because I already did some changes there and will have conflict.

@mkovalua mkovalua requested a review from nsemets November 3, 2025 19:43
@nsemets
Copy link
Collaborator

nsemets commented Nov 4, 2025

@mkovalua Fix unit test. You need to provide mock CurrentResourceSelectors.getCurrentResource.

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ProjectComponent, OSFTestingModule],
imports: [ProjectComponent, OSFTestingModule, NgxsModule.forRoot([])],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use NgxsModule.forRoot. Review other tests and use approach with provideMockStore.

@mkovalua mkovalua requested a review from nsemets November 4, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants