Remove required=false and disabled=false attributes

This commit is contained in:
Kasper Seweryn 2022-05-01 17:36:36 +02:00 committed by Georg Krause
parent 39b4e9a5b9
commit d6a46f5aab
27 changed files with 53 additions and 53 deletions

View File

@ -7,7 +7,7 @@
>
<a
href
:disabled="current - 1 < 1"
:disabled="current - 1 < 1 || null"
role="button"
:aria-label="labels.previousPage"
:class="[{'disabled': current - 1 < 1}, 'item']"
@ -27,7 +27,7 @@
</template>
<a
href
:disabled="current + 1 > maxPage"
:disabled="current + 1 > maxPage || null"
role="button"
:aria-label="labels.nextPage"
:class="[{'disabled': current + 1 > maxPage}, 'item']"

View File

@ -157,7 +157,7 @@
:title="labels.previousTrack"
:aria-label="labels.previousTrack"
class="control"
:disabled="emptyQueue ? true : null"
:disabled="emptyQueue || null"
@click.prevent.stop="$store.dispatch('queue/previous')"
>
<i :class="['ui', 'backward step', {'disabled': emptyQueue}, 'icon']" />
@ -188,7 +188,7 @@
:title="labels.next"
:aria-label="labels.next"
class="control"
:disabled="hasNext ? true : null"
:disabled="hasNext || null"
@click.prevent.stop="$store.dispatch('queue/next')"
>
<i :class="['ui', {'disabled': !hasNext}, 'forward step', 'icon']" />

View File

@ -75,7 +75,7 @@
v-if="showSubmit"
type="submit"
:class="['ui', 'primary', {loading: isLoading}, 'button']"
:disabled="isLoading || !id || id.length === 0"
:disabled="isLoading || !id || id.length === 0 || null"
>
<translate translate-context="Content/Search/Input.Label/Noun">
Search

View File

@ -121,14 +121,14 @@
</td>
<td>
<i
:disabled="idx === 0"
:disabled="idx === 0 || null"
role="button"
:title="labels.up"
:class="['up', 'arrow', {disabled: idx === 0}, 'icon']"
@click="move(idx, -1)"
/>
<i
:disabled="idx >= local.fields.length - 1"
:disabled="idx >= local.fields.length - 1 || null"
role="button"
:title="labels.down"
:class="['down', 'arrow', {disabled: idx >= local.fields.length - 1}, 'icon']"

View File

@ -78,8 +78,8 @@
<input
v-model="newValues.username"
type="text"
:required="creating"
:disabled="!creating"
:required="creating || null"
:disabled="!creating || null"
:placeholder="labels.usernamePlaceholder"
>
</div>
@ -183,7 +183,7 @@
id="itunes-category"
v-model="newValues.metadata.itunes_subcategory"
name="itunes-category"
:disabled="!newValues.metadata.itunes_category"
:disabled="!newValues.metadata.itunes_category || null"
class="ui dropdown"
>
<option

View File

@ -5,7 +5,7 @@
>
<button
v-if="!dropdownOnly"
:disabled="!playable"
:disabled="!playable || null"
:aria-label="labels.replacePlay"
:class="buttonClasses.concat(['ui', {loading: isLoading}, {'mini': discrete}, {disabled: !playable}])"
@click.stop.prevent="replacePlay"
@ -37,7 +37,7 @@
ref="add"
class="item basic"
data-ref="add"
:disabled="!playable"
:disabled="!playable || null"
:title="labels.addToQueue"
@click.stop.prevent="add"
>
@ -47,7 +47,7 @@
ref="addNext"
class="item basic"
data-ref="addNext"
:disabled="!playable"
:disabled="!playable || null"
:title="labels.playNext"
@click.stop.prevent="addNext()"
>
@ -57,7 +57,7 @@
ref="playNow"
class="item basic"
data-ref="playNow"
:disabled="!playable"
:disabled="!playable || null"
:title="labels.playNow"
@click.stop.prevent="addNext(true)"
>
@ -66,7 +66,7 @@
<button
v-if="track"
class="item basic"
:disabled="!playable"
:disabled="!playable || null"
:title="labels.startRadio"
@click.stop.prevent="$store.dispatch('radios/start', {type: 'similar', objectId: track.id})"
>
@ -75,7 +75,7 @@
<button
v-if="track"
class="item basic"
:disabled="!playable"
:disabled="!playable || null"
@click.stop="$store.commit('playlists/chooseTrack', track)"
>
<i class="list icon" />
@ -102,7 +102,7 @@
ref="filterArtist"
data-ref="filterArtist"
class="item basic"
:disabled="!filterableArtist"
:disabled="!filterableArtist || null"
:title="labels.hideArtist"
@click.stop.prevent="filterArtist"
>

View File

