Skip to content

Commit a5fcfdf

Browse files
committed
fix: move download and enable button to outside of details tab
Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
1 parent 1219c8e commit a5fcfdf

File tree

8 files changed

+241
-193
lines changed

8 files changed

+241
-193
lines changed

apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue

Lines changed: 0 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -12,102 +12,6 @@
1212
<NcIconSvgWrapper :path="mdiTextBoxOutline" />
1313
</template>
1414
<div class="app-details">
15-
<div class="app-details__actions">
16-
<div v-if="app.active && canLimitToGroups(app)" class="app-details__actions-groups">
17-
<input
18-
:id="`groups_enable_${app.id}`"
19-
v-model="groupCheckedAppsData"
20-
type="checkbox"
21-
:value="app.id"
22-
class="groups-enable__checkbox checkbox"
23-
@change="setGroupLimit">
24-
<label :for="`groups_enable_${app.id}`">{{ t('settings', 'Limit to groups') }}</label>
25-
<input
26-
type="hidden"
27-
class="group_select"
28-
:title="t('settings', 'All')"
29-
value="">
30-
<br>
31-
<label for="limitToGroups">
32-
<span>{{ t('settings', 'Limit app usage to groups') }}</span>
33-
</label>
34-
<NcSelect
35-
v-if="isLimitedToGroups(app)"
36-
input-id="limitToGroups"
37-
:options="groups"
38-
:model-value="appGroups"
39-
:limit="5"
40-
label="name"
41-
:multiple="true"
42-
keep-open
43-
@option:selected="addGroupLimitation"
44-
@option:deselected="removeGroupLimitation"
45-
@search="asyncFindGroup">
46-
<span slot="noResult">{{ t('settings', 'No results') }}</span>
47-
</NcSelect>
48-
</div>
49-
<div class="app-details__actions-manage">
50-
<input
51-
v-if="app.update"
52-
class="update primary"
53-
type="button"
54-
:value="t('settings', 'Update to {version}', { version: app.update })"
55-
:disabled="installing || isLoading || isManualInstall"
56-
@click="update(app.id)">
57-
<input
58-
v-if="app.canUnInstall"
59-
class="uninstall"
60-
type="button"
61-
:value="t('settings', 'Remove')"
62-
:disabled="installing || isLoading"
63-
@click="remove(app.id, removeData)">
64-
<input
65-
v-if="app.active"
66-
class="enable"
67-
type="button"
68-
:value="disableButtonText"
69-
:disabled="installing || isLoading || isInitializing || isDeploying"
70-
@click="disable(app.id)">
71-
<input
72-
v-if="!app.active && (app.canInstall || app.isCompatible)"
73-
:title="enableButtonTooltip"
74-
:aria-label="enableButtonTooltip"
75-
class="enable primary"
76-
type="button"
77-
:value="enableButtonText"
78-
:disabled="!app.canInstall || installing || isLoading || !defaultDeployDaemonAccessible || isInitializing || isDeploying"
79-
@click="enableButtonAction">
80-
<input
81-
v-else-if="!app.active && !app.canInstall"
82-
:title="forceEnableButtonTooltip"
83-
:aria-label="forceEnableButtonTooltip"
84-
class="enable force"
85-
type="button"
86-
:value="forceEnableButtonText"
87-
:disabled="installing || isLoading"
88-
@click="forceEnable(app.id)">
89-
<NcButton
90-
v-if="app?.app_api && (app.canInstall || app.isCompatible)"
91-
:aria-label="t('settings', 'Advanced deploy options')"
92-
variant="secondary"
93-
@click="() => showDeployOptionsModal = true">
94-
<template #icon>
95-
<NcIconSvgWrapper :path="mdiToyBrickPlusOutline" />
96-
</template>
97-
{{ t('settings', 'Deploy options') }}
98-
</NcButton>
99-
</div>
100-
<p v-if="!defaultDeployDaemonAccessible" class="warning">
101-
{{ t('settings', 'Default Deploy daemon is not accessible') }}
102-
</p>
103-
<NcCheckboxRadioSwitch
104-
v-if="app.canUnInstall"
105-
:model-value="removeData"
106-
:disabled="installing || isLoading || !defaultDeployDaemonAccessible"
107-
@update:modelValue="toggleRemoveData">
108-
{{ t('settings', 'Delete data on remove') }}
109-
</NcCheckboxRadioSwitch>
110-
</div>
11115

