diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index ff46345b1..f3537c4f8 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -35,11 +35,6 @@ export const routes: Routes = [ canActivate: [authGuard], providers: [provideStates([ProjectsState])], }, - { - path: 'confirm/:userId/:token', - loadComponent: () => import('./features/home/home.component').then((mod) => mod.HomeComponent), - data: { skipBreadcrumbs: true }, - }, { path: 'register', canActivate: [redirectIfLoggedInGuard], diff --git a/src/app/core/components/root/root.component.html b/src/app/core/components/root/root.component.html index 735043347..143bead91 100644 --- a/src/app/core/components/root/root.component.html +++ b/src/app/core/components/root/root.component.html @@ -26,4 +26,4 @@ } - + diff --git a/src/app/core/components/root/root.component.ts b/src/app/core/components/root/root.component.ts index 12083b732..c230d6860 100644 --- a/src/app/core/components/root/root.component.ts +++ b/src/app/core/components/root/root.component.ts @@ -1,3 +1,5 @@ +import { TranslatePipe } from '@ngx-translate/core'; + import { ConfirmDialog } from 'primeng/confirmdialog'; import { CommonModule } from '@angular/common'; @@ -23,6 +25,7 @@ import { IS_MEDIUM, IS_WEB } from '@osf/shared/helpers'; BreadcrumbComponent, RouterOutlet, SidenavComponent, + TranslatePipe, ], templateUrl: './root.component.html', styleUrls: ['./root.component.scss'], diff --git a/src/app/features/admin-institutions/components/admin-table/admin-table.component.html b/src/app/features/admin-institutions/components/admin-table/admin-table.component.html index 6a6600616..8a14efc91 100644 --- a/src/app/features/admin-institutions/components/admin-table/admin-table.component.html +++ b/src/app/features/admin-institutions/components/admin-table/admin-table.component.html @@ -32,11 +32,12 @@ [showToggleAll]="false" [showClear]="false" [dropdownIcon]="'hidden'" + [ariaLabel]="'common.accessibility.customizeOptions' | translate" >
- - {{ 'adminInstitutions.institutionUsers.customize' | translate }} + + {{ 'adminInstitutions.institutionUsers.customize' | translate }}
@@ -49,6 +50,7 @@ icon="fa fa-download text-primary text-xl" outlined styleClass="grey-border-color" + [ariaLabel]="'common.buttons.download' | translate" (onClick)="downloadMenu.toggle($event)" /> @@ -56,11 +58,11 @@ - - + [attr.aria-label]="'common.buttons.reportsLink' | translate" + > } @@ -112,7 +114,7 @@ @if (col.dateFormat) { {{ getCellValue(rowData[col.field]) | date: col.dateFormat }} @@ -135,6 +137,7 @@ [icon]="col.iconClass" variant="text" severity="info" + [ariaLabel]="'common.accessibility.tooltipBtn' | translate" (onClick)="onIconClick(rowData, col)" /> } @@ -158,7 +161,13 @@ @if (isNextPreviousPagination()) {
@if (firstLink() && prevLink()) { - + } @@ -174,6 +184,7 @@ severity="contrast" text [disabled]="!nextLink()" + [ariaLabel]="'common.accessibility.goToNextPage' | translate" (onClick)="switchPage(nextLink())" />
diff --git a/src/app/features/admin-institutions/mappers/institution-preprint-to-table-data.mapper.ts b/src/app/features/admin-institutions/mappers/institution-preprint-to-table-data.mapper.ts index f988e5823..81973bcb9 100644 --- a/src/app/features/admin-institutions/mappers/institution-preprint-to-table-data.mapper.ts +++ b/src/app/features/admin-institutions/mappers/institution-preprint-to-table-data.mapper.ts @@ -1,15 +1,11 @@ -import { extractPathAfterDomain } from '@osf/features/admin-institutions/helpers'; import { ResourceModel } from '@shared/models'; +import { extractPathAfterDomain } from '../helpers'; import { TableCellData, TableCellLink } from '../models'; export function mapPreprintResourceToTableData(preprint: ResourceModel): TableCellData { return { - title: { - text: preprint.title, - url: preprint.absoluteUrl, - target: '_blank', - } as TableCellLink, + title: preprint.title, link: { text: preprint.absoluteUrl.split('/').pop() || preprint.absoluteUrl, url: preprint.absoluteUrl, diff --git a/src/app/features/admin-institutions/mappers/institution-project-to-table-data.mapper.ts b/src/app/features/admin-institutions/mappers/institution-project-to-table-data.mapper.ts index f795c9f23..1e5e9bfd7 100644 --- a/src/app/features/admin-institutions/mappers/institution-project-to-table-data.mapper.ts +++ b/src/app/features/admin-institutions/mappers/institution-project-to-table-data.mapper.ts @@ -1,13 +1,11 @@ -import { extractPathAfterDomain } from '@osf/features/admin-institutions/helpers'; -import { TableCellData, TableCellLink } from '@osf/features/admin-institutions/models'; import { ResourceModel } from '@shared/models'; +import { extractPathAfterDomain } from '../helpers'; +import { TableCellData, TableCellLink } from '../models'; + export function mapProjectResourceToTableCellData(project: ResourceModel): TableCellData { return { - title: { - url: project.absoluteUrl, - text: project.title, - } as TableCellLink, + title: project.title, link: { url: project.absoluteUrl, text: project.absoluteUrl.split('/').pop() || project.absoluteUrl, diff --git a/src/app/features/admin-institutions/mappers/institution-registration-to-table-data.mapper.ts b/src/app/features/admin-institutions/mappers/institution-registration-to-table-data.mapper.ts index dfba289d1..8dbd650cf 100644 --- a/src/app/features/admin-institutions/mappers/institution-registration-to-table-data.mapper.ts +++ b/src/app/features/admin-institutions/mappers/institution-registration-to-table-data.mapper.ts @@ -5,11 +5,7 @@ import { TableCellData, TableCellLink } from '../models'; export function mapRegistrationResourceToTableData(registration: ResourceModel): TableCellData { return { - title: { - text: registration.title, - url: registration.absoluteUrl, - target: '_blank', - } as TableCellLink, + title: registration.title, link: { text: registration.absoluteUrl.split('/').pop() || registration.absoluteUrl, url: registration.absoluteUrl, diff --git a/src/app/features/admin-institutions/mappers/institution-user-to-table-data.mapper.ts b/src/app/features/admin-institutions/mappers/institution-user-to-table-data.mapper.ts index 7f86ec86e..914c4f62a 100644 --- a/src/app/features/admin-institutions/mappers/institution-user-to-table-data.mapper.ts +++ b/src/app/features/admin-institutions/mappers/institution-user-to-table-data.mapper.ts @@ -1,17 +1,11 @@ -import { InstitutionUser, TableCellData } from '@osf/features/admin-institutions/models'; +import { InstitutionUser, TableCellData } from '../models'; import { environment } from 'src/environments/environment'; export function mapUserToTableCellData(user: InstitutionUser): TableCellData { return { id: user.id, - userName: user.userName - ? { - text: user.userName, - url: `${environment.webUrl}/${user.userId}`, - target: '_blank', - } - : '-', + userName: user.userName || '-', department: user.department || '-', userLink: { text: user.userId, diff --git a/src/app/features/admin-institutions/pages/institutions-preprints/institutions-preprints.component.html b/src/app/features/admin-institutions/pages/institutions-preprints/institutions-preprints.component.html index d8adbe5ba..f3c504b3b 100644 --- a/src/app/features/admin-institutions/pages/institutions-preprints/institutions-preprints.component.html +++ b/src/app/features/admin-institutions/pages/institutions-preprints/institutions-preprints.component.html @@ -18,7 +18,7 @@

-

{{ resourcesCount() }} {{ 'adminInstitutions.projects.totalProjects' | translate }}

+

+ {{ resourcesCount() }} {{ 'adminInstitutions.projects.totalProjects' | translate }} +

(null); diff --git a/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html b/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html index 16c48218b..46fed730d 100644 --- a/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html +++ b/src/app/features/analytics/components/view-duplicates/view-duplicates.component.html @@ -28,6 +28,7 @@

icon="fas fa-ellipsis-vertical" raised variant="outlined" + [ariaLabel]="'common.buttons.more' | translate" (onClick)="componentActionMenu.toggle($event)" > diff --git a/src/app/features/home/pages/dashboard/dashboard.component.html b/src/app/features/home/pages/dashboard/dashboard.component.html index cd1024b79..2be0c1284 100644 --- a/src/app/features/home/pages/dashboard/dashboard.component.html +++ b/src/app/features/home/pages/dashboard/dashboard.component.html @@ -10,11 +10,11 @@

{{ 'home.loggedIn.dashboard.quickSearch.goTo' | translate }} - + {{ 'home.loggedIn.dashboard.quickSearch.myProjects' | translate }} {{ 'home.loggedIn.dashboard.quickSearch.toOrganize' | translate }} - + {{ 'home.loggedIn.dashboard.quickSearch.search' | translate }} {{ 'home.loggedIn.dashboard.quickSearch.osf' | translate }} diff --git a/src/app/features/home/pages/dashboard/dashboard.component.ts b/src/app/features/home/pages/dashboard/dashboard.component.ts index ab1603af8..72cf98d6b 100644 --- a/src/app/features/home/pages/dashboard/dashboard.component.ts +++ b/src/app/features/home/pages/dashboard/dashboard.component.ts @@ -16,7 +16,7 @@ import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { CreateProjectDialogComponent } from '@osf/features/my-projects/components'; import { IconComponent, MyProjectsTableComponent, SubHeaderComponent } from '@osf/shared/components'; -import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { SortOrder } from '@osf/shared/enums'; import { IS_MEDIUM } from '@osf/shared/helpers'; import { MyResourcesItem, MyResourcesSearchFilters, TableParameters } from '@osf/shared/models'; @@ -44,7 +44,7 @@ export class DashboardComponent implements OnInit { readonly activeProject = signal(null); readonly sortColumn = signal(undefined); readonly sortOrder = signal(SortOrder.Asc); - readonly tableParams = signal({ ...MY_PROJECTS_TABLE_PARAMS }); + readonly tableParams = signal({ ...DEFAULT_TABLE_PARAMS }); readonly projects = select(MyResourcesSelectors.getProjects); readonly totalProjectsCount = select(MyResourcesSelectors.getTotalProjects); @@ -73,7 +73,7 @@ export class DashboardComponent implements OnInit { setupQueryParamsSubscription(): void { this.route.queryParams.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((params) => { const page = Number(params['page']) || 1; - const rows = Number(params['rows']) || MY_PROJECTS_TABLE_PARAMS.rows; + const rows = Number(params['rows']) || DEFAULT_TABLE_PARAMS.rows; const sortField = params['sortField']; const sortOrder = params['sortOrder'] as SortOrder; const search = params['search'] || ''; diff --git a/src/app/features/institutions/pages/institutions-list/institutions-list.component.html b/src/app/features/institutions/pages/institutions-list/institutions-list.component.html index 8e6ce79b2..6e2b8f855 100644 --- a/src/app/features/institutions/pages/institutions-list/institutions-list.component.html +++ b/src/app/features/institutions/pages/institutions-list/institutions-list.component.html @@ -18,13 +18,7 @@ @for (institution of institutions(); track $index) {

diff --git a/src/app/features/institutions/pages/institutions-list/institutions-list.component.ts b/src/app/features/institutions/pages/institutions-list/institutions-list.component.ts index bca6e1bf7..6314795a1 100644 --- a/src/app/features/institutions/pages/institutions-list/institutions-list.component.ts +++ b/src/app/features/institutions/pages/institutions-list/institutions-list.component.ts @@ -27,7 +27,7 @@ import { SearchInputComponent, SubHeaderComponent, } from '@osf/shared/components'; -import { TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { parseQueryFilterParams } from '@osf/shared/helpers'; import { QueryParams } from '@osf/shared/models'; import { FetchInstitutions, InstitutionsSelectors } from '@osf/shared/stores'; @@ -59,7 +59,7 @@ export class InstitutionsListComponent { queryParams = toSignal(this.route.queryParams); currentPage = signal(1); - currentPageSize = signal(TABLE_PARAMS.rows); + currentPageSize = signal(DEFAULT_TABLE_PARAMS.rows); first = signal(0); institutions = select(InstitutionsSelectors.getInstitutions); diff --git a/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts b/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts index ab90affb3..ee103da92 100644 --- a/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts +++ b/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts @@ -15,7 +15,7 @@ import { MeetingsState } from '@osf/features/meetings/store'; import { parseQueryFilterParams } from '@osf/shared/helpers'; import { MOCK_MEETING } from '@osf/shared/mocks'; import { SearchInputComponent, SubHeaderComponent } from '@shared/components'; -import { TABLE_PARAMS } from '@shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@shared/constants'; import { SortOrder } from '@shared/enums'; import { MeetingsFeatureCardComponent } from '../../components'; @@ -73,10 +73,10 @@ describe('MeetingsLandingComponent', () => { expect(component.partnerOrganizations).toEqual(PARTNER_ORGANIZATIONS); expect(component.meetingsFeatureCards).toEqual(MEETINGS_FEATURE_CARDS); expect(component.skeletonData).toHaveLength(10); - expect(component.tableParams().rows).toBe(TABLE_PARAMS.rows); + expect(component.tableParams().rows).toBe(DEFAULT_TABLE_PARAMS.rows); expect(component.tableParams().firstRowIndex).toBe(0); expect(component.currentPage()).toBe(1); - expect(component.currentPageSize()).toBe(TABLE_PARAMS.rows); + expect(component.currentPageSize()).toBe(DEFAULT_TABLE_PARAMS.rows); expect(component.sortColumn()).toBe(''); expect(component.sortOrder()).toBe(SortOrder.Asc); }); diff --git a/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.ts b/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.ts index 52bba1a88..1ecbbecd2 100644 --- a/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.ts +++ b/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.ts @@ -26,7 +26,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { Meeting } from '@osf/features/meetings/models'; import { GetAllMeetings, MeetingsSelectors } from '@osf/features/meetings/store'; import { SearchInputComponent, SubHeaderComponent } from '@shared/components'; -import { TABLE_PARAMS } from '@shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@shared/constants'; import { SortOrder } from '@shared/enums'; import { parseQueryFilterParams } from '@shared/helpers'; import { QueryParams, SearchFilters, TableParameters } from '@shared/models'; @@ -62,9 +62,9 @@ export class MeetingsLandingComponent { sortColumn = signal(''); sortOrder = signal(SortOrder.Asc); currentPage = signal(1); - currentPageSize = signal(TABLE_PARAMS.rows); + currentPageSize = signal(DEFAULT_TABLE_PARAMS.rows); tableParams = signal({ - ...TABLE_PARAMS, + ...DEFAULT_TABLE_PARAMS, firstRowIndex: 0, }); diff --git a/src/app/features/metadata/components/metadata-affiliated-institutions/metadata-affiliated-institutions.component.html b/src/app/features/metadata/components/metadata-affiliated-institutions/metadata-affiliated-institutions.component.html index 4a994d1a5..21b111021 100644 --- a/src/app/features/metadata/components/metadata-affiliated-institutions/metadata-affiliated-institutions.component.html +++ b/src/app/features/metadata/components/metadata-affiliated-institutions/metadata-affiliated-institutions.component.html @@ -6,10 +6,12 @@

{{ 'project.overview.metadata.affiliatedInstitutions' | translate }}

}
- +
+ +
diff --git a/src/app/features/metadata/components/metadata-contributors/metadata-contributors.component.html b/src/app/features/metadata/components/metadata-contributors/metadata-contributors.component.html index f1f26d9a2..a65f57fb3 100644 --- a/src/app/features/metadata/components/metadata-contributors/metadata-contributors.component.html +++ b/src/app/features/metadata/components/metadata-contributors/metadata-contributors.component.html @@ -1,10 +1,10 @@ - +

{{ 'project.overview.metadata.contributors' | translate }}

@if (!readonly()) { @@ -12,7 +12,7 @@

{{ 'project.overview.metadata.contributors' | translate }}

@if (contributors()) { -
+
@for (contributor of contributors(); track contributor.id) {
{{ contributor.fullName }} diff --git a/src/app/features/metadata/components/metadata-description/metadata-description.component.html b/src/app/features/metadata/components/metadata-description/metadata-description.component.html index 845f1d4bd..69fdc299b 100644 --- a/src/app/features/metadata/components/metadata-description/metadata-description.component.html +++ b/src/app/features/metadata/components/metadata-description/metadata-description.component.html @@ -11,9 +11,5 @@

{{ 'project.overview.metadata.description' | translate }}

}
- @if (description()) { -

{{ description() }}

- } @else { -

{{ 'project.overview.metadata.noDescription' | translate }}

- } +

{{ description() || ('project.overview.metadata.noDescription' | translate) }}

diff --git a/src/app/features/metadata/components/metadata-funding/metadata-funding.component.html b/src/app/features/metadata/components/metadata-funding/metadata-funding.component.html index 67f7d77ca..5fa7fa5e7 100644 --- a/src/app/features/metadata/components/metadata-funding/metadata-funding.component.html +++ b/src/app/features/metadata/components/metadata-funding/metadata-funding.component.html @@ -12,7 +12,7 @@

{{ 'project.overview.metadata.fundingSupport' | translate }}

@if (funders()?.length) { -
+
@for (funder of funders(); track funder.funderIdentifier) {

{{ 'files.detail.resourceMetadata.fields.funder' | translate }}: {{ funder.funderName }}

@@ -35,8 +35,8 @@

{{ 'project.overview.metadata.fundingSupport' | translate }}

}
} @else { -
-

{{ 'project.overview.metadata.noInformation' | translate }}

+
+

{{ 'project.overview.metadata.noInformation' | translate }}

} diff --git a/src/app/features/metadata/components/metadata-license/metadata-license.component.html b/src/app/features/metadata/components/metadata-license/metadata-license.component.html index 91982195f..d4a993b05 100644 --- a/src/app/features/metadata/components/metadata-license/metadata-license.component.html +++ b/src/app/features/metadata/components/metadata-license/metadata-license.component.html @@ -11,13 +11,7 @@

{{ 'project.overview.metadata.license' | translate }}

}
- @if (license()) { -
-

{{ license()?.name }}

-
- } @else { -
-

{{ 'project.overview.metadata.noLicense' | translate }}

-
- } +
+

{{ license()?.name || ('project.overview.metadata.noLicense' | translate) }}

+
diff --git a/src/app/features/metadata/components/metadata-publication-doi/metadata-publication-doi.component.html b/src/app/features/metadata/components/metadata-publication-doi/metadata-publication-doi.component.html index 52681361c..477b6f458 100644 --- a/src/app/features/metadata/components/metadata-publication-doi/metadata-publication-doi.component.html +++ b/src/app/features/metadata/components/metadata-publication-doi/metadata-publication-doi.component.html @@ -10,30 +10,31 @@

{{ 'project.overview.metadata.publication' | translate }}

> }
+ @if (resourceType() === ResourceType.Project) { @if (identifiers() && identifiers().length) { -
+
@for (identifier of identifiers()!; track identifier.id) { @if (identifier.category === 'doi') { - + {{ doiHost + identifier.value }} } }
} @else { -
-

{{ 'project.overview.metadata.noPublicationDoi' | translate }}

+
+

{{ 'project.overview.metadata.noPublicationDoi' | translate }}

} } @else { -
+
@if (publicationDoi()) { - + {{ doiHost + publicationDoi() }} } @else { -

{{ 'project.overview.metadata.noPublicationDoi' | translate }}

+

{{ 'project.overview.metadata.noPublicationDoi' | translate }}

}
} diff --git a/src/app/features/metadata/components/metadata-resource-information/metadata-resource-information.component.html b/src/app/features/metadata/components/metadata-resource-information/metadata-resource-information.component.html index b31512d64..5f2621417 100644 --- a/src/app/features/metadata/components/metadata-resource-information/metadata-resource-information.component.html +++ b/src/app/features/metadata/components/metadata-resource-information/metadata-resource-information.component.html @@ -19,19 +19,21 @@

}

- @if (customItemMetadata()?.resourceTypeGeneral) { -
-

- {{ 'project.overview.metadata.resourceType' | translate }}: - {{ getResourceTypeName(customItemMetadata()?.resourceTypeGeneral!) }} -

+
+ @if (customItemMetadata()?.resourceTypeGeneral) { +
+

+ {{ 'project.overview.metadata.resourceType' | translate }}: + {{ getResourceTypeName(customItemMetadata()?.resourceTypeGeneral!) }} +

-

- {{ 'project.overview.metadata.resourceLanguage' | translate }}: - {{ getLanguageName(customItemMetadata()?.language || '') }} -

-
- } @else { -

{{ 'project.overview.metadata.noResourceInformation' | translate }}

- } +

+ {{ 'project.overview.metadata.resourceLanguage' | translate }}: + {{ getLanguageName(customItemMetadata()?.language || '') }} +

+
+ } @else { +

{{ 'project.overview.metadata.noResourceInformation' | translate }}

+ } +
diff --git a/src/app/features/metadata/components/shared-metadata/shared-metadata.component.html b/src/app/features/metadata/components/shared-metadata/shared-metadata.component.html index cfd856d73..b89107798 100644 --- a/src/app/features/metadata/components/shared-metadata/shared-metadata.component.html +++ b/src/app/features/metadata/components/shared-metadata/shared-metadata.component.html @@ -7,7 +7,7 @@

{{ 'project.overview.metadata.dateCreated' | translate }}

-

+

{{ metadata()?.dateCreated | date: 'MMM d, y, h:mm a' }}

@@ -17,7 +17,7 @@

{{ 'project.overview.metadata.dateUpdated' | translate }}

-

+

{{ metadata()?.dateModified | date: 'MMM d, y, h:mm a' }}

diff --git a/src/app/features/moderation/components/moderators-table/moderators-table.component.html b/src/app/features/moderation/components/moderators-table/moderators-table.component.html index 6930ab39c..715289e7f 100644 --- a/src/app/features/moderation/components/moderators-table/moderators-table.component.html +++ b/src/app/features/moderation/components/moderators-table/moderators-table.component.html @@ -96,7 +96,8 @@ icon="fas fa-trash" severity="danger" text - (click)="removeModerator(item)" + (onClick)="removeModerator(item)" + [ariaLabel]="'common.buttons.delete' | translate" [disabled]="!isCurrentUserAdminModerator() && currentUserId() !== item.id" /> } diff --git a/src/app/features/moderation/components/moderators-table/moderators-table.component.ts b/src/app/features/moderation/components/moderators-table/moderators-table.component.ts index fc857a840..e3c721fd9 100644 --- a/src/app/features/moderation/components/moderators-table/moderators-table.component.ts +++ b/src/app/features/moderation/components/moderators-table/moderators-table.component.ts @@ -16,7 +16,7 @@ import { EmploymentHistoryDialogComponent, SelectComponent, } from '@osf/shared/components'; -import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { TableParameters } from '@osf/shared/models'; @Component({ @@ -39,7 +39,7 @@ export class ModeratorsTableComponent { dialogService = inject(DialogService); translateService = inject(TranslateService); - readonly tableParams = signal({ ...MY_PROJECTS_TABLE_PARAMS }); + readonly tableParams = signal({ ...DEFAULT_TABLE_PARAMS }); readonly permissionsOptions = MODERATION_PERMISSIONS; readonly ModeratorPermission = ModeratorPermission; diff --git a/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.spec.ts b/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.spec.ts index ecd77e681..18ccc2f7e 100644 --- a/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.spec.ts +++ b/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.spec.ts @@ -8,7 +8,7 @@ import { of } from 'rxjs'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { ProjectFormControls } from '@osf/shared/enums'; import { MOCK_STORE } from '@osf/shared/mocks'; import { CreateProject, GetMyProjects, MyResourcesSelectors } from '@osf/shared/stores'; @@ -84,7 +84,7 @@ describe('CreateProjectDialogComponent', () => { component.submitForm(); expect(MOCK_STORE.dispatch).toHaveBeenCalledWith(new CreateProject('Title', 'Desc', 'Tpl', 'Storage', ['a1'])); - expect(MOCK_STORE.dispatch).toHaveBeenCalledWith(new GetMyProjects(1, MY_PROJECTS_TABLE_PARAMS.rows, {})); + expect(MOCK_STORE.dispatch).toHaveBeenCalledWith(new GetMyProjects(1, DEFAULT_TABLE_PARAMS.rows, {})); expect((dialogRef as any).close).toHaveBeenCalledWith({ project: { id: 'new-project-id' } }); }); }); diff --git a/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.ts b/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.ts index d9a1d4fa3..6f74d333a 100644 --- a/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.ts +++ b/src/app/features/my-projects/components/create-project-dialog/create-project-dialog.component.ts @@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { AddProjectFormComponent } from '@osf/shared/components'; -import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { ProjectFormControls } from '@osf/shared/enums'; import { CustomValidators } from '@osf/shared/helpers'; import { ProjectForm } from '@osf/shared/models'; @@ -73,7 +73,7 @@ export class CreateProjectDialogComponent { next: () => { const projects = this.store.selectSnapshot(MyResourcesSelectors.getProjects); const newProject = projects[0]; - this.actions.getMyProjects(1, MY_PROJECTS_TABLE_PARAMS.rows, {}); + this.actions.getMyProjects(1, DEFAULT_TABLE_PARAMS.rows, {}); this.dialogRef.close({ project: newProject }); }, }); diff --git a/src/app/features/my-projects/my-projects.component.ts b/src/app/features/my-projects/my-projects.component.ts index df2eef8fe..63ee108d7 100644 --- a/src/app/features/my-projects/my-projects.component.ts +++ b/src/app/features/my-projects/my-projects.component.ts @@ -24,7 +24,7 @@ import { FormControl, FormsModule } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { MyProjectsTableComponent, SelectComponent, SubHeaderComponent } from '@osf/shared/components'; -import { MY_PROJECTS_TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { ResourceType, SortOrder } from '@osf/shared/enums'; import { IS_MEDIUM, parseQueryFilterParams } from '@osf/shared/helpers'; import { MyResourcesItem, MyResourcesSearchFilters, QueryParams, TableParameters } from '@osf/shared/models'; @@ -80,12 +80,12 @@ export class MyProjectsComponent implements OnInit { readonly queryParams = toSignal(this.route.queryParams); readonly currentPage = signal(1); - readonly currentPageSize = signal(MY_PROJECTS_TABLE_PARAMS.rows); + readonly currentPageSize = signal(DEFAULT_TABLE_PARAMS.rows); readonly selectedTab = signal(MyProjectsTab.Projects); readonly activeProject = signal(null); readonly sortColumn = signal(undefined); readonly sortOrder = signal(SortOrder.Asc); - readonly tableParams = signal({ ...MY_PROJECTS_TABLE_PARAMS, firstRowIndex: 0 }); + readonly tableParams = signal({ ...DEFAULT_TABLE_PARAMS, firstRowIndex: 0 }); readonly projects = select(MyResourcesSelectors.getProjects); readonly registrations = select(MyResourcesSelectors.getRegistrations); @@ -174,7 +174,7 @@ export class MyProjectsComponent implements OnInit { updateComponentState(params: QueryParams): void { untracked(() => { - const size = params.size || MY_PROJECTS_TABLE_PARAMS.rows; + const size = params.size || DEFAULT_TABLE_PARAMS.rows; this.currentPage.set(params.page ?? 1); this.currentPageSize.set(size); @@ -200,7 +200,7 @@ export class MyProjectsComponent implements OnInit { this.isLoading.set(true); const filters = this.createFilters(params); const pageNumber = params.page ?? 1; - const pageSize = params.size ?? MY_PROJECTS_TABLE_PARAMS.rows; + const pageSize = params.size ?? DEFAULT_TABLE_PARAMS.rows; let action$; switch (this.selectedTab()) { diff --git a/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.html b/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.html index 0b7a98b9b..e29db002e 100644 --- a/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.html +++ b/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.html @@ -5,13 +5,20 @@
@if (formArrayControls.length > 1) { - + }
}
- +
diff --git a/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.ts b/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.ts index a65ad89f2..327841ee1 100644 --- a/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.ts +++ b/src/app/features/preprints/components/stepper/author-assertion-step/array-input/array-input.component.ts @@ -1,3 +1,5 @@ +import { TranslatePipe } from '@ngx-translate/core'; + import { Button } from 'primeng/button'; import { ChangeDetectionStrategy, Component, input } from '@angular/core'; @@ -7,7 +9,7 @@ import { TextInputComponent } from '@shared/components'; @Component({ selector: 'osf-array-input', - imports: [ReactiveFormsModule, Button, TextInputComponent], + imports: [ReactiveFormsModule, Button, TextInputComponent, TranslatePipe], templateUrl: './array-input.component.html', styleUrl: './array-input.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/features/preprints/components/stepper/file-step/file-step.component.html b/src/app/features/preprints/components/stepper/file-step/file-step.component.html index 10a2d87ab..2b6b6a399 100644 --- a/src/app/features/preprints/components/stepper/file-step/file-step.component.html +++ b/src/app/features/preprints/components/stepper/file-step/file-step.component.html @@ -111,7 +111,14 @@

{{ 'preprints.preprintStepper.file.title' | translate }}

{{ file.name }}

- + } } diff --git a/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html b/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html index 31cc9a65a..13b28e730 100644 --- a/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html +++ b/src/app/features/preprints/components/stepper/supplements-step/supplements-step.component.html @@ -69,7 +69,14 @@

{{ 'preprints.preprintStepper.supplements.title' | translate }}

{{ preprintProject()?.name }}

- +
} diff --git a/src/app/features/preprints/pages/my-preprints/my-preprints.component.ts b/src/app/features/preprints/pages/my-preprints/my-preprints.component.ts index 6e12c9e42..400431522 100644 --- a/src/app/features/preprints/pages/my-preprints/my-preprints.component.ts +++ b/src/app/features/preprints/pages/my-preprints/my-preprints.component.ts @@ -24,7 +24,7 @@ import { FormControl } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { ListInfoShortenerComponent, SearchInputComponent, SubHeaderComponent } from '@osf/shared/components'; -import { TABLE_PARAMS } from '@osf/shared/constants'; +import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants'; import { SortOrder } from '@osf/shared/enums'; import { parseQueryFilterParams } from '@osf/shared/helpers'; import { QueryParams, SearchFilters, TableParameters } from '@osf/shared/models'; @@ -61,8 +61,8 @@ export class MyPreprintsComponent { sortColumn = signal(''); sortOrder = signal(SortOrder.Asc); currentPage = signal(1); - currentPageSize = signal(TABLE_PARAMS.rows); - tableParams = signal({ ...TABLE_PARAMS, firstRowIndex: 0 }); + currentPageSize = signal(DEFAULT_TABLE_PARAMS.rows); + tableParams = signal({ ...DEFAULT_TABLE_PARAMS, firstRowIndex: 0 }); preprints = select(PreprintSelectors.getMyPreprints); preprintsTotalCount = select(PreprintSelectors.getMyPreprintsTotalCount); diff --git a/src/app/features/project/overview/components/linked-resources/linked-resources.component.html b/src/app/features/project/overview/components/linked-resources/linked-resources.component.html index 68da00521..44fff2ec1 100644 --- a/src/app/features/project/overview/components/linked-resources/linked-resources.component.html +++ b/src/app/features/project/overview/components/linked-resources/linked-resources.component.html @@ -28,6 +28,7 @@

icon="fas fa-trash" severity="danger" text + [ariaLabel]="'common.buttons.delete' | translate" (onClick)="openDeleteResourceModal(linkedResource.id)" > diff --git a/src/app/features/project/overview/components/overview-components/overview-components.component.html b/src/app/features/project/overview/components/overview-components/overview-components.component.html index 7c208c1dd..a1e265639 100644 --- a/src/app/features/project/overview/components/overview-components/overview-components.component.html +++ b/src/app/features/project/overview/components/overview-components/overview-components.component.html @@ -31,6 +31,7 @@

icon="fas fa-ellipsis-vertical" raised variant="outlined" + [ariaLabel]="'common.buttons.more' | translate" (onClick)="componentActionMenu.toggle($event)" > diff --git a/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html b/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html index 4267d9a10..5088423ae 100644 --- a/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html +++ b/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html @@ -9,7 +9,12 @@

{{ 'project.overview.header.privateProject' | translate }}

- +
@@ -47,6 +52,7 @@ [pTooltip]="'project.overview.tooltips.viewOnlyLinks' | translate" tooltipPosition="bottom" [routerLink]="'../contributors'" + [ariaLabel]="'project.overview.tooltips.viewOnlyLinks' | translate" > {{ resource.viewOnlyLinksCount }} @@ -59,6 +65,7 @@ (click)="forkActionMenu.toggle($event)" [pTooltip]="'project.overview.tooltips.duplicate' | translate" tooltipPosition="bottom" + [ariaLabel]="'project.overview.tooltips.duplicate' | translate" > {{ resource.forksCount }} @@ -79,6 +86,7 @@ class="flex" (onClick)="toggleBookmark()" [loading]="isBookmarksLoading() || isBookmarksSubmitting()" + [ariaLabel]="'project.overview.tooltips.bookmarks' | translate" > @if (!isBookmarksLoading() && !isBookmarksSubmitting()) { @@ -92,6 +100,7 @@ (onClick)="socialsActionMenu.toggle($event)" [pTooltip]="'project.overview.tooltips.share' | translate" tooltipPosition="bottom" + [ariaLabel]="'project.overview.tooltips.share' | translate" > {{ socialsActionItems().length }} diff --git a/src/app/features/project/settings/components/settings-project-affiliation/settings-project-affiliation.component.html b/src/app/features/project/settings/components/settings-project-affiliation/settings-project-affiliation.component.html index af179c1e5..f4107a9c1 100644 --- a/src/app/features/project/settings/components/settings-project-affiliation/settings-project-affiliation.component.html +++ b/src/app/features/project/settings/components/settings-project-affiliation/settings-project-affiliation.component.html @@ -31,6 +31,7 @@

{{ 'myProjects.settings.projectAffiliation' | translate icon="fas fa-trash" severity="danger" text + [ariaLabel]="'common.buttons.delete' | translate" (onClick)="removeAffiliation(affiliation)" >

diff --git a/src/app/features/settings/profile-settings/components/education/education.component.html b/src/app/features/settings/profile-settings/components/education/education.component.html index 7e09a236b..aadd8fda0 100644 --- a/src/app/features/settings/profile-settings/components/education/education.component.html +++ b/src/app/features/settings/profile-settings/components/education/education.component.html @@ -14,7 +14,7 @@ { it('should load projects on init', () => { const dispatchSpy = jest.spyOn(store, 'dispatch'); - const action = new GetMyProjects(1, MY_PROJECTS_TABLE_PARAMS.rows, {}); + const action = new GetMyProjects(1, DEFAULT_TABLE_PARAMS.rows, {}); store.dispatch(action); expect(dispatchSpy).toHaveBeenCalledWith(action); diff --git a/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.scss b/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.scss index 59134fadc..a4c3a31e5 100644 --- a/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.scss +++ b/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.scss @@ -1,8 +1,7 @@ -@use "styles/variables" as var; @use "styles/mixins" as mix; .label { - color: var.$dark-blue-1; + color: var(--dark-blue-1); margin: 0; cursor: pointer; } @@ -13,5 +12,5 @@ } .border-divider { - border-bottom: 1px solid var.$grey-2; + border-bottom: 1px solid var(--grey-2); } diff --git a/src/app/shared/components/contributors/add-contributor-item/add-contributor-item.component.html b/src/app/shared/components/contributors/add-contributor-item/add-contributor-item.component.html index c9de4d79c..239a1b4c2 100644 --- a/src/app/shared/components/contributors/add-contributor-item/add-contributor-item.component.html +++ b/src/app/shared/components/contributors/add-contributor-item/add-contributor-item.component.html @@ -2,7 +2,7 @@

{{ contributor().fullName }}

-
diff --git a/src/app/shared/components/search-input/search-input.component.ts b/src/app/shared/components/search-input/search-input.component.ts index a04614836..809ecb62b 100644 --- a/src/app/shared/components/search-input/search-input.component.ts +++ b/src/app/shared/components/search-input/search-input.component.ts @@ -1,3 +1,5 @@ +import { TranslatePipe } from '@ngx-translate/core'; + import { Button } from 'primeng/button'; import { InputText } from 'primeng/inputtext'; @@ -8,7 +10,7 @@ import { IconComponent } from '../icon/icon.component'; @Component({ selector: 'osf-search-input', - imports: [InputText, Button, ReactiveFormsModule, IconComponent], + imports: [InputText, Button, ReactiveFormsModule, IconComponent, TranslatePipe], templateUrl: './search-input.component.html', styleUrl: './search-input.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/app/shared/components/search-results-container/search-results-container.component.html b/src/app/shared/components/search-results-container/search-results-container.component.html index 343612663..b97395488 100644 --- a/src/app/shared/components/search-results-container/search-results-container.component.html +++ b/src/app/shared/components/search-results-container/search-results-container.component.html @@ -51,6 +51,7 @@

severity="secondary" icon="fas fa-sliders" size="large" + [ariaLabel]="'common.accessibility.openFilters' | translate" (click)="openFilters()" > } @@ -59,6 +60,7 @@

severity="secondary" icon="fas fa-filter" size="large" + [ariaLabel]="'common.accessibility.openSortingOptions' | translate" (click)="openSorting()" >

@@ -107,13 +109,20 @@

@if (first() && prev()) { - + } @@ -123,6 +132,7 @@

icon="fas fa-angle-right" severity="contrast" text + [ariaLabel]="'common.accessibility.goToNextPage' | translate" [disabled]="!next()" (click)="switchPage(!next() ? first() : next())" > diff --git a/src/app/shared/components/search-results-container/search-results-container.component.scss b/src/app/shared/components/search-results-container/search-results-container.component.scss index feaeacc4d..68b2f7a86 100644 --- a/src/app/shared/components/search-results-container/search-results-container.component.scss +++ b/src/app/shared/components/search-results-container/search-results-container.component.scss @@ -1,5 +1,3 @@ -@use "styles/variables" as var; - .result-count { color: var(--pr-blue-1); } @@ -10,12 +8,12 @@ justify-content: center; width: 100%; height: 44px; - border: 1px solid var.$grey-2; + border: 1px solid var(--grey-2); border-radius: 12px; - padding: 0 24px 0 24px; + padding: 0 1.5rem; cursor: pointer; } .card-selected { - background: var.$bg-blue-2; + background: var(--bg-blue-2); } diff --git a/src/app/shared/components/stepper/stepper.component.scss b/src/app/shared/components/stepper/stepper.component.scss index 1ae17b641..90c570f4f 100644 --- a/src/app/shared/components/stepper/stepper.component.scss +++ b/src/app/shared/components/stepper/stepper.component.scss @@ -1,4 +1,5 @@ @use "styles/mixins" as mix; + :host { max-width: 100%; overflow: auto; diff --git a/src/app/shared/components/subjects/subjects.component.html b/src/app/shared/components/subjects/subjects.component.html index 39fc1c960..fcd77e332 100644 --- a/src/app/shared/components/subjects/subjects.component.html +++ b/src/app/shared/components/subjects/subjects.component.html @@ -64,6 +64,7 @@

{{ 'shared.subjects.title' | translate }}

(onNodeCollapse)="collapseNode($event.node)" (onNodeSelect)="selectSubject($event.node.data)" (onNodeUnselect)="removeSubject($event.node.data)" + [ariaLabel]="'shared.subjects.subjectTree' | translate" > } diff --git a/src/app/shared/components/tags-input/tags-input.component.html b/src/app/shared/components/tags-input/tags-input.component.html index 8eab8fb4e..cffa97d09 100644 --- a/src/app/shared/components/tags-input/tags-input.component.html +++ b/src/app/shared/components/tags-input/tags-input.component.html @@ -21,6 +21,7 @@ [readOnly]="readonly()" (keydown)="onInputKeydown($event)" (blur)="onInputBlur($event)" + [attr.aria-label]="'common.accessibility.tagInput' | translate" class="tag-input-field" />
diff --git a/src/app/shared/components/view-only-table/view-only-table.component.html b/src/app/shared/components/view-only-table/view-only-table.component.html index fef65dfba..90d274386 100644 --- a/src/app/shared/components/view-only-table/view-only-table.component.html +++ b/src/app/shared/components/view-only-table/view-only-table.component.html @@ -64,9 +64,9 @@ icon="fas fa-trash" severity="danger" text - (click)="deleteLink.emit(item)" - > - + [ariaLabel]="'common.buttons.delete' | translate" + (onClick)="deleteLink.emit(item)" + /> } @else { diff --git a/src/app/shared/constants/meetings-table.constants.ts b/src/app/shared/constants/default-table-params.constants.ts similarity index 80% rename from src/app/shared/constants/meetings-table.constants.ts rename to src/app/shared/constants/default-table-params.constants.ts index 769587a07..34bfb03dc 100644 --- a/src/app/shared/constants/meetings-table.constants.ts +++ b/src/app/shared/constants/default-table-params.constants.ts @@ -1,6 +1,6 @@ import { TableParameters } from '@shared/models'; -export const TABLE_PARAMS: TableParameters = { +export const DEFAULT_TABLE_PARAMS: TableParameters = { rows: 10, paginator: true, scrollable: false, diff --git a/src/app/shared/constants/index.ts b/src/app/shared/constants/index.ts index 23069ad60..243495732 100644 --- a/src/app/shared/constants/index.ts +++ b/src/app/shared/constants/index.ts @@ -3,13 +3,11 @@ export * from './addons-category-options.const'; export * from './addons-tab-options.const'; export * from './contributors.constants'; export * from './default-citation-titles.const'; +export * from './default-table-params.constants'; export * from './filter-placeholders'; export * from './input-limits.const'; export * from './input-validation-messages.const'; export * from './language.const'; -export * from './meetings-table.constants'; -export * from './my-projects-table.constants'; -export * from './pie-chart-palette'; export * from './pie-chart-palette'; export * from './registry-services-icons.const'; export * from './resource-card-labels.const'; diff --git a/src/app/shared/constants/my-projects-table.constants.ts b/src/app/shared/constants/my-projects-table.constants.ts deleted file mode 100644 index a3d485202..000000000 --- a/src/app/shared/constants/my-projects-table.constants.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TableParameters } from '../models'; - -export const MY_PROJECTS_TABLE_PARAMS: TableParameters = { - rows: 10, - paginator: true, - scrollable: false, - rowsPerPageOptions: [5, 10, 25], - totalRecords: 0, - firstRowIndex: 0, - defaultSortColumn: null, - defaultSortOrder: null, -}; diff --git a/src/app/shared/models/index.ts b/src/app/shared/models/index.ts index 395386811..e6902177d 100644 --- a/src/app/shared/models/index.ts +++ b/src/app/shared/models/index.ts @@ -21,7 +21,6 @@ export * from './institutions'; export * from './language-code.model'; export * from './license'; export * from './license.model'; -export * from './license.model'; export * from './licenses-json-api.model'; export * from './meta-tags'; export * from './metadata-tabs.model'; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index fba1bd785..713d2d4eb 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -47,7 +47,27 @@ "continueUpdate": "Continue Update", "editAndResubmit": "Edit And Resubmit", "createNewVersion": "Create New Version", - "leaveThisView": "Leave this view" + "leaveThisView": "Leave this view", + "addOneMore": "Add One More" + }, + "accessibility": { + "help": "Help", + "openFilters": "Open filters", + "openSortingOptions": "Open sorting options", + "goToFirstPage": "Go to first page", + "goToPreviousPage": "Go to previous page", + "goToNextPage": "Go to next page", + "mainNavigation": "Main navigation", + "searchHelp": "Search help", + "confirmationDialog": "Confirmation dialog", + "reportsLink": "Reports link", + "tooltipBtn": "Tooltip button", + "customizeOptions": "Customize options", + "toggleProjectVisibility": "Toggle project visibility", + "tagInput": "Tag input" + }, + "dialogs": { + "confirmation": "Confirmation" }, "search": { "title": "Search", @@ -963,10 +983,10 @@ "link": "Link", "noLink": "No link available" }, - "noLinkedServices": "This project has no configured linked services at the moment.", - "redirectMessage": "Visit", - "addonsLink": "Add-ons", - "redirectMessageSuffix": "to add a linked service." + "noLinkedServices": "This project has no configured linked services at the moment.", + "redirectMessage": "Visit", + "addonsLink": "Add-ons", + "redirectMessageSuffix": "to add a linked service." } }, "files": { @@ -1663,7 +1683,6 @@ "startDate": "Start Date", "endDate": "End Date", "ongoing": "Ongoing", - "addMore": "Add One More", "successUpdate": "Education successfully updated." }, "changesDiscarded": "Changes discarded successfully.",