mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
[DURACOM-307] start migration and type fixing
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<ds-form *ngIf="!!formModel" #formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[displaySubmit]="false"
|
||||
[displayCancel]="false"
|
||||
(dfChange)="onChange($event)"
|
||||
(removeArrayItem)="onRemove($event)"></ds-form>
|
||||
@if (!!formModel) {
|
||||
<ds-form #formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[displaySubmit]="false"
|
||||
[displayCancel]="false"
|
||||
(dfChange)="onChange($event)"
|
||||
(removeArrayItem)="onRemove($event)"></ds-form>
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
@@ -78,9 +78,8 @@ import { SectionAccessesService } from './section-accesses.service';
|
||||
templateUrl: './section-accesses.component.html',
|
||||
styleUrls: ['./section-accesses.component.scss'],
|
||||
imports: [
|
||||
FormComponent,
|
||||
NgIf,
|
||||
],
|
||||
FormComponent
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionAccessesComponent extends SectionModelComponent {
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -65,17 +61,15 @@ import { SectionsType } from '../sections-type';
|
||||
styleUrls: ['./submission-section-cc-licenses.component.scss'],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
ThemedLoadingComponent,
|
||||
AsyncPipe,
|
||||
VarDirective,
|
||||
NgForOf,
|
||||
DsSelectComponent,
|
||||
NgbDropdownModule,
|
||||
FormsModule,
|
||||
InfiniteScrollModule,
|
||||
BtnDisabledDirective,
|
||||
],
|
||||
BtnDisabledDirective
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionCcLicensesComponent extends SectionModelComponent {
|
||||
|
@@ -1,10 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgComponentOutlet,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe, NgClass, NgComponentOutlet } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Injector,
|
||||
@@ -30,15 +24,13 @@ import { rendersSectionType } from '../sections-decorator';
|
||||
styleUrls: ['./section-container.component.scss'],
|
||||
imports: [
|
||||
AlertComponent,
|
||||
NgForOf,
|
||||
NgbAccordionModule,
|
||||
NgComponentOutlet,
|
||||
TranslateModule,
|
||||
NgClass,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
SectionsDirective,
|
||||
],
|
||||
SectionsDirective
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionContainerComponent implements OnInit {
|
||||
|
@@ -3,18 +3,26 @@ Template for the detect duplicates submission section component
|
||||
@author Kim Shepherd
|
||||
-->
|
||||
<div class="text-sm-left" *ngVar="(this.getDuplicateData() | async) as data">
|
||||
<ng-container *ngIf="data?.potentialDuplicates.length === 0">
|
||||
@if (data?.potentialDuplicates.length === 0) {
|
||||
<div class="alert alert-success w-100">{{ 'submission.sections.duplicates.none' | translate }}</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="data?.potentialDuplicates.length > 0">
|
||||
<div class="alert alert-warning w-100">{{ 'submission.sections.duplicates.detected' | translate }}</div>
|
||||
<div *ngFor="let dupe of data?.potentialDuplicates" class="ds-duplicate">
|
||||
}
|
||||
@if (data?.potentialDuplicates.length > 0) {
|
||||
<div class="alert alert-warning w-100">{{ 'submission.sections.duplicates.detected' | translate }}</div>
|
||||
@for (dupe of data?.potentialDuplicates; track dupe) {
|
||||
<div class="ds-duplicate">
|
||||
<a target="_blank" [href]="getItemLink(dupe.uuid)">{{dupe.title}}</a>
|
||||
<div *ngFor="let metadatum of Metadata.toViewModelList(dupe.metadata)">
|
||||
{{('item.preview.' + metadatum.key) | translate}} {{metadatum.value}}
|
||||
</div>
|
||||
<p *ngIf="dupe.workspaceItemId">{{ 'submission.sections.duplicates.in-workspace' | translate }}</p>
|
||||
<p *ngIf="dupe.workflowItemId">{{ 'submission.sections.duplicates.in-workflow' | translate }}</p>
|
||||
@for (metadatum of Metadata.toViewModelList(dupe.metadata); track metadatum) {
|
||||
<div>
|
||||
{{('item.preview.' + metadatum.key) | translate}} {{metadatum.value}}
|
||||
</div>
|
||||
}
|
||||
@if (dupe.workspaceItemId) {
|
||||
<p>{{ 'submission.sections.duplicates.in-workspace' | translate }}</p>
|
||||
}
|
||||
@if (dupe.workflowItemId) {
|
||||
<p>{{ 'submission.sections.duplicates.in-workflow' | translate }}</p>
|
||||
}
|
||||
</div>
|
||||
</ng-container>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
@@ -255,11 +255,7 @@ describe('SubmissionSectionDuplicatesComponent test suite', () => {
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [BrowserModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
NgxPaginationModule],
|
||||
imports: [BrowserModule, FormsModule, ReactiveFormsModule, NgxPaginationModule],
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
@@ -41,11 +37,9 @@ import { SectionsService } from '../sections.service';
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
imports: [
|
||||
VarDirective,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
NgForOf,
|
||||
],
|
||||
TranslateModule
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
||||
|
@@ -1,11 +1,15 @@
|
||||
<ds-loading *ngIf="isLoading" message="Loading..."></ds-loading>
|
||||
<ds-form *ngIf="!isLoading && formModel" #formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[displaySubmit]="false"
|
||||
[displayCancel]="false"
|
||||
(dfChange)="onChange($event)"
|
||||
(dfFocus)="onFocus($event)"
|
||||
(remove)="onRemove($event)"
|
||||
(ngbEvent)="onCustomEvent($event)"
|
||||
(removeArrayItem)="onRemove($event)"></ds-form>
|
||||
@if (isLoading) {
|
||||
<ds-loading message="Loading..."></ds-loading>
|
||||
}
|
||||
@if (!isLoading && formModel) {
|
||||
<ds-form #formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[displaySubmit]="false"
|
||||
[displayCancel]="false"
|
||||
(dfChange)="onChange($event)"
|
||||
(dfFocus)="onFocus($event)"
|
||||
(remove)="onRemove($event)"
|
||||
(ngbEvent)="onCustomEvent($event)"
|
||||
(removeArrayItem)="onRemove($event)"></ds-form>
|
||||
}
|
||||
|
@@ -659,6 +659,6 @@ describe('SubmissionSectionFormComponent test suite', () => {
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [CommonModule, FormsModule, ReactiveFormsModule],
|
||||
imports: [FormsModule, ReactiveFormsModule],
|
||||
})
|
||||
class TestComponent {}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -77,9 +77,8 @@ import { SectionFormOperationsService } from './section-form-operations.service'
|
||||
templateUrl: './section-form.component.html',
|
||||
imports: [
|
||||
FormComponent,
|
||||
ThemedLoadingComponent,
|
||||
NgIf,
|
||||
],
|
||||
ThemedLoadingComponent
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionFormComponent extends SectionModelComponent {
|
||||
|
@@ -4,17 +4,17 @@ Template for the identifiers submission section component
|
||||
-->
|
||||
<!-- Main identifier data -->
|
||||
<ng-container *ngVar="(getIdentifierData() | async) as identifierData">
|
||||
<ng-container *ngIf="identifierData && identifierData.identifiers">
|
||||
<div>
|
||||
<span>{{'submission.sections.identifiers.info' | translate}}</span>
|
||||
<ul>
|
||||
<ng-container *ngFor="let identifier of identifierData.identifiers">
|
||||
<ng-container *ngIf="identifierData.displayTypes.includes(identifier.identifierType) && identifier.value">
|
||||
<li>{{'submission.sections.identifiers.' + identifier.identifierType + '_label' | translate}}
|
||||
{{identifier.value}}</li>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
</ng-container>
|
||||
@if (identifierData && identifierData.identifiers) {
|
||||
<div>
|
||||
<span>{{'submission.sections.identifiers.info' | translate}}</span>
|
||||
<ul>
|
||||
@for (identifier of identifierData.identifiers; track identifier) {
|
||||
@if (identifierData.displayTypes.includes(identifier.identifierType) && identifier.value) {
|
||||
<li>{{'submission.sections.identifiers.' + identifier.identifierType + '_label' | translate}}
|
||||
{{identifier.value}}</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</ng-container>
|
||||
|
@@ -276,10 +276,10 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => {
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
NgxPaginationModule],
|
||||
NgxPaginationModule
|
||||
],
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
@@ -40,11 +36,9 @@ import { SectionsService } from '../sections.service';
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
VarDirective,
|
||||
],
|
||||
VarDirective
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
||||
|
@@ -1,9 +1,11 @@
|
||||
<span class="mb-5 preserve-line-breaks" [innerHTML]="licenseText$ | async"></span>
|
||||
<br> <br>
|
||||
<ds-form *ngIf="formModel" #formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[formLayout]="formLayout"
|
||||
[displaySubmit]="displaySubmit"
|
||||
[displayCancel]="false"
|
||||
(dfChange)="onChange($event)"></ds-form>
|
||||
@if (formModel) {
|
||||
<ds-form #formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[formLayout]="formLayout"
|
||||
[displaySubmit]="displaySubmit"
|
||||
[displayCancel]="false"
|
||||
(dfChange)="onChange($event)"></ds-form>
|
||||
}
|
||||
|
@@ -377,11 +377,10 @@ describe('SubmissionSectionLicenseComponent test suite', () => {
|
||||
standalone: true,
|
||||
imports: [
|
||||
SubmissionSectionLicenseComponent,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
FormComponent,
|
||||
ReactiveFormsModule,
|
||||
],
|
||||
ReactiveFormsModule
|
||||
],
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
AfterViewChecked,
|
||||
ChangeDetectorRef,
|
||||
@@ -67,9 +64,8 @@ import {
|
||||
providers: [],
|
||||
imports: [
|
||||
FormComponent,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
],
|
||||
AsyncPipe
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionLicenseComponent extends SectionModelComponent implements AfterViewChecked {
|
||||
|
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe, NgClass } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -59,14 +54,12 @@ import { LdnPattern } from './submission-coar-notify.config';
|
||||
styleUrls: ['./section-coar-notify.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
NgIf,
|
||||
NgForOf,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
NgbDropdownModule,
|
||||
NgClass,
|
||||
InfiniteScrollModule,
|
||||
],
|
||||
InfiniteScrollModule
|
||||
],
|
||||
providers: [NgbDropdown],
|
||||
})
|
||||
export class SubmissionSectionCoarNotifyComponent extends SectionModelComponent {
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
NgForOf,
|
||||
NgIf,
|
||||
TitleCasePipe,
|
||||
} from '@angular/common';
|
||||
import { TitleCasePipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -20,12 +16,10 @@ import { PermittedVersions } from '../../../../core/submission/models/sherpa-pol
|
||||
templateUrl: './content-accordion.component.html',
|
||||
styleUrls: ['./content-accordion.component.scss'],
|
||||
imports: [
|
||||
NgForOf,
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
NgbCollapseModule,
|
||||
TitleCasePipe,
|
||||
],
|
||||
TitleCasePipe
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class ContentAccordionComponent {
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
DatePipe,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -18,10 +15,9 @@ import { Metadata } from '../../../../core/submission/models/sherpa-policies-det
|
||||
templateUrl: './metadata-information.component.html',
|
||||
styleUrls: ['./metadata-information.component.scss'],
|
||||
imports: [
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
DatePipe,
|
||||
],
|
||||
DatePipe
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class MetadataInformationComponent {
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -18,10 +15,8 @@ import { Journal } from '../../../../core/submission/models/sherpa-policies-deta
|
||||
templateUrl: './publication-information.component.html',
|
||||
styleUrls: ['./publication-information.component.scss'],
|
||||
imports: [
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
NgForOf,
|
||||
],
|
||||
TranslateModule
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class PublicationInformationComponent {
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
KeyValuePipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { KeyValuePipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -23,10 +19,8 @@ import { ContentAccordionComponent } from '../content-accordion/content-accordio
|
||||
imports: [
|
||||
ContentAccordionComponent,
|
||||
TranslateModule,
|
||||
KeyValuePipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
],
|
||||
KeyValuePipe
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class PublisherPolicyComponent {
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
@@ -47,12 +43,10 @@ import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.co
|
||||
AlertComponent,
|
||||
TranslateModule,
|
||||
PublisherPolicyComponent,
|
||||
NgIf,
|
||||
PublicationInformationComponent,
|
||||
AsyncPipe,
|
||||
VarDirective,
|
||||
NgForOf,
|
||||
],
|
||||
VarDirective
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionSherpaPoliciesComponent extends SectionModelComponent {
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -22,10 +19,7 @@ import { isEmpty } from '../../../../shared/empty.util';
|
||||
@Component({
|
||||
selector: 'ds-submission-section-upload-access-conditions',
|
||||
templateUrl: './submission-section-upload-access-conditions.component.html',
|
||||
imports: [
|
||||
NgForOf,
|
||||
NgIf,
|
||||
],
|
||||
imports: [],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionUploadAccessConditionsComponent implements OnInit {
|
||||
|
@@ -5,15 +5,17 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ds-form *ngIf="formModel"
|
||||
#formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[displaySubmit]="!isSaving"
|
||||
[displayCancel]="!isSaving"
|
||||
(submitForm)="onSubmit()"
|
||||
(cancel)="onModalClose()"
|
||||
(dfChange)="onChange($event)"></ds-form>
|
||||
@if (formModel) {
|
||||
<ds-form
|
||||
#formRef="formComponent"
|
||||
[formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[displaySubmit]="!isSaving"
|
||||
[displayCancel]="!isSaving"
|
||||
(submitForm)="onSubmit()"
|
||||
(cancel)="onModalClose()"
|
||||
(dfChange)="onChange($event)"></ds-form>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -403,11 +403,10 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => {
|
||||
standalone: true,
|
||||
imports: [
|
||||
SubmissionSectionUploadFileEditComponent,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
FormComponent,
|
||||
ReactiveFormsModule,
|
||||
],
|
||||
ReactiveFormsModule
|
||||
],
|
||||
})
|
||||
class TestComponent {
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -79,10 +79,9 @@ import {
|
||||
templateUrl: './section-upload-file-edit.component.html',
|
||||
imports: [
|
||||
FormComponent,
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
BtnDisabledDirective,
|
||||
],
|
||||
BtnDisabledDirective
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionUploadFileEditComponent
|
||||
|
@@ -286,9 +286,9 @@ describe('SubmissionSectionUploadFileComponent test suite', () => {
|
||||
standalone: true,
|
||||
imports: [
|
||||
ThemedSubmissionSectionUploadFileComponent,
|
||||
CommonModule,
|
||||
AsyncPipe,
|
||||
NgbModule],
|
||||
NgbModule
|
||||
],
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -51,12 +48,11 @@ import { SubmissionSectionUploadFileViewComponent } from './view/section-upload-
|
||||
imports: [
|
||||
TranslateModule,
|
||||
SubmissionSectionUploadFileViewComponent,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
ThemedFileDownloadLinkComponent,
|
||||
FileSizePipe,
|
||||
BtnDisabledDirective,
|
||||
],
|
||||
BtnDisabledDirective
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
@@ -1,38 +1,46 @@
|
||||
<div>
|
||||
<ng-container *ngIf="metadata">
|
||||
<ng-container *ngFor="let entry of getAllMetadataValue(fileTitleKey)">
|
||||
<ng-container *ngIf="entry.value !== ''">
|
||||
@if (metadata) {
|
||||
@for (entry of getAllMetadataValue(fileTitleKey); track entry) {
|
||||
@if (entry.value !== '') {
|
||||
<h3>
|
||||
{{entry.value}}
|
||||
<span class="text-muted">({{fileData?.sizeBytes | dsFileSize}})</span>
|
||||
</h3>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="entry.value === ''">
|
||||
<h5 *ngIf="metadata[fileTitleKey].indexOf(entry) === 0">
|
||||
<span class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{fileTitleKey}}</span>
|
||||
</h5>
|
||||
</ng-container>
|
||||
}
|
||||
@if (entry.value === '') {
|
||||
@if (metadata[fileTitleKey].indexOf(entry) === 0) {
|
||||
<h5>
|
||||
<span class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{fileTitleKey}}</span>
|
||||
</h5>
|
||||
}
|
||||
}
|
||||
<span class="clearfix"></span>
|
||||
</ng-container>
|
||||
<ng-container *ngFor="let entry of getAllMetadataValue(fileDescrKey)">
|
||||
<ng-container *ngIf="entry.value !== ''">
|
||||
}
|
||||
@for (entry of getAllMetadataValue(fileDescrKey); track entry) {
|
||||
@if (entry.value !== '') {
|
||||
{{entry.value | dsTruncate:['150']}}
|
||||
</ng-container>
|
||||
<ng-container *ngIf="entry.value === ''">
|
||||
<span *ngIf="metadata[fileDescrKey].indexOf(entry) === 0"
|
||||
class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{fileDescrKey}}</span>
|
||||
</ng-container>
|
||||
}
|
||||
@if (entry.value === '') {
|
||||
@if (metadata[fileDescrKey].indexOf(entry) === 0) {
|
||||
<span
|
||||
class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{fileDescrKey}}</span>
|
||||
}
|
||||
}
|
||||
<span class="clearfix"></span>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<div class="mt-1" *ngIf="fileFormat">
|
||||
{{'admin.registries.bitstream-formats.edit.head' | translate:{format: fileFormat} }}
|
||||
</div>
|
||||
<div class="mt-1" *ngIf="fileCheckSum">
|
||||
Checksum {{fileCheckSum.checkSumAlgorithm}}: {{fileCheckSum.value}}
|
||||
</div>
|
||||
@if (fileFormat) {
|
||||
<div class="mt-1">
|
||||
{{'admin.registries.bitstream-formats.edit.head' | translate:{format: fileFormat} }}
|
||||
</div>
|
||||
}
|
||||
@if (fileCheckSum) {
|
||||
<div class="mt-1">
|
||||
Checksum {{fileCheckSum.checkSumAlgorithm}}: {{fileCheckSum.value}}
|
||||
</div>
|
||||
}
|
||||
<span class="clearfix"></span>
|
||||
<ds-submission-section-upload-access-conditions [accessConditions]="fileData.accessConditions"></ds-submission-section-upload-access-conditions>
|
||||
</div>
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -30,10 +27,8 @@ import { SubmissionSectionUploadAccessConditionsComponent } from '../../accessCo
|
||||
SubmissionSectionUploadAccessConditionsComponent,
|
||||
TranslateModule,
|
||||
TruncatePipe,
|
||||
NgIf,
|
||||
NgForOf,
|
||||
FileSizePipe,
|
||||
],
|
||||
FileSizePipe
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionUploadFileViewComponent implements OnInit {
|
||||
|
@@ -1,23 +1,24 @@
|
||||
<ds-alert [content]="'submission.sections.upload.info'"
|
||||
[dismissible]="true"
|
||||
[type]="AlertTypeEnum.Info"></ds-alert>
|
||||
[dismissible]="true"
|
||||
[type]="AlertTypeEnum.Info"></ds-alert>
|
||||
|
||||
<ng-container *ngIf="fileList.length > 0; else noFileUploaded">
|
||||
|
||||
<div *ngIf="collectionDefaultAccessConditions.length > 0" class="row">
|
||||
<div class="col-sm-12" >
|
||||
<ds-alert [type]="AlertTypeEnum.Warning">
|
||||
<ng-container *ngIf="collectionPolicyType === 1">
|
||||
{{ 'submission.sections.upload.header.policy.default.nolist' | translate:{ "collectionName": collectionName } }}
|
||||
</ng-container>
|
||||
<ng-container *ngIf="collectionPolicyType === 2">
|
||||
{{ 'submission.sections.upload.header.policy.default.withlist' | translate:{ "collectionName": collectionName } }}
|
||||
</ng-container>
|
||||
<span class="clearfix"></span>
|
||||
<ds-submission-section-upload-access-conditions [accessConditions]="collectionDefaultAccessConditions"></ds-submission-section-upload-access-conditions>
|
||||
</ds-alert>
|
||||
@if (fileList.length > 0) {
|
||||
@if (collectionDefaultAccessConditions.length > 0) {
|
||||
<div class="row">
|
||||
<div class="col-sm-12" >
|
||||
<ds-alert [type]="AlertTypeEnum.Warning">
|
||||
@if (collectionPolicyType === 1) {
|
||||
{{ 'submission.sections.upload.header.policy.default.nolist' | translate:{ "collectionName": collectionName } }}
|
||||
}
|
||||
@if (collectionPolicyType === 2) {
|
||||
{{ 'submission.sections.upload.header.policy.default.withlist' | translate:{ "collectionName": collectionName } }}
|
||||
}
|
||||
<span class="clearfix"></span>
|
||||
<ds-submission-section-upload-access-conditions [accessConditions]="collectionDefaultAccessConditions"></ds-submission-section-upload-access-conditions>
|
||||
</ds-alert>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<span class="text-left font-weight-bold">{{ 'bitstream.edit.form.primaryBitstream.label' | translate }}</span>
|
||||
@@ -28,30 +29,29 @@
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngFor="let fileEntry of fileList; let i = index;">
|
||||
@for (fileEntry of fileList; track fileEntry; let i = $index) {
|
||||
<ds-submission-upload-section-file
|
||||
[isPrimary]="primaryBitstreamUUID ? primaryBitstreamUUID === fileEntry.uuid : null"
|
||||
[availableAccessConditionOptions]="availableAccessConditionOptions"
|
||||
[collectionId]="collectionId"
|
||||
[collectionPolicyType]="collectionPolicyType"
|
||||
[configMetadataForm]="(configMetadataForm$ | async)"
|
||||
[fileId]="fileEntry.uuid"
|
||||
[fileIndex]="i"
|
||||
[fileName]="fileNames[i]"
|
||||
[sectionId]="sectionData.id"
|
||||
[submissionId]="submissionId"></ds-submission-upload-section-file>
|
||||
[isPrimary]="primaryBitstreamUUID ? primaryBitstreamUUID === fileEntry.uuid : null"
|
||||
[availableAccessConditionOptions]="availableAccessConditionOptions"
|
||||
[collectionId]="collectionId"
|
||||
[collectionPolicyType]="collectionPolicyType"
|
||||
[configMetadataForm]="(configMetadataForm$ | async)"
|
||||
[fileId]="fileEntry.uuid"
|
||||
[fileIndex]="i"
|
||||
[fileName]="fileNames[i]"
|
||||
[sectionId]="sectionData.id"
|
||||
[submissionId]="submissionId"></ds-submission-upload-section-file>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #noFileUploaded>
|
||||
}
|
||||
} @else {
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="text-center h3"><span class="text-muted">{{'submission.sections.upload.no-file-uploaded' | translate}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
}
|
||||
|
||||
|
@@ -382,8 +382,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule],
|
||||
imports: [],
|
||||
})
|
||||
class TestComponent {
|
||||
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -74,12 +70,10 @@ export interface AccessConditionGroupsMapEntry {
|
||||
imports: [
|
||||
ThemedSubmissionSectionUploadFileComponent,
|
||||
SubmissionSectionUploadAccessConditionsComponent,
|
||||
NgIf,
|
||||
AlertComponent,
|
||||
TranslateModule,
|
||||
NgForOf,
|
||||
AsyncPipe,
|
||||
],
|
||||
AsyncPipe
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class SubmissionSectionUploadComponent extends SectionModelComponent {
|
||||
|
Reference in New Issue
Block a user