Skip to content
New issue

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

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

Already on GitHub? # to your account

[Enhancement]: confirmation message before saving a template #6161

Open
2 of 4 tasks
warkhos opened this issue Oct 14, 2024 · 2 comments
Open
2 of 4 tasks

[Enhancement]: confirmation message before saving a template #6161

warkhos opened this issue Oct 14, 2024 · 2 comments

Comments

@warkhos
Copy link

warkhos commented Oct 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of problem

I was able to identify that when you try to save a page as a template and you assigned a name that it's already been used for an existent template, after you hit save it'll overwrite the existent template with no confirmation message or warning.

Description of solution

I think of two possible solutions:

  1. include a text prior to save the new template like "IMPORTANT:..." this message should indicate that if you use the name for an existent template it'll automatically overwrite the existent template file and the older version will be lost.

  2. when the user click on "save" in order to create the new page template file, run through the existent templates filename in the folder and make sure there is no existent templates with the same filename; if the search results shows an existent template already using the name, the system could display a confirmation/warning message asking the user if they want to overwrite the existent template file.

Description of alternatives considered

n/a

Anything else?

n/a

Do you be plan to contribute code for this enhancement?

  • Yes

Would you be interested in sponsoring this enhancement?

  • Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jeremy-farrance
Copy link
Contributor

jeremy-farrance commented Oct 22, 2024

Since detecting on the front-end that a matching filename already exists on the backend would require a round trip to the server and a UI confirmation feels awkward (is there already a pattern like this elsewhere in the PersonaBar?), I think a simpler to implement (third) solution is to:

  1. on save, (backend, server-side) check if the filename already exists, and if it does, simply add a number to the end of the filename. This would need to loop...

As an example, I am trying to save "Provider-Profile" and there are already two files in /Templates named:

  • Provider-Profile.page.template
  • Provider-Profile-1.page.template
    ^^

So we end up saving with the name Provider-Profile-2.page.template

If there is some agreement here, I may be able to implement this one upcoming weekend.

@warkhos
Copy link
Author

warkhos commented Oct 22, 2024

Jeremy that sounds so much better. I'm okay with this solution.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants