Skip to content
Snippets Groups Projects
Commit 0e643a96 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch 'fix-dialog-object-forms-internal-dialog-mode-handling' into 'master'

Fix dialog-Object-Form's internal dialog-mode-handling

See merge request !1793
parents a885741c 7f18103c
No related branches found
No related tags found
1 merge request!1793Fix dialog-Object-Form's internal dialog-mode-handling
Pipeline #197789 passed with warnings
Pipeline: AlekSIS

#197790

    ...@@ -27,6 +27,7 @@ Fixed ...@@ -27,6 +27,7 @@ Fixed
    * Recurring events without until value weren't shown. * Recurring events without until value weren't shown.
    * It wasn't possible to change icons of OAuth applications in the frontend. * It wasn't possible to change icons of OAuth applications in the frontend.
    * First fetching of calendar feeds logged an error to console. * First fetching of calendar feeds logged an error to console.
    * [Dev] Dialog-Object-Form's internal dialog-mode-handling did not implement opening via activator slot.
    `4.0`_ - 2025-03-29 `4.0`_ - 2025-03-29
    ------------------- -------------------
    ......
    <template> <template>
    <mobile-fullscreen-dialog <mobile-fullscreen-dialog
    v-model="dialog" v-model="dialogMode"
    max-width="555px" max-width="555px"
    :close-button="false" :close-button="false"
    > >
    ...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
    :valid.sync="valid" :valid.sync="valid"
    @loading="handleLoading" @loading="handleLoading"
    @save="handleSave" @save="handleSave"
    @cancel="dialog = false" @cancel="dialogMode = false"
    > >
    <template v-for="(_, slot) of $scopedSlots" #[slot]="scope" <template v-for="(_, slot) of $scopedSlots" #[slot]="scope"
    ><slot :name="slot" v-bind="scope" ><slot :name="slot" v-bind="scope"
    ...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
    </template> </template>
    <template #actions> <template #actions>
    <cancel-button @click="dialog = false" :disabled="loading" /> <cancel-button @click="dialogMode = false" :disabled="loading" />
    <save-button <save-button
    @click="$refs.form.submit()" @click="$refs.form.submit()"
    :loading="loading" :loading="loading"
    ...@@ -67,22 +67,9 @@ export default { ...@@ -67,22 +67,9 @@ export default {
    }, },
    mixins: [openableDialogMixin, objectFormPropsMixin, loadingMixin], mixins: [openableDialogMixin, objectFormPropsMixin, loadingMixin],
    emits: ["cancel", "save"], emits: ["cancel", "save"],
    computed: {
    dialog: {
    get() {
    return this.value;
    },
    set(newValue) {
    this.$emit("input", newValue);
    },
    },
    },
    methods: { methods: {
    close() {
    this.dialog = false;
    },
    handleSave(items) { handleSave(items) {
    this.dialog = false; this.dialogMode = false;
    this.$emit("save", items); this.$emit("save", items);
    }, },
    }, },
    ......
    ...@@ -47,7 +47,6 @@ export default { ...@@ -47,7 +47,6 @@ export default {
    this.$emit("cancel"); this.$emit("cancel");
    }, },
    handleSuccess() { handleSuccess() {
    this.dialog = false;
    let snackbarTextKey = this.isCreate let snackbarTextKey = this.isCreate
    ? this.createSuccessMessageI18nKey ? this.createSuccessMessageI18nKey
    : this.editSuccessMessageI18nKey; : this.editSuccessMessageI18nKey;
    ......
    export default { export default {
    props: { props: {
    /** /**
    * Dialog state (open or closed) * Dialog-mode (open or closed)
    * @model * @model
    * @values true,false * @values true,false
    */ */
    ...@@ -11,4 +11,25 @@ export default { ...@@ -11,4 +11,25 @@ export default {
    }, },
    }, },
    emits: ["input"], emits: ["input"],
    data() {
    return {
    internalDialogMode: this.value,
    };
    },
    computed: {
    dialogMode: {
    get() {
    return this.internalDialogMode;
    },
    set(newValue) {
    this.internalDialogMode = newValue;
    this.$emit("input", newValue);
    },
    },
    },
    mounted() {
    this.$watch("value", (newVal) => {
    this.dialogMode = newVal;
    });
    },
    }; };
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment