Skip to content

Commit fbbdf27

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

7 files changed

Lines changed: 57 additions & 1 deletion

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[uploadFilesOptions]="uploadFilesOptions"></ds-submission-upload-files>
77
<div class="clearfix"></div>
88
</div>
9-
9+
<ds-submission-legend *ngIf="showSubmissionLegend" class="submission-form-header-legend">
10+
</ds-submission-legend>
1011
<div class="submission-form-header-item mb-3 mb-sm-0 flex-sm-grow-1 flex-md-grow-0">
1112
<ng-container *ngIf="!isSectionHidden">
1213
<ds-submission-form-collection [currentCollectionId]="collectionId"

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
@@ -7125,6 +7125,8 @@
71257125

71267126
"submission.sections.general.sections_not_valid": "There are incomplete sections.",
71277127

7128+
"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>",
7129+
71287130
"submission.sections.identifiers.info": "The following identifiers will be created for your item:",
71297131

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

0 commit comments

Comments
 (0)