Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converting more components to setup composition api #1892

Merged
merged 25 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d3af4bd
chore: convert settings page to setup composition api
aweebs Feb 21, 2023
a3aece9
chore: fix admin page redirect check
aweebs Mar 3, 2023
6e67518
chore: convert apikeys page to composition api
aweebs Feb 21, 2023
15c433b
chore: add in temporary apikeys table since datatable is not availabl…
aweebs Feb 21, 2023
7e81f1c
chore: add API revoke confirmation modal
aweebs Feb 26, 2023
0f504a3
chore: Convert devices.vue to setup composition api
aweebs Feb 21, 2023
31d5f21
chore: Add temporary table list to devices.vue
aweebs Feb 21, 2023
369df9d
chore: Add delete confirmation to devices page
aweebs Feb 26, 2023
5760b66
chore: remove selected device info component and prefer table
aweebs Mar 4, 2023
e396fc6
chore: convert logs and activities to setup composition api
aweebs Feb 26, 2023
ae0f65f
chore: fix logs and activity page layout
aweebs Mar 4, 2023
ba9d495
chore: remove loading and error states from logs and activities
aweebs Mar 17, 2023
8f42587
chore: update ImageEditor and ImageSearch to setup composition API
aweebs Mar 1, 2023
214f0cb
chore: update MetadataEditor, MetadataEditorDialog, and PersonEditor …
aweebs Mar 1, 2023
f73f9d0
chore: PlayButton make track index props optional
aweebs Mar 7, 2023
9943330
chore: fix v-chip component's not using size correctly
aweebs Mar 1, 2023
56a36c0
chore: update routed pages to use setup composition api
aweebs Mar 2, 2023
963c36e
chore: change library routes to use itemId param instead of viewId fo…
aweebs Mar 7, 2023
b252eea
refactor: route pages use onMounted instead of watching route params …
aweebs Mar 15, 2023
e22c213
chore: rewrite setup wizard with setup composition api
aweebs Mar 2, 2023
7845f7f
chore: convert UpNext component to setup composition api
aweebs Mar 3, 2023
9084f67
chore: remove obvious return value from SkeletonHomeSection computed …
aweebs Mar 8, 2023
7da717d
chore: consistent typing style for computed properties
aweebs Mar 12, 2023
280b24d
chore: remove PlaybackInfoCard
aweebs Mar 13, 2023
f343849
refactor: remove ValidCardShapes type union - it duplicates CardShapes
aweebs Mar 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions frontend/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@
"dateCreated": "Date created",
"description": "Add and revoke API keys for external access to your server",
"refreshKeysFailure": "Error refreshing API keys",
"revoke": "Revoke",
"revokeAll": "Revoke all API keys",
"revokeConfirm": "Confirm API key revocation",
"revokeAllFailure": "Error revoking all API keys",
"revokeAllSuccess": "Successfully revoked all API keys",
"revokeFailure": "Error revoking API key",
Expand All @@ -344,6 +346,7 @@
"appVersion": "App version",
"delete": "Delete",
"deleteAll": "Delete all",
"deleteConfirm": "Confirm device deletion",
"deleteAllDevicesError": "Error deleting all devices",
"deleteAllDevicesSuccess": "All devices deleted successfully",
"deleteDeviceError": "Error deleting device",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Buttons/FilterButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const isMovieOrTvShow = computed(
props.item.CollectionType === 'tvshows'
);

const statusFilters = computed((): { label: string; name: ItemFilter }[] => [
const statusFilters = computed<{ label: string; name: ItemFilter }[]>(() => [
{
label: t('played'),
name: ItemFilter.IsPlayed
Expand Down
16 changes: 12 additions & 4 deletions frontend/src/components/Buttons/Playback/PlayButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ const props = withDefaults(
iconOnly?: boolean;
fab?: boolean;
shuffle?: boolean;
videoTrackIndex: number;
audioTrackIndex: number;
subtitleTrackIndex: number;
videoTrackIndex?: number;
audioTrackIndex?: number;
subtitleTrackIndex?: number;
disabled?: boolean;
}>(),
{ iconOnly: false, fab: false, shuffle: false, disabled: false }
{
iconOnly: false,
fab: false,
shuffle: false,
disabled: false,
videoTrackIndex: undefined,
audioTrackIndex: undefined,
subtitleTrackIndex: undefined
}
);

const playbackManager = playbackManagerStore();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Buttons/TypeButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const { t } = useI18n();

const model = ref<BaseItemKind[]>([]);

const items = computed((): { title: string; value: BaseItemKind }[] => {
const items = computed<{ title: string; value: BaseItemKind }[]>(() => {
switch (props.type) {
case 'movies': {
return [
Expand Down
32 changes: 20 additions & 12 deletions frontend/src/components/Item/CollectionTabs.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<template>
<div v-if="!!children">
<div v-if="children">
<v-tabs v-model="currentTab" class="mb-3" bg-color="transparent">
<v-tab v-for="(items, type) in children" :key="type">
{{ type }} ({{ items.length }})
<v-tab v-for="(baseItems, type) in children" :key="type" :value="type">
{{ type }} ({{ baseItems.length }})
</v-tab>
</v-tabs>
<h1 v-if="!children && !loading" class="text-h5 text-center">
{{ $t('collectionEmpty') }}
</h1>
<v-tabs v-model="currentTab" class="bg-transparent">
<v-tab v-for="(items, type) in children" :key="type">
<v-window v-model="currentTab" class="bg-transparent">
<v-window-item
v-for="(baseItems, type) in children"
:key="type"
:value="type">
<v-container>
<skeleton-item-grid v-if="loading" :view-type="item.Type" />
<item-grid :loading="loading" :items="items" />
<item-grid :loading="loading" :items="baseItems" />
</v-container>
</v-tab>
</v-tabs>
</v-window-item>
</v-window>
</div>
</template>

Expand All @@ -40,11 +43,16 @@ const children = computed(() => {
watch(
() => props.item,
async (item) => {
if (!children.value) {
loading.value = true;
await items.fetchAndAddCollection(item.Id);
loading.value = false;
aweebs marked this conversation as resolved.
Show resolved Hide resolved
/**
* Only try to load children if there aren't any children items in the itemStore yet
*/
if (children.value) {
return;
}

loading.value = true;
await items.fetchAndAddCollection(item.Id);
loading.value = false;
},
{ immediate: true }
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Item/ItemMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</v-list>
</v-menu>
<metadata-editor-dialog
v-if="metadataDialog"
v-if="item.Id"
aweebs marked this conversation as resolved.
Show resolved Hide resolved
v-model:dialog="metadataDialog"
:item-id="item.Id" />
</div>
Expand Down
Loading