Skip to content

Commit

Permalink
Merge remote-tracking branch 'alex/themed-SubmissionUploadFilesCompon…
Browse files Browse the repository at this point in the history
…ent_contribute-7.6' into minor-themed-component-fixes_contribute-main

# Conflicts:
#	src/app/submission/submission.module.ts
#	src/themes/custom/lazy-theme.module.ts
  • Loading branch information
alexandrevryghem committed Apr 24, 2024
2 parents 3f92249 + 8b29a71 commit a73b2ad
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app/submission/form/submission-form.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="container-fluid">
<div *ngIf="(isLoading() | async) !== true" class="submission-form-header mb-3 d-flex flex-wrap position-sticky">
<div *ngIf="(uploadEnabled$ | async)" class="w-100">
<ds-submission-upload-files [submissionId]="submissionId"
<ds-themed-submission-upload-files [submissionId]="submissionId"
[collectionId]="collectionId"
[uploadFilesOptions]="uploadFilesOptions"></ds-submission-upload-files>
[uploadFilesOptions]="uploadFilesOptions"></ds-themed-submission-upload-files>
<div class="clearfix"></div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/app/submission/form/submission-form.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { SubmissionFormCollectionComponent } from './collection/submission-form-
import { SubmissionFormFooterComponent } from './footer/submission-form-footer.component';
import { SubmissionFormSectionAddComponent } from './section-add/submission-form-section-add.component';
import { SubmissionFormComponent } from './submission-form.component';
import { SubmissionUploadFilesComponent } from './submission-upload-files/submission-upload-files.component';
import { ThemedSubmissionUploadFilesComponent } from './submission-upload-files/themed-submission-upload-files.component';

describe('SubmissionFormComponent Component', () => {

Expand Down Expand Up @@ -86,7 +86,7 @@ describe('SubmissionFormComponent Component', () => {
ThemedLoadingComponent,
SubmissionSectionContainerComponent,
SubmissionFormFooterComponent,
SubmissionUploadFilesComponent,
ThemedSubmissionUploadFilesComponent,
SubmissionFormCollectionComponent,
SubmissionFormSectionAddComponent,
] },
Expand Down
14 changes: 7 additions & 7 deletions src/app/submission/form/submission-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import {

import { AuthService } from '../../core/auth/auth.service';
import { SubmissionDefinitionsModel } from '../../core/config/models/config-submission-definitions.model';
import {
SubmissionSectionModel,
SubmissionSectionVisibility,
} from '../../core/config/models/config-submission-section.model';
import { Collection } from '../../core/shared/collection.model';
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
import { Item } from '../../core/shared/item.model';
Expand All @@ -42,14 +46,10 @@ import { SectionsService } from '../sections/sections.service';
import { SectionsType } from '../sections/sections-type';
import { VisibilityType } from '../sections/visibility-type';
import { SubmissionService } from '../submission.service';
import {
SubmissionSectionModel,
SubmissionSectionVisibility,
} from './../../core/config/models/config-submission-section.model';
import { SubmissionFormCollectionComponent } from './collection/submission-form-collection.component';
import { SubmissionFormFooterComponent } from './footer/submission-form-footer.component';
import { SubmissionFormSectionAddComponent } from './section-add/submission-form-section-add.component';
import { SubmissionUploadFilesComponent } from './submission-upload-files/submission-upload-files.component';
import { ThemedSubmissionUploadFilesComponent } from './submission-upload-files/themed-submission-upload-files.component';

/**
* This component represents the submission form.
Expand All @@ -63,7 +63,7 @@ import { SubmissionUploadFilesComponent } from './submission-upload-files/submis
ThemedLoadingComponent,
SubmissionSectionContainerComponent,
SubmissionFormFooterComponent,
SubmissionUploadFilesComponent,
ThemedSubmissionUploadFilesComponent,
SubmissionFormCollectionComponent,
SubmissionFormSectionAddComponent,
],
Expand All @@ -81,7 +81,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {

/**
* Checks if the collection can be modifiable by the user
* @type {booelan}
* @type {boolean}
*/
@Input() collectionModifiable: boolean | null = null;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {
Component,
Input,
} from '@angular/core';

import { ThemedComponent } from '../../../shared/theme-support/themed.component';
import { UploaderOptions } from '../../../shared/upload/uploader/uploader-options.model';
import { SubmissionUploadFilesComponent } from './submission-upload-files.component';

/**
* Themed wrapper for {@link SubmissionUploadFilesComponent}
*/
@Component({
selector: 'ds-themed-submission-upload-files',
templateUrl: '../../../shared/theme-support/themed.component.html',
standalone: true,
})
export class ThemedSubmissionUploadFilesComponent extends ThemedComponent<SubmissionUploadFilesComponent> {

@Input() collectionId: string;

@Input() submissionId: string;

@Input() uploadFilesOptions: UploaderOptions;

protected inAndOutputNames: (keyof SubmissionUploadFilesComponent & keyof this)[] = [
'collectionId',
'submissionId',
'uploadFilesOptions',
];

protected getComponentName(): string {
return 'SubmissionUploadFilesComponent';
}

protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../../themes/${themeName}/app/submission/form/submission-upload-files/submission-upload-files.component.ts`);
}

protected importUnthemedComponent(): Promise<any> {
return import('./submission-upload-files.component');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NgIf } from '@angular/common';
import { Component } from '@angular/core';

import { UploaderComponent } from '../../../../../../app/shared/upload/uploader/uploader.component';
import { SubmissionUploadFilesComponent as BaseComponent } from '../../../../../../app/submission/form/submission-upload-files/submission-upload-files.component';

@Component({
selector: 'ds-submission-upload-files',
// templateUrl: './submission-upload-files.component.html',
templateUrl: '../../../../../../app/submission/form/submission-upload-files/submission-upload-files.component.html',
imports: [
UploaderComponent,
NgIf,
],
standalone: true,
})
export class SubmissionUploadFilesComponent extends BaseComponent {
}
2 changes: 2 additions & 0 deletions src/themes/custom/lazy-theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import { CommunityStatisticsPageComponent } from './app/statistics-page/communit
import { ItemStatisticsPageComponent } from './app/statistics-page/item-statistics-page/item-statistics-page.component';
import { SiteStatisticsPageComponent } from './app/statistics-page/site-statistics-page/site-statistics-page.component';
import { SubmissionEditComponent } from './app/submission/edit/submission-edit.component';
import { SubmissionUploadFilesComponent } from './app/submission/form/submission-upload-files/submission-upload-files.component';
import { SubmissionImportExternalComponent } from './app/submission/import-external/submission-import-external.component';
import { SubmissionSectionUploadFileComponent } from './app/submission/sections/upload/file/section-upload-file.component';
import { SubmissionSubmitComponent } from './app/submission/submit/submission-submit.component';
Expand Down Expand Up @@ -190,6 +191,7 @@ const DECLARATIONS = [
MetadataImportPageComponent,
ItemDetailPreviewFieldComponent,
ProfilePageMetadataFormComponent,
SubmissionUploadFilesComponent,
];

@NgModule({
Expand Down

0 comments on commit a73b2ad

Please sign in to comment.