Skip to content

Commit 0d281d5

Browse files
Mattia VianelliMattia Vianelli
authored andcommitted
DSC-2715 Provided config that can be used to hide the submission legend
(cherry picked from commit 7832f2391d439862a9177524e557a9755fc01b97)
1 parent ebb6262 commit 0d281d5

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/app/submission/form/submission-form.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[uploadFilesOptions]="uploadFilesOptions"></ds-submission-upload-files>
99
<div class="clearfix"></div>
1010
</div>
11-
<ds-submission-legend *ngIf="showSubmissionLegend" class="submission-form-header-legend">
11+
<ds-submission-legend *ngIf="shouldShowLegend" class="submission-form-header-legend">
1212
</ds-submission-legend>
1313
<div class="submission-form-header-item mb-3 mb-sm-0 flex-sm-grow-1 flex-md-grow-0">
1414
@if (!isSectionHidden) {

src/app/submission/form/submission-form.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { SubmissionFormCollectionComponent } from './collection/submission-form-
5555
import { ThemedSubmissionFormFooterComponent } from './footer/themed-submission-form-footer.component';
5656
import { SubmissionFormSectionAddComponent } from './section-add/submission-form-section-add.component';
5757
import { ThemedSubmissionUploadFilesComponent } from './submission-upload-files/themed-submission-upload-files.component';
58+
import { environment } from '../../../environments/environment';
5859

5960
/**
6061
* This component represents the submission form.
@@ -335,6 +336,16 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
335336
});
336337
}
337338

339+
/**
340+
* Check if submission legend should be shown
341+
*/
342+
get shouldShowLegend(): boolean {
343+
return !environment.submission.hideLegend;
344+
}
345+
346+
/**
347+
* Check if submission form is loading
348+
*/
338349
protected getSectionsList(): Observable<any> {
339350
return this.submissionService.getSubmissionSections(this.submissionId).pipe(
340351
filter((sections: SectionDataObject[]) => isNotEmpty(sections)),

src/config/default-app-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export class DefaultAppConfig implements AppConfig {
325325
},
326326
// Minimum number of characters required before performing a lookup.
327327
minChars: 3,
328+
hideLegend: false
328329
};
329330

330331
// Fallback language in which the UI will be rendered if the user's browser language is not an active language

src/config/submission-config.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ export interface SubmissionConfig extends Config {
5656
detectDuplicate: DetectDuplicateConfig;
5757
dropdownHintEnabled?: SubmissionDropdownHintEnabled;
5858
minChars?: number;
59+
hideLegend?: boolean;
5960
}

0 commit comments

Comments
 (0)