NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 26 forks source link

Add ability to rename sections #999

Closed laurenwalker closed 4 years ago

laurenwalker commented 5 years ago

When "Rename" is clicked, the tab name will become editable. On focusout, the ProjEditorSectionView will change the label of the section in the ProjectSectionModel.

Since the Data and Metrics tabs are not associated with ProjectSectionModels, their labels/names are set as the dataLabel and metricsLabel attributes on the ProjectModel. These are serialized as options in the project document XML.

laurenwalker commented 5 years ago

For the MVP, let's allow only section name changes for the Markdown sections. The Data, Members, and Metrics tab names will continue to be hard-coded in MetacatUI.

I created a new issue for renaming the other section types: #1058

laurenwalker commented 4 years ago

I added the menu to each section tab that has the Rename menu option. It doesn't do anything when you click on it yet.

rushirajnenuji commented 4 years ago

Hi Lauren - yes I pulled in the changes from #1081 They look good.

rushirajnenuji commented 4 years ago

Hi Lauren - I've added the rename a section function to PortEditorSectionsView. Whenever rename is clicked - the label gets a focus applied to it with a blinking cursor (indicating the section is editable).

I tried applying the bootstrap's focus / highlight CSS rules, but it seems that they're only applicable to input HTML element. Since the sections tabs are an anchor element, I've added custom CSS rule to highlight the editable part in this commit: https://github.com/NCEAS/metacatui/commit/745405e8761b04dbda12e1ed9c2614fd596b6dba

rushirajnenuji commented 4 years ago

I noticed one issue when the focus CSS rules get applied on click (section name). (though the section remains uneditable as expected). I'm moving this back to the "in-progress" column. Needs work.

laurenwalker commented 4 years ago

Hi Rushi - I see you moved this into the Review pipeline a week ago. Did you want me to review this?

rushirajnenuji commented 4 years ago

Hi Lauren - yes, that was my intention. But I think we have already reviewed this as a group during our last Portals meeting. So, maybe this is good to be close right now.

laurenwalker commented 4 years ago

I looked it over and fixed a couple minor issues. Will close