Skip to content

Commit 8cf2068

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 fbbdf27 commit 8cf2068

4 files changed

Lines changed: 11 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
@@ -6,7 +6,7 @@
66
[uploadFilesOptions]="uploadFilesOptions"></ds-submission-upload-files>
77
<div class="clearfix"></div>
88
</div>
9-
<ds-submission-legend *ngIf="showSubmissionLegend" class="submission-form-header-legend">
9+
<ds-submission-legend *ngIf="shouldShowLegend" class="submission-form-header-legend">
1010
</ds-submission-legend>
1111
<div class="submission-form-header-item mb-3 mb-sm-0 flex-sm-grow-1 flex-md-grow-0">
1212
<ng-container *ngIf="!isSectionHidden">

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { SubmissionFormCollectionComponent } from './collection/submission-form-
5555
import { SubmissionFormFooterComponent } from './footer/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.
@@ -334,6 +335,13 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
334335
});
335336
}
336337

338+
/**
339+
* Check if submission legend should be shown
340+
*/
341+
get shouldShowLegend(): boolean {
342+
return !environment.submission.hideLegend;
343+
}
344+
337345
/**
338346
* Check if submission form is loading
339347
*/

src/config/default-app-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ export class DefaultAppConfig implements AppConfig {
323323
},
324324
// Minimum number of characters required before performing a lookup.
325325
minChars: 3,
326+
hideLegend: false
326327
};
327328

328329
// Default 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)