Skip to content

Commit

Permalink
NAS-123699: Cobia BETA.1: Sudo Commands fields on Edit User are not s…
Browse files Browse the repository at this point in the history
…aving (#8679)
  • Loading branch information
AlexKarpov98 authored Aug 29, 2023
1 parent bebdedd commit 4966d1c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
[matAutocomplete]="auto"
[matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(blur)="onInputBlur()"
(matChipInputTokenEnd)="onAdd($event.value)"
/>
</mat-chip-grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ describe('IxChipsComponent', () => {
expect(formControl.value).toEqual(['operator', 'root']);
});

it('does not create chip after leaving the focus of the input', async () => {
it('does not create chip after leaving the focus of the input if there is provider with autocomplete', async () => {
spectator.setInput('autocompleteProvider', jest.fn(() => of(['sys', 'staff'])));
const input = await matChipList.getInput();
await input.setValue('www-date');
await input.blur();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ export class IxChipsComponent implements OnChanges, ControlValueAccessor {
this.updateValues([...this.values, newValue]);
}

onInputBlur(): void {
if (this.autocompleteProvider) {
this.chipInput.nativeElement.value = null;
return;
}
this.onAdd(this.chipInput.nativeElement.value);
}

private setAutocomplete(): void {
if (!this.autocompleteProvider) {
this.suggestions$ = null;
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/other/_tn-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ $primary-dark: darken(map-get($md-primary, 500), 8%);
}

.mat-mdc-select-panel .mat-mdc-option:hover,
.mat-mdc-option-active,
.mat-mdc-menu-content button.mat-mdc-menu-item:hover,
.mat-mdc-menu-content button.mat-mdc-menu-item:hover .mat-icon:not(.theme-picker-swatch-icon),
.mat-mdc-menu-content button.mat-mdc-menu-item:focus,
Expand Down

0 comments on commit 4966d1c

Please sign in to comment.