fix(front): playlist modal
This commit is contained in:
parent
ebbdf31038
commit
863e8200e4
|
@ -7,7 +7,6 @@ import { useI18n } from 'vue-i18n'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
|
||||||
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
import useLogger from '~/composables/useLogger'
|
import useLogger from '~/composables/useLogger'
|
||||||
|
@ -59,10 +58,6 @@ const privacyLevelChoices = {
|
||||||
} as const satisfies Record<PrivacyLevel, string>;
|
} as const satisfies Record<PrivacyLevel, string>;
|
||||||
|
|
||||||
const el = useCurrentElement()
|
const el = useCurrentElement()
|
||||||
onMounted(async () => {
|
|
||||||
await nextTick()
|
|
||||||
$(el.value).find('.dropdown').dropdown()
|
|
||||||
})
|
|
||||||
|
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
|
@ -103,11 +98,11 @@ const submit = async () => {
|
||||||
<Layout form
|
<Layout form
|
||||||
@submit.prevent="submit()"
|
@submit.prevent="submit()"
|
||||||
>
|
>
|
||||||
<h4
|
<h3
|
||||||
v-if="title"
|
v-if="title"
|
||||||
>
|
>
|
||||||
{{ t('components.playlists.Form.header.createPlaylist') }}
|
{{ t('components.playlists.Form.header.createPlaylist') }}
|
||||||
</h4>
|
</h3>
|
||||||
<Alert
|
<Alert
|
||||||
v-if="success"
|
v-if="success"
|
||||||
green
|
green
|
||||||
|
@ -138,7 +133,6 @@ const submit = async () => {
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</Alert>
|
</Alert>
|
||||||
<div class="three fields">
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="playlist-name">{{ t('components.playlists.Form.label.name') }}</label>
|
<label for="playlist-name">{{ t('components.playlists.Form.label.name') }}</label>
|
||||||
<Input
|
<Input
|
||||||
|
@ -168,6 +162,5 @@ const submit = async () => {
|
||||||
</template>
|
</template>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -16,6 +16,7 @@ import Button from '~/components/ui/Button.vue'
|
||||||
import Link from '~/components/ui/Link.vue'
|
import Link from '~/components/ui/Link.vue'
|
||||||
import Alert from '~/components/ui/Alert.vue'
|
import Alert from '~/components/ui/Alert.vue'
|
||||||
import Input from '~/components/ui/Input.vue'
|
import Input from '~/components/ui/Input.vue'
|
||||||
|
import Spacer from '~/components/ui/Spacer.vue'
|
||||||
|
|
||||||
const logger = useLogger()
|
const logger = useLogger()
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
@ -83,6 +84,9 @@ const addToPlaylist = async (playlistId: number, allowDuplicates: boolean) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
store.dispatch('playlists/fetchOwn')
|
store.dispatch('playlists/fetchOwn')
|
||||||
|
watch(playlistNameFilter, () => console.log(playlistNameFilter.value))
|
||||||
|
watch(sortedPlaylists, () => console.log(sortedPlaylists.value))
|
||||||
|
watch(playlists, () => console.log(playlists.value))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -91,30 +95,17 @@ store.dispatch('playlists/fetchOwn')
|
||||||
:title="t('components.playlists.PlaylistModal.header.addToPlaylist')"
|
:title="t('components.playlists.PlaylistModal.header.addToPlaylist')"
|
||||||
:cancel="t('components.playlists.PlaylistModal.button.cancel')"
|
:cancel="t('components.playlists.PlaylistModal.button.cancel')"
|
||||||
>
|
>
|
||||||
<h4 class="header">
|
|
||||||
<template v-if="track">
|
<template v-if="track">
|
||||||
// TODO: Check subheader
|
<h3 class="ui header">
|
||||||
<h2 class="ui header">
|
|
||||||
{{ t('components.playlists.PlaylistModal.header.addToPlaylist') }}
|
{{ t('components.playlists.PlaylistModal.header.addToPlaylist') }}
|
||||||
<div class="ui sub header">
|
<div class="ui sub header">
|
||||||
{{ t('components.playlists.PlaylistModal.header.track', {artist: trackCreditString, title: track.title}) }}
|
{{ t('components.playlists.PlaylistModal.header.track', {artist: trackCreditString, title: track.title}) }}
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h3>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>
|
|
||||||
{{ t('components.playlists.PlaylistModal.header.manage') }}
|
|
||||||
</span>
|
|
||||||
</h4>
|
|
||||||
<div class="scrolling content">
|
|
||||||
<playlist-form
|
|
||||||
:key="formKey"
|
|
||||||
:create="true"
|
|
||||||
/>
|
|
||||||
<div class="ui divider" />
|
|
||||||
<div v-if="playlists.length > 0">
|
<div v-if="playlists.length > 0">
|
||||||
<Alert
|
<Alert
|
||||||
v-if="showDuplicateTrackAddConfirmation"
|
v-if="showDuplicateTrackAddConfirmation"
|
||||||
role="alert"
|
|
||||||
yellow
|
yellow
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
|
@ -147,22 +138,16 @@ store.dispatch('playlists/fetchOwn')
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
||||||
<h4 class="ui header">
|
<h4 class="ui header">
|
||||||
{{ t('components.playlists.PlaylistModal.header.available') }}
|
{{ t('components.playlists.PlaylistModal.header.available') }}
|
||||||
</h4>
|
</h4>
|
||||||
<div class="ui form">
|
<!-- <Input
|
||||||
<div class="fields">
|
|
||||||
<div class="field">
|
|
||||||
<label for="playlist-name-filter">{{ t('components.playlists.PlaylistModal.label.filter') }}</label>
|
|
||||||
<Input
|
|
||||||
search
|
|
||||||
id="playlist-name-filter"
|
id="playlist-name-filter"
|
||||||
v-model="playlistNameFilter"
|
v-model="playlistNameFilter"
|
||||||
:placeholder="labels.filterPlaylistField"
|
:placeholder="labels.filterPlaylistField"
|
||||||
/>
|
:label="t('components.playlists.PlaylistModal.label.filter')"
|
||||||
</div>
|
/> -->
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<table
|
<table
|
||||||
v-if="sortedPlaylists.length > 0"
|
v-if="sortedPlaylists.length > 0"
|
||||||
class="ui unstackable very basic table"
|
class="ui unstackable very basic table"
|
||||||
|
@ -223,11 +208,12 @@ store.dispatch('playlists/fetchOwn')
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="ui small placeholder segment component-placeholder">
|
<Spacer />
|
||||||
<h4 class="ui header">
|
<Alert blue>
|
||||||
|
<span>
|
||||||
{{ t('components.playlists.PlaylistModal.header.noResults') }}
|
{{ t('components.playlists.PlaylistModal.header.noResults') }}
|
||||||
</h4>
|
</span>
|
||||||
</div>
|
</Alert>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -239,6 +225,12 @@ store.dispatch('playlists/fetchOwn')
|
||||||
{{ t('components.playlists.PlaylistModal.empty.noPlaylists') }}
|
{{ t('components.playlists.PlaylistModal.empty.noPlaylists') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<Spacer />
|
||||||
|
|
||||||
|
<playlist-form
|
||||||
|
:key="formKey"
|
||||||
|
:create="true"
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue