Skip to content

Commit 2ad1ee7

Browse files
committed
Merge branch 'main' into fix/ang-925
2 parents b9bf4b4 + d309d6f commit 2ad1ee7

File tree

121 files changed

+468
-714
lines changed

Some content is hidden

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

121 files changed

+468
-714
lines changed

src/app/core/components/breadcrumb/breadcrumb.component.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
@use "styles/variables" as var;
2-
31
.breadcrumbs {
4-
color: var(--header-color, var.$dark-blue-1);
2+
color: var(--header-color, var(--dark-blue-1));
53
font-weight: 600;
64
text-transform: capitalize;
75
background-color: var(--header-background-color);

src/app/core/components/footer/footer.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</div>
77
</div>
88

9-
<div class="footer-socials flex justify-content-center align-items-center" [class]="isWeb() ? 'my-3' : 'my-4'">
9+
<div class="footer-socials flex justify-content-center align-items-center my-4">
1010
@for (icon of socialIcons; track icon.name) {
1111
<a
1212
class="social-link flex align-items-center justify-content-center"
@@ -20,8 +20,7 @@
2020
</div>
2121

2222
<div
23-
class="footer-secondary-nav flex flex-column justify-content-center align-items-center md:flex-row md:justify-content-between"
24-
[class.mt-4]="!isWeb()"
23+
class="footer-secondary-nav flex flex-column justify-content-center align-items-center mt-4 md:flex-row md:justify-content-between xl:mt-0"
2524
>
2625
<div class="footer-links flex flex-wrap justify-content-center mt-1">
2726
<a routerLink="/terms-of-use">{{ 'footer.links.termsOfUse' | translate }}</a>

src/app/core/components/footer/footer.component.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
22
import { MockComponent, MockPipe, MockProvider } from 'ng-mocks';
33

4-
import { BehaviorSubject } from 'rxjs';
5-
64
import { ComponentFixture, TestBed } from '@angular/core/testing';
75
import { ActivatedRoute } from '@angular/router';
86

9-
import { IS_WEB } from '@osf/shared/helpers';
107
import { IconComponent } from '@shared/components';
118

129
import { FooterComponent } from './footer.component';
1310

1411
describe('FooterComponent', () => {
1512
let component: FooterComponent;
1613
let fixture: ComponentFixture<FooterComponent>;
17-
let isWebSubject: BehaviorSubject<boolean>;
1814

1915
beforeEach(async () => {
20-
isWebSubject = new BehaviorSubject<boolean>(true);
21-
2216
await TestBed.configureTestingModule({
2317
imports: [FooterComponent, MockComponent(IconComponent), MockPipe(TranslatePipe)],
24-
providers: [MockProvider(TranslateService), MockProvider(ActivatedRoute), MockProvider(IS_WEB, isWebSubject)],
18+
providers: [MockProvider(TranslateService), MockProvider(ActivatedRoute)],
2519
}).compileComponents();
2620

2721
fixture = TestBed.createComponent(FooterComponent);
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { TranslatePipe } from '@ngx-translate/core';
22

3-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
4-
import { toSignal } from '@angular/core/rxjs-interop';
3+
import { ChangeDetectionStrategy, Component } from '@angular/core';
54
import { RouterLink } from '@angular/router';
65

76
import { SOCIAL_ICONS } from '@osf/core/constants';
87
import { IconComponent } from '@osf/shared/components';
9-
import { IS_WEB } from '@osf/shared/helpers';
108

119
@Component({
1210
selector: 'osf-footer',
@@ -16,7 +14,5 @@ import { IS_WEB } from '@osf/shared/helpers';
1614
changeDetection: ChangeDetectionStrategy.OnPush,
1715
})
1816
export class FooterComponent {
19-
isWeb = toSignal(inject(IS_WEB));
20-
2117
readonly socialIcons = SOCIAL_ICONS;
2218
}

src/app/core/components/root/root.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@
2121
</div>
2222
</div>
2323

24-
<p-confirm-dialog id="dialog" styleClass="w-full md:w-6 xl:w-5" [header]="'common.dialogs.confirmation' | translate" />
24+
<p-confirm-dialog
25+
id="dialog"
26+
styleClass="w-full md:w-6 xl:w-5"
27+
[header]="'common.accessibility.confirmation' | translate"
28+
/>

src/app/core/components/root/root.component.spec.ts

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { BehaviorSubject } from 'rxjs';
77

88
import { ComponentFixture, TestBed } from '@angular/core/testing';
99

10-
import { BreadcrumbComponent } from '@core/components/breadcrumb/breadcrumb.component';
11-
import { FooterComponent } from '@core/components/footer/footer.component';
12-
import { HeaderComponent } from '@core/components/header/header.component';
13-
import { TopnavComponent } from '@core/components/topnav/topnav.component';
14-
import { IS_WEB, IS_XSMALL } from '@osf/shared/helpers';
10+
import { IS_WEB } from '@osf/shared/helpers';
1511

12+
import { BreadcrumbComponent } from '../breadcrumb/breadcrumb.component';
13+
import { FooterComponent } from '../footer/footer.component';
14+
import { HeaderComponent } from '../header/header.component';
1615
import { OSFBannerComponent } from '../osf-banners/osf-banner.component';
1716
import { SidenavComponent } from '../sidenav/sidenav.component';
17+
import { TopnavComponent } from '../topnav/topnav.component';
1818

1919
import { RootComponent } from './root.component';
2020

@@ -24,11 +24,9 @@ describe('Component: Root', () => {
2424
let component: RootComponent;
2525
let fixture: ComponentFixture<RootComponent>;
2626
let isWebSubject: BehaviorSubject<boolean>;
27-
let isMobileSubject: BehaviorSubject<boolean>;
2827

2928
beforeEach(async () => {
3029
isWebSubject = new BehaviorSubject<boolean>(true);
31-
isMobileSubject = new BehaviorSubject<boolean>(false);
3230

3331
await TestBed.configureTestingModule({
3432
imports: [
@@ -44,11 +42,7 @@ describe('Component: Root', () => {
4442
OSFBannerComponent
4543
),
4644
],
47-
providers: [
48-
MockProvider(IS_WEB, isWebSubject),
49-
MockProvider(IS_XSMALL, isMobileSubject),
50-
MockProvider(ConfirmationService),
51-
],
45+
providers: [MockProvider(IS_WEB, isWebSubject), MockProvider(ConfirmationService)],
5246
}).compileComponents();
5347

5448
fixture = TestBed.createComponent(RootComponent);
@@ -82,15 +76,6 @@ describe('Component: Root', () => {
8276
expect(tabletLayout).toBeTruthy();
8377
});
8478

85-
it('should hide breadcrumb in tablet layout when mobile', () => {
86-
isWebSubject.next(false);
87-
isMobileSubject.next(true);
88-
fixture.detectChanges();
89-
90-
const breadcrumb = fixture.nativeElement.querySelector('osf-breadcrumb');
91-
expect(breadcrumb).toBeFalsy();
92-
});
93-
9479
it('should contain confirm dialog component', () => {
9580
const confirmDialog = fixture.nativeElement.querySelector('p-confirm-dialog');
9681
expect(confirmDialog).toBeTruthy();
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
@use "styles/variables" as var;
2-
@use "styles/mixins" as mix;
3-
41
:host {
52
width: 100%;
63
}
74

85
.kpi-container {
9-
border: 1px solid var.$grey-2;
10-
border-radius: 12px;
11-
color: var.$dark-blue-1;
6+
border: 1px solid var(--grey-2);
7+
border-radius: 0.75rem;
8+
color: var(--dark-blue-1);
129
width: 100%;
1310
height: 100%;
1411
min-height: 180px;
1512

1613
.value {
17-
color: var.$blue-1;
18-
font-size: 2.285rem;
14+
color: var(--blue-1);
15+
font-size: 2rem;
1916
font-weight: 700;
20-
margin: 1rem 0 1.7rem;
17+
margin: 1rem 0 1.5rem;
2118
}
2219

2320
.value-skeleton {
24-
margin: 1rem 0 1.7rem;
21+
margin: 1rem 0 1.5rem;
2522
}
2623
}

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { ActivatedRoute, Router } from '@angular/router';
1010
import { ProjectOverviewSelectors } from '@osf/features/project/overview/store';
1111
import { RegistryOverviewSelectors } from '@osf/features/registry/store/registry-overview';
1212
import { ResourceType } from '@osf/shared/enums';
13-
import { IS_SMALL } from '@osf/shared/helpers';
1413
import { DuplicatesSelectors } from '@osf/shared/stores';
1514
import {
1615
ContributorsListComponent,
@@ -74,7 +73,6 @@ describe('Component: View Duplicates', () => {
7473
MockProvider(CustomDialogService, mockCustomDialogService),
7574
MockProvider(Router, routerMock),
7675
MockProvider(ActivatedRoute, activatedRouteMock),
77-
{ provide: IS_SMALL, useValue: of(false) },
7876
],
7977
}).compileComponents();
8078

@@ -88,31 +86,7 @@ describe('Component: View Duplicates', () => {
8886
expect(component).toBeTruthy();
8987
});
9088

91-
it('should open ForkDialog with width 95vw and refresh on success', () => {
92-
const openSpy = jest
93-
.spyOn(mockCustomDialogService, 'open')
94-
.mockReturnValue({ onClose: of({ success: true }) } as any);
95-
(component as any).actions = { ...component.actions, getDuplicates: jest.fn() };
96-
97-
component.handleForkResource();
98-
99-
expect(openSpy).toHaveBeenCalledWith(
100-
expect.any(Function),
101-
expect.objectContaining({
102-
width: '95vw',
103-
header: 'project.overview.dialog.fork.headerProject',
104-
data: expect.objectContaining({
105-
resource: expect.any(Object),
106-
resourceType: ResourceType.Project,
107-
}),
108-
})
109-
);
110-
111-
expect((component as any).actions.getDuplicates).toHaveBeenCalled();
112-
});
113-
11489
it('should open ForkDialog with width 450px when small and not refresh on failure', () => {
115-
(component as any).isSmall = () => true;
11690
(component as any).actions = { ...component.actions, getDuplicates: jest.fn() };
11791

11892
const openSpy = jest

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
TruncatedTextComponent,
4040
} from '@osf/shared/components';
4141
import { ResourceType, UserPermissions } from '@osf/shared/enums';
42-
import { IS_SMALL } from '@osf/shared/helpers';
4342
import { ToolbarResource } from '@osf/shared/models';
4443
import { Duplicate } from '@osf/shared/models/duplicates';
4544
import { CustomDialogService } from '@osf/shared/services';
@@ -83,7 +82,6 @@ export class ViewDuplicatesComponent {
8382
readonly UserPermissions = UserPermissions;
8483

8584
currentPage = signal<string>('1');
86-
isSmall = toSignal(inject(IS_SMALL));
8785
firstIndex = computed(() => (parseInt(this.currentPage()) - 1) * this.pageSize);
8886

8987
readonly forkActionItems = (resourceId: string) => [
@@ -194,13 +192,12 @@ export class ViewDuplicatesComponent {
194192

195193
handleForkResource(): void {
196194
const toolbarResource = this.toolbarResource();
197-
const dialogWidth = !this.isSmall() ? '95vw' : '450px';
198195

199196
if (toolbarResource) {
200197
this.customDialogService
201198
.open(ForkDialogComponent, {
202199
header: 'project.overview.dialog.fork.headerProject',
203-
width: dialogWidth,
200+
width: '450px',
204201
data: {
205202
resource: toolbarResource,
206203
resourceType: this.resourceType(),
@@ -233,12 +230,10 @@ export class ViewDuplicatesComponent {
233230
}
234231

235232
private handleDeleteFork(id: string): void {
236-
const dialogWidth = !this.isSmall() ? '95vw' : '650px';
237-
238233
this.customDialogService
239234
.open(DeleteComponentDialogComponent, {
240235
header: 'project.overview.dialog.deleteComponent.header',
241-
width: dialogWidth,
236+
width: '650px',
242237
data: {
243238
componentId: id,
244239
resourceType: this.resourceType(),

src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ <h3>{{ 'collections.addToCollection.projectContributors' | translate }}</h3>
4040
<osf-contributors-table
4141
class="w-full"
4242
[(contributors)]="projectContributors"
43+
[tableParams]="tableParams()"
4344
[isLoading]="isContributorsLoading()"
4445
(remove)="handleRemoveContributor($event)"
4546
></osf-contributors-table>

0 commit comments

Comments
 (0)