Skip to content

Commit

Permalink
Merge pull request #44092 from nextcloud/feat/refactor-app-account-ma…
Browse files Browse the repository at this point in the history
…nagement

feat: Refactor app & account management UI code
  • Loading branch information
susnux authored Mar 11, 2024
2 parents f4beb95 + fc73bd0 commit 8ad8280
Show file tree
Hide file tree
Showing 123 changed files with 2,052 additions and 1,062 deletions.
70 changes: 70 additions & 0 deletions apps/settings/src/app-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* @copyright Copyright (c) 2024 Ferdinand Thiessen <opensource@fthiessen.de>
*
* @author Ferdinand Thiessen <opensource@fthiessen.de>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

export interface IAppstoreCategory {
/**
* The category ID
*/
id: string
/**
* The display name (can be localized)
*/
displayName: string
/**
* Inline SVG path
*/
icon: string
}

export interface IAppstoreAppRelease {
version: string
translations: {
[key: string]: {
changelog: string
}
}
}

export interface IAppstoreApp {
id: string
name: string
summary: string
description: string
licence: string
author: string[] | Record<string, string>
level: number
version: string
category: string|string[]

preview?: string
screenshot?: string

active: boolean
internal: boolean
removeable: boolean
installed: boolean
canInstall: boolean
canUninstall: boolean
isCompatible: boolean

appstoreData: Record<string, never>
releases: IAppstoreAppRelease[]
}
262 changes: 0 additions & 262 deletions apps/settings/src/components/AppDetails.vue

This file was deleted.

34 changes: 31 additions & 3 deletions apps/settings/src/components/AppList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
</template>

<script>
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import AppItem from './AppList/AppItem.vue'
import PrefixMixin from './PrefixMixin.vue'
import pLimit from 'p-limit'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand All @@ -150,8 +150,19 @@ export default {
AppItem,
NcButton,
},
mixins: [PrefixMixin],
props: ['category', 'app', 'search'],
props: {
category: {
type: String,
required: true,
},
},
data() {
return {
search: '',
}
},
computed: {
counter() {
return this.apps.filter(app => app.update).length
Expand Down Expand Up @@ -249,7 +260,24 @@ export default {
}
},
},
beforeDestroy() {
unsubscribe('nextcloud:unified-search.search', this.setSearch)
unsubscribe('nextcloud:unified-search.reset', this.resetSearch)
},
beforeCreate() {
subscribe('nextcloud:unified-search.search', this.setSearch)
subscribe('nextcloud:unified-search.reset', this.resetSearch)
},
methods: {
setSearch(value) {
this.search = value
},
resetSearch() {
this.search = ''
},
toggleBundle(id) {
if (this.allBundlesEnabled(id)) {
return this.disableBundle(id)
Expand Down
Loading

0 comments on commit 8ad8280

Please sign in to comment.