MOBILE-4708 chore: Fix some strict boolean inputs

main
Pau Ferrer Ocaña 2024-11-25 10:36:43 +01:00
parent e48cd9a3f7
commit 48ddd21e00
7 changed files with 10 additions and 10 deletions

View File

@ -34,7 +34,7 @@
</p> </p>
</ion-label> </ion-label>
<core-button-with-spinner [loading]="device.updating" slot="end"> <core-button-with-spinner [loading]="device.updating" slot="end">
<ion-toggle [(ngModel)]="device.enable" (ngModelChange)="enableDevice(device, device.enable)" <ion-toggle [(ngModel)]="device.enable" (ngModelChange)="enableDevice(device, !!device.enable)"
[attr.aria-labelledby]="'device-'+ device.id " /> [attr.aria-labelledby]="'device-'+ device.id " />
</core-button-with-spinner> </core-button-with-spinner>
</ion-item> </ion-item>

View File

@ -311,7 +311,7 @@
<!-- Outcomes. --> <!-- Outcomes. -->
<ion-item class="ion-text-wrap" *ngFor="let outcome of gradeInfo!.outcomes"> <ion-item class="ion-text-wrap" *ngFor="let outcome of gradeInfo!.outcomes">
<ion-select *ngIf="canSaveGrades && outcome.itemNumber" [(ngModel)]="outcome.selectedId" <ion-select *ngIf="canSaveGrades && outcome.itemNumber" [(ngModel)]="outcome.selectedId"
interface="action-sheet" [disabled]="gradeInfo!.disabled" [cancelText]="'core.cancel' | translate" interface="action-sheet" [disabled]="!!gradeInfo!.disabled" [cancelText]="'core.cancel' | translate"
[interfaceOptions]="{header: outcome.name }"> [interfaceOptions]="{header: outcome.name }">
<p class="item-heading" slot="label">{{ outcome.name }}</p> <p class="item-heading" slot="label">{{ outcome.name }}</p>
<ion-select-option *ngFor="let grade of outcome.options" [value]="grade.value"> <ion-select-option *ngFor="let grade of outcome.options" [value]="grade.value">

View File

@ -5,7 +5,7 @@
<ion-modal [keepContentsMounted]="true"> <ion-modal [keepContentsMounted]="true">
<ng-template> <ng-template>
<ion-datetime id="datetime" [formControlName]="'f_'+field.id" [max]="maxDate" [min]="minDate" <ion-datetime id="datetime" [formControlName]="'f_'+field.id" [max]="maxDate" [min]="minDate"
[disabled]="searchMode && searchFields && !searchFields['f_'+field.id+'_z']" presentation="date" [disabled]="!!searchMode && !!searchFields && !searchFields['f_'+field.id+'_z']" presentation="date"
[showDefaultButtons]="true" /> [showDefaultButtons]="true" />
</ng-template> </ng-template>
</ion-modal> </ion-modal>

View File

