Skip to content

Commit b24bf84

Browse files
committed
Merge branch 'develop' into ENG-9260
2 parents 187d2b2 + b2bdce5 commit b24bf84

File tree

160 files changed

+3091
-1923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+3091
-1923
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "osf",
3-
"version": "25.2.0",
3+
"version": "25.3.0",
44
"scripts": {
55
"ng": "ng",
66
"analyze-bundle": "ng build --configuration=analyze-bundle && source-map-explorer dist/**/*.js --no-border-checks",

src/@types/global.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,11 @@ declare global {
4747
*/
4848
loggedIn: boolean;
4949
};
50+
51+
/**
52+
* Flag used by prerender services to determine when a page is fully loaded.
53+
* Set to false initially, then set to true once all AJAX requests and content are loaded.
54+
*/
55+
prerenderReady?: boolean;
5056
}
5157
}

src/app/app.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export const routes: Routes = [
6868
path: 'my-projects',
6969
loadComponent: () =>
7070
import('./features/my-projects/my-projects.component').then((mod) => mod.MyProjectsComponent),
71-
providers: [provideStates([BookmarksState, ProjectsState])],
7271
canActivate: [authGuard],
72+
providers: [provideStates([BookmarksState, ProjectsState])],
7373
},
7474
{
7575
path: 'my-registrations',

src/app/core/components/nav-menu/nav-menu.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { NO_ERRORS_SCHEMA, signal } from '@angular/core';
44
import { ComponentFixture, TestBed } from '@angular/core/testing';
55
import { ActivatedRoute, Router } from '@angular/router';
66

7+
import { CustomMenuItem } from '@core/models/custom-menu-item.model';
78
import { AuthService } from '@core/services/auth.service';
8-
import { CustomMenuItem } from '@osf/core/models';
99
import { ProviderSelectors } from '@osf/core/store/provider/provider.selectors';
1010
import { UserSelectors } from '@osf/core/store/user/user.selectors';
1111
import { IconComponent } from '@osf/shared/components/icon/icon.component';
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { inject, Injectable } from '@angular/core';
2+
3+
import { WINDOW } from '../provider/window.provider';
4+
5+
@Injectable({
6+
providedIn: 'root',
7+
})
8+
export class PrerenderReadyService {
9+
private readonly window = inject(WINDOW);
10+
11+
setNotReady(): void {
12+
if (this.window && 'prerenderReady' in this.window) {
13+
this.window.prerenderReady = false;
14+
}
15+
}
16+
17+
setReady(): void {
18+
if (this.window && 'prerenderReady' in this.window) {
19+
this.window.prerenderReady = true;
20+
}
21+
}
22+
}

src/app/features/analytics/components/view-duplicates/view-duplicates.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
88
import { ActivatedRoute, Router } from '@angular/router';
99

1010
import { ProjectOverviewSelectors } from '@osf/features/project/overview/store';
11-
import { RegistryOverviewSelectors } from '@osf/features/registry/store/registry-overview';
11+
import { RegistrySelectors } from '@osf/features/registry/store/registry';
1212
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
1313
import { CustomPaginatorComponent } from '@osf/shared/components/custom-paginator/custom-paginator.component';
1414
import { IconComponent } from '@osf/shared/components/icon/icon.component';
@@ -64,8 +64,8 @@ describe('Component: View Duplicates', () => {
6464
{ selector: DuplicatesSelectors.getDuplicatesTotalCount, value: 0 },
6565
{ selector: ProjectOverviewSelectors.getProject, value: MOCK_PROJECT_OVERVIEW },
6666
{ selector: ProjectOverviewSelectors.isProjectAnonymous, value: false },
67-
{ selector: RegistryOverviewSelectors.getRegistry, value: undefined },
68-
{ selector: RegistryOverviewSelectors.isRegistryAnonymous, value: false },
67+
{ selector: RegistrySelectors.getRegistry, value: undefined },
68+
{ selector: RegistrySelectors.isRegistryAnonymous, value: false },
6969
],
7070
}),
7171
MockProvider(CustomDialogService, mockCustomDialogService),

