chore(front): cleaning up

This commit is contained in:
upsiflu 2025-03-26 16:58:35 +01:00
parent 7aa917f385
commit efc6e8a30e
6 changed files with 25 additions and 34 deletions

View File

@ -10,6 +10,7 @@ import PlayButton from '~/components/audio/PlayButton.vue'
import Card from '~/components/ui/Card.vue' import Card from '~/components/ui/Card.vue'
import Link from '~/components/ui/Link.vue' import Link from '~/components/ui/Link.vue'
import Spacer from '~/components/ui/Spacer.vue' import Spacer from '~/components/ui/Spacer.vue'
import Layout from '~/components/ui/Layout.vue'
import { type Album } from '~/types' import { type Album } from '~/types'

View File

@ -15,21 +15,20 @@ import Alert from '~/components/ui/Alert.vue'
import Input from '~/components/ui/Input.vue' import Input from '~/components/ui/Input.vue'
import Pills from '~/components/ui/Pills.vue' import Pills from '~/components/ui/Pills.vue'
interface Events {
(e: 'category', contentCategory: ContentCategory): void
(e: 'submittable', value: boolean): void
(e: 'loading', value: boolean): void
(e: 'errored', errors: string[]): void
(e: 'created', channel: Channel): void
(e: 'updated', channel: Channel): void
}
interface Props { interface Props {
object?: Channel | null object?: Channel | null
step?: number step?: number
} }
const emit = defineEmits<Events>() const emit = defineEmits<{
category: [contentCategory: ContentCategory]
submittable: [value: boolean]
loading: [value: boolean]
errored: [errors: string[]]
created: [channel: Channel]
updated: [channel: Channel]
}>()
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
object: null, object: null,
step: 1 step: 1

View File

@ -314,7 +314,7 @@ fetchOwnedApps()
</Alert> </Alert>
<div <div
v-for="f in orderedSettingsFields" v-for="f in orderedSettingsFields"
:key="f.id" :key="f.id + sharedLabels.fields[f.id].help"
class="field" class="field"
> >
<Textarea <Textarea

View File

