Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: address review comments
Signed-off-by: Andrey Borysenko <[email protected]>
  • Loading branch information
andrey18106 committed Oct 29, 2024
commit 87327552a280f44e6699a09f8e03c312f67ce13f
7 changes: 3 additions & 4 deletions apps/settings/src/app-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export interface IAppstoreApp {
app_api: boolean
active: boolean
internal: boolean
removeable: boolean
removable: boolean
installed: boolean
canInstall: boolean
canUninstall: boolean
canUnInstall: boolean
isCompatible: boolean
needsDownload: boolean
update: string | null
update?: string

appstoreData: Record<string, never>
releases?: IAppstoreAppRelease[]
Expand Down Expand Up @@ -91,5 +91,4 @@ export interface IAppstoreExApp extends IAppstoreApp {
daemon: IDeployDaemon | null | undefined
status: IExAppStatus | Record<string, never>
error: string
removable: boolean
}
4 changes: 2 additions & 2 deletions apps/settings/src/components/AppList/AppDaemonBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</template>

<script setup lang="ts">
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import { mdiFileChart } from '@mdi/js'
import type { IDeployDaemon } from '../../app-types.ts'
import { mdiFileChart } from '@mdi/js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'

defineProps<{
daemon?: IDeployDaemon
Expand Down
22 changes: 14 additions & 8 deletions apps/settings/src/components/AppList/AppItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
class="app-image app-image-icon"
:headers="getDataItemHeaders(`app-table-col-icon`)">
<div v-if="!app?.app_api && shouldDisplayDefaultIcon" class="icon-settings-dark" />
<NcIconSvgWrapper v-else-if="app?.app_api && shouldDisplayDefaultIcon"
:path="mdiCogOutline()"
<NcIconSvgWrapper v-else-if="app.app_api && shouldDisplayDefaultIcon"
: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"
<svg v-else-if="listView && app.preview && !app.app_api"
width="32"
height="32"
viewBox="0 0 32 32">
Expand Down Expand Up @@ -83,7 +83,7 @@
@click.stop="update(app.id)">
{{ t('settings', 'Update to {update}', {update:app.update}) }}
</NcButton>
<NcButton v-if="app.canUnInstall || app.canUninstall"
<NcButton v-if="app.canUnInstall"
class="uninstall"
type="tertiary"
:disabled="installing || isLoading"
Expand Down Expand Up @@ -125,6 +125,8 @@ import SvgFilterMixin from '../SvgFilterMixin.vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import { mdiCogOutline } from '@mdi/js'
import { useAppApiStore } from '../../store/app-api-store'


export default {
name: 'AppItem',
Expand All @@ -133,7 +135,14 @@ export default {
AppScore,
NcButton,
NcIconSvgWrapper,
mdiCogOutline,
},
setup() {
const appApiStore = useAppApiStore()

return {
appApiStore,
mdiCogOutline,
}
},
mixins: [AppManagement, SvgFilterMixin],
props: {
Expand Down Expand Up @@ -206,9 +215,6 @@ export default {

},
methods: {
mdiCogOutline() {
return mdiCogOutline
},
prefix(prefix, content) {
return prefix + '_' + content
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:value="t('settings', 'Update to {version}', { version: app.update })"
:disabled="installing || isLoading || isManualInstall"
@click="update(app.id)">
<input v-if="app.canUnInstall || app.canUninstall"
<input v-if="app.canUnInstall"
class="uninstall"
type="button"
:value="t('settings', 'Remove')"
Expand Down Expand Up @@ -81,7 +81,7 @@
<p v-if="!defaultDeployDaemonAccessible" class="warning">
{{ t('settings', 'Default Deploy daemon is not accessible') }}
</p>
<NcCheckboxRadioSwitch v-if="app.canUnInstall || app.canUninstall"
<NcCheckboxRadioSwitch v-if="app.canUnInstall"
:checked="removeData"
:disabled="installing || isLoading || !defaultDeployDaemonAccessible"
@update:checked="toggleRemoveData">
Expand Down Expand Up @@ -113,7 +113,7 @@
<NcDateTime :timestamp="lastModified" />
</div>

<div v-if="appAuthors" class="app-details__section">
<div class="app-details__section">
<h4>
{{ t('settings', 'Author') }}
</h4>
Expand All @@ -122,7 +122,7 @@
</p>
</div>

<div v-if="appCategories" class="app-details__section">
<div class="app-details__section">
<h4>
{{ t('settings', 'Categories') }}
</h4>
Expand Down
6 changes: 0 additions & 6 deletions apps/settings/src/mixins/AppManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import rebuildNavigation from '../service/rebuild-navigation.js'
import { useAppApiStore } from '../store/app-api-store'

export default {
setup() {
const appApiStore = useAppApiStore()
return {
appApiStore,
}
},
computed: {
appGroups() {
return this.app.groups.map(group => { return { id: group, name: group } })
Expand Down
10 changes: 5 additions & 5 deletions apps/settings/src/store/app-api-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const useAppApiStore = defineStore('app-api-apps', {
} as IExAppStatus
}
app.active = true
app.canUninstall = false
app.canUnInstall = false
app.removable = true
app.error = ''
}
Expand Down Expand Up @@ -159,7 +159,7 @@ export const useAppApiStore = defineStore('app-api-apps', {
if (app) {
app.active = false
if (app.removable) {
app.canUninstall = true
app.canUnInstall = true
}
}
return true
Expand All @@ -183,14 +183,14 @@ export const useAppApiStore = defineStore('app-api-apps', {
app.active = false
app.needsDownload = true
app.installed = false
app.canUninstall = false
app.canUnInstall = false
app.canInstall = true
app.daemon = null
app.status = {}
if (app.update !== null) {
this.updateCount--
}
app.update = null
app.update = undefined
}
return true
})
Expand All @@ -213,7 +213,7 @@ export const useAppApiStore = defineStore('app-api-apps', {
const app = this.apps.find((app) => app.id === appId)
if (app) {
const version = app.update
app.update = null
app.update = undefined
app.version = version || app.version
app.status = {
type: 'update',
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 @@ -26,7 +26,7 @@
<!-- Featured/Supported badges -->
<div class="app-sidebar__badges">
<AppLevelBadge :level="app.level" />
<AppDaemonBadge v-if="app?.app_api && app?.daemon" :daemon="app.daemon" />
<AppDaemonBadge v-if="app.app_api && app.daemon" :daemon="app.daemon" />
<AppScore v-if="hasRating" :score="rating" />
</div>
</template>
Expand Down