diff --git a/src/app/core/admin/end-user-agreement/eua.service.ts b/src/app/core/admin/end-user-agreement/eua.service.ts index 4c79d83e..5d1cfc13 100644 --- a/src/app/core/admin/end-user-agreement/eua.service.ts +++ b/src/app/core/admin/end-user-agreement/eua.service.ts @@ -34,6 +34,6 @@ export class EuaService extends AbstractEntityService { } publish(eua: EndUserAgreement): Observable { - return this.updateAction('publish', eua); + return this.updateAction('publish', eua, {}); } } diff --git a/src/app/core/admin/end-user-agreement/list-euas/admin-list-euas.component.ts b/src/app/core/admin/end-user-agreement/list-euas/admin-list-euas.component.ts index fb6e22b7..c4d52413 100644 --- a/src/app/core/admin/end-user-agreement/list-euas/admin-list-euas.component.ts +++ b/src/app/core/admin/end-user-agreement/list-euas/admin-list-euas.component.ts @@ -33,6 +33,10 @@ import { } from '../../../../common/table'; import { EndUserAgreement } from '../../../auth'; import { EuaService } from '../eua.service'; +import { + PreviewEuaModalComponent, + PreviewEuaModalData +} from '../preview-eua-modal/preview-eua-modal.component'; @Component({ templateUrl: './admin-list-euas.component.html', @@ -163,8 +167,9 @@ export class AdminListEuasComponent implements OnInit { /** * Opens a preview modal containing the text and title of this end user agreement. */ - previewEndUserAgreement(endUserAgreement: EndUserAgreement) { - const { text, title } = endUserAgreement; - this.#dialogService.alert(title, text); + previewEndUserAgreement(eua: EndUserAgreement) { + this.#dialogService.open(PreviewEuaModalComponent, { + data: { eua } + }); } } diff --git a/src/app/core/admin/end-user-agreement/manage-eua/manage-eua.component.ts b/src/app/core/admin/end-user-agreement/manage-eua/manage-eua.component.ts index 2055492d..55c10b8d 100644 --- a/src/app/core/admin/end-user-agreement/manage-eua/manage-eua.component.ts +++ b/src/app/core/admin/end-user-agreement/manage-eua/manage-eua.component.ts @@ -9,6 +9,10 @@ import { DialogService } from '../../../../common/dialog'; import { SystemAlertComponent, SystemAlertService } from '../../../../common/system-alert'; import { EndUserAgreement } from '../../../auth'; import { EuaService } from '../eua.service'; +import { + PreviewEuaModalComponent, + PreviewEuaModalData +} from '../preview-eua-modal/preview-eua-modal.component'; @Component({ standalone: true, @@ -44,6 +48,8 @@ export class ManageEuaComponent { } previewEua(): void { - this.#dialogService.alert(this.eua().title, this.eua().text); + this.#dialogService.open(PreviewEuaModalComponent, { + data: { eua: this.eua() } + }); } } diff --git a/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.html b/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.html new file mode 100644 index 00000000..6b3a679c --- /dev/null +++ b/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.html @@ -0,0 +1,8 @@ + +
+
+

{{ data.eua.title }}

+
+
+
+
diff --git a/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.scss b/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.ts b/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.ts new file mode 100644 index 00000000..102112ca --- /dev/null +++ b/src/app/core/admin/end-user-agreement/preview-eua-modal/preview-eua-modal.component.ts @@ -0,0 +1,28 @@ +import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog'; +import { Component, inject } from '@angular/core'; +import { FormsModule } from '@angular/forms'; + +import { ModalComponent } from '../../../../common'; +import { DialogAction } from '../../../../common/dialog'; +import { EndUserAgreement } from '../../../auth'; + +export type PreviewEuaModalData = { + eua: EndUserAgreement; +}; + +@Component({ + selector: 'app-preview-eua-modal', + standalone: true, + imports: [FormsModule, ModalComponent], + templateUrl: './preview-eua-modal.component.html', + styleUrl: './preview-eua-modal.component.scss' +}) +export class PreviewEuaModalComponent { + readonly #dialogRef = inject(DialogRef); + + readonly data: PreviewEuaModalData = inject(DIALOG_DATA); + + close() { + this.#dialogRef.close({ action: DialogAction.CANCEL }); + } +} diff --git a/src/app/core/eua/user-eua.component.html b/src/app/core/eua/user-eua.component.html index ffae7ee3..5eae5f6d 100644 --- a/src/app/core/eua/user-eua.component.html +++ b/src/app/core/eua/user-eua.component.html @@ -2,12 +2,12 @@
@if (eua$ | async; as eua) {
-

+

End User Agreement (EUA)
@if (!alreadyAccepted()) { Please review and acknowledge the end user agreement } -

+