Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New contents in stack are deleted after publication #19

Open
wiebkevogel opened this issue Dec 3, 2019 · 1 comment
Open

New contents in stack are deleted after publication #19

wiebkevogel opened this issue Dec 3, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@wiebkevogel
Copy link
Contributor

When editing entries with several users, we have the problem that edited entries in a stack can be deleted by publishing them, for example:

User 1: is in the entry and makes a change
User 2: opens another entry from the same entry (Relationship-Fieldtype: edit) in a stack and make some changes
User 1: stores and publishes the new content
User 2: gets a notification and has only the possibility to reload the page and not save its changes any more

Suggestion would be to include a "cancel" button in the dialog, so that user 2 gets the possibility to save or continue. What did you think?

@wiebkevogel
Copy link
Contributor Author

wiebkevogel commented Dec 3, 2019

Maybe something like:

Workspace.js

        this.channel.listenForWhisper('published', ({ user, message }) => {
            Statamic.$toast.success(`Published by ${user.name}.`);
            const messageProp = message
                ? `Entry has been published by ${user.name} with the message: ${message}`
                : `Entry has been published by ${user.name} with no message.`
            Statamic.$components.append('CollaborationBlockingNotification', {
                props: { message: messageProp }
            }).on('confirm', () => window.location.reload());
        });

BlockingNotification.vue

<template>

    <modal name="confirmation-modal" :pivotY="0.1" :overflow="false">
        <div class="confirmation-modal flex flex-col h-full" slot-scope="{ close }">
            <div class="text-lg font-medium p-2 pb-0">
                Refresh Required
            </div>
            <div class="flex-1 px-2 py-3 text-grey">
                {{ message }}
            </div>
            <div class="p-2 bg-grey-20 border-t flex items-center justify-end text-sm">
                <button class="btn btn-default ml-2" @click="close">Continue without reload</button>
                <button class="btn btn-primary ml-2" @click="$emit('confirm')">Refresh</button>
            </div>
        </div>
    </modal>

</template>

<script>
export default {

    props: ['message'],

}
</script>

@duncanmcclean duncanmcclean added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants