diff --git a/front/src/components/favorites/List.vue b/front/src/components/favorites/List.vue index 4644a8bb8..19182e524 100644 --- a/front/src/components/favorites/List.vue +++ b/front/src/components/favorites/List.vue @@ -42,7 +42,7 @@ const logger = useLogger() const sharedLabels = useSharedLabels() const router = useRouter() -const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName) +const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName, props.defaultPaginateBy) const updateQueryString = () => router.replace({ query: { diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index 8e884295a..750489eba 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -47,7 +47,7 @@ const orderingOptions: [OrderingField, keyof typeof sharedLabels.filters][] = [ const logger = useLogger() const sharedLabels = useSharedLabels() -const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName) +const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName, props.defaultPaginateBy) const router = useRouter() const updateQueryString = () => router.replace({ diff --git a/front/src/components/library/Artists.vue b/front/src/components/library/Artists.vue index fdc75b831..cfbde8db0 100644 --- a/front/src/components/library/Artists.vue +++ b/front/src/components/library/Artists.vue @@ -47,7 +47,7 @@ const orderingOptions: [OrderingField, keyof typeof sharedLabels.filters][] = [ const logger = useLogger() const sharedLabels = useSharedLabels() -const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName) +const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName, props.defaultPaginateBy) const router = useRouter() const updateQueryString = () => router.replace({ diff --git a/front/src/components/library/Podcasts.vue b/front/src/components/library/Podcasts.vue index 6dc7ead6a..45d3c67cb 100644 --- a/front/src/components/library/Podcasts.vue +++ b/front/src/components/library/Podcasts.vue @@ -50,7 +50,7 @@ const orderingOptions: [OrderingField, keyof typeof sharedLabels.filters][] = [ const logger = useLogger() const sharedLabels = useSharedLabels() -const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName) +const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName, props.defaultPaginateBy) const router = useRouter() const updateQueryString = () => router.replace({ diff --git a/front/src/components/library/Radios.vue b/front/src/components/library/Radios.vue index 61f71cb76..66145898c 100644 --- a/front/src/components/library/Radios.vue +++ b/front/src/components/library/Radios.vue @@ -42,7 +42,7 @@ const orderingOptions: [OrderingField, keyof typeof sharedLabels.filters][] = [ const logger = useLogger() const sharedLabels = useSharedLabels() -const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName) +const { onOrderingUpdate, orderingString, paginateBy, ordering, orderingDirection } = useOrdering(props.orderingConfigName, props.defaultPaginateBy) const router = useRouter() const updateQueryString = () => router.replace({ diff --git a/front/src/components/manage/ChannelsTable.vue b/front/src/components/manage/ChannelsTable.vue index 781fd73c1..863875488 100644 --- a/front/src/components/manage/ChannelsTable.vue +++ b/front/src/components/manage/ChannelsTable.vue @@ -34,7 +34,8 @@ const orderingOptions: [OrderingField, keyof typeof sharedLabels.filters][] = [ ] const actionFilters = computed(() => ({ q: query.value, ...props.filters })) -const actions = [] +// TODO (wvffle): Find correct type +const actions: unknown[] = [] const isLoading = ref(false) const fetchData = async () => { @@ -65,11 +66,7 @@ const fetchData = async () => { } } -onSearch(() => { - page.value = 1 - fetchData() -}) - +onSearch(() => (page.value = 1)) watch(page, fetchData) onOrderingUpdate(fetchData) fetchData() diff --git a/front/src/components/manage/library/AlbumsTable.vue b/front/src/components/manage/library/AlbumsTable.vue index 99417c69b..73735f494 100644 --- a/front/src/components/manage/library/AlbumsTable.vue +++ b/front/src/components/manage/library/AlbumsTable.vue @@ -76,11 +76,7 @@ const fetchData = async () => { } } -onSearch(() => { - page.value = 1 - fetchData() -}) - +onSearch(() => (page.value = 1)) watch(page, fetchData) onOrderingUpdate(fetchData) fetchData() diff --git a/front/src/components/manage/library/ArtistsTable.vue b/front/src/components/manage/library/ArtistsTable.vue index f312164cd..d1c0edf8a 100644 --- a/front/src/components/manage/library/ArtistsTable.vue +++ b/front/src/components/manage/library/ArtistsTable.vue @@ -74,11 +74,7 @@ const fetchData = async () => { } } -onSearch(() => { - page.value = 1 - fetchData() -}) - +onSearch(() => (page.value = 1)) watch(page, fetchData) onOrderingUpdate(fetchData) fetchData() diff --git a/front/src/components/manage/library/EditsCardList.vue b/front/src/components/manage/library/EditsCardList.vue index b328ec966..638f9eee8 100644 --- a/front/src/components/manage/library/EditsCardList.vue +++ b/front/src/components/manage/library/EditsCardList.vue @@ -81,7 +81,8 @@ const fetchTargets = async () => { targets[key as keyof typeof targets][payload.id] = { payload, currentState: configs[key as keyof typeof targets].fields.reduce((state, field) => { - state[field.id] = { value: field.getValue(payload) } + // TODO (wvffle): This cast may result in an `undefined` key added, make sure to test that. + state[field.id as EditObjectType] = { value: field.getValue(payload) } return state }, {} as Record) } @@ -119,17 +120,13 @@ const fetchData = async () => { } } -onSearch(() => { - page.value = 1 - fetchData() -}) - +onSearch(() => (page.value = 1)) watch(page, fetchData) onOrderingUpdate(fetchData) fetchData() -const sharedLabels = useSharedLabels() const { $pgettext } = useGettext() +const sharedLabels = useSharedLabels() const labels = computed(() => ({ searchPlaceholder: $pgettext('Content/Search/Input.Placeholder', 'Search by account, summary, domain…') })) diff --git a/front/src/components/manage/library/LibrariesTable.vue b/front/src/components/manage/library/LibrariesTable.vue index 598f279d2..bc5666a1c 100644 --- a/front/src/components/manage/library/LibrariesTable.vue +++ b/front/src/components/manage/library/LibrariesTable.vue @@ -76,11 +76,7 @@ const fetchData = async () => { } } -onSearch(() => { - page.value = 1 - fetchData() -}) - +onSearch(() => (page.value = 1)) watch(page, fetchData) onOrderingUpdate(fetchData) fetchData() diff --git a/front/src/components/manage/library/TagsTable.vue b/front/src/components/manage/library/TagsTable.vue index abd575563..c3684686a 100644 --- a/front/src/components/manage/library/TagsTable.vue +++ b/front/src/components/manage/library/TagsTable.vue @@ -1,16 +1,112 @@ + + - - diff --git a/front/src/components/manage/library/TracksTable.vue b/front/src/components/manage/library/TracksTable.vue index fa4060569..c90a9cac4 100644 --- a/front/src/components/manage/library/TracksTable.vue +++ b/front/src/components/manage/library/TracksTable.vue @@ -1,16 +1,103 @@ + + - - diff --git a/front/src/components/manage/library/UploadsTable.vue b/front/src/components/manage/library/UploadsTable.vue index 523a67d9b..0965d23d5 100644 --- a/front/src/components/manage/library/UploadsTable.vue +++ b/front/src/components/manage/library/UploadsTable.vue @@ -1,16 +1,118 @@ + + - - diff --git a/front/src/components/manage/moderation/AccountsTable.vue b/front/src/components/manage/moderation/AccountsTable.vue index 55913e609..ba4cb39d9 100644 --- a/front/src/components/manage/moderation/AccountsTable.vue +++ b/front/src/components/manage/moderation/AccountsTable.vue @@ -1,16 +1,104 @@ + + - - diff --git a/front/src/components/manage/moderation/DomainsTable.vue b/front/src/components/manage/moderation/DomainsTable.vue index 42ae09677..a18521c26 100644 --- a/front/src/components/manage/moderation/DomainsTable.vue +++ b/front/src/components/manage/moderation/DomainsTable.vue @@ -1,3 +1,112 @@ + + - - diff --git a/front/src/components/manage/users/InvitationsTable.vue b/front/src/components/manage/users/InvitationsTable.vue index 4a329a045..f850b539d 100644 --- a/front/src/components/manage/users/InvitationsTable.vue +++ b/front/src/components/manage/users/InvitationsTable.vue @@ -1,3 +1,92 @@ + + - - diff --git a/front/src/components/manage/users/UsersTable.vue b/front/src/components/manage/users/UsersTable.vue index c1696e30c..c1fc380a3 100644 --- a/front/src/components/manage/users/UsersTable.vue +++ b/front/src/components/manage/users/UsersTable.vue @@ -1,3 +1,97 @@ + + - - diff --git a/front/src/components/mixins/Pagination.vue b/front/src/components/mixins/Pagination.vue deleted file mode 100644 index 1bc7a05b9..000000000 --- a/front/src/components/mixins/Pagination.vue +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/front/src/composables/locale/useSharedLabels.ts b/front/src/composables/locale/useSharedLabels.ts index 88b4aec21..e5f033999 100644 --- a/front/src/composables/locale/useSharedLabels.ts +++ b/front/src/composables/locale/useSharedLabels.ts @@ -70,6 +70,7 @@ export default () => ({ release_date: $pgettext('Content/*/*/Noun', 'Release date'), accessed_date: $pgettext('Content/*/*/Noun', 'Accessed date'), applied_date: $pgettext('Content/*/*/Noun', 'Applied date'), + handled_date: $pgettext('Content/*/*/Noun', 'Handled date'), first_seen: $pgettext('Content/Moderation/Dropdown/Noun', 'First seen date'), last_seen: $pgettext('Content/Moderation/Dropdown/Noun', 'Last seen date'), modification_date: $pgettext('Content/Playlist/Dropdown/Noun', 'Modification date'), diff --git a/front/src/composables/moderation/useEditConfigs.ts b/front/src/composables/moderation/useEditConfigs.ts index 6f496e8bf..cf1b49613 100644 --- a/front/src/composables/moderation/useEditConfigs.ts +++ b/front/src/composables/moderation/useEditConfigs.ts @@ -11,13 +11,13 @@ interface ConfigField { getValueRepr?: (obj: any) => string } -interface EditableConfigField extends ConfigField { +export interface EditableConfigField extends ConfigField { id: EditObjectType } export type EditObject = Artist | Album | Track export type EditObjectType = 'artist' | 'album' | 'track' -type Configs = Record +type Configs = Record const { $pgettext } = gettext const getContentValueRepr = (val: Content) => val.text diff --git a/front/src/composables/useOrdering.ts b/front/src/composables/useOrdering.ts index e275825a9..86d6f4857 100644 --- a/front/src/composables/useOrdering.ts +++ b/front/src/composables/useOrdering.ts @@ -8,7 +8,7 @@ export interface OrderingProps { orderingConfigName: RouteWithPreferences | null } -export default (orderingConfigName: MaybeRef) => { +export default (orderingConfigName: MaybeRef, defaultPaginateBy?: MaybeRef) => { const store = useStore() const route = useRoute() @@ -18,6 +18,9 @@ export default (orderingConfigName: MaybeRef) => { }) const { paginateBy, ordering, orderingDirection } = toRefs(config) + if (defaultPaginateBy !== undefined) { + paginateBy.value = unref(defaultPaginateBy) + } const orderingString = computed(() => { if (orderingDirection.value === '-') return `-${ordering.value}` diff --git a/front/src/store/ui.ts b/front/src/store/ui.ts index 93e4c8e44..bd98ea38c 100644 --- a/front/src/store/ui.ts +++ b/front/src/store/ui.ts @@ -19,7 +19,10 @@ export type WebSocketEventName = 'inbox.item_added' | 'import.status_updated' | | 'report.created' | 'user_request.created' | 'Listen' export type OrderingField = 'creation_date' | 'title' | 'album__title' | 'artist__name' | 'release_date' | 'name' - | 'applied_date' | 'followers_count' | 'uploads_count' + | 'applied_date' | 'followers_count' | 'uploads_count' | 'length' | 'items_count' | 'modification_date' | 'size' + | 'accessed_date' | 'bitrate' | 'duration' | 'last_fetch_date' | 'preferred_username' | 'domain' | 'handled_date' + | 'album_title' | 'artist_name' | 'actors_count' | 'outbox_activities_count' | 'expiration_date' | 'date_joined' + | 'last_activity' | 'username' export type OrderingDirection = '-' | '+' interface RoutePreferences { diff --git a/front/src/types.ts b/front/src/types.ts index e1c8dbe40..31da500f4 100644 --- a/front/src/types.ts +++ b/front/src/types.ts @@ -160,6 +160,13 @@ export interface Form { help_text: Content } +// Upload stuff +export interface Upload { + filename?: string + source?: string + uuid: string +} + // Yet uncategorized stuff export interface Actor { preferred_username: string diff --git a/front/src/views/admin/moderation/ReportsList.vue b/front/src/views/admin/moderation/ReportsList.vue index 75e2fd79c..31f9890cf 100644 --- a/front/src/views/admin/moderation/ReportsList.vue +++ b/front/src/views/admin/moderation/ReportsList.vue @@ -1,3 +1,89 @@ + + - - diff --git a/front/src/views/admin/moderation/RequestsList.vue b/front/src/views/admin/moderation/RequestsList.vue index 84ceebb79..50ed682b8 100644 --- a/front/src/views/admin/moderation/RequestsList.vue +++ b/front/src/views/admin/moderation/RequestsList.vue @@ -1,3 +1,84 @@ + + - - diff --git a/front/src/views/content/libraries/FilesTable.vue b/front/src/views/content/libraries/FilesTable.vue index b7017d2e5..23dbe86d9 100644 --- a/front/src/views/content/libraries/FilesTable.vue +++ b/front/src/views/content/libraries/FilesTable.vue @@ -1,3 +1,121 @@ + + - - diff --git a/front/src/views/playlists/List.vue b/front/src/views/playlists/List.vue index 1f35bb6cd..915625eed 100644 --- a/front/src/views/playlists/List.vue +++ b/front/src/views/playlists/List.vue @@ -1,3 +1,105 @@ + + - -