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

Allow hiding the preview link #1798

Open
antonioribeiro opened this issue Sep 2, 2022 · 6 comments
Open

Allow hiding the preview link #1798

antonioribeiro opened this issue Sep 2, 2022 · 6 comments

Comments

@antonioribeiro
Copy link
Member

Summary

Sometime we want to have revisions, to see who's changing what, but not previews, because there's no frontend page related to that module.

Describe the solution you'd like

I believe the only way to hide the preview link is to remove HasRevisions from the model. Would be better if we could hide them by configuration, maybe on $indexOptions?

@ifox
Copy link
Member

ifox commented Sep 2, 2022

We can make this easier and better, but there is another way without disabling revisions: returning an empty array of revisions to the UI, using formData. The current UX requires preview to be enabled to restore a revision, since clicking on a revision opens the preview. When returning an empty array, revisions are not exposed to the user, the preview link is not showing, and revisions are still stored in database. If you use this approach, forceReloadOnSuccess should also be used, since without it the frontend will dynamically expose the new revision on save.

@antonioribeiro
Copy link
Member Author

It's not only about storing revisions, but being able to look at who and when is updating these records, while hiding the preview link. If we remove revisions but keep them on database it's not really useful on the CMS, unless we create something else for users to see who is changing things.

To not overcomplicate things, the revision links could stay, showing only a modal asking if the user wants to restore to that version. But ideally it should load all the inputs on the CMS, make them read-only, and change the update button to "RESTORE".

Screen Shot 2022-09-02 at 14 19 02

@ifox
Copy link
Member

ifox commented Sep 2, 2022

I was only providing a way to achieve what you were looking for because what you are describing requires internal changes to the UX, so it is not as simple as giving you the ability to hide the preview link was what I was trying to say. We can certainly find a solution, but it will require more time.

@ifox
Copy link
Member

ifox commented Sep 2, 2022

What you describe about the form when restoring a revision is also pretty much the existing behavior, it loads the form with a message indicating to the user that they are currently restoring, the button label changes too, but it currently goes through a preview where the restore button is exposed to get into the form in restore mode.

@Tofandel
Copy link
Contributor

I think there is some improvement that can be done on revisions, maybe instead of the preview we could show the fields directly in the form and highlight the ones which have been modified somehow, it does need to make it clearer what's been modified or not

We could even have a revision on a field by field basis, a bit like languages, so you have a revision icon next to a field which shows the edits that happened to that field when you click on it, and shows the old value of only that field when selecting the revision

@ifox
Copy link
Member

ifox commented Mar 12, 2024

I agree a "diff" sort of view would be great as an option, but we don't want to lose our ability to visually compare the frontend when there is a corresponding route to preview for the edited record. Even when the edited record doesn't correspond to a route, it can usually be rendered using the frontend components in which the data would be used. There is definitely a use case for non-previewable revisions, and I think our data structure could easily be rendered as a helpful diff in that case. I also researched in the past how we could apply some diff styling to the rendered frontend, to better indicate where the changes are visually, but the experience could be jarring depending on the frontend design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Next
Development

No branches or pull requests

4 participants