Pull request #12: VM/TestsIds

Merge in SL/common-ui from VM/TestsIds to master

* commit 'dfa5be23247ae142b4ce516eb023f5f8b55331d2':
  Added multiple ids needed for tests
This commit is contained in:
Valentin-Gabriel Mihai 2022-03-28 22:04:03 +02:00
commit fe2ad1138a
7 changed files with 16 additions and 1 deletions

View File

@ -8,6 +8,7 @@
[class.grey-selected]="greySelected" [class.grey-selected]="greySelected"
[disabled]="disabled" [disabled]="disabled"
[type]="isSubmit ? 'submit' : 'button'" [type]="isSubmit ? 'submit' : 'button'"
[id]="id ? id : buttonId"
mat-icon-button mat-icon-button
> >
<mat-icon [svgIcon]="icon"></mat-icon> <mat-icon [svgIcon]="icon"></mat-icon>

View File

@ -12,6 +12,7 @@ import { IqserTooltipPosition, IqserTooltipPositions } from '../../utils';
export class CircleButtonComponent implements OnInit { export class CircleButtonComponent implements OnInit {
readonly circleButtonTypes = CircleButtonTypes; readonly circleButtonTypes = CircleButtonTypes;
@Input() id!: string;
@Input() icon!: string; @Input() icon!: string;
@Input() tooltip?: string; @Input() tooltip?: string;
@Input() tooltipClass?: string; @Input() tooltipClass?: string;
@ -49,4 +50,8 @@ export class CircleButtonComponent implements OnInit {
this.action.emit($event); this.action.emit($event);
} }
} }
get buttonId (): String {
return `${Math.random().toString(36).substring(2, 9)}-button`;
}
} }

View File

@ -7,6 +7,7 @@
[disabled]="disabled" [disabled]="disabled"
mat-button mat-button
type="button" type="button"
[id]="id ? id : buttonId"
> >
<mat-icon *ngIf="icon" [svgIcon]="icon"></mat-icon> <mat-icon *ngIf="icon" [svgIcon]="icon"></mat-icon>
<span>{{ label }}</span> <span>{{ label }}</span>

View File

@ -12,9 +12,14 @@ export class IconButtonComponent {
readonly iconButtonTypes = IconButtonTypes; readonly iconButtonTypes = IconButtonTypes;
@Input() @Required() label!: string; @Input() @Required() label!: string;
@Input() id!: string;
@Input() icon?: string; @Input() icon?: string;
@Input() showDot = false; @Input() showDot = false;
@Input() disabled = false; @Input() disabled = false;
@Input() type: IconButtonType = IconButtonTypes.default; @Input() type: IconButtonType = IconButtonTypes.default;
@Output() readonly action = new EventEmitter<MouseEvent>(); @Output() readonly action = new EventEmitter<MouseEvent>();
get buttonId (): String {
return `${Math.random().toString(36).substring(2, 9)}-button`;
}
} }

View File

@ -1,4 +1,5 @@
export interface BaseHeaderConfig { export interface BaseHeaderConfig {
readonly id?: string;
readonly label: string; readonly label: string;
readonly icon?: string; readonly icon?: string;
readonly hide?: boolean; readonly hide?: boolean;

View File

@ -53,6 +53,7 @@
[icon]="config.icon" [icon]="config.icon"
[iqserHelpMode]="config.helpModeKey" [iqserHelpMode]="config.helpModeKey"
[tooltip]="config.label" [tooltip]="config.label"
[id]="config.id"
tooltipPosition="below" tooltipPosition="below"
></iqser-circle-button> ></iqser-circle-button>
</ng-container> </ng-container>

View File

@ -16,7 +16,7 @@
<div *ngIf="config.requireInput" class="iqser-input-group required w-300 mt-24"> <div *ngIf="config.requireInput" class="iqser-input-group required w-300 mt-24">
<label>{{ inputLabel }}</label> <label>{{ inputLabel }}</label>
<input [(ngModel)]="inputValue" /> <input [(ngModel)]="inputValue" id="requiredConfirmInput"/>
</div> </div>
<div *ngIf="config.checkboxes.length > 0" class="mt-24 checkboxes-wrapper"> <div *ngIf="config.checkboxes.length > 0" class="mt-24 checkboxes-wrapper">
@ -35,6 +35,7 @@
[disabled]="(config.requireInput && confirmationDoesNotMatch()) || config.disableConfirm" [disabled]="(config.requireInput && confirmationDoesNotMatch()) || config.disableConfirm"
color="primary" color="primary"
mat-flat-button mat-flat-button
id="confirm"
> >
{{ config.confirmationText }} {{ config.confirmationText }}
</button> </button>