AAE-35882 Studio modelling forms required dropdown has double asterisk (#10948)

* AAE-35882 fixing the double asterix issue on require fields on preview and form-editors and workspace

* AAE-35882 altering one unit as the asterisks are now handled by mat-form-fields
This commit is contained in:
Soumyajit Chakraborty
2025-06-16 20:13:38 +05:30
committed by GitHub
parent eda59a1de8
commit 22b62804d5
3 changed files with 12 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
<div>
<mat-form-field>
<mat-label *ngIf="!field.leftLabels" class="adf-label" [attr.for]="field.id">
{{ field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span>
{{ field.name | translate }}
</mat-label>
<mat-select
class="adf-select"
@@ -22,6 +22,7 @@
[title]="field.tooltip"
panelClass="adf-select-filter"
[multiple]="field.hasMultipleValues"
[required]="isRequired()"
>
<adf-select-filter-input *ngIf="showInputFilter" (change)="filter$.next($event)" />

View File

@@ -336,7 +336,13 @@ describe('DropdownCloudWidgetComponent', () => {
});
});
it('should be able to display label with asterisk', () => {
it('should be able to display label with asterisk when left-label is present', () => {
widget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id', readOnly: false, leftLabels: true }), {
id: 'dropdown-id',
name: 'option list',
type: FormFieldTypes.DROPDOWN,
options: filterOptionList
});
fixture.detectChanges();
const asterisk: HTMLElement = element.querySelector('.adf-asterisk');
@@ -402,6 +408,7 @@ describe('DropdownCloudWidgetComponent', () => {
describe('and NOT visible', () => {
beforeEach(() => {
widget.field.isVisible = false;
widget.field.required = false;
});
it('should be valid with no option selected', () => {