Skip to content

Commit ebb6262

Browse files
Mattia VianelliMattia Vianelli
authored andcommitted
DSC-2715 Created new component for the submission legend
(cherry picked from commit f57ec9d46b7ba7675300be1ae68536e736ea8f52)
1 parent 08f84af commit ebb6262

7 files changed

Lines changed: 58 additions & 2 deletions

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
[uploadFilesOptions]="uploadFilesOptions"></ds-submission-upload-files>
99
<div class="clearfix"></div>
1010
</div>
11-
}
11+
<ds-submission-legend *ngIf="showSubmissionLegend" class="submission-form-header-legend">
12+
</ds-submission-legend>
1213
<div class="submission-form-header-item mb-3 mb-sm-0 flex-sm-grow-1 flex-md-grow-0">
1314
@if (!isSectionHidden) {
1415
<ds-submission-form-collection
1516
[currentCollectionId]="collectionId"
1617
[currentDefinition]="definitionId"
17-
[entityType]="entityType"
18+
[entityType]="entityType"
1819
[submissionId]="submissionId"
1920
[collectionModifiable]="collectionModifiable"
2021
[isReadonly]="isSectionReadonly"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
flex-grow: 1;
1010
}
1111

12+
.submission-form-header-legend {
13+
width: 100%;
14+
}
15+
1216
.submission-form-footer {
1317
border-radius: var(--bs-card-border-radius);
1418
bottom: 0;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p [innerHTML]="legendText | translate"></p>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:host {
2+
display: block;
3+
margin-bottom: 1rem;
4+
}
5+
6+
p {
7+
display: inline-block;
8+
margin: 0;
9+
padding: 0.75rem 1rem;
10+
border: 1px solid #dee2e6;
11+
border-radius: 0.25rem;
12+
background-color: #fff;
13+
font-size: 0.875rem;
14+
color: #212529;
15+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { SubmissionLegendComponent } from './submission-legend.component';
4+
5+
describe('SubmissionLegendComponent', () => {
6+
let component: SubmissionLegendComponent;
7+
let fixture: ComponentFixture<SubmissionLegendComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ SubmissionLegendComponent ]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(SubmissionLegendComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'ds-submission-legend',
5+
templateUrl: './submission-legend.component.html',
6+
styleUrls: ['./submission-legend.component.scss']
7+
})
8+
export class SubmissionLegendComponent {
9+
legendText = 'submission.sections.general.legend';
10+
}

src/assets/i18n/en.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7368,6 +7368,8 @@
73687368

73697369
"submission.sections.general.sections_not_valid": "There are incomplete sections.",
73707370

7371+
"submission.sections.general.legend": "<h3><b>Mandatory Fields</b></h3><p>Fields marked with an asterisk (*) must be completed before the submision can be finalized.</p>",
7372+
73717373
"submission.sections.identifiers.info": "The following identifiers will be created for your item:",
73727374

73737375
"submission.sections.identifiers.no_handle": "No handles have been minted for this item.",

0 commit comments

Comments
 (0)