diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index a9be27183..90da93795 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,9 +1,5 @@
import { createDispatchMap, select } from '@ngxs/store';
-import { TranslateService } from '@ngx-translate/core';
-
-import { DialogService } from 'primeng/dynamicdialog';
-
import { filter } from 'rxjs';
import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, OnInit } from '@angular/core';
@@ -14,6 +10,7 @@ import { ENVIRONMENT } from '@core/provider/environment.provider';
import { GetCurrentUser } from '@core/store/user';
import { GetEmails, UserEmailsSelectors } from '@core/store/user-emails';
import { ConfirmEmailComponent } from '@shared/components';
+import { CustomDialogService } from '@shared/services';
import { FullScreenLoaderComponent, ToastComponent } from './shared/components';
@@ -25,14 +22,12 @@ import { GoogleTagManagerService } from 'angular-google-tag-manager';
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
- providers: [DialogService],
})
export class AppComponent implements OnInit {
private readonly googleTagManagerService = inject(GoogleTagManagerService);
private readonly destroyRef = inject(DestroyRef);
- private readonly dialogService = inject(DialogService);
+ private readonly customDialogService = inject(CustomDialogService);
private readonly router = inject(Router);
- private readonly translateService = inject(TranslateService);
private readonly environment = inject(ENVIRONMENT);
private readonly actions = createDispatchMap({ getCurrentUser: GetCurrentUser, getEmails: GetEmails });
@@ -67,12 +62,9 @@ export class AppComponent implements OnInit {
}
private showEmailDialog() {
- this.dialogService.open(ConfirmEmailComponent, {
+ this.customDialogService.open(ConfirmEmailComponent, {
+ header: 'home.confirmEmail.title',
width: '448px',
- focusOnShow: false,
- header: this.translateService.instant('home.confirmEmail.title'),
- modal: true,
- closable: false,
data: this.unverifiedEmails(),
});
}
diff --git a/src/app/app.config.ts b/src/app/app.config.ts
index b456a9341..d1fdb3c61 100644
--- a/src/app/app.config.ts
+++ b/src/app/app.config.ts
@@ -5,6 +5,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { ConfirmationService, MessageService } from 'primeng/api';
import { providePrimeNG } from 'primeng/config';
+import { DialogService } from 'primeng/dynamicdialog';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { ApplicationConfig, ErrorHandler, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
@@ -26,12 +27,13 @@ export const appConfig: ApplicationConfig = {
providers: [
APPLICATION_INITIALIZATION_PROVIDER,
ConfirmationService,
+ DialogService,
+ MessageService,
{
provide: ErrorHandler,
useFactory: () => Sentry.createErrorHandler({ showDialog: false }),
},
importProvidersFrom(TranslateModule.forRoot(provideTranslation())),
- MessageService,
provideAnimations(),
providePrimeNG({
theme: {
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 ea0db013c..b5fcdc54d 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
@@ -110,60 +110,63 @@
@for (col of columns; track col.field) {
@let currentColumnField = rowData[col.field];
- @if (col.isLink && isLink(currentColumnField)) {
-
- @if (col.dateFormat) {
- {{ getCellValue(currentColumnField) | date: col.dateFormat }}
+
+
+ @if (col.isLink && isLink(currentColumnField)) {
+
+ @if (col.dateFormat) {
+ {{ getCellValue(currentColumnField) | date: col.dateFormat }}
+ } @else {
+ {{ getCellValue(currentColumnField) }}
+ }
+
+ } @else if (col.isLink && col.isArray && isLinkArray(currentColumnField)) {
+
+ @for (link of currentColumnField; track $index) {
+
+ }
+
+ } @else {
+ @if (col.dateFormat && currentColumnField) {
+
+ {{ getCellValue(currentColumnField) | date: col.dateFormat }}
+
+ } @else if (!col.dateFormat && currentColumnField) {
+
+ {{ getCellValue(currentColumnField) }}
+
} @else {
- {{ getCellValue(currentColumnField) }}
+ {{ currentColumnField ?? '-' }}
}
-
- } @else if (col.isLink && col.isArray && isLinkArray(currentColumnField)) {
-
- @for (link of currentColumnField; track $index) {
-
- }
-
- } @else {
- @if (col.dateFormat && currentColumnField) {
-
- {{ getCellValue(currentColumnField) | date: col.dateFormat }}
-
- } @else if (!col.dateFormat && currentColumnField) {
-
- {{ getCellValue(currentColumnField) }}
-
- } @else {
- {{ currentColumnField ?? '-' }}
}
- }
- @if (col.showIcon && !col.isArray) {
-
- }
+ @if (col.showIcon && !col.isArray) {
+
+ }
+
|
}
diff --git a/src/app/features/admin-institutions/pages/institutions-projects/institutions-projects.component.ts b/src/app/features/admin-institutions/pages/institutions-projects/institutions-projects.component.ts
index 9b2fb2901..d9f9b6fd4 100644
--- a/src/app/features/admin-institutions/pages/institutions-projects/institutions-projects.component.ts
+++ b/src/app/features/admin-institutions/pages/institutions-projects/institutions-projects.component.ts
@@ -1,9 +1,8 @@
import { createDispatchMap, select } from '@ngxs/store';
-import { TranslatePipe, TranslateService } from '@ngx-translate/core';
+import { TranslatePipe } from '@ngx-translate/core';
import { Button } from 'primeng/button';
-import { DialogService } from 'primeng/dynamicdialog';
import { filter } from 'rxjs';
@@ -22,7 +21,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { UserSelectors } from '@core/store/user';
import { ResourceType, SortOrder } from '@osf/shared/enums';
import { PaginationLinksModel, ResourceModel, SearchFilters } from '@osf/shared/models';
-import { ToastService } from '@osf/shared/services';
+import { CustomDialogService, ToastService } from '@osf/shared/services';
import {
FetchResources,
FetchResourcesByLink,
@@ -49,13 +48,11 @@ import { InstitutionsAdminSelectors, RequestProjectAccess, SendUserMessage } fro
templateUrl: './institutions-projects.component.html',
styleUrl: './institutions-projects.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
- providers: [DialogService],
})
export class InstitutionsProjectsComponent implements OnInit, OnDestroy {
- private dialogService = inject(DialogService);
+ private customDialogService = inject(CustomDialogService);
private destroyRef = inject(DestroyRef);
private toastService = inject(ToastService);
- private translate = inject(TranslateService);
private actions = createDispatchMap({
sendUserMessage: SendUserMessage,
@@ -137,14 +134,10 @@ export class InstitutionsProjectsComponent implements OnInit, OnDestroy {
return;
}
- this.dialogService
+ this.customDialogService
.open(ContactDialogComponent, {
+ header: 'adminInstitutions.institutionUsers.sendEmail',
width: '448px',
- focusOnShow: false,
- header: this.translate.instant('adminInstitutions.institutionUsers.sendEmail'),
- closeOnEscape: true,
- modal: true,
- closable: true,
data: this.currentUser()?.fullName,
})
.onClose.pipe(
diff --git a/src/app/features/admin-institutions/pages/institutions-users/institutions-users.component.ts b/src/app/features/admin-institutions/pages/institutions-users/institutions-users.component.ts
index 52c8e53a7..9510d4d63 100644
--- a/src/app/features/admin-institutions/pages/institutions-users/institutions-users.component.ts
+++ b/src/app/features/admin-institutions/pages/institutions-users/institutions-users.component.ts
@@ -3,7 +3,6 @@ import { createDispatchMap, select } from '@ngxs/store';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import { CheckboxModule } from 'primeng/checkbox';
-import { DialogService } from 'primeng/dynamicdialog';
import { PaginatorState } from 'primeng/paginator';
import { filter } from 'rxjs';
@@ -18,7 +17,7 @@ import { SelectComponent } from '@osf/shared/components';
import { DEFAULT_TABLE_PARAMS } from '@osf/shared/constants';
import { Primitive } from '@osf/shared/helpers';
import { SearchFilters } from '@osf/shared/models';
-import { ToastService } from '@osf/shared/services';
+import { CustomDialogService, ToastService } from '@osf/shared/services';
import { SortOrder } from '@shared/enums';
import { AdminTableComponent } from '../../components';
@@ -36,11 +35,10 @@ import { FetchInstitutionUsers, InstitutionsAdminSelectors, SendUserMessage } fr
templateUrl: './institutions-users.component.html',
styleUrl: './institutions-users.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
- providers: [DialogService],
})
export class InstitutionsUsersComponent {
- private readonly translate = inject(TranslateService);
- private readonly dialogService = inject(DialogService);
+ private readonly translateService = inject(TranslateService);
+ private readonly customDialogService = inject(CustomDialogService);
private readonly destroyRef = inject(DestroyRef);
private readonly toastService = inject(ToastService);
private readonly environment = inject(ENVIRONMENT);
@@ -76,7 +74,7 @@ export class InstitutionsUsersComponent {
amountText = computed(() => {
const count = this.totalCount();
- return count + ' ' + this.translate.instant('adminInstitutions.summary.totalUsers').toLowerCase();
+ return count + ' ' + this.translateService.instant('adminInstitutions.summary.totalUsers').toLowerCase();
});
constructor() {
@@ -109,14 +107,10 @@ export class InstitutionsUsersComponent {
onIconClick(event: TableIconClickEvent): void {
switch (event.action) {
case 'sendMessage': {
- this.dialogService
+ this.customDialogService
.open(SendEmailDialogComponent, {
+ header: 'adminInstitutions.institutionUsers.sendEmail',
width: '448px',
- focusOnShow: false,
- header: this.translate.instant('adminInstitutions.institutionUsers.sendEmail'),
- closeOnEscape: true,
- modal: true,
- closable: true,
data: this.currentUser()?.fullName,
})
.onClose.pipe(
diff --git a/src/app/features/analytics/components/view-duplicates/view-duplicates.component.ts b/src/app/features/analytics/components/view-duplicates/view-duplicates.component.ts
index 0641302f2..54c04300c 100644
--- a/src/app/features/analytics/components/view-duplicates/view-duplicates.component.ts
+++ b/src/app/features/analytics/components/view-duplicates/view-duplicates.component.ts
@@ -1,9 +1,8 @@
import { createDispatchMap, select } from '@ngxs/store';
-import { TranslatePipe, TranslateService } from '@ngx-translate/core';
+import { TranslatePipe } from '@ngx-translate/core';
import { Button } from 'primeng/button';
-import { DialogService } from 'primeng/dynamicdialog';
import { Menu } from 'primeng/menu';
import { PaginatorState } from 'primeng/paginator';
@@ -42,6 +41,7 @@ import { ResourceType, UserPermissions } from '@osf/shared/enums';
import { IS_SMALL } from '@osf/shared/helpers';
import { ToolbarResource } from '@osf/shared/models';
import { Duplicate } from '@osf/shared/models/duplicates';
+import { CustomDialogService } from '@osf/shared/services';
import { ClearDuplicates, DuplicatesSelectors, GetAllDuplicates } from '@osf/shared/stores';
@Component({
@@ -62,11 +62,9 @@ import { ClearDuplicates, DuplicatesSelectors, GetAllDuplicates } from '@osf/sha
templateUrl: './view-duplicates.component.html',
styleUrl: './view-duplicates.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
- providers: [DialogService],
})
export class ViewDuplicatesComponent {
- private dialogService = inject(DialogService);
- private translateService = inject(TranslateService);
+ private customDialogService = inject(CustomDialogService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private destroyRef = inject(DestroyRef);
@@ -180,21 +178,17 @@ export class ViewDuplicatesComponent {
const dialogWidth = !this.isSmall() ? '95vw' : '450px';
if (toolbarResource) {
- this.dialogService
+ this.customDialogService
.open(ForkDialogComponent, {
+ header: 'project.overview.dialog.fork.headerProject',
width: dialogWidth,
- focusOnShow: false,
- header: this.translateService.instant('project.overview.dialog.fork.headerProject'),
- closeOnEscape: true,
- modal: true,
- closable: true,
data: {
resource: toolbarResource,
resourceType: this.resourceType(),
},
})
.onClose.subscribe((result) => {
- if (result.success) {
+ if (result?.success) {
const resource = this.currentResource();
if (resource) {
this.actions.getDuplicates(resource.id, resource.type, parseInt(this.currentPage()), this.pageSize);
@@ -222,14 +216,10 @@ export class ViewDuplicatesComponent {
private handleDeleteFork(id: string): void {
const dialogWidth = !this.isSmall() ? '95vw' : '650px';
- this.dialogService
+ this.customDialogService
.open(DeleteComponentDialogComponent, {
+ header: 'project.overview.dialog.deleteComponent.header',
width: dialogWidth,
- focusOnShow: false,
- header: this.translateService.instant('project.overview.dialog.deleteComponent.header'),
- closeOnEscape: true,
- modal: true,
- closable: true,
data: {
componentId: id,
resourceType: this.resourceType(),
@@ -239,7 +229,7 @@ export class ViewDuplicatesComponent {
},
})
.onClose.subscribe((result) => {
- if (result && result.success) {
+ if (result?.success) {
const resource = this.currentResource();
if (resource) {
this.actions.getDuplicates(resource.id, resource.type, parseInt(this.currentPage()), this.pageSize);
diff --git a/src/app/features/collections/components/add-to-collection/add-to-collection.component.ts b/src/app/features/collections/components/add-to-collection/add-to-collection.component.ts
index cd508271e..ff3512069 100644
--- a/src/app/features/collections/components/add-to-collection/add-to-collection.component.ts
+++ b/src/app/features/collections/components/add-to-collection/add-to-collection.component.ts
@@ -1,9 +1,8 @@
import { createDispatchMap, select } from '@ngxs/store';
-import { TranslatePipe, TranslateService } from '@ngx-translate/core';
+import { TranslatePipe } from '@ngx-translate/core';
import { Button } from 'primeng/button';
-import { DialogService } from 'primeng/dynamicdialog';
import { Stepper } from 'primeng/stepper';
import { Observable } from 'rxjs';
@@ -30,7 +29,7 @@ import {
import { LoadingSpinnerComponent } from '@shared/components';
import { HeaderStyleHelper } from '@shared/helpers';
import { CanDeactivateComponent } from '@shared/models';
-import { BrandService } from '@shared/services';
+import { BrandService, CustomDialogService } from '@shared/services';
import { CollectionsSelectors, GetCollectionProvider } from '@shared/stores';
import { ProjectsSelectors } from '@shared/stores/projects/projects.selectors';
@@ -57,15 +56,13 @@ import {
],
templateUrl: './add-to-collection.component.html',
styleUrl: './add-to-collection.component.scss',
- providers: [DialogService],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AddToCollectionComponent implements CanDeactivateComponent {
private readonly router = inject(Router);
private readonly route = inject(ActivatedRoute);
private readonly destroyRef = inject(DestroyRef);
- private readonly dialogService = inject(DialogService);
- private readonly translateService = inject(TranslateService);
+ private readonly customDialogService = inject(CustomDialogService);
readonly AddToCollectionSteps = AddToCollectionSteps;
@@ -131,22 +128,18 @@ export class AddToCollectionComponent implements CanDeactivateComponent {
userId: this.currentUser()?.id || '',
};
- const dialogRef = this.dialogService.open(AddToCollectionConfirmationDialogComponent, {
- width: '500px',
- focusOnShow: false,
- header: this.translateService.instant('collections.addToCollection.confirmationDialogHeader'),
- closeOnEscape: true,
- modal: true,
- closable: true,
- data: { payload, project: this.selectedProject() },
- });
-
- dialogRef.onClose.subscribe((result) => {
- if (result) {
- this.allowNavigation.set(true);
- this.router.navigate([this.selectedProject()?.id, 'overview']);
- }
- });
+ this.customDialogService
+ .open(AddToCollectionConfirmationDialogComponent, {
+ header: 'collections.addToCollection.confirmationDialogHeader',
+ width: '500px',
+ data: { payload, project: this.selectedProject() },
+ })
+ .onClose.subscribe((result) => {
+ if (result) {
+ this.allowNavigation.set(true);
+ this.router.navigate([this.selectedProject()?.id, 'overview']);
+ }
+ });
}
private initializeProvider(): void {
diff --git a/src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.ts b/src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.ts
index bee98ce2d..56c28c377 100644
--- a/src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.ts
+++ b/src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.ts
@@ -1,9 +1,8 @@
import { createDispatchMap, select } from '@ngxs/store';
-import { TranslatePipe, TranslateService } from '@ngx-translate/core';
+import { TranslatePipe } from '@ngx-translate/core';
import { Button } from 'primeng/button';
-import { DialogService } from 'primeng/dynamicdialog';
import { Step, StepItem, StepPanel } from 'primeng/stepper';
import { Tooltip } from 'primeng/tooltip';
@@ -22,7 +21,7 @@ import {
import { AddContributorType, ResourceType } from '@osf/shared/enums';
import { findChangedItems } from '@osf/shared/helpers';
import { ContributorDialogAddModel, ContributorModel } from '@osf/shared/models';
-import { CustomConfirmationService, ToastService } from '@osf/shared/services';
+import { CustomConfirmationService, CustomDialogService, ToastService } from '@osf/shared/services';
import {
AddContributor,
ContributorsSelectors,
@@ -36,13 +35,11 @@ import {
imports: [Button, Step, StepItem, StepPanel, Tooltip, TranslatePipe, ContributorsTableComponent, InfoIconComponent],
templateUrl: './project-contributors-step.component.html',
styleUrl: './project-contributors-step.component.scss',
- providers: [DialogService],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ProjectContributorsStepComponent {
private readonly destroyRef = inject(DestroyRef);
- private readonly translateService = inject(TranslateService);
- private readonly dialogService = inject(DialogService);
+ private readonly customDialogService = inject(CustomDialogService);
private readonly toastService = inject(ToastService);
private readonly customConfirmationService = inject(CustomConfirmationService);
@@ -127,15 +124,11 @@ export class ProjectContributorsStepComponent {
private openAddContributorDialog() {
const addedContributorIds = this.projectContributors().map((x) => x.userId);
- this.dialogService
+ this.customDialogService
.open(AddContributorDialogComponent, {
+ header: 'project.contributors.addDialog.addRegisteredContributor',
width: '448px',
data: addedContributorIds,
- focusOnShow: false,
- header: this.translateService.instant('project.contributors.addDialog.addRegisteredContributor'),
- closeOnEscape: true,
- modal: true,
- closable: true,
})
.onClose.pipe(
filter((res: ContributorDialogAddModel) => !!res),
@@ -157,14 +150,10 @@ export class ProjectContributorsStepComponent {
}
private openAddUnregisteredContributorDialog() {
- this.dialogService
+ this.customDialogService
.open(AddUnregisteredContributorDialogComponent, {
+ header: 'project.contributors.addDialog.addUnregisteredContributor',
width: '448px',
- focusOnShow: false,
- header: this.translateService.instant('project.contributors.addDialog.addUnregisteredContributor'),
- closeOnEscape: true,
- modal: true,
- closable: true,
})
.onClose.pipe(
filter((res: ContributorDialogAddModel) => !!res),
diff --git a/src/app/features/collections/components/collections-discover/collections-discover.component.html b/src/app/features/collections/components/collections-discover/collections-discover.component.html
index 3adf33906..9e1e0de8e 100644
--- a/src/app/features/collections/components/collections-discover/collections-discover.component.html
+++ b/src/app/features/collections/components/collections-discover/collections-discover.component.html
@@ -12,11 +12,7 @@
{{ collectionProvider()?.name }}
-
+