From accbcedcbf529ab21ecace3db38ead257966ec0c Mon Sep 17 00:00:00 2001 From: William Welling Date: Fri, 11 Jul 2025 11:09:50 -0500 Subject: [PATCH] Upgrade proxy license step --- .../container/section-container.component.ts | 2 +- .../submission/sections/sections-decorator.ts | 2 +- .../license/section-license.component.html | 132 ++++++++++-------- .../license/section-license.component.scss | 0 .../license/section-license.component.ts | 19 ++- 5 files changed, 89 insertions(+), 66 deletions(-) create mode 100644 src/themes/tamu/app/submission/sections/license/section-license.component.scss diff --git a/src/app/submission/sections/container/section-container.component.ts b/src/app/submission/sections/container/section-container.component.ts index fa6860d9530..f551af89cea 100644 --- a/src/app/submission/sections/container/section-container.component.ts +++ b/src/app/submission/sections/container/section-container.component.ts @@ -79,7 +79,7 @@ export class SubmissionSectionContainerComponent implements OnInit { @ViewChild('sectionRef') sectionRef: SectionsDirective; // TAMU Customization - theme service to get active theme - private themeService: ThemeService; + private readonly themeService: ThemeService; // END TAMU Customization - theme service to get active theme /** diff --git a/src/app/submission/sections/sections-decorator.ts b/src/app/submission/sections/sections-decorator.ts index 8ac351bee1a..c71cbc2af30 100644 --- a/src/app/submission/sections/sections-decorator.ts +++ b/src/app/submission/sections/sections-decorator.ts @@ -43,7 +43,7 @@ export function renderSectionFor(sectionType: SectionsType, theme: string = 'dsp export function rendersSectionType(sectionType: SectionsType, theme: string = 'dspace') { let themedMap = submissionSectionsMap.get(theme); if (themedMap === undefined || !themedMap.has(sectionType)) { - themedMap = submissionSectionsMap.get('dspace'); + return submissionSectionsMap.get(sectionType); } return themedMap.get(sectionType); } diff --git a/src/themes/tamu/app/submission/sections/license/section-license.component.html b/src/themes/tamu/app/submission/sections/license/section-license.component.html index d55f7830b97..243fd826e9d 100644 --- a/src/themes/tamu/app/submission/sections/license/section-license.component.html +++ b/src/themes/tamu/app/submission/sections/license/section-license.component.html @@ -1,83 +1,91 @@
-
{{"submission.sections.proxy-license.header" | translate}}
-

- {{"submission.sections.proxy-license.last-step-label" | translate}} - {{"submission.sections.proxy-license.last-step" | translate}} -

-

{{"submission.sections.proxy-license.instructions" | translate}}

+
{{"submission.sections.proxy-license.header" | translate}}
+

+ {{"submission.sections.proxy-license.last-step-label" | translate}} + {{"submission.sections.proxy-license.last-step" | translate}} +

+

{{"submission.sections.proxy-license.instructions" | translate}}

- +
-

+

- - - -
-
-
- {{proxy.metadata['dc.source'][0].value}} ({{proxy.sizeBytes | dsFileSize}}) -
-
- - - - - - -
+ + @if (uploadFilesOptions.url) { + + } + @if (proxyLicense | async; as proxy) { + +
+
+ @if ((proxy.metadata['dc.source'] && proxy.metadata['dc.source'].length > 0)) { +
+ {{proxy.metadata['dc.source'][0].value}} ({{proxy.sizeBytes | dsFileSize}})
+ } +
+ + + + + + +
+
- {{"submission.sections.proxy-license.upload-instructions" | translate}} + } + {{"submission.sections.proxy-license.upload-instructions" | translate}}
- + @if (formModel) { + + }
- - - + + + diff --git a/src/themes/tamu/app/submission/sections/license/section-license.component.scss b/src/themes/tamu/app/submission/sections/license/section-license.component.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/themes/tamu/app/submission/sections/license/section-license.component.ts b/src/themes/tamu/app/submission/sections/license/section-license.component.ts index 61fb5be6bbf..823e773d005 100644 --- a/src/themes/tamu/app/submission/sections/license/section-license.component.ts +++ b/src/themes/tamu/app/submission/sections/license/section-license.component.ts @@ -1,7 +1,8 @@ +import { AsyncPipe } from '@angular/common'; import { ChangeDetectorRef, Component, ElementRef, Inject, ViewChild } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { DynamicCheckboxModel, DynamicFormLayout, DynamicRadioGroupModel, MATCH_DISABLED } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, Observable, of } from 'rxjs'; import { distinctUntilChanged, filter, map, switchMap, take, tap } from 'rxjs/operators'; @@ -18,10 +19,14 @@ import { WorkspaceitemSectionLicenseObject } from '../../../../../../app/core/su import { WorkspaceItem } from '../../../../../../app/core/submission/models/workspaceitem.model'; import { normalizeSectionData } from '../../../../../../app/core/submission/submission-response-parsing.service'; import { isNotEmpty, isNotUndefined } from '../../../../../../app/shared/empty.util'; +import { ThemedFileDownloadLinkComponent } from '../../../../../../app/shared/file-download-link/themed-file-download-link.component'; import { FormBuilderService } from '../../../../../../app/shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../../../../app/shared/form/form.component'; import { FormService } from '../../../../../../app/shared/form/form.service'; import { NotificationsService } from '../../../../../../app/shared/notifications/notifications.service'; import { UploaderOptions } from '../../../../../../app/shared/upload/uploader/uploader-options.model'; +import { UploaderComponent } from '../../../../../../app/shared/upload/uploader/uploader.component'; +import { FileSizePipe } from '../../../../../../app/shared/utils/file-size-pipe'; import { followLink } from '../../../../../../app/shared/utils/follow-link-config.model'; import { SectionFormOperationsService } from '../../../../../../app/submission/sections/form/section-form-operations.service'; import { SubmissionSectionLicenseComponent as BaseComponent } from '../../../../../../app/submission/sections/license/section-license.component'; @@ -39,9 +44,19 @@ import { SECTION_LICENSE_FORM_LAYOUT } from './section-license.model'; */ @Component({ selector: 'ds-submission-section-license', - // styleUrls: ['./section-license.component.scss'], + styleUrls: ['./section-license.component.scss'], + // styleUrls: ['../../../../../../app/submission/sections/license/section-license.component.scss'], templateUrl: './section-license.component.html', // templateUrl: '../../../../../../app/submission/sections/license/section-license.component.html', + imports: [ + AsyncPipe, + FileSizePipe, + FormComponent, + UploaderComponent, + ThemedFileDownloadLinkComponent, + TranslateModule, + ], + standalone: true, }) @renderSectionFor(SectionsType.License, 'tamu') export class SubmissionSectionLicenseComponent extends BaseComponent {