File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
AppNavigation/AppointmentConfigList Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 3131 </ActionButton >
3232 <ActionButton
3333 :close-after-click =" true"
34- @click =" showModal = true" >
34+ @click =" duplicate" >
35+ <template #icon >
36+ <ContentDuplicate :size =" 20" />
37+ </template >
38+ {{ t('calendar', 'Duplicate') }}
39+ </ActionButton >
40+ <ActionButton
41+ :close-after-click =" true"
42+ @click =" openEditModal" >
3543 <template #icon >
3644 <PencilIcon :size =" 20" />
3745 </template >
4957 </AppNavigationItem >
5058 <AppointmentConfigModal
5159 v-if =" showModal"
52- :is-new =" false"
60+ :is-new =" isDuplicate"
61+ :is-duplicate =" isDuplicate"
5362 :config =" config"
5463 @close =" closeModal" />
5564 </div >
@@ -63,6 +72,7 @@ import {
6372 NcAppNavigationItem as AppNavigationItem ,
6473} from ' @nextcloud/vue'
6574import CalendarCheckIcon from ' vue-material-design-icons/CalendarCheck.vue'
75+ import ContentDuplicate from ' vue-material-design-icons/ContentDuplicate.vue'
6676import LinkVariantIcon from ' vue-material-design-icons/Link.vue'
6777import OpenInNewIcon from ' vue-material-design-icons/OpenInNew.vue'
6878import PencilIcon from ' vue-material-design-icons/PencilOutline.vue'
@@ -78,6 +88,7 @@ export default {
7888 AppNavigationItem,
7989 ActionButton,
8090 ActionLink,
91+ ContentDuplicate,
8192 DeleteIcon,
8293 OpenInNewIcon,
8394 PencilIcon,
@@ -96,6 +107,7 @@ export default {
96107 return {
97108 showModal: false ,
98109 loading: false ,
110+ isDuplicate: false ,
99111 }
100112 },
101113
@@ -108,6 +120,17 @@ export default {
108120 methods: {
109121 closeModal () {
110122 this .showModal = false
123+ this .isDuplicate = false
124+ },
125+
126+ openEditModal () {
127+ this .isDuplicate = false
128+ this .showModal = true
129+ },
130+
131+ duplicate () {
132+ this .isDuplicate = true
133+ this .showModal = true
111134 },
112135
113136 async copyLink () {
Original file line number Diff line number Diff line change @@ -199,6 +199,11 @@ export default {
199199 type: Boolean ,
200200 required: true ,
201201 },
202+
203+ isDuplicate: {
204+ type: Boolean ,
205+ default: false ,
206+ },
202207 },
203208
204209 data () {
@@ -293,6 +298,10 @@ export default {
293298 reset () {
294299 this .editing = this .config .clone ()
295300
301+ if (this .isDuplicate ) {
302+ this .editing .name = ` ${ this .editing .name } ${ this .t (' calendar' , ' (copy)' )} `
303+ }
304+
296305 this .enablePreparationDuration = !! this .editing .preparationDuration
297306 this .enableFollowupDuration = !! this .editing .followupDuration
298307 this .enableFutureLimit = !! this .editing .futureLimit
You can’t perform that action at this time.
0 commit comments