mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5472] Missing placeholder for inplace input (#7541)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<div
|
||||
class="adf-inplace-input-container"
|
||||
[ngClass]="{'adf-inplace-input-container-error': control.invalid}"
|
||||
[ngClass]="{'adf-inplace-input-container-error': control.invalid && control.touched}"
|
||||
>
|
||||
<mat-form-field class="adf-inplace-input-mat-form-field">
|
||||
<input
|
||||
@@ -10,8 +10,12 @@
|
||||
data-automation-id="adf-inplace-input"
|
||||
>
|
||||
|
||||
<mat-label data-automation-id="adf-inplace-input-label">
|
||||
<ng-content select="[label]"></ng-content>
|
||||
</mat-label>
|
||||
|
||||
<mat-error data-automation-id="adf-inplace-input-error">
|
||||
<ng-content></ng-content>
|
||||
<ng-content select="[error]"></ng-content>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
@@ -1,3 +1,5 @@
|
||||
$adf-inplace-input-padding: 7px;
|
||||
|
||||
.adf-inplace-input-container {
|
||||
.mat-form-field-underline {
|
||||
display: none;
|
||||
@@ -8,8 +10,12 @@
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.mat-form-field-label {
|
||||
padding: $adf-inplace-input-padding;
|
||||
}
|
||||
|
||||
&-error {
|
||||
input {
|
||||
.adf-inplace-input {
|
||||
border: 1px solid var(--theme-warn-color) !important;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +25,7 @@
|
||||
}
|
||||
|
||||
.adf-inplace-input {
|
||||
padding: 7px;
|
||||
padding: $adf-inplace-input-padding;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
|
||||
|
@@ -69,4 +69,16 @@ describe('InplaceFormInputComponent', () => {
|
||||
|
||||
expect(error).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should show label', () => {
|
||||
formControl.setValue('');
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
const error = fixture.nativeElement.querySelector(
|
||||
'[data-automation-id="adf-inplace-input-label"]'
|
||||
);
|
||||
|
||||
expect(error).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@@ -42,15 +42,21 @@
|
||||
</mat-form-field>
|
||||
|
||||
<adf-inplace-form-input [control]="processInstanceName">
|
||||
<span *ngIf="processInstanceName.hasError('required')">
|
||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.PROCESS_NAME_REQUIRED' | translate }}
|
||||
</span>
|
||||
<span id="adf-start-process-maxlength-error" *ngIf="processInstanceName.hasError('maxlength')">
|
||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.MAXIMUM_LENGTH' | translate : { characters : maxNameLength } }}
|
||||
</span>
|
||||
<span *ngIf="processInstanceName.hasError('pattern')">
|
||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.SPACE_VALIDATOR' | translate }}
|
||||
</span>
|
||||
<ng-container label>
|
||||
{{'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.FORM.LABEL.NAME' | translate}}
|
||||
</ng-container>
|
||||
|
||||
<ng-container error>
|
||||
<span *ngIf="processInstanceName.hasError('required')">
|
||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.PROCESS_NAME_REQUIRED' | translate }}
|
||||
</span>
|
||||
<span id="adf-start-process-maxlength-error" *ngIf="processInstanceName.hasError('maxlength')">
|
||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.MAXIMUM_LENGTH' | translate : { characters : maxNameLength } }}
|
||||
</span>
|
||||
<span *ngIf="processInstanceName.hasError('pattern')">
|
||||
{{ 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.SPACE_VALIDATOR' | translate }}
|
||||
</span>
|
||||
</ng-container>
|
||||
</adf-inplace-form-input>
|
||||
</form>
|
||||
|
||||
|
Reference in New Issue
Block a user