diff options
author | Andrey Borysenko <andrey18106x@gmail.com> | 2024-10-23 23:32:46 +0300 |
---|---|---|
committer | Andrey Borysenko <andrey18106x@gmail.com> | 2024-10-29 20:54:08 +0200 |
commit | 87327552a280f44e6699a09f8e03c312f67ce13f (patch) | |
tree | e4cfda1e6ea58890e73086318be6b2b283672070 /apps | |
parent | 6e75b41ece870fb38fd1e0fca72e89f18d412a75 (diff) | |
download | nextcloud-server-87327552a280f44e6699a09f8e03c312f67ce13f.tar.gz nextcloud-server-87327552a280f44e6699a09f8e03c312f67ce13f.zip |
fix: address review comments
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/src/app-types.ts | 7 | ||||
-rw-r--r-- | apps/settings/src/components/AppList/AppDaemonBadge.vue | 4 | ||||
-rw-r--r-- | apps/settings/src/components/AppList/AppItem.vue | 22 | ||||
-rw-r--r-- | apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue | 8 | ||||
-rw-r--r-- | apps/settings/src/mixins/AppManagement.js | 6 | ||||
-rw-r--r-- | apps/settings/src/store/app-api-store.ts | 10 | ||||
-rw-r--r-- | apps/settings/src/views/AppStoreSidebar.vue | 2 |
7 files changed, 29 insertions, 30 deletions
diff --git a/apps/settings/src/app-types.ts b/apps/settings/src/app-types.ts index da7a62e47cf..9bba3ee6d50 100644 --- a/apps/settings/src/app-types.ts +++ b/apps/settings/src/app-types.ts @@ -44,13 +44,13 @@ export interface IAppstoreApp { app_api: boolean active: boolean internal: boolean - removeable: boolean + removable: boolean installed: boolean canInstall: boolean - canUninstall: boolean + canUnInstall: boolean isCompatible: boolean needsDownload: boolean - update: string | null + update?: string appstoreData: Record<string, never> releases?: IAppstoreAppRelease[] @@ -91,5 +91,4 @@ export interface IAppstoreExApp extends IAppstoreApp { daemon: IDeployDaemon | null | undefined status: IExAppStatus | Record<string, never> error: string - removable: boolean } diff --git a/apps/settings/src/components/AppList/AppDaemonBadge.vue b/apps/settings/src/components/AppList/AppDaemonBadge.vue index 1a5cd5bbea3..b323272e837 100644 --- a/apps/settings/src/components/AppList/AppDaemonBadge.vue +++ b/apps/settings/src/components/AppList/AppDaemonBadge.vue @@ -12,9 +12,9 @@ </template> <script setup lang="ts"> -import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' -import { mdiFileChart } from '@mdi/js' import type { IDeployDaemon } from '../../app-types.ts' +import { mdiFileChart } from '@mdi/js' +import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' defineProps<{ daemon?: IDeployDaemon diff --git a/apps/settings/src/components/AppList/AppItem.vue b/apps/settings/src/components/AppList/AppItem.vue index 31a57ea5c73..59cce7306c6 100644 --- a/apps/settings/src/components/AppList/AppItem.vue +++ b/apps/settings/src/components/AppList/AppItem.vue @@ -15,12 +15,12 @@ class="app-image app-image-icon" :headers="getDataItemHeaders(`app-table-col-icon`)"> <div v-if="!app?.app_api && shouldDisplayDefaultIcon" class="icon-settings-dark" /> - <NcIconSvgWrapper v-else-if="app?.app_api && shouldDisplayDefaultIcon" - :path="mdiCogOutline()" + <NcIconSvgWrapper v-else-if="app.app_api && shouldDisplayDefaultIcon" + :path="mdiCogOutline" :size="listView ? 24 : 48" style="min-width: auto; min-height: auto; height: 100%;" /> - <svg v-else-if="listView && app.preview && !app?.app_api" + <svg v-else-if="listView && app.preview && !app.app_api" width="32" height="32" viewBox="0 0 32 32"> @@ -83,7 +83,7 @@ @click.stop="update(app.id)"> {{ t('settings', 'Update to {update}', {update:app.update}) }} </NcButton> - <NcButton v-if="app.canUnInstall || app.canUninstall" + <NcButton v-if="app.canUnInstall" class="uninstall" type="tertiary" :disabled="installing || isLoading" @@ -125,6 +125,8 @@ import SvgFilterMixin from '../SvgFilterMixin.vue' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' import { mdiCogOutline } from '@mdi/js' +import { useAppApiStore } from '../../store/app-api-store' + export default { name: 'AppItem', @@ -133,7 +135,14 @@ export default { AppScore, NcButton, NcIconSvgWrapper, - mdiCogOutline, + }, + setup() { + const appApiStore = useAppApiStore() + + return { + appApiStore, + mdiCogOutline, + } }, mixins: [AppManagement, SvgFilterMixin], props: { @@ -206,9 +215,6 @@ export default { }, methods: { - mdiCogOutline() { - return mdiCogOutline - }, prefix(prefix, content) { return prefix + '_' + content }, diff --git a/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue b/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue index 4772b97ecf6..f70696f4100 100644 --- a/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue +++ b/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue @@ -49,7 +49,7 @@ :value="t('settings', 'Update to {version}', { version: app.update })" :disabled="installing || isLoading || isManualInstall" @click="update(app.id)"> - <input v-if="app.canUnInstall || app.canUninstall" + <input v-if="app.canUnInstall" class="uninstall" type="button" :value="t('settings', 'Remove')" @@ -81,7 +81,7 @@ <p v-if="!defaultDeployDaemonAccessible" class="warning"> {{ t('settings', 'Default Deploy daemon is not accessible') }} </p> - <NcCheckboxRadioSwitch v-if="app.canUnInstall || app.canUninstall" + <NcCheckboxRadioSwitch v-if="app.canUnInstall" :checked="removeData" :disabled="installing || isLoading || !defaultDeployDaemonAccessible" @update:checked="toggleRemoveData"> @@ -113,7 +113,7 @@ <NcDateTime :timestamp="lastModified" /> </div> - <div v-if="appAuthors" class="app-details__section"> + <div class="app-details__section"> <h4> {{ t('settings', 'Author') }} </h4> @@ -122,7 +122,7 @@ </p> </div> - <div v-if="appCategories" class="app-details__section"> + <div class="app-details__section"> <h4> {{ t('settings', 'Categories') }} </h4> diff --git a/apps/settings/src/mixins/AppManagement.js b/apps/settings/src/mixins/AppManagement.js index 1c88267bdbf..904e8abcaff 100644 --- a/apps/settings/src/mixins/AppManagement.js +++ b/apps/settings/src/mixins/AppManagement.js @@ -8,12 +8,6 @@ import rebuildNavigation from '../service/rebuild-navigation.js' import { useAppApiStore } from '../store/app-api-store' export default { - setup() { - const appApiStore = useAppApiStore() - return { - appApiStore, - } - }, computed: { appGroups() { return this.app.groups.map(group => { return { id: group, name: group } }) diff --git a/apps/settings/src/store/app-api-store.ts b/apps/settings/src/store/app-api-store.ts index e056f5bc660..b4ac7124189 100644 --- a/apps/settings/src/store/app-api-store.ts +++ b/apps/settings/src/store/app-api-store.ts @@ -95,7 +95,7 @@ export const useAppApiStore = defineStore('app-api-apps', { } as IExAppStatus } app.active = true - app.canUninstall = false + app.canUnInstall = false app.removable = true app.error = '' } @@ -159,7 +159,7 @@ export const useAppApiStore = defineStore('app-api-apps', { if (app) { app.active = false if (app.removable) { - app.canUninstall = true + app.canUnInstall = true } } return true @@ -183,14 +183,14 @@ export const useAppApiStore = defineStore('app-api-apps', { app.active = false app.needsDownload = true app.installed = false - app.canUninstall = false + app.canUnInstall = false app.canInstall = true app.daemon = null app.status = {} if (app.update !== null) { this.updateCount-- } - app.update = null + app.update = undefined } return true }) @@ -213,7 +213,7 @@ export const useAppApiStore = defineStore('app-api-apps', { const app = this.apps.find((app) => app.id === appId) if (app) { const version = app.update - app.update = null + app.update = undefined app.version = version || app.version app.status = { type: 'update', diff --git a/apps/settings/src/views/AppStoreSidebar.vue b/apps/settings/src/views/AppStoreSidebar.vue index 1021837faaa..ab6f9e134ac 100644 --- a/apps/settings/src/views/AppStoreSidebar.vue +++ b/apps/settings/src/views/AppStoreSidebar.vue @@ -26,7 +26,7 @@ <!-- Featured/Supported badges --> <div class="app-sidebar__badges"> <AppLevelBadge :level="app.level" /> - <AppDaemonBadge v-if="app?.app_api && app?.daemon" :daemon="app.daemon" /> + <AppDaemonBadge v-if="app.app_api && app.daemon" :daemon="app.daemon" /> <AppScore v-if="hasRating" :score="rating" /> </div> </template> |