@ -146,7 +146,7 @@
:title="labels.previous"
:aria-label="labels.previous"
class="circular button control tablet-and-up"
:disabled="!hasPrevious"
:disabled="!hasPrevious || null"
@click.prevent.stop="$store.dispatch('queue/previous')"
>
<i :class="['ui', 'large', {'disabled': !hasPrevious}, 'backward step', 'icon']" />
@ -173,7 +173,7 @@
:title="labels.next"
:aria-label="labels.next"
class="circular button control"
:disabled="!hasNext"
:disabled="!hasNext || null"
@click.prevent.stop="$store.dispatch('queue/next')"
>
<i :class="['ui', 'large', {'disabled': !hasNext}, 'forward step', 'icon']" />
@ -199,7 +199,7 @@
class="circular control button"
:title="labels.loopingDisabled"
:aria-label="labels.loopingDisabled"
:disabled="!currentTrack"
:disabled="!currentTrack || null"
@click.prevent.stop="$store.commit('player/looping', 1)"
>
<i :class="['ui', {'disabled': !currentTrack}, 'step', 'repeat', 'icon']" />
@ -209,7 +209,7 @@
class="looping circular control button"
:title="labels.loopingSingle"
:aria-label="labels.loopingSingle"
:disabled="!currentTrack"
:disabled="!currentTrack || null"
@click.prevent.stop="$store.commit('player/looping', 2)"
>
<i
@ -223,7 +223,7 @@
class="looping circular control button"
:title="labels.loopingWhole"
:aria-label="labels.loopingWhole"
:disabled="!currentTrack"
:disabled="!currentTrack || null"
@click.prevent.stop="$store.commit('player/looping', 0)"
>
<i
@ -234,7 +234,7 @@
</button>
<button
class="circular control button"
:disabled="queueIsEmpty"
:disabled="queueIsEmpty || null"
:title="labels.shuffle"
:aria-label="labels.shuffle"
@click.prevent.stop="shuffle()"

View File

@ -127,7 +127,7 @@
v-if="field.input_type === 'long_text'"
:id="`custom-field-${idx}`"
:value="customFields[field.label]"
:required="field.required"
:required="field.required || null"
rows="5"
@input="$set(customFields, field.label, $event.target.value)"
/>
@ -136,7 +136,7 @@
:id="`custom-field-${idx}`"
type="text"
:value="customFields[field.label]"
:required="field.required"
:required="field.required || null"
@input="$set(customFields, field.label, $event.target.value)"
>
</div>

View File

@ -36,7 +36,7 @@
</button>
<button
:class="['ui', 'primary', {loading: isLoading}, 'button']"
:disabled="!submittable"
:disabled="!submittable || null"
@click.stop.prevent="$refs.albumForm.submit()"
>
<translate translate-context="*/*/Button.Label">

View File

@ -100,7 +100,7 @@
<button
:class="['ui', 'primary button', {loading: isLoading}]"
type="submit"
:disabled="!statusData || !statusData.canSubmit"
:disabled="!statusData || !statusData.canSubmit || null"
@click.prevent.stop="$refs.uploadForm.publish"
>
<translate translate-context="*/Channels/Button.Label">
@ -111,7 +111,7 @@
ref="dropdown"
v-dropdown
class="ui floating dropdown icon button"
:disabled="!statusData || !statusData.canSubmit"
:disabled="!statusData || !statusData.canSubmit || null"
>
<i class="dropdown icon" />
<div class="menu">

View File

@ -89,7 +89,7 @@
</dangerous-button>
<button
v-else
:disabled="checked.length === 0"
:disabled="checked.length === 0 || null"
:aria-label="labels.performAction"
:class="['ui', {disabled: checked.length === 0}, {'loading': actionLoading}, 'button']"
@click="launchAction"
@ -199,7 +199,7 @@
<input
type="checkbox"
:aria-label="labels.selectAllItems"
:disabled="checkable.length === 0"
:disabled="checkable.length === 0 || null"
:checked="checkable.length > 0 && checked.length === checkable.length"
@change="toggleCheckAll"
>
@ -220,7 +220,7 @@
<input
type="checkbox"
:aria-label="labels.selectItem"
:disabled="checkable.indexOf(getId(obj)) === -1"
:disabled="checkable.indexOf(getId(obj)) === -1 || null"
:checked="checked.indexOf(getId(obj)) > -1"
@click="toggleCheck($event, getId(obj), index)"
>

View File

@ -49,7 +49,7 @@
v-model="newValue"
:name="fieldId"
:rows="rows"
:required="required"
:required="required || null"
:placeholder="placeholder || labels.placeholder"
/>
</div>

View File

@ -1,7 +1,7 @@
<template>
<button
:class="[{disabled: disabled}]"
:disabled="disabled"
:disabled="disabled || null"
@click.prevent.stop="showModal = true"
>
<slot />

View File

@ -72,7 +72,7 @@
<button
:class="['ui', {'loading': isLoading}, 'right', 'floated', 'button']"
type="submit"
:disabled="isLoading"
:disabled="isLoading || null"
>
<translate translate-context="Content/Channels/Button.Label/Verb">
Update description

View File