src/app/features/analytics/components/view-duplicates/view-duplicates.component.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ import { ActivatedRoute, Router, RouterLink } from '@angular/router';
2525
import { UserSelectors } from '@core/store/user';
2626
import { DeleteComponentDialogComponent, ForkDialogComponent } from '@osf/features/project/overview/components';
2727
import { ClearProjectOverview, GetProjectById, ProjectOverviewSelectors } from '@osf/features/project/overview/store';
28-
import {
29-
ClearRegistryOverview,
30-
GetRegistryById,
31-
RegistryOverviewSelectors,
32-
} from '@osf/features/registry/store/registry-overview';
28+
import { ClearRegistry, GetRegistryById, RegistrySelectors } from '@osf/features/registry/store/registry';
3329
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
3430
import { CustomPaginatorComponent } from '@osf/shared/components/custom-paginator/custom-paginator.component';
3531
import { IconComponent } from '@osf/shared/components/icon/icon.component';
@@ -72,9 +68,9 @@ export class ViewDuplicatesComponent {
7268
private router = inject(Router);
7369
private destroyRef = inject(DestroyRef);
7470
private project = select(ProjectOverviewSelectors.getProject);
75-
private registration = select(RegistryOverviewSelectors.getRegistry);
71+
private registration = select(RegistrySelectors.getRegistry);
7672
private isProjectAnonymous = select(ProjectOverviewSelectors.isProjectAnonymous);
77-
private isRegistryAnonymous = select(RegistryOverviewSelectors.isRegistryAnonymous);
73+
private isRegistryAnonymous = select(RegistrySelectors.isRegistryAnonymous);
7874

7975
duplicates = select(DuplicatesSelectors.getDuplicates);
8076
isDuplicatesLoading = select(DuplicatesSelectors.getDuplicatesLoading);
@@ -127,7 +123,7 @@ export class ViewDuplicatesComponent {
127123
getDuplicates: GetAllDuplicates,
128124
clearDuplicates: ClearDuplicates,
129125
clearProject: ClearProjectOverview,
130-
clearRegistration: ClearRegistryOverview,
126+
clearRegistration: ClearRegistry,
131127
getComponentsTree: GetResourceWithChildren,
132128
});
133129

src/app/features/analytics/components/view-linked-projects/view-linked-projects.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
66
import { ActivatedRoute } from '@angular/router';
77

88
import { ProjectOverviewSelectors } from '@osf/features/project/overview/store';
9-
import { RegistryOverviewSelectors } from '@osf/features/registry/store/registry-overview';
9+
import { RegistrySelectors } from '@osf/features/registry/store/registry';
1010
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
1111
import { CustomPaginatorComponent } from '@osf/shared/components/custom-paginator/custom-paginator.component';
1212
import { IconComponent } from '@osf/shared/components/icon/icon.component';
@@ -54,7 +54,7 @@ describe('Component: View Duplicates', () => {
5454
{ selector: LinkedProjectsSelectors.getLinkedProjectsLoading, value: false },
5555
{ selector: LinkedProjectsSelectors.getLinkedProjectsTotalCount, value: 0 },
5656
{ selector: ProjectOverviewSelectors.getProject, value: MOCK_PROJECT_OVERVIEW },
57-
{ selector: RegistryOverviewSelectors.getRegistry, value: undefined },
57+
{ selector: RegistrySelectors.getRegistry, value: undefined },
5858
],
5959
}),
6060
MockProvider(ActivatedRoute, activatedRouteMock),

src/app/features/analytics/components/view-linked-projects/view-linked-projects.component.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ import { toSignal } from '@angular/core/rxjs-interop';
2222
import { ActivatedRoute, RouterLink } from '@angular/router';
2323

2424
import { ClearProjectOverview, GetProjectById, ProjectOverviewSelectors } from '@osf/features/project/overview/store';
25-
import {
26-
ClearRegistryOverview,
27-
GetRegistryById,
28-
RegistryOverviewSelectors,
29-
} from '@osf/features/registry/store/registry-overview';
25+
import { ClearRegistry, GetRegistryById, RegistrySelectors } from '@osf/features/registry/store/registry';
3026
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
3127
import { CustomPaginatorComponent } from '@osf/shared/components/custom-paginator/custom-paginator.component';
3228
import { IconComponent } from '@osf/shared/components/icon/icon.component';
@@ -59,7 +55,7 @@ export class ViewLinkedProjectsComponent {
5955
private route = inject(ActivatedRoute);
6056
private destroyRef = inject(DestroyRef);
6157
private project = select(ProjectOverviewSelectors.getProject);
62-
private registration = select(RegistryOverviewSelectors.getRegistry);
58+
private registration = select(RegistrySelectors.getRegistry);
6359

6460
linkedProjects = select(LinkedProjectsSelectors.getLinkedProjects);
6561
isLoading = select(LinkedProjectsSelectors.getLinkedProjectsLoading);
@@ -93,7 +89,7 @@ export class ViewLinkedProjectsComponent {
9389
getLinkedProjects: GetAllLinkedProjects,
9490
clearLinkedProjects: ClearLinkedProjects,
9591
clearProject: ClearProjectOverview,
96-
clearRegistration: ClearRegistryOverview,
92+
clearRegistration: ClearRegistry,
9793
});
9894

9995
constructor() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { AnalyticsService } from './analytics.service';
1+
export { ResourceAnalyticsService } from './resource-analytics.service';

0 commit comments

Comments
 (0)