diff --git a/apps/settings/src/app-types.ts b/apps/settings/src/app-types.ts index 77a1b6797f3cd..3ce2aa1648c9b 100644 --- a/apps/settings/src/app-types.ts +++ b/apps/settings/src/app-types.ts @@ -53,13 +53,6 @@ export interface IAppstoreApp { releases?: IAppstoreAppRelease[] } -export interface IAppstoreExApp extends IAppstoreApp { - daemon: IDeployDaemon, - status: IExAppStatus, - error: string, - app_api: boolean, -} - export interface IComputeDevice { id: string, label: string, @@ -90,3 +83,10 @@ export interface IExAppStatus { init_start_time: number, type: string, } + +export interface IAppstoreExApp extends IAppstoreApp { + daemon: IDeployDaemon, + status: IExAppStatus, + error: string, + app_api: boolean, +} diff --git a/apps/settings/src/components/AppList.vue b/apps/settings/src/components/AppList.vue index 9f53cba25e314..b9199553a9484 100644 --- a/apps/settings/src/components/AppList.vue +++ b/apps/settings/src/components/AppList.vue @@ -168,10 +168,10 @@ export default { return this.apps.filter(app => app.update).length }, loading() { - if (!this.$store.getters['app_api_apps/isAppApiEnabled']) { + if (!this.$store.getters['appApiApps/isAppApiEnabled']) { return this.$store.getters.loading('list') } - return this.$store.getters.loading('list') || this.$store.getters['app_api_apps/loading']('list') + return this.$store.getters.loading('list') || this.$store.getters['appApiApps/loading']('list') }, hasPendingUpdate() { return this.apps.filter(app => app.update).length > 0 @@ -181,7 +181,7 @@ export default { }, apps() { // Exclude ExApps from the list if AppAPI is disabled - const exApps = this.$store.getters.isAppApiEnabled ? this.$store.getters['app_api_apps/getAllApps'] : [] + const exApps = this.$store.getters.isAppApiEnabled ? this.$store.getters['appApiApps/getAllApps'] : [] const apps = [...this.$store.getters.getAllApps, ...exApps] .filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1) .sort(function(a, b) { @@ -310,13 +310,12 @@ export default { this.apps .filter(app => app.update) .map(app => limit(() => { - let type = 'updateApp' - if (app?.app_api) { - type = 'app_api_apps/updateApp' - } - this.$store.dispatch(type, { appId: app.id }) - }), - ) + let type = 'updateApp' + if (app?.app_api) { + type = 'appApiApps/updateApp' + } + this.$store.dispatch(type, { appId: app.id }) + })) }, }, } diff --git a/apps/settings/src/components/AppList/AppDaemonBadge.vue b/apps/settings/src/components/AppList/AppDaemonBadge.vue index 1a46d3c7ebb70..1a5cd5bbea3c1 100644 --- a/apps/settings/src/components/AppList/AppDaemonBadge.vue +++ b/apps/settings/src/components/AppList/AppDaemonBadge.vue @@ -16,7 +16,7 @@ import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js import { mdiFileChart } from '@mdi/js' import type { IDeployDaemon } from '../../app-types.ts' -const props = defineProps<{ +defineProps<{ daemon?: IDeployDaemon }>() diff --git a/apps/settings/src/components/AppList/AppItem.vue b/apps/settings/src/components/AppList/AppItem.vue index 96f8160534f7a..4ff51e938d271 100644 --- a/apps/settings/src/components/AppList/AppItem.vue +++ b/apps/settings/src/components/AppList/AppItem.vue @@ -16,9 +16,9 @@ :headers="getDataItemHeaders(`app-table-col-icon`)">
+ :path="mdiCogOutline()" + :size="listView ? 24 : 48" + style="min-width: auto; min-height: auto; height: 100%;" /> () -
+ :checked="removeData" + :disabled="installing || isLoading || !defaultDeployDaemonAccessible" + @update:checked="toggleRemoveData"> {{ t('settings', 'Delete data on remove') }} diff --git a/apps/settings/src/mixins/AppManagement.js b/apps/settings/src/mixins/AppManagement.js index d3ebc98db4ae5..0254b4b717216 100644 --- a/apps/settings/src/mixins/AppManagement.js +++ b/apps/settings/src/mixins/AppManagement.js @@ -13,13 +13,13 @@ export default { }, installing() { if (this.app?.app_api) { - return this.app && this.$store.getters['app_api_apps/loading']('install') + return this.app && this.$store.getters['appApiApps/loading']('install') } return this.$store.getters.loading('install') }, isLoading() { if (this.app?.app_api) { - return this.app && this.$store.getters['app_api_apps/loading'](this.app.id) + return this.app && this.$store.getters['appApiApps/loading'](this.app.id) } return this.app && this.$store.getters.loading(this.app.id) }, @@ -108,9 +108,9 @@ export default { return true } if (this.app?.daemon?.accepts_deploy_id === 'docker-install') { - return this.$store.getters['app_api_apps/getDaemonAccessible'] === true + return this.$store.getters['appApiApps/getDaemonAccessible'] === true } - return this.$store.getters['app_api_apps/getDaemonAccessible'] + return this.$store.getters['appApiApps/getDaemonAccessible'] } return true }, @@ -136,7 +136,7 @@ export default { if (this.app?.app_api) { return false } - return this.app.groups.length || this.groupCheckedAppsData; + return this.app.groups.length || this.groupCheckedAppsData }, setGroupLimit() { if (this.app?.app_api) { @@ -179,7 +179,7 @@ export default { forceEnable(appId) { let type = 'forceEnableApp' if (this.app?.app_api) { - type = 'app_api_apps/forceEnableApp' + type = 'appApiApps/forceEnableApp' } this.$store.dispatch(type, { appId, groups: [] }) .then((response) => { rebuildNavigation() }) @@ -188,7 +188,7 @@ export default { enable(appId) { let type = 'enableApp' if (this.app?.app_api) { - type = 'app_api_apps/enableApp' + type = 'appApiApps/enableApp' } this.$store.dispatch(type, { appId, groups: [] }) .then((response) => { rebuildNavigation() }) @@ -197,7 +197,7 @@ export default { disable(appId) { let type = 'disableApp' if (this.app?.app_api) { - type = 'app_api_apps/disableApp' + type = 'appApiApps/disableApp' } this.$store.dispatch(type, { appId }) .then((response) => { rebuildNavigation() }) @@ -207,7 +207,7 @@ export default { let type = 'uninstallApp' let payload = { appId } if (this.app?.app_api) { - type = 'app_api_apps/uninstallApp' + type = 'appApiApps/uninstallApp' payload = { appId, removeData } } this.$store.dispatch(type, payload) @@ -217,7 +217,7 @@ export default { install(appId) { let type = 'enableApp' if (this.app?.app_api) { - type = 'app_api_apps/enableApp' + type = 'appApiApps/enableApp' } this.$store.dispatch(type, { appId }) .then((response) => { rebuildNavigation() }) @@ -226,7 +226,7 @@ export default { update(appId) { let type = 'updateApp' if (this.app?.app_api) { - type = 'app_api_apps/updateApp' + type = 'appApiApps/updateApp' } this.$store.dispatch(type, { appId }) .then((response) => { rebuildNavigation() }) diff --git a/apps/settings/src/store/app_api_apps.js b/apps/settings/src/store/app_api_apps.js index 4e505e6d8c8fd..390f1f4db1a32 100644 --- a/apps/settings/src/store/app_api_apps.js +++ b/apps/settings/src/store/app_api_apps.js @@ -392,5 +392,8 @@ const actions = { export default { namespaced: true, // we will use AppAPI store module explicitly, since methods names are the same, we need to scope it - state, mutations, getters, actions + state, + mutations, + getters, + actions, } diff --git a/apps/settings/src/store/apps.js b/apps/settings/src/store/apps.js index 5de9628f947fb..7364f96fae2ec 100644 --- a/apps/settings/src/store/apps.js +++ b/apps/settings/src/store/apps.js @@ -102,7 +102,7 @@ const mutations = { state.apps.find(app => app.id === appId).installed = false state.apps.find(app => app.id === appId).canUnInstall = false state.apps.find(app => app.id === appId).canInstall = true - if (app.id === 'app_api') { + if (appId === 'app_api') { state.appApiEnabled = false } }, diff --git a/apps/settings/src/store/index.js b/apps/settings/src/store/index.js index 2cf8767b9046d..62dab7246fcc6 100644 --- a/apps/settings/src/store/index.js +++ b/apps/settings/src/store/index.js @@ -7,7 +7,7 @@ import Vue from 'vue' import Vuex, { Store } from 'vuex' import users from './users.js' import apps from './apps.js' -import app_api_apps from './app_api_apps.js' +import appApiApps from './app_api_apps.js' import settings from './users-settings.js' import oc from './oc.js' import { showError } from '@nextcloud/dialogs' @@ -36,7 +36,7 @@ export const useStore = () => { modules: { users, apps, - app_api_apps, + appApiApps, settings, oc, }, diff --git a/apps/settings/src/views/AppStore.vue b/apps/settings/src/views/AppStore.vue index 5be2b118b9f55..0c922ce729689 100644 --- a/apps/settings/src/views/AppStore.vue +++ b/apps/settings/src/views/AppStore.vue @@ -59,17 +59,18 @@ onBeforeMount(() => { // eslint-disable-next-line @typescript-eslint/no-explicit-any (instance?.proxy as any).$store.dispatch('getCategories', { shouldRefetchCategories: true }); // eslint-disable-next-line @typescript-eslint/no-explicit-any - (instance?.proxy as any).$store.dispatch('getAllApps'); + (instance?.proxy as any).$store.dispatch('getAllApps') + // eslint-disable-next-line @typescript-eslint/no-explicit-any if ((instance?.proxy as any).$store.getters.isAppApiEnabled) { // eslint-disable-next-line @typescript-eslint/no-explicit-any - (instance?.proxy as any).$store.dispatch('app_api_apps/getAllApps'); + (instance?.proxy as any).$store.dispatch('appApiApps/getAllApps'); // eslint-disable-next-line @typescript-eslint/no-explicit-any - (instance?.proxy as any).$store.dispatch('app_api_apps/updateAppsStatus'); + (instance?.proxy as any).$store.dispatch('appApiApps/updateAppsStatus') } }) onBeforeUnmount(() => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - clearInterval((instance?.proxy as any).$store.getters('app_api_apps/getStatusUpdater')); + clearInterval((instance?.proxy as any).$store.getters('appApiApps/getStatusUpdater')) }) diff --git a/apps/settings/src/views/AppStoreSidebar.vue b/apps/settings/src/views/AppStoreSidebar.vue index fc2b94d8ee055..bb60e425308a2 100644 --- a/apps/settings/src/views/AppStoreSidebar.vue +++ b/apps/settings/src/views/AppStoreSidebar.vue @@ -65,7 +65,7 @@ const legacyStore = useStore() const appId = computed(() => route.params.id ?? '') const app = computed(() => { if (legacyStore.getters.isAppApiEnabled) { - const exApp = legacyStore.getters['app_api_apps/getAllApps'] + const exApp = legacyStore.getters['appApiApps/getAllApps'] .find((app) => app.id === appId.value) ?? null if (exApp) { return exApp