diff --git a/frontend/src/components/activity/ScheduleEntry.vue b/frontend/src/components/activity/ScheduleEntry.vue index 75b9afa3ee..a77ba2ef66 100644 --- a/frontend/src/components/activity/ScheduleEntry.vue +++ b/frontend/src/components/activity/ScheduleEntry.vue @@ -164,11 +164,15 @@ Displays a single scheduleEntry - + @@ -31,7 +30,6 @@ import DialogForm from '@/components/dialog/DialogForm.vue' import DialogBase from '@/components/dialog/DialogBase.vue' import DialogActivityForm from './DialogActivityForm.vue' -import { scheduleEntryRoute } from '@/router.js' export default { name: 'DialogActivityEdit', @@ -39,6 +37,10 @@ export default { extends: DialogBase, props: { scheduleEntry: { type: Object, required: true }, + hideHeaderFields: { + type: Boolean, + default: false, + }, }, data() { return { @@ -47,12 +49,12 @@ export default { } }, computed: { - scheduleEntries() { - return this.activity.scheduleEntries() - }, activity() { return this.scheduleEntry.activity() }, + scheduleEntries() { + return this.activity.scheduleEntries() + }, }, watch: { showDialog: async function (showDialog) { @@ -113,6 +115,9 @@ export default { // patch activity entity const activityPayload = { ...this.entityData } + if (this.hideHeaderFields) { + delete activityPayload.location + } delete activityPayload.scheduleEntries promises.push(this.api.patch(this.entityUri, activityPayload)) @@ -128,7 +133,6 @@ export default { this.close() this.$emit('activity-updated', data) }, - scheduleEntryRoute, }, } diff --git a/frontend/src/components/program/DialogActivityForm.vue b/frontend/src/components/activity/dialog/DialogActivityForm.vue similarity index 87% rename from frontend/src/components/program/DialogActivityForm.vue rename to frontend/src/components/activity/dialog/DialogActivityForm.vue index f1d9c7b5eb..13b0f0ecc5 100644 --- a/frontend/src/components/program/DialogActivityForm.vue +++ b/frontend/src/components/activity/dialog/DialogActivityForm.vue @@ -36,11 +36,12 @@ - + @@ -69,10 +70,18 @@ export default { type: Object, required: true, }, + currentScheduleEntry: { + type: Object, + required: true, + }, autoselectTitle: { type: Boolean, default: false, }, + hideLocation: { + type: Boolean, + default: false, + }, }, data() { return { diff --git a/frontend/src/components/program/FormScheduleEntryItem.vue b/frontend/src/components/activity/dialog/FormScheduleEntryItem.vue similarity index 97% rename from frontend/src/components/program/FormScheduleEntryItem.vue rename to frontend/src/components/activity/dialog/FormScheduleEntryItem.vue index 2726ce06a6..fe35687130 100644 --- a/frontend/src/components/program/FormScheduleEntryItem.vue +++ b/frontend/src/components/activity/dialog/FormScheduleEntryItem.vue @@ -50,7 +50,7 @@ - + @@ -82,9 +82,9 @@ export default { }, // true if current item is the last scheduleEntry - isLastItem: { + deletable: { type: Boolean, - required: true, + required: false, }, }, data() { diff --git a/frontend/src/components/program/FormScheduleEntryList.vue b/frontend/src/components/activity/dialog/FormScheduleEntryList.vue similarity index 90% rename from frontend/src/components/program/FormScheduleEntryList.vue rename to frontend/src/components/activity/dialog/FormScheduleEntryList.vue index 537e317fbf..d296d23600 100644 --- a/frontend/src/components/program/FormScheduleEntryList.vue +++ b/frontend/src/components/activity/dialog/FormScheduleEntryList.vue @@ -4,7 +4,7 @@ - {{ $tc('components.program.formScheduleEntryList.name') }} + {{ $tc('components.activity.dialog.formScheduleEntryList.name') }} @@ -47,6 +51,11 @@ export default { required: true, }, + currentScheduleEntry: { + type: Object, + required: true, + }, + // all available periods periods: { type: Array, diff --git a/frontend/src/components/program/DialogActivityCreate.vue b/frontend/src/components/program/DialogActivityCreate.vue index 49f5a9fde8..66075847b2 100644 --- a/frontend/src/components/program/DialogActivityCreate.vue +++ b/frontend/src/components/program/DialogActivityCreate.vue @@ -106,7 +106,7 @@