@ -107,7 +107,7 @@
:id="fieldConfig.id"
v-model="values[fieldConfig.id]"
:type="fieldConfig.inputType || 'text'"
:required="fieldConfig.required"
:required="fieldConfig.required || null"
:name="fieldConfig.id"
>
</template>
@ -118,7 +118,7 @@
:id="fieldConfig.id"
ref="license"
v-model="values[fieldConfig.id]"
:required="fieldConfig.required"
:required="fieldConfig.required || null"
class="ui fluid search dropdown"
>
<option :value="null">
@ -158,7 +158,7 @@
:id="fieldConfig.id"
v-model="values[fieldConfig.id]"
:initial-value="initialValues[fieldConfig.id]"
:required="fieldConfig.required"
:required="fieldConfig.required || null"
:name="fieldConfig.id"
@delete="values[fieldConfig.id] = initialValues[fieldConfig.id]"
>
@ -220,7 +220,7 @@
<button
:class="['ui', {'loading': isLoading}, 'right', 'floated', 'success', 'button']"
type="submit"
:disabled="isLoading || !mutationPayload"
:disabled="isLoading || !mutationPayload || null"
>
<translate
v-if="canEdit"

View File

@ -9,7 +9,7 @@
/>
<button
v-if="nextPage || previousPage"
:disabled="!previousPage"
:disabled="!previousPage || null"
:class="['ui', {disabled: !previousPage}, 'circular', 'icon', 'basic', 'button']"
@click="fetchData(previousPage)"
>
@ -17,7 +17,7 @@
</button>
<button
v-if="nextPage || previousPage"
:disabled="!nextPage"
:disabled="!nextPage || null"
:class="['ui', {disabled: !nextPage}, 'circular', 'icon', 'basic', 'button']"
@click="fetchData(nextPage)"
>

View File

@ -64,7 +64,7 @@
</div>
<div class="ui hidden divider" />
<button
:disabled="!canSave"
:disabled="!canSave || null"
:class="['ui', 'success', {loading: isLoading}, 'button']"
@click="save"
>
@ -105,7 +105,7 @@
</select>
<button
id="addFilter"
:disabled="!currentFilterType"
:disabled="!currentFilterType || null"
class="ui button"
@click="add"
>

View File

@ -90,7 +90,7 @@
>
<div class="ui loader" />
</div>
<div v-else-if="result && result.count > 0">
<div v-else-if="result?.count > 0">
<edit-card
v-for="obj in result.results"
:key="obj.uuid"

View File

@ -123,7 +123,7 @@
</button>
<button
:class="['ui', 'right', 'floated', 'success', {'disabled loading': isLoading}, 'button']"
:disabled="isLoading"
:disabled="isLoading || null"
>
<translate
v-if="object"

View File

@ -34,7 +34,7 @@
<button
:class="['ui', {'loading': isLoading}, 'right', 'floated', 'button']"
type="submit"
:disabled="isLoading"
:disabled="isLoading || null"
>
<translate translate-context="Content/Moderation/Button.Label/Verb">
Add note

View File

@ -37,7 +37,7 @@
<div class="ui field">
<button
:class="['ui', {loading: isLoading}, 'button']"
:disabled="isLoading"
:disabled="isLoading || null"
type="submit"
>
<translate translate-context="Content/Admin/Button.Label/Verb">

View File

@ -4,7 +4,7 @@
<select
class="ui dropdown"
:value="value"
:required="required"
:required="required || null"
@change="$emit('input', $event.target.value)"
>
<option

View File

@ -74,7 +74,7 @@
</div>
<div class="ui bottom attached segment">
<button
:disabled="queueTracks.length === 0"
:disabled="queueTracks.length === 0 || null"
:class="['ui', {disabled: queueTracks.length === 0}, 'labeled', 'icon', 'button']"
:title="labels.copyTitle"
@click="insertMany(queueTracks, false)"
@ -91,7 +91,7 @@
</button>
<dangerous-button
:disabled="plts.length === 0"
:disabled="plts.length === 0 || null"
class="ui labeled right floated danger icon button"
:action="clearPlaylist"
>

View File

@ -55,7 +55,7 @@
<button
:class="['ui', {'loading': isCreating}, 'success', 'button']"
type="submit"
:disabled="isCreating"
:disabled="isCreating || null"
>
<translate translate-context="Content/Moderation/Button/Verb">
Add

View File

@ -125,7 +125,7 @@
v-if="step === 2"
:class="['ui', 'primary button', {loading: isLoading}]"
type="submit"
:disabled="!submittable && !isLoading"
:disabled="!submittable && !isLoading || null"
@click.prevent.stop="$refs.createForm.submit"
>
<translate translate-context="*/Channels/Button.Label">

View File

@ -378,7 +378,7 @@
</button>
<button
:class="['ui', 'primary', 'confirm', {loading: edit.isLoading}, 'button']"
:disabled="!edit.submittable"
:disabled="!edit.submittable || null"
@click.stop="$refs.editForm.submit"
>
<translate translate-context="*/Channels/Button.Label">

View File

@ -118,7 +118,7 @@
<div class="header-buttons">
<div class="ui small buttons">
<radio-button
:disabled="!isPlayable"
:disabled="!isPlayable || null"
type="library"
:object-id="object.uuid"
/>