11216
<ul class="app-details__dependencies">
11317
<li v-if="app.missingMinOwnCloudVersion">
@@ -208,10 +112,6 @@
208112
</div>
209113
</div>
210114

211-
<AppDeployOptionsModal
212-
v-if="app?.app_api"
213-
:show.sync="showDeployOptionsModal"
214-
:app="app" />
215115
<DaemonSelectionDialog
216116
v-if="app?.app_api"
217117
:show.sync="showSelectDaemonModal"
@@ -226,14 +126,10 @@ import { mdiBugOutline, mdiFeatureSearchOutline, mdiStar, mdiTextBoxOutline, mdi
226126
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
227127
import NcAppSidebarTab from '@nextcloud/vue/components/NcAppSidebarTab'
228128
import NcButton from '@nextcloud/vue/components/NcButton'
229-
import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'
230129
import NcDateTime from '@nextcloud/vue/components/NcDateTime'
231130
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
232-
import NcSelect from '@nextcloud/vue/components/NcSelect'
233131
import DaemonSelectionDialog from '../AppAPI/DaemonSelectionDialog.vue'
234-
import AppDeployOptionsModal from './AppDeployOptionsModal.vue'
235132
import AppManagement from '../../mixins/AppManagement.js'
236-
import { useAppApiStore } from '../../store/app-api-store.js'
237133
import { useAppsStore } from '../../store/apps-store.js'
238134
239135
export default {
@@ -244,9 +140,6 @@ export default {
244140
NcButton,
245141
NcDateTime,
246142
NcIconSvgWrapper,
247-
NcSelect,
248-
NcCheckboxRadioSwitch,
249-
AppDeployOptionsModal,
250143
DaemonSelectionDialog,
251144
},
252145
@@ -261,11 +154,9 @@ export default {
261154
262155
setup() {
263156
const store = useAppsStore()
264-
const appApiStore = useAppApiStore()
265157
266158
return {
267159
store,
268-
appApiStore,
269160
270161
productName: window.OC.theme.productName,
271162
@@ -409,29 +300,10 @@ export default {
409300
},
410301
411302
methods: {
412-
toggleRemoveData() {
413-
this.removeData = !this.removeData
414-
},
415-
416303
showSelectionModal(deployOptions = null) {
417304
this.deployOptions = deployOptions
418305
this.showSelectDaemonModal = true
419306
},
420-
421-
async enableButtonAction() {
422-
if (!this.app?.app_api) {
423-
this.enable(this.app.id)
424-
return
425-
}
426-
await this.appApiStore.fetchDockerDaemons()
427-
if (this.appApiStore.dockerDaemons.length === 1 && this.app.needsDownload) {
428-
this.enable(this.app.id, this.appApiStore.dockerDaemons[0])
429-
} else if (this.app.needsDownload) {
430-
this.showSelectionModal()
431-
} else {
432-
this.enable(this.app.id, this.app.daemon)
433-
}
434-
},
435307
},
436308
}
437309
</script>
@@ -440,21 +312,6 @@ export default {
440312
.app-details {
441313
padding: 20px;
442314
443-
&__actions {
444-
// app management
445-
&-manage {
446-
// if too many, shrink them and ellipsis
447-
display: flex;
448-
align-items: center;
449-
input {
450-
flex: 0 1 auto;
451-
min-width: 0;
452-
text-overflow: ellipsis;
453-
white-space: nowrap;
454-
overflow: hidden;
455-
}
456-
}
457-
}
458315
&__authors {
459316
color: var(--color-text-maxcontrast);
460317
}

0 commit comments

Comments
 (0)