@ -55,7 +55,7 @@
<!-- Subquestion --> <!-- Subquestion -->
<ng-container *ngIf="question.parent !== 0"> <ng-container *ngIf="question.parent !== 0">
<ion-radio-group [(ngModel)]="answers[question.name]" [required]="question.required" [name]="question.name"> <ion-radio-group [(ngModel)]="answers[question.name]" [required]="!!question.required" [name]="question.name">
<ion-row class="ion-align-items-center ion-padding-horizontal" [class.even]="isEven"> <ion-row class="ion-align-items-center ion-padding-horizontal" [class.even]="isEven">
<ion-col size="7"> <ion-col size="7">
@ -71,7 +71,7 @@
<ion-radio [value]="value + 1" [attr.aria-label]="question.num + '. '+question.text + ': ' + option" /> <ion-radio [value]="value + 1" [attr.aria-label]="question.num + '. '+question.text + ': ' + option" />
</ion-col> </ion-col>
<ion-col class="ion-hide-md-up" size="5"> <ion-col class="ion-hide-md-up" size="5">
<ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required" <ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="!!question.required"
[attr.aria-labelledby]="'addon-mod_survey-'+question.name" interface="action-sheet" [attr.aria-labelledby]="'addon-mod_survey-'+question.name" interface="action-sheet"
[name]="question.name" [cancelText]="'core.cancel' | translate" [name]="question.name" [cancelText]="'core.cancel' | translate"
[interfaceOptions]="{header: question.text}"> [interfaceOptions]="{header: question.text}">
@ -94,7 +94,7 @@
</span> </span>
</ion-col> </ion-col>
<ion-col size="5"> <ion-col size="5">
<ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required" <ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="!!question.required"
[attr.aria-labelledby]="'addon-mod_survey-'+question.name" interface="action-sheet" [name]="question.name" [attr.aria-labelledby]="'addon-mod_survey-'+question.name" interface="action-sheet" [name]="question.name"
[cancelText]="'core.cancel' | translate" [interfaceOptions]="{header: question.text}"> [cancelText]="'core.cancel' | translate" [interfaceOptions]="{header: question.text}">
<ion-select-option [value]="question.required ? '-1' : '0'" selected [disabled]="question.required"> <ion-select-option [value]="question.required ? '-1' : '0'" selected [disabled]="question.required">
@ -109,7 +109,7 @@
<ion-item *ngIf="question.type === 0" class="ion-text-wrap" [class.even]="isEven"> <ion-item *ngIf="question.type === 0" class="ion-text-wrap" [class.even]="isEven">
<ion-textarea labelPlacement="floating" [(ngModel)]="answers[question.name]" [name]="question.name" <ion-textarea labelPlacement="floating" [(ngModel)]="answers[question.name]" [name]="question.name"
[required]="question.required"> [required]="!!question.required">
<p slot="label" [core-mark-required]="question.required"> <p slot="label" [core-mark-required]="question.required">
<strong>{{question.num}}.</strong> {{ question.text }} <strong>{{question.num}}.</strong> {{ question.text }}
</p> </p>

View File

@ -1,5 +1,5 @@
<!-- Display a loading until the iframe page is loaded. --> <!-- Display a loading until the iframe page is loaded. -->
<core-loading [hideUntil]="!loading && (safeUrl || launchExternalLabel)" /> <core-loading [hideUntil]="!loading && (!!safeUrl || !!launchExternalLabel)" />
<!--The iframe needs to be outside of core-loading, otherwise the request is canceled while loading. --> <!--The iframe needs to be outside of core-loading, otherwise the request is canceled while loading. -->
<!-- Don't add the iframe until safeUrl is set, adding an iframe with null as src causes the iframe to load the whole app. --> <!-- Don't add the iframe until safeUrl is set, adding an iframe with null as src causes the iframe to load the whole app. -->

View File

@ -1,4 +1,4 @@
<core-loading [hideUntil]="iframeSrc" [fullscreen]="false"> <core-loading [hideUntil]="!!iframeSrc" [fullscreen]="false">
<core-iframe *ngIf="iframeSrc" [src]="iframeSrc" iframeHeight="auto" [allowFullscreen]="true" (loaded)="iframeLoaded()" <core-iframe *ngIf="iframeSrc" [src]="iframeSrc" iframeHeight="auto" [allowFullscreen]="true" (loaded)="iframeLoaded()"
[showFullscreenOnToolbar]="enableInAppFullscreen" [autoFullscreenOnRotate]="enableInAppFullscreen" /> [showFullscreenOnToolbar]="enableInAppFullscreen" [autoFullscreenOnRotate]="enableInAppFullscreen" />
<script *ngIf="resizeScript && iframeSrc" type="text/javascript" [src]="resizeScript"></script> <script *ngIf="resizeScript && iframeSrc" type="text/javascript" [src]="resizeScript"></script>

View File

@ -9,7 +9,7 @@
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content> <ion-content>
<core-loading [hideUntil]="url"> <core-loading [hideUntil]="!!url">
<core-iframe *ngIf="url" [src]="url" [allowAutoLogin]="autoLogin" /> <core-iframe *ngIf="url" [src]="url" [allowAutoLogin]="autoLogin" />
</core-loading> </core-loading>
</ion-content> </ion-content>