Red Hat Bugzilla – Bug 1007928
File Explorer: allows to open and edit files, changes cannot be saved
Last modified: 2016-07-31 21:08:14 EDT
Description of problem:
You can open an editor for pom.xml (see bug 1007276), kmodule.xml, project.imports, .gitignore, .pom.xml, .kmodule.xml and .project.imports. You can make changes there (only revert to previous version for project.imports) but you are not allowed to save them.
It should not be possible to edit a file that cannot be saved. These files should be opened in a read-only mode.
This got fixed as a side product of "996880 - Project screen: Source not working". Clicking kmodule.xml now opens a text editor that allows hard editing of the file.
Actually taking this back, since the dot files still need to be managed.
This is not a blocker and also we need to discuss if we should or not allow . files to be editable in the UI, since they contain sensitive metadata.
Internal Whiteboard: Beta Blocker → Blocker
Not critical for Beta, but need to address for GA
(In reply to Edson Tirelli from comment #3)
> This is not a blocker and also we need to discuss if we should or not allow
> . files to be editable in the UI, since they contain sensitive metadata.
I agree that editing .pom.xml, .kmodule.xml and .project.imports should not be allowed - users have no reason to make any changes in there.
I'm not so sure about .gitignore - that could be nice to have editable, for more technical folks probably.
As for project.imports file, see bug 1008859 - it's now blank. But once it shows something, it should behave the same as pom.xml and kmodule.xml, I think.
I understand what you are after with this. I don't want the non-technical people breaking the dot files either.
And here comes the but. Kie-wb contains several perspectives. The file explorers in Author perspective hide all the dot files and the Administration perspective shows them. So I feel that we have a clear separation between the users that know not to touch dot files and the people who do not understand them.
With this separation I don't think it is a problem that the admin level user can open and even edit the files. If we take the approach that the user should not be able to edit these files then I think we should also prevent the users from editing these files with doing a direct git clone and pushing changes back to kie-wb.
Also something to keep in mind, each file in kie-wb has a dot file. To block dot file editing means the dot files can not be edited by default and we make a white list for the files that can be edited.
Since I feel that what we now have works and "fixing" the dot file issue actually causes a lot more trouble than it might fix. I propose that we close this ticket.
(In reply to Toni Rikkola from comment #6)
The file explorer from Administration perspective is also available in the Asset Repository perspective, that makes the separation a bit less clear I think.
Would it be hard to filter all files starting with a dot and by default open them in some kind of a read-only editor? There's only the .gitignore that seems reasonable to allow editing, but business folks probably wouldn't need to use it anyway. This would mean no need for a white list, right?
Anyway - please don't close this as long as it is possible to edit these files but not to save the changes. I think the dot files should be read-only, but if you decide to allow editing, also add the possibility to save it.
Ok, dot files now open into dot file editor (same as the text editor). The dot file editor only allows editing for admins. Any other user gets the editor without the save menu and with a text area that can not be changed.
This only prevents the non admins from editing the dot files if they use the dot file editor. The dot file editor is the default editor for dot files.
The one issue left is the project.imports file - covered now in bug 1039916. As the rest is fixed, I'm marking this as verified.