@ -126,8 +126,6 @@ const selectedChannel = computed(() =>
: availableChannels.value.find(({ artist }) => artist.id === channelDropdownId.value) || null : availableChannels.value.find(({ artist }) => artist.id === channelDropdownId.value) || null
) )
const emptyChannelCreateRequest:components['schemas']['ChannelCreateRequest'] = { const emptyChannelCreateRequest:components['schemas']['ChannelCreateRequest'] = {
name: store.state.auth.fullUsername, name: store.state.auth.fullUsername,
username: store.state.auth.username, username: store.state.auth.username,
@ -138,7 +136,7 @@ const emptyChannelCreateRequest:components['schemas']['ChannelCreateRequest'] =
const createEmptyChannel = async () => { const createEmptyChannel = async () => {
try { try {
const response = await axios.post( await axios.post(
'channels/', 'channels/',
(emptyChannelCreateRequest satisfies operations['create_channel_2']['requestBody']['content']['application/json']) (emptyChannelCreateRequest satisfies operations['create_channel_2']['requestBody']['content']['application/json'])
) )
@ -154,6 +152,7 @@ const fetchChannels = async () => {
'channels/', 'channels/',
{ params: { scope: 'me' } } { params: { scope: 'me' } }
) )
availableChannels.value = response.data.results.filter(channel => availableChannels.value = response.data.results.filter(channel =>
props.filter === undefined props.filter === undefined
? true ? true
@ -477,6 +476,7 @@ defineExpose({
</li> </li>
</ul> </ul>
</Alert> </Alert>
<!-- Select Album and License --> <!-- Select Album and License -->
<div :class="['ui', 'required', 'field']"> <div :class="['ui', 'required', 'field']">

View File

@ -15,9 +15,16 @@ import { useModal } from '~/ui/composables/useModal.ts'
import axios from 'axios' import axios from 'axios'
import RemoteSearchForm from '~/components/RemoteSearchForm.vue' import RemoteSearchForm from '~/components/RemoteSearchForm.vue'
import Modal from '~/components/ui/Modal.vue'
import Card from '~/components/ui/Card.vue' import Card from '~/components/ui/Card.vue'
import ArtistCard from '~/components/artist/Card.vue' import ArtistCard from '~/components/artist/Card.vue'
import useSharedLabels from '~/composables/locale/useSharedLabels'
import useOrdering from '~/composables/navigation/useOrdering'
import useErrorHandler from '~/composables/useErrorHandler'
import usePage from '~/composables/navigation/usePage'
import useLogger from '~/composables/useLogger'
import { useTags } from '~/ui/composables/useTags.ts'
import Pagination from '~/components/ui/Pagination.vue' import Pagination from '~/components/ui/Pagination.vue'
import Layout from '~/components/ui/Layout.vue' import Layout from '~/components/ui/Layout.vue'
import Header from '~/components/ui/Header.vue' import Header from '~/components/ui/Header.vue'
@ -27,12 +34,7 @@ import Alert from '~/components/ui/Alert.vue'
import Spacer from '~/components/ui/Spacer.vue' import Spacer from '~/components/ui/Spacer.vue'
import Pills from '~/components/ui/Pills.vue' import Pills from '~/components/ui/Pills.vue'
import Loader from '~/components/ui/Loader.vue' import Loader from '~/components/ui/Loader.vue'
import Modal from '~/components/ui/Modal.vue'
import useSharedLabels from '~/composables/locale/useSharedLabels'
import useOrdering from '~/composables/navigation/useOrdering'
import useErrorHandler from '~/composables/useErrorHandler'
import usePage from '~/composables/navigation/usePage'
import useLogger from '~/composables/useLogger'
interface Props extends OrderingProps { interface Props extends OrderingProps {
scope?: 'me' | 'all' scope?: 'me' | 'all'
@ -50,7 +52,9 @@ const page = usePage()
const tags = useRouteQuery<string[]>('tag', []) const tags = useRouteQuery<string[]>('tag', [])
const tagList = computed(() => ({ const tagList = useTags(tags)
computed(() => ({
currents: [].map(tag => ({ type: 'custom' as const, label: tag })), currents: [].map(tag => ({ type: 'custom' as const, label: tag })),
others: tags.value.map(tag => ({ type: 'custom' as const, label: tag })) others: tags.value.map(tag => ({ type: 'custom' as const, label: tag }))
})) }))

View File

@ -57,14 +57,6 @@ const destinationSelected = (destination: UploadDestination) =>
// Load the library for the chosen privacy level // Load the library for the chosen privacy level
const privacyLevel = ref<PrivacyLevel>('me') const privacyLevel = ref<PrivacyLevel>('me')
// Lade User
const url = '`federation/actors/${object.full_username}/libraries/`'
// Step 2
const filesSelected = (e: InputEvent) => {
state.value = { ...state.value, files: [] }
}
const modalTitle = computed(() => const modalTitle = computed(() =>
({ selectDestination: 'Upload', uploadFiles: 'Select files for upload', uploadsInProgress: 'Uploading...' } ({ selectDestination: 'Upload', uploadFiles: 'Select files for upload', uploadsInProgress: 'Uploading...' }
[state.value.page]) [state.value.page])
@ -140,8 +132,6 @@ const channelUpload = ref()
v-if="state.page === 'uploadFiles'" v-if="state.page === 'uploadFiles'"
stack stack
> >
<!-- -->
<ChannelUpload <ChannelUpload
v-if="state.uploadDestination?.type === 'channel'" v-if="state.uploadDestination?.type === 'channel'"
ref="channelUpload" ref="channelUpload"
@ -149,9 +139,6 @@ const channelUpload = ref()
:channel="state.uploadDestination?.channel || null" :channel="state.uploadDestination?.channel || null"
/> />
<!-- -->
<!-- Privacy Slider -->
<LibraryUpload <LibraryUpload
v-if="state.uploadDestination?.type === 'library'" v-if="state.uploadDestination?.type === 'library'"
v-model="privacyLevel" v-model="privacyLevel"