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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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