diff options
author | Andrey Borysenko <andrey18106x@gmail.com> | 2024-10-14 16:46:35 +0300 |
---|---|---|
committer | Andrey Borysenko <andrey18106x@gmail.com> | 2024-10-30 20:36:55 +0200 |
commit | a29e17001258a4f7ed9b47bea2c083b1fb150f52 (patch) | |
tree | 0df0c65f96691396849d0f58ca117341f00963af /apps | |
parent | 9e694d12baa3ee70d650b3ef15d1bd4d00153bb2 (diff) | |
download | nextcloud-server-a29e17001258a4f7ed9b47bea2c083b1fb150f52.tar.gz nextcloud-server-a29e17001258a4f7ed9b47bea2c083b1fb150f52.zip |
fix(ci): resolve eslint errors
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/src/app-types.ts | 14 | ||||
-rw-r--r-- | apps/settings/src/components/AppList.vue | 23 | ||||
-rw-r--r-- | apps/settings/src/components/AppList/AppDaemonBadge.vue | 2 | ||||
-rw-r--r-- | apps/settings/src/components/AppList/AppItem.vue | 6 | ||||
-rw-r--r-- | apps/settings/src/components/AppStoreSidebar/AppDeployDaemonTab.vue | 1 | ||||
-rw-r--r-- | apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue | 6 | ||||
-rw-r--r-- | apps/settings/src/mixins/AppManagement.js | 22 | ||||
-rw-r--r-- | apps/settings/src/store/app_api_apps.js | 5 | ||||
-rw-r--r-- | apps/settings/src/store/apps.js | 2 | ||||
-rw-r--r-- | apps/settings/src/store/index.js | 4 | ||||
-rw-r--r-- | apps/settings/src/views/AppStore.vue | 9 | ||||
-rw-r--r-- | apps/settings/src/views/AppStoreSidebar.vue | 2 |
12 files changed, 53 insertions, 43 deletions
diff --git a/apps/settings/src/app-types.ts b/apps/settings/src/app-types.ts index 77a1b6797f3..3ce2aa1648c 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 7f7d357ba35..3f8fa85039b 100644 --- a/apps/settings/src/components/AppList.vue +++ b/apps/settings/src/components/AppList.vue @@ -168,7 +168,10 @@ export default { return this.apps.filter(app => app.update).length }, loading() { - return this.$store.getters.loading('list') + if (!this.$store.getters['appApiApps/isAppApiEnabled']) { + return this.$store.getters.loading('list') + } + return this.$store.getters.loading('list') || this.$store.getters['appApiApps/loading']('list') }, hasPendingUpdate() { return this.apps.filter(app => app.update).length > 0 @@ -177,7 +180,9 @@ export default { return this.hasPendingUpdate && this.useListView }, apps() { - const apps = this.$store.getters.getAllApps + // Exclude ExApps from the list if AppAPI is disabled + 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) { const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name @@ -304,12 +309,14 @@ export default { const limit = pLimit(1) this.apps .filter(app => app.update) - .map((app) => limit(() => { - if (app?.app_api) { - this.$store.dispatch('app_api_apps/updateApp', { appId: app.id }) - } - this.update(app.id) - })) + .map(app => limit(() => { + let type = 'updateApp' + if (app?.app_api) { + type = 'app_api_apps/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 1a46d3c7ebb..1a5cd5bbea3 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 }>() </script> diff --git a/apps/settings/src/components/AppList/AppItem.vue b/apps/settings/src/components/AppList/AppItem.vue index 189eee7cd93..e837a9b07ca 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`)"> <div v-if="(listView && !app.preview && !app?.app_api) || (!listView && !screenshotLoaded && !app?.app_api)" class="icon-settings-dark" /> <NcIconSvgWrapper v-else-if="(listView && app?.app_api && !app.preview) || (!listView && !screenshotLoaded && app?.app_api)" - :path="mdiCogOutline()" - :size="listView ? 24 : 48" - style="min-width: auto; min-height: auto; height: 100%;"/> + :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" width="32" diff --git a/apps/settings/src/components/AppStoreSidebar/AppDeployDaemonTab.vue b/apps/settings/src/components/AppStoreSidebar/AppDeployDaemonTab.vue index 6f223f821d3..8eb8f943ea4 100644 --- a/apps/settings/src/components/AppStoreSidebar/AppDeployDaemonTab.vue +++ b/apps/settings/src/components/AppStoreSidebar/AppDeployDaemonTab.vue @@ -34,7 +34,6 @@ defineProps<{ }>() </script> - <style scoped lang="scss"> .daemon { padding: 20px; diff --git a/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue b/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue index a3723dc3a79..b732c5b82f5 100644 --- a/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue +++ b/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue @@ -79,9 +79,9 @@ @click="forceEnable(app.id)"> </div> <NcCheckboxRadioSwitch v-if="app.canUnInstall" - :checked="removeData" - :disabled="installing || isLoading || !defaultDeployDaemonAccessible" - @update:checked="toggleRemoveData"> + :checked="removeData" + :disabled="installing || isLoading || !defaultDeployDaemonAccessible" + @update:checked="toggleRemoveData"> {{ t('settings', 'Delete data on remove') }} </NcCheckboxRadioSwitch> </div> diff --git a/apps/settings/src/mixins/AppManagement.js b/apps/settings/src/mixins/AppManagement.js index ae7ab7b096c..4edfa741d07 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 }) .catch((error) => { showError(error) }) diff --git a/apps/settings/src/store/app_api_apps.js b/apps/settings/src/store/app_api_apps.js index 4e505e6d8c8..390f1f4db1a 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 986fed396c0..95382c2aacb 100644 --- a/apps/settings/src/store/apps.js +++ b/apps/settings/src/store/apps.js @@ -103,7 +103,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 2cf8767b904..62dab7246fc 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 5be2b118b9f..0c922ce7296 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')) }) </script> diff --git a/apps/settings/src/views/AppStoreSidebar.vue b/apps/settings/src/views/AppStoreSidebar.vue index fc2b94d8ee0..bb60e425308 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 |