Added multiple ids needed for tests

This commit is contained in:
Valentin Mihai 2022-03-25 11:18:11 +02:00
parent 9f2cdbe490
commit f3c088af03
7 changed files with 16 additions and 1 deletions

View File

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

View File

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

View File

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

View File

@ -12,9 +12,14 @@ export class IconButtonComponent {
readonly iconButtonTypes = IconButtonTypes;
@Input() @Required() label!: string;
@Input() id!: string;
@Input() icon?: string;
@Input() showDot = false;
@Input() disabled = false;
@Input() type: IconButtonType = IconButtonTypes.default;
@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 {
readonly id?: string;
readonly label: string;
readonly icon?: string;
readonly hide?: boolean;

View File

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

View File

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