diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 380f359ef..5e6672935 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,7 +136,7 @@ eslint: - cd front - yarn install script: - - yarn lint + - yarn lint --max-warnings 0 cache: key: "$CI_PROJECT_ID__eslint_npm_cache" paths: diff --git a/front/src/components/audio/PlayButton.vue b/front/src/components/audio/PlayButton.vue index aba5a346d..33c54c2c5 100644 --- a/front/src/components/audio/PlayButton.vue +++ b/front/src/components/audio/PlayButton.vue @@ -133,20 +133,20 @@ export default { mixins: [ReportMixin, PlayOptionsMixin], props: { // we can either have a single or multiple tracks to play when clicked - tracks: { type: Array, required: false, default: () => { return [] } }, - track: { type: Object, required: false, default: () => { return {} } }, - account: { type: Object, required: false, default: () => { return {} } }, + tracks: { type: Array, required: false, default: () => { return null } }, + track: { type: Object, required: false, default: () => { return null } }, + account: { type: Object, required: false, default: () => { return null } }, dropdownIconClasses: { type: Array, required: false, default: () => { return ['dropdown'] } }, playIconClass: { type: String, required: false, default: 'play icon' }, buttonClasses: { type: Array, required: false, default: () => { return ['button'] } }, - playlist: { type: Object, required: false, default: () => { return {} } }, + playlist: { type: Object, required: false, default: () => { return null } }, discrete: { type: Boolean, default: false }, dropdownOnly: { type: Boolean, default: false }, iconOnly: { type: Boolean, default: false }, - artist: { type: Object, required: false, default: () => { return {} } }, - album: { type: Object, required: false, default: () => { return {} } }, - library: { type: Object, required: false, default: () => { return {} } }, - channel: { type: Object, required: false, default: () => { return {} } }, + artist: { type: Object, required: false, default: () => { return null } }, + album: { type: Object, required: false, default: () => { return null } }, + library: { type: Object, required: false, default: () => { return null } }, + channel: { type: Object, required: false, default: () => { return null } }, isPlayable: { type: Boolean, required: false, default: null }, playing: { type: Boolean, required: false, default: false }, paused: { type: Boolean, required: false, default: false } diff --git a/front/src/components/audio/VolumeControl.vue b/front/src/components/audio/VolumeControl.vue index aa61c89b8..d8f45dccc 100644 --- a/front/src/components/audio/VolumeControl.vue +++ b/front/src/components/audio/VolumeControl.vue @@ -50,7 +50,7 @@ diff --git a/front/src/components/library/TrackBase.vue b/front/src/components/library/TrackBase.vue index 5107cc58a..fd809c74e 100644 --- a/front/src/components/library/TrackBase.vue +++ b/front/src/components/library/TrackBase.vue @@ -252,7 +252,7 @@ export default { EmbedWizard }, mixins: [ReportMixin], - props: { id: { type: Number, required: true } }, + props: { id: { type: [String, Number], required: true } }, data () { return { time, diff --git a/front/src/components/library/TrackDetail.vue b/front/src/components/library/TrackDetail.vue index 182eba921..276edcba9 100644 --- a/front/src/components/library/TrackDetail.vue +++ b/front/src/components/library/TrackDetail.vue @@ -301,7 +301,7 @@ export default { }, props: { track: { type: Object, required: true }, - libraries: { type: Array, required: true } + libraries: { type: Array, default: null } }, data () { return { diff --git a/front/src/components/library/TrackEdit.vue b/front/src/components/library/TrackEdit.vue index add5c4485..ce5422796 100644 --- a/front/src/components/library/TrackEdit.vue +++ b/front/src/components/library/TrackEdit.vue @@ -53,7 +53,7 @@ export default { props: { objectType: { type: String, required: true }, object: { type: Object, required: true }, - libraries: { type: Array, required: true } + libraries: { type: Array, default: null } }, data () { return { diff --git a/front/src/components/moderation/ReportCategoryDropdown.vue b/front/src/components/moderation/ReportCategoryDropdown.vue index abab26b27..e15bc50d2 100644 --- a/front/src/components/moderation/ReportCategoryDropdown.vue +++ b/front/src/components/moderation/ReportCategoryDropdown.vue @@ -30,11 +30,11 @@ import lodash from '@/lodash' export default { mixins: [TranslationsMixin], props: { - value: { type: String, required: true }, - all: { type: String, required: true }, - label: { type: String, required: true }, - empty: { type: String, required: true }, - required: { type: String, required: true }, + value: { type: String, default: null }, + all: { type: String, default: null }, + label: { type: Boolean }, + empty: { type: Boolean }, + required: { type: Boolean }, restrictTo: { type: Array, default: () => { return [] } } }, computed: { diff --git a/front/src/components/notifications/NotificationRow.vue b/front/src/components/notifications/NotificationRow.vue index 3eaa16d96..9668d5351 100644 --- a/front/src/components/notifications/NotificationRow.vue +++ b/front/src/components/notifications/NotificationRow.vue @@ -107,7 +107,7 @@ export default { let acceptFollow = null let rejectFollow = null let message = null - if (a.related_object.approved === null) { + if (a.related_object && a.related_object.approved === null) { message = this.labels.libraryPendingFollowMessage acceptFollow = { buttonClass: 'success', @@ -121,7 +121,7 @@ export default { label: this.$pgettext('Content/*/Button.Label/Verb', 'Reject'), handler: () => { self.rejectLibraryFollow(a.related_object) } } - } else if (a.related_object.approved) { + } else if (a.related_object && a.related_object.approved) { message = this.labels.libraryFollowMessage } else { message = this.labels.libraryRejectMessage diff --git a/front/src/components/radios/Button.vue b/front/src/components/radios/Button.vue index 107ea3866..d3cead016 100644 --- a/front/src/components/radios/Button.vue +++ b/front/src/components/radios/Button.vue @@ -25,10 +25,10 @@ import lodash from '@/lodash' export default { props: { - customRadioId: { type: Number, default: 0, required: false }, + customRadioId: { type: Number, required: false, default: null }, type: { type: String, required: false, default: '' }, clientOnly: { type: Boolean, default: false }, - objectId: { type: String, default: null } + objectId: { type: [String, Number, Object], default: null } }, computed: { running () { diff --git a/front/src/components/radios/Card.vue b/front/src/components/radios/Card.vue index 9d5cd182b..d71c7d0b2 100644 --- a/front/src/components/radios/Card.vue +++ b/front/src/components/radios/Card.vue @@ -53,11 +53,11 @@ export default { props: { type: { type: String, required: true, default: '' }, customRadio: { type: Object, required: false, default: () => { return {} } }, - objectId: { type: String, required: false, default: '' } + objectId: { type: String, required: false, default: null } }, computed: { radio () { - if (this.customRadio) { + if (Object.keys(this.customRadio).length > 0) { return this.customRadio } return this.$store.getters['radios/types'][this.type] diff --git a/front/src/views/Notifications.vue b/front/src/views/Notifications.vue index b97bedc71..26bc12c39 100644 --- a/front/src/views/Notifications.vue +++ b/front/src/views/Notifications.vue @@ -197,7 +197,7 @@ diff --git a/front/src/views/content/remote/Card.vue b/front/src/views/content/remote/Card.vue index c66ed4d94..813ed48c0 100644 --- a/front/src/views/content/remote/Card.vue +++ b/front/src/views/content/remote/Card.vue @@ -244,7 +244,7 @@ export default { isLoadingFollow: false, showScan: false, scanTimeout: null, - latestScan: this.library.latest_scan + latestScan: this.initialLibrary.latest_scan } }, computed: { diff --git a/front/src/views/library/DetailOverview.vue b/front/src/views/library/DetailOverview.vue index 14db9f12a..d66984814 100644 --- a/front/src/views/library/DetailOverview.vue +++ b/front/src/views/library/DetailOverview.vue @@ -46,7 +46,7 @@ export default { ArtistWidget }, props: { - object: { type: String, required: true }, + object: { type: Object, required: true }, isOwner: { type: Boolean, required: true } }, data () { diff --git a/front/src/views/playlists/Detail.vue b/front/src/views/playlists/Detail.vue index 272a0d535..8cc6fa6d2 100644 --- a/front/src/views/playlists/Detail.vue +++ b/front/src/views/playlists/Detail.vue @@ -189,7 +189,7 @@ export default { EmbedWizard }, props: { - id: { type: Number, required: true }, + id: { type: [Number, String], required: true }, defaultEdit: { type: Boolean, default: false } }, data: function () {