kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
fix(front):wong type assignements
rodzic
8a63832d75
commit
dfb15ee98b
|
@ -10,7 +10,7 @@ import Layout from '~/components/ui/Layout.vue'
|
|||
import Spacer from '~/components/ui/Spacer.vue'
|
||||
import Card from '~/components/ui/Card.vue'
|
||||
|
||||
import type { Channel, PrivacyLevel } from '~/types'
|
||||
import type { Channel, LibraryPrivacyLevelEnum } from '~/types'
|
||||
import ChannelUpload from '~/components/channels/UploadForm.vue'
|
||||
import LibraryUpload from '~/components/library/FileUpload.vue'
|
||||
|
||||
|
@ -65,7 +65,7 @@ watch(state, ({ page }, oldValue) => {
|
|||
// Step 1.1
|
||||
|
||||
// Load the library for the chosen privacy level
|
||||
const privacyLevel = ref<PrivacyLevel>('me')
|
||||
const privacyLevel = ref<LibraryPrivacyLevelEnum>('me')
|
||||
|
||||
const modalTitle = computed(() =>
|
||||
({ selectDestination: 'Upload', uploadFiles: 'Select files for upload', uploadsInProgress: 'Uploading...' }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { PrivacyLevel } from '~/types'
|
||||
import type { PrivacyLevelEnum } from '~/types'
|
||||
|
||||
import { humanSize, truncate } from '~/utils/filters'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
@ -15,7 +15,7 @@ import useLogger from '~/composables/useLogger'
|
|||
|
||||
import DangerousButton from '~/components/common/DangerousButton.vue'
|
||||
|
||||
const PRIVACY_LEVELS = ['me', 'instance', 'everyone'] as PrivacyLevel[]
|
||||
const PRIVACY_LEVELS = ['me', 'instance', 'everyone'] as PrivacyLevelEnum[]
|
||||
|
||||
interface Props {
|
||||
id: number
|
||||
|
@ -226,7 +226,7 @@ const updateObj = async (attr: string) => {
|
|||
</option>
|
||||
</select>
|
||||
<template v-else>
|
||||
{{ sharedLabels.fields.privacy_level.shortChoices[object.privacy_level as PrivacyLevel] }}
|
||||
{{ sharedLabels.fields.privacy_level.shortChoices[object.privacy_level as PrivacyLevelEnum] }}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { PrivacyLevel, ImportStatus } from '~/types'
|
||||
import type { PrivacyLevelEnum, ImportStatus } from '~/types'
|
||||
|
||||
import { humanSize, truncate } from '~/utils/filters'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
@ -46,7 +46,7 @@ const showUploadDetailModal = ref(false)
|
|||
const open = ref(false)
|
||||
|
||||
const privacyLevels = computed(() =>
|
||||
sharedLabels.fields.privacy_level.shortChoices[object.value?.library?.privacy_level as PrivacyLevel]
|
||||
sharedLabels.fields.privacy_level.shortChoices[object.value?.library?.privacy_level as PrivacyLevelEnum]
|
||||
)
|
||||
const importStatus = computed(() =>
|
||||
sharedLabels.fields.import_status.choices[object.value?.import_status as ImportStatus]?.label
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { PrivacyLevel, Upload } from '~/types'
|
||||
import type { LibraryPrivacyLevelEnum, Upload } from '~/types'
|
||||
import type { SmartSearchProps } from '~/composables/navigation/useSmartSearch'
|
||||
import type { OrderingProps } from '~/composables/navigation/useOrdering'
|
||||
import type { RouteRecordName } from 'vue-router'
|
||||
|
@ -99,7 +99,7 @@ const isAllSelected = computed<boolean | 'mixed'>({
|
|||
// For privacy slider and <select>
|
||||
|
||||
// Model for use in global slider `privacy_level`
|
||||
const globalPrivacyLevel = computed<PrivacyLevel | undefined>({
|
||||
const globalPrivacyLevel = computed<LibraryPrivacyLevelEnum | undefined>({
|
||||
get () {
|
||||
return selectedItems.value.length === 0
|
||||
? undefined
|
||||
|
@ -181,7 +181,7 @@ const privacyOptions = {
|
|||
me: sharedLabels.fields.privacy_level.choices.me,
|
||||
instance: sharedLabels.fields.privacy_level.choices.instance,
|
||||
everyone: sharedLabels.fields.privacy_level.choices.everyone
|
||||
} as const satisfies Record<PrivacyLevel, string>
|
||||
} as const satisfies Record<LibraryPrivacyLevelEnum, string>
|
||||
|
||||
|
||||
// Current logic:
|
||||
|
@ -478,7 +478,7 @@ fetchData()
|
|||
<Pill
|
||||
:title="t('components.manage.library.UploadsTable.table.upload.header.visibility')"
|
||||
v-bind="item.privacy_level
|
||||
? { onClick: () => { token('privacy_level').value = item.privacy_level as PrivacyLevel } }
|
||||
? { onClick: () => { token('privacy_level').value = item.privacy_level as LibraryPrivacyLevelEnum } }
|
||||
: { disabled: true }
|
||||
"
|
||||
>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { Library, PrivacyLevel } from '~/types'
|
||||
import type { Library, PrivacyLevelEnum } from '~/types'
|
||||
|
||||
import { humanSize } from '~/utils/filters'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
@ -19,7 +19,7 @@ const sharedLabels = useSharedLabels()
|
|||
|
||||
const sizeLabel = computed(() => t('views.content.libraries.Card.label.size'))
|
||||
|
||||
const privacyTooltips = (level: PrivacyLevel) => `Visibility: ${sharedLabels.fields.privacy_level.choices[level].toLowerCase()}`
|
||||
const privacyTooltips = (level: PrivacyLevelEnum) => `Visibility: ${sharedLabels.fields.privacy_level.choices[level].toLowerCase()}`
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { Library, PrivacyLevel } from '~/types'
|
||||
import type { Library, PrivacyLevelEnum } from '~/types'
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed } from 'vue'
|
||||
|
@ -26,7 +26,7 @@ const sharedLabels = useSharedLabels()
|
|||
// TODO: Check if this is still needed:
|
||||
// const sizeLabel = computed(() => t('views.content.libraries.Card.label.size'))
|
||||
|
||||
const privacyTooltips = (level: PrivacyLevel) => `Visibility: ${sharedLabels.fields.privacy_level.choices[level].toLowerCase()}`
|
||||
const privacyTooltips = (level: PrivacyLevelEnum) => `Visibility: ${sharedLabels.fields.privacy_level.choices[level].toLowerCase()}`
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { Library, BackendError, PrivacyLevel } from '~/types'
|
||||
import type { Library, BackendError, PrivacyLevelEnum } from '~/types'
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed, ref } from 'vue'
|
||||
|
@ -11,7 +11,7 @@ import useSharedLabels from '~/composables/locale/useSharedLabels'
|
|||
|
||||
import DangerousButton from '~/components/common/DangerousButton.vue'
|
||||
|
||||
const PRIVACY_LEVELS = ['me', 'instance', 'everyone'] as PrivacyLevel[]
|
||||
const PRIVACY_LEVELS = ['me', 'instance', 'everyone'] as PrivacyLevelEnum[]
|
||||
|
||||
interface Events {
|
||||
(e: 'updated', data: Library): void
|
||||
|
|
Ładowanie…
Reference in New Issue