Skip to content

Commit 90981c8

Browse files
committed
[Port dspace-7_x] Clean up spacing in input forms
Manual port of #4136 by @gingyx to DSpace 7.x.
1 parent 7063c49 commit 90981c8

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div [class.form-group]="(model.type !== 'GROUP' && asBootstrapFormGroup) || getClass('element', 'container').includes('form-group')"
1+
<div [class.form-group]="hasLabel || model.type === 'DATE' || (model.type !== 'GROUP' && asBootstrapFormGroup) || getClass('element', 'container').includes('form-group')"
22
[class.d-none]="model.hidden"
33
[formGroup]="group"
44
[ngClass]="[getClass('element', 'container'), getClass('grid', 'container')]">
@@ -19,8 +19,7 @@
1919
<small *ngIf="hasHint && (formBuilderService.hasArrayGroupValue(model) || (!model.repeatable && (isRelationship === false || value?.value === null)) || (model.repeatable === true && context?.index === context?.context?.groups?.length - 1)) && (!showErrorMessages || errorMessages.length === 0)"
2020
class="text-muted ds-hint" [innerHTML]="model.hint | translate" [ngClass]="getClass('element', 'hint')"></small>
2121
<!-- In case of repeatable fields show empty space for all elements except the first -->
22-
<div *ngIf="context?.index !== null
23-
&& (!showErrorMessages || errorMessages.length === 0)" class="clearfix w-100 mb-2"></div>
22+
<div *ngIf="context?.parent?.groups?.length > 1 && (!showErrorMessages || errorMessages.length === 0)" class="clearfix w-100 mb-2"></div>
2423

2524
<div *ngIf="!model.hideErrorMessages && showErrorMessages" [id]="id + '_errors'"
2625
[ngClass]="[getClass('element', 'errors'), getClass('grid', 'errors')]">
@@ -78,7 +77,7 @@
7877
</ds-existing-relation-list-element>
7978
<small *ngIf="hasHint && (model.repeatable === false || context?.index === context?.context?.groups?.length - 1) && (!showErrorMessages || errorMessages.length === 0)"
8079
class="text-muted ds-hint" [innerHTML]="model.hint | translate" [ngClass]="getClass('element', 'hint')"></small>
81-
<div class="clearfix w-100 mb-2"></div>
80+
<div *ngIf="context?.parent?.groups?.length > 1 && (!showErrorMessages || errorMessages.length === 0)" class="clearfix w-100 mb-2"></div>
8281
</ng-container>
8382
<ng-content></ng-content>
8483
</div>

src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@
1414
-moz-appearance: none;
1515
appearance: none;
1616
}
17+
18+
.invalid-feedback {
19+
margin-top: 0;
20+
}
21+
22+
.col-form-label {
23+
padding-top: 0;
24+
padding-bottom: 0;
25+
margin-bottom: 0.5rem;
26+
}

src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="d-flex">
2-
<span class="mr-auto text-contents">
2+
<span class="mr-auto text-contents align-self-center">
33
<ng-container *ngIf="!(metadataRepresentation$ | async)">
44
<ds-themed-loading [showMessage]="false"></ds-themed-loading>
55
</ng-container>

src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44

55
legend {
66
font-size: initial;
7+
margin-bottom: 0;
78
}

0 commit comments

Comments
 (0)