Skip to content

Commit

Permalink
fix(ci): resolve eslint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
  • Loading branch information
andrey18106 committed Oct 14, 2024
1 parent 90b4dc8 commit 4944dee
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 45 deletions.
14 changes: 7 additions & 7 deletions apps/settings/src/app-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
}
19 changes: 9 additions & 10 deletions apps/settings/src/components/AppList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -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 })
}))
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/src/components/AppList/AppDaemonBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions apps/settings/src/components/AppList/AppItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ defineProps<{
}>()
</script>
<style scoped lang="scss">
.daemon {
padding: 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
22 changes: 11 additions & 11 deletions apps/settings/src/mixins/AppManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down Expand Up @@ -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
},
Expand All @@ -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) {
Expand Down Expand Up @@ -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() })
Expand All @@ -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() })
Expand All @@ -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() })
Expand All @@ -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)
Expand All @@ -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() })
Expand All @@ -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() })
Expand Down
5 changes: 4 additions & 1 deletion apps/settings/src/store/app_api_apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
2 changes: 1 addition & 1 deletion apps/settings/src/store/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -36,7 +36,7 @@ export const useStore = () => {
modules: {
users,
apps,
app_api_apps,
appApiApps,
settings,
oc,
},
Expand Down
9 changes: 5 additions & 4 deletions apps/settings/src/views/AppStore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion apps/settings/src/views/AppStoreSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4944dee

Please sign in to comment.