Skip to content

Commit

Permalink
disable multiple switch if only one resource is affected
Browse files Browse the repository at this point in the history
  • Loading branch information
lsteinmann committed Jul 9, 2024
1 parent 3152a20 commit 60597e8
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.convertFieldData.header">Felddate
konvertiert werden, so dass sie dem Eingabetyp <b>{{inputTypeLabel}}</b> entsprechen.
</span>

<div id="multiple-switch" class="row">
<div id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.convertFieldData.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.convertFieldData.all">In allen Ressourcen dieser Kategorie konvertieren</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="convertAll" (change)="convertAll = !convertAll">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="convertAll"
(change)="convertAll = !convertAll"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.deleteFieldData.header">Felddaten
Daten wirklich löschen?
</span>

<div id="multiple-switch" class="row">
<div id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.deleteFieldData.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.deleteFieldData.all">Bei allen Ressourcen dieser Kategorie löschen</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="deleteAll" (change)="deleteAll = !deleteAll">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="deleteAll"
(change)="deleteAll = !deleteAll"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.deleteOutliers.header">
Wert <b>{{outlierValue}}</b> wirklich löschen?
</div>

<div id="multiple-switch" class="row">
<div id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.deleteOutliers.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.deleteOutliers.all">Alle Vorkommnisse dieses Werts löschen</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="deleteAll" (change)="deleteAll = !deleteAll;">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="deleteAll"
(change)="deleteAll = !deleteAll"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.deleteResource.header">Ressource
Möchten Sie die Ressource <b>{{document.resource.identifier}}</b> wirklich löschen?
</span>

<div *ngIf="isMultipleSwitchAvailable()" id="multiple-switch" class="row">
<div *ngIf="isMultipleSwitchAvailable()"
id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.deleteResource.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.deleteResource.all">Alle Ressourcen dieser Kategorie löschen</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="deleteAll" (change)="deleteAll = !deleteAll">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="deleteAll"
(change)="deleteAll = !deleteAll"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
</div>

<div *ngIf="deleteAll" class="text-center alert alert-warning"
i18n="@@navbar.taskbar.deleteResource.all.info">
Bitte beachten Sie: Durch diese Aktion werden alle <b>{{countAffected}}</b> Ressourcen der unkonfigurierten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.fixOutliers.header">
[getLabel]="getValueLabel"
(onValueSelected)="selectedValue = $event"></searchable-select>

<div *ngIf="selectedValue" id="multiple-switch" class="row">
<div *ngIf="selectedValue"
id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.fixOutliers.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.fixOutliers.all">Alle Vorkommnisse dieses Werts ersetzen</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="replaceAll" (change)="replaceAll = !replaceAll;">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="replaceAll"
(change)="replaceAll = !replaceAll"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.selectNewCategory.header">Neue Ka
</category-picker>
</div>

<div *ngIf="selectedCategory && document.resource.category" id="multiple-switch" class="row">
<div *ngIf="selectedCategory && document.resource.category"
id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.selectNewCategory.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.selectNewCategory.all">Bei allen Ressourcen dieser Kategorie durchführen</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="multiple" (change)="multiple = !multiple">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="multiple"
(change)="multiple = !multiple"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@ <h5 class="modal-title" i18n="@@navbar.taskbar.selectNewField.header">Neues Feld
</option>
</select>

<div *ngIf="selectedFieldName" id="multiple-switch" class="row">
<div *ngIf="selectedFieldName"
id="multiple-switch"
class="row"
[disableTooltip]="countAffected !== 1"
[class.disabled]="countAffected == 1"
ngbTooltip="Nur diese Ressource ist betroffen."
i18n-ngbTooltip="@@navbar.taskbar.selectNewField.all.tooltip"
container="body">
<div class="col-auto mr-auto">
<span i18n="@@navbar.taskbar.selectNewField.all">Bei allen Ressourcen dieser Kategorie durchführen</span>
</div>
<div class="col-auto">
<label class="switch">
<input type="checkbox" [checked]="multiple" (change)="multiple = !multiple">
<label class="switch" [class.disabled]="countAffected == 1">
<input type="checkbox"
[checked]="multiple"
(change)="multiple = !multiple"
[disabled]="countAffected == 1">
<span class="slider round"></span>
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
user-select: none;
}

div.disabled {
color: grey;
}

.warnings-tool-info {
margin-bottom: 5px;
}
Expand Down

0 comments on commit 60597e8

Please sign in to comment.