[AAE-7765] Improved display mandatory form fields (#7531)

* [MNT-22765] Improved display mandatory form fields

* [MNT-22765] added unit tests

* [MNT-22765] fixed test with error icon on rest fail

* Trigger travis

* [MNT-22765] removed underscore from var name

* [AAE-7765] removed underscore from unit test

* [AAE-7765] fixed css lint

* [AAE-7765] fixed e2e error message css class

* [AAE-7765] fixed storybook e2e
This commit is contained in:
Tomasz Gnyp
2022-03-07 19:29:12 +01:00
committed by GitHub
parent e877cd822b
commit 3dc9f7cdfd
67 changed files with 915 additions and 219 deletions

View File

@@ -1,8 +1,7 @@
<div class="adf-attach-widget {{field.className}}"
[class.adf-invalid]="!field.isValid"
[class.adf-readonly]="field.readOnly">
<label class="adf-label" [attr.for]="field.id">{{field.name | translate}}
<span *ngIf="isRequired()">*</span>
<span class="adf-asterisk" *ngIf="isRequired()">*</span>
</label>
<div class="adf-attach-widget-container">
<div id="adf-attach-widget-simple-upload" *ngIf="isSimpleUploadButton() && isUploadButtonVisible()">
@@ -16,7 +15,8 @@
(change)="onAttachFileChanged($event)" />
</a>
</div>
<div class="adf-attach-widget__menu-upload" *ngIf="isUploadButtonVisible() && isMultipleSourceUpload()">
<div class="adf-attach-widget__menu-upload" (focusout)="markAsTouched()"
*ngIf="isUploadButtonVisible() && isMultipleSourceUpload()">
<button mat-raised-button color="primary" [matMenuTriggerFor]="menu" [id]="field.id">
{{ 'FORM.FIELD.UPLOAD' | translate }}
<mat-icon>attach_file</mat-icon>
@@ -99,4 +99,4 @@
</div>
<error-widget [error]="field.validationSummary"></error-widget>
<error-widget *ngIf="isInvalidFieldRequired()" required="{{ 'FORM.FIELD.REQUIRED' | translate }}"></error-widget>
<error-widget *ngIf="!field.isValid && isTouched() && !isSelected()" required="{{ 'FORM.FIELD.REQUIRED' | translate }}"></error-widget>

View File

@@ -227,6 +227,10 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
}
}
isSelected(): boolean {
return this.hasFile;
}
private isExternalHost(repository: AlfrescoEndpointRepresentation): boolean {
const currentECMHost = this.getDomainHost(this.appConfigService.get(AppConfigValues.ECMHOST));
const chosenRepositoryHost = this.getDomainHost(repository.repositoryUrl);

View File

@@ -49,7 +49,7 @@ adf-start-task {
line-height: 0;
}
.adf-error-text-container {
.adf-error-container {
margin-top: -10px;
}
}