Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions apps/appstore/lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function listCategories(): DataResponse {
* Get all available apps
*
* @param bool $details - Whether to include detailed appstore information about the app
* @return DataResponse<Http::STATUS_OK, list<array{id: string, name: string, groups: list<string>, internal: bool, isCompatible: bool, missingDependencies?: list<string>, missingMaxNextcloudVersion: bool, missingMinNextcloudVersion: bool, ...<array-key, mixed>}>, array{}>
* @return DataResponse<Http::STATUS_OK, list<array{id: string, name: string, groups: list<string>, internal: bool, isCompatible: bool, missingDependencies?: list<string>, ...<array-key, mixed>}>, array{}>
*
* 200: The apps were found successfully
*/
Expand Down Expand Up @@ -132,17 +132,14 @@ public function listApps(bool $details = false): DataResponse {
$ignoreMax = in_array($appData['id'], $ignoreMaxApps);
$missing = $this->dependencyAnalyzer->analyze($appData, $ignoreMax);
$appData['missingDependencies'] = $missing;

$appData['missingMinNextcloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['min-version']);
$appData['missingMaxNextcloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['max-version']);
$appData['isCompatible'] = $this->dependencyAnalyzer->isMarkedCompatible($appData);
$appData['internal'] = in_array($appData['id'], $this->appManager->getAlwaysEnabledApps());

return $appData;
}, $apps);

/**
* @var list<array{id: string, name: string, groups: list<string>, internal: bool, isCompatible: bool, missingDependencies?: list<string>, missingMaxNextcloudVersion: bool, missingMinNextcloudVersion: bool, ...<array-key, mixed>}> $apps
* @var list<array{id: string, name: string, groups: list<string>, internal: bool, isCompatible: bool, missingDependencies?: list<string>, ...<array-key, mixed>}> $apps
*/
usort($apps, $this->sortApps(...));
return new DataResponse($apps);
Expand Down Expand Up @@ -474,8 +471,6 @@ private function getAppsForCategory(string $requestedCategory = ''): array {
$phpDependencies
),
'level' => ($app['isFeatured'] === true) ? 200 : 100,
'missingMaxNextcloudVersion' => false,
'missingMinNextcloudVersion' => false,
'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($app['screenshots'][0]['url']) : '',
'ratingOverall' => $app['ratingOverall'],
'ratingNumOverall' => $app['ratingNumOverall'],
Expand Down
10 changes: 1 addition & 9 deletions apps/appstore/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@
"name",
"groups",
"internal",
"isCompatible",
"missingMaxNextcloudVersion",
"missingMinNextcloudVersion"
"isCompatible"
],
"properties": {
"id": {
Expand All @@ -275,12 +273,6 @@
"items": {
"type": "string"
}
},
"missingMaxNextcloudVersion": {
"type": "boolean"
},
"missingMinNextcloudVersion": {
"type": "boolean"
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions apps/appstore/src/apps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export interface IAppstoreAppResponse extends IAppInfoData, Partial<IAppstoreMet

// App dependency information
dependencies: unknown
missingMaxNextcloudVersion: boolean
missingMinNextcloudVersion: boolean

// App state information

Expand Down
12 changes: 0 additions & 12 deletions apps/appstore/src/components/AppstoreSidebar/AppDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import type { IAppstoreApp, IAppstoreExApp } from '../../apps.d.ts'

import { mdiTextBoxOutline } from '@mdi/js'
import { getCapabilities } from '@nextcloud/capabilities'
import { t } from '@nextcloud/l10n'
import { computed, useId } from 'vue'
import NcAppSidebarTab from '@nextcloud/vue/components/NcAppSidebarTab'
Expand All @@ -23,8 +22,6 @@ const { app } = defineProps<{ app: IAppstoreApp | IAppstoreExApp }>()

const store = useAppsStore()

// @ts-expect-error - missing types
const productName = getCapabilities().theming.productName as string
const idLimitedToGroups = useId()

const lastModified = computed(() => app.releases
Expand Down Expand Up @@ -138,15 +135,6 @@ function authorName(xmlNode): string {
<BadgeAppScore :app />
</div>

<NcNoteCard v-if="app.missingMinNextcloudVersion || app.missingMaxNextcloudVersion" type="warning">
<template v-if="app.missingMinNextcloudVersion">
{{ t('appstore', 'This app has no minimum {productName} version assigned. This will be an error in the future.', { productName }) }}
</template>
<template v-if="app.missingMaxNextcloudVersion">
{{ t('appstore', 'This app has no maximum {productName} version assigned. This will be an error in the future.', { productName }) }}
</template>
</NcNoteCard>

<NcNoteCard v-if="!app.isCompatible && app.missingDependencies && app.missingDependencies.length" type="error">
{{ t('appstore', 'This app cannot be installed because the following dependencies are not fulfilled:') }}
<ul :aria-label="t('appstore', 'Missing dependencies')" :class="$style.appstoreDetailsTab__missingDependencies">
Expand Down
10 changes: 1 addition & 9 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -17255,9 +17255,7 @@
"name",
"groups",
"internal",
"isCompatible",
"missingMaxNextcloudVersion",
"missingMinNextcloudVersion"
"isCompatible"
],
"properties": {
"id": {
Expand All @@ -17283,12 +17281,6 @@
"items": {
"type": "string"
}
},
"missingMaxNextcloudVersion": {
"type": "boolean"
},
"missingMinNextcloudVersion": {
"type": "boolean"
}
}
}
Expand Down
Loading