-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
refactor(appstore): migrate to Typescript and Vue 3 #57290
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5abb879
perf(appstore): only send what is needed in app listing
susnux c62eae5
refactor(appstore): prepare Vue 3 migration
susnux 28d7132
refactor(appstore): migrate markdown component to Typescript
susnux a524610
refactor(appstore): migrate daemon selection dialog to Typescript and…
susnux ff45fb8
refactor(appstore): migrate app discover section to Vue 3
susnux a4d8b3b
refactor(appstore): migrate app management views to Vue 3 and Typescript
susnux 26ef27b
refactor(appstore): migrate app bundles view to Vue 3
susnux 3b1ed57
refactor(appstore): migrate app level badge to css modules
susnux 5e7f45a
refactor(appstore): migrate sidebar to Vue 3 and Typescript
susnux 9f8745f
refactor(appstore): migrate appstore views to Vue 3 and Typescript
susnux b0d3643
refactor(appstore): handle in-app-search of appstore
susnux ed30b19
test(appstore): adjust cypress tests for app split
susnux e03f486
chore: fix psalm issues
susnux 7d8e640
chore: compile assets
susnux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| <!-- | ||
| - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
| - SPDX-License-Identifier: AGPL-3.0-or-later | ||
| --> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { t } from '@nextcloud/l10n' | ||
| import { computed } from 'vue' | ||
| import { useRoute } from 'vue-router' | ||
| import NcAppContent from '@nextcloud/vue/components/NcAppContent' | ||
| import NcContent from '@nextcloud/vue/components/NcContent' | ||
| import AppstoreNavigation from './views/AppstoreNavigation.vue' | ||
| import AppstoreSidebar from './views/AppstoreSidebar.vue' | ||
| import { APPSTORE_CATEGORY_NAMES } from './constants.ts' | ||
| import { useAppsStore } from './store/apps.ts' | ||
|
|
||
| const route = useRoute() | ||
| const store = useAppsStore() | ||
|
|
||
| const currentCategory = computed(() => { | ||
| if (route.params.category) { | ||
| return [route.params.category].flat()[0]! | ||
| } | ||
| if (route.name === 'apps-bundles') { | ||
| return 'bundles' | ||
| } else if (route.name === 'apps-search') { | ||
| return 'search' | ||
| } | ||
| return 'discover' | ||
| }) | ||
|
|
||
| const heading = computed(() => { | ||
| if (currentCategory.value in APPSTORE_CATEGORY_NAMES) { | ||
| return APPSTORE_CATEGORY_NAMES[currentCategory.value] | ||
| } | ||
| return store.getCategoryById(currentCategory.value)?.displayName ?? currentCategory.value | ||
| }) | ||
| const pageTitle = computed(() => `${heading.value} - ${t('appstore', 'App store')}`) | ||
|
|
||
| const showSidebar = computed(() => !!route.params.id) | ||
| </script> | ||
|
|
||
| <template> | ||
| <NcContent appName="appstore"> | ||
| <AppstoreNavigation /> | ||
| <NcAppContent | ||
| :class="$style.appstoreApp__content" | ||
| :pageHeading="t('appstore', 'App store')" | ||
| :pageTitle> | ||
| <h2 v-if="heading" :class="$style.appstoreApp__heading"> | ||
| {{ heading }} | ||
| </h2> | ||
| <router-view /> | ||
| </NcAppContent> | ||
| <AppstoreSidebar v-if="showSidebar" /> | ||
| </NcContent> | ||
| </template> | ||
|
|
||
| <style module> | ||
| .appstoreApp__content { | ||
| padding-inline-end: var(--body-container-margin); | ||
| position: relative; | ||
| } | ||
|
|
||
| .appstoreApp__heading { | ||
| margin-block-start: var(--app-navigation-padding); | ||
| margin-inline-start: calc(var(--default-clickable-area) + var(--app-navigation-padding) * 2); | ||
| min-height: var(--default-clickable-area); | ||
| line-height: var(--default-clickable-area); | ||
| vertical-align: center; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /*! | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| import type { IAppstoreApp, IAppstoreExApp } from '../apps.d.ts' | ||
| import type { AppAction } from './index.ts' | ||
|
|
||
| import { mdiClose } from '@mdi/js' | ||
| import { t } from '@nextcloud/l10n' | ||
| import { useAppsStore } from '../store/apps.ts' | ||
| import { canDisable } from '../utils/appStatus.ts' | ||
|
|
||
| export const actionDisable: AppAction = { | ||
| id: 'disable', | ||
| icon: mdiClose, | ||
| order: 10, | ||
| enabled: canDisable, | ||
| label: () => t('appstore', 'Disable'), | ||
| async callback(app: IAppstoreApp | IAppstoreExApp) { | ||
| const store = useAppsStore() | ||
| await store.disableApp(app.id) | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /*! | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| import type { IAppstoreApp, IAppstoreExApp } from '../apps.d.ts' | ||
| import type { AppAction } from './index.ts' | ||
|
|
||
| import { mdiCheck } from '@mdi/js' | ||
| import { t } from '@nextcloud/l10n' | ||
| import { useAppsStore } from '../store/apps.ts' | ||
| import { canEnable, canInstall } from '../utils/appStatus.ts' | ||
|
|
||
| export const actionEnable: AppAction = { | ||
| id: 'enable', | ||
| icon: mdiCheck, | ||
| order: 1, | ||
| variant: 'primary', | ||
| enabled(app: IAppstoreApp | IAppstoreExApp) { | ||
| return !canInstall(app) && canEnable(app) | ||
| }, | ||
| label: () => t('appstore', 'Enable'), | ||
| async callback(app: IAppstoreApp | IAppstoreExApp) { | ||
| const store = useAppsStore() | ||
| await store.enableApp(app.id) | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /*! | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| import type { IAppstoreApp, IAppstoreExApp } from '../apps.d.ts' | ||
| import type { AppAction } from './index.ts' | ||
|
|
||
| import { mdiAlertCircleCheckOutline } from '@mdi/js' | ||
| import { t } from '@nextcloud/l10n' | ||
| import { useAppsStore } from '../store/apps.ts' | ||
| import { canForceEnable, canInstall, needForceEnable } from '../utils/appStatus.ts' | ||
|
|
||
| export const actionForceEnable: AppAction = { | ||
| id: 'force-enable', | ||
| icon: mdiAlertCircleCheckOutline, | ||
| order: 3, | ||
| inline: false, | ||
| variant: 'warning', | ||
| label: () => t('appstore', 'Force enable'), | ||
| enabled(app: IAppstoreApp | IAppstoreExApp) { | ||
| return !canInstall(app) && canForceEnable(app) && needForceEnable(app) | ||
| }, | ||
| async callback(app: IAppstoreApp | IAppstoreExApp) { | ||
| const store = useAppsStore() | ||
| await store.forceEnableApp(app.id) | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /*! | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| import type { IAppstoreApp, IAppstoreExApp } from '../apps.d.ts' | ||
| import type { AppAction } from './index.ts' | ||
|
|
||
| import { mdiDownload } from '@mdi/js' | ||
| import { t } from '@nextcloud/l10n' | ||
| import { useAppsStore } from '../store/apps.ts' | ||
| import { canInstall, needForceEnable } from '../utils/appStatus.ts' | ||
|
|
||
| export const actionInstall: AppAction = { | ||
| id: 'install', | ||
| icon: mdiDownload, | ||
| order: 5, | ||
| enabled(app) { | ||
| return canInstall(app) && !needForceEnable(app) | ||
| }, | ||
| label: (app: IAppstoreApp | IAppstoreExApp) => { | ||
| if (app.app_api) { | ||
| return t('appstore', 'Deploy and enable') | ||
| } | ||
| if (app.needsDownload) { | ||
| return t('appstore', 'Download and enable') | ||
| } | ||
| return t('appstore', 'Install and enable') | ||
| }, | ||
| async callback(app: IAppstoreApp | IAppstoreExApp) { | ||
| const store = useAppsStore() | ||
| await store.enableApp(app.id) | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /*! | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| import type { IAppstoreApp, IAppstoreExApp } from '../apps.d.ts' | ||
| import type { AppAction } from './index.ts' | ||
|
|
||
| import { mdiDownload } from '@mdi/js' | ||
| import { t } from '@nextcloud/l10n' | ||
| import { useAppsStore } from '../store/apps.ts' | ||
| import { canInstall, needForceEnable } from '../utils/appStatus.ts' | ||
|
|
||
| export const actionInstallForced: AppAction = { | ||
| id: 'install-forced', | ||
| icon: mdiDownload, | ||
| order: 5, | ||
| inline: false, | ||
| enabled(app) { | ||
| return canInstall(app) && needForceEnable(app) | ||
| }, | ||
| label: (app: IAppstoreApp | IAppstoreExApp) => { | ||
| if (app.app_api) { | ||
| return t('appstore', 'Deploy and force enable') | ||
| } | ||
| if (app.needsDownload) { | ||
| return t('appstore', 'Download and force enable') | ||
| } | ||
| return t('appstore', 'Install and force enable') | ||
| }, | ||
| async callback(app: IAppstoreApp | IAppstoreExApp) { | ||
| const store = useAppsStore() | ||
| await store.enableApp(app.id, true) | ||
| }, | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.