Closed laurenwalker closed 4 years ago
I'm going to separate the Hide and Delete features into separate tickets. This ticket will be just for the feature to delete markdown sections.
The feature to hide Data and Metrics tabs are in the new ticket #1080
A lot of the code that went into completing #1080 has paved the way for this ticket. Namely, the PortEditorSectionsView now has a listener for clicks on the "Delete" menu option, which calls PortEditorSectionsView.removeSection()
. The PortalModel.removeSection()
function should be fleshed out to delete Markdown sections from the model. Then the PortEditorSectionsView
will need to remove the section link and section content from the webpage. I added a PortEditorSectionsView.removeSectionLink()
function that should be reused to remove the section link. We should set a listener in the PortEditorSectionsView to listen to sections that are removed from the PortalModel, and remove the sections from the PortEditorSectionsView in a callback function.
Hi Lauren - I've added the functionality to delete Markdown sections with the above commit: https://github.com/NCEAS/metacatui/commit/dfb8d70ebd96d72a189560eee794662eda868cd2
Sorry - I re-read the description and noticed that I missed adding the confirmation message before deleting the section.
Are we thinking of a modal or a tooltip?
Ideally, it would be great to have an "Undo" action rather than a confirmation message, but a confirmation is probably faster to implement. Let's go with a Bootstrap popover.
Is there any update on this ticket? Let me know if you're experiencing any trouble spots I can help with.
Hi Lauren - this issue is ready for review.
I find the delete confirm message to be unintuitive and difficult to hover over. I also don't think we need to ask confirmation for the Data and Metrics pages since they don't have any unsaved content that would be lost, unlike the Markdown pages.
I'll work on making the confirmation message easier to use.
When "Delete" is clicked, a confirmation message is displayed (maybe as a tooltip?) If confirmed, the ProjEditorSectionsView will remove the ProjEditorSectionView and it's corresponding ProjectSectionModel from the ProjectModel.