Enhancement: Explain behavior of unset app config boolean to user (#5345)

This commit is contained in:
shamoon 2024-01-10 15:34:20 -08:00 committed by GitHub
parent 8e8810cbaa
commit 3dcb973adb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 6 deletions

View file

@ -2,7 +2,14 @@
<div class="row">
@if (!horizontal) {
<div class="d-flex align-items-center position-relative hidden-button-container col-md-3">
<label class="form-label" [for]="inputId">{{title}}</label>
<label class="form-label" [for]="inputId" [ngbTooltip]="showUnsetNote && isUnset ? tipContent: null" placement="end">
{{title}}
@if (showUnsetNote && isUnset) {
<svg class="sidebaricon-sm ms-1" fill="currentColor">
<use xlink:href="assets/bootstrap-icons.svg#exclamation-triangle"/>
</svg>
}
</label>
@if (removable) {
<button type="button" class="btn btn-sm btn-danger position-absolute left-0" (click)="removed.emit(this)">
<svg class="sidebaricon" fill="currentColor">
@ -16,7 +23,14 @@
<div class="form-check form-switch">
<input #inputField type="checkbox" class="form-check-input" [id]="inputId" [(ngModel)]="value" (change)="onChange(value)" (blur)="onTouched()" [disabled]="disabled">
@if (horizontal) {
<label class="form-check-label" [for]="inputId">{{title}}</label>
<label class="form-check-label" [class.text-muted]="showUnsetNote && isUnset" [for]="inputId" [ngbTooltip]="showUnsetNote && isUnset ? tipContent: null" placement="end">
{{title}}
@if (showUnsetNote && isUnset) {
<svg class="sidebaricon-sm ms-1" fill="currentColor">
<use xlink:href="assets/bootstrap-icons.svg#exclamation-triangle"/>
</svg>
}
</label>
}
@if (hint) {
<div class="form-text text-muted">{{hint}}</div>
@ -25,3 +39,8 @@
</div>
</div>
</div>
<ng-template #tipContent>
<span class="text-light fst-italic" i18n>Note: value has not yet been set and will not apply until explicitly changed</span>
</ng-template>