-
Notifications
You must be signed in to change notification settings - Fork 43
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
497 edit page related external links #2490
Conversation
30a73c3
to
61b158b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one tiny comment
app/helpers/tabbed_nav_helper.rb
Outdated
@@ -23,6 +23,8 @@ def current_tab_name | |||
"unpublish" | |||
when "admin" | |||
"admin" | |||
when "related_external_links" | |||
"linking" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might just be me but the name 'linking' seems a little different to the other tabs. Would 'external_links' be more in keeping with the other tab names and match up more with the name of the property in the Artefact model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might just be me but the name 'linking' seems a little different to the other tabs. Would 'external_links' be more in keeping with the other tab names and match up more with the name of the property in the Artefact model?
Yeah that's been bugging me a bit since the start. I took the name from the routes file that appears to redirect related_external_links
in the URL to linking
in the views but I have no idea why. Happy to hear further opinions on that though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can use whatever we want here, as it's not really user-visible. So long as we make sure we update all the places that might reference it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed linking
to related_external_links
in all appropriate places. I think it reads better like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the external links are invalid, the invalid values are not persisted in the text boxes, the text boxes are simply populated with whatever the currently-saved external links are. This appears to be the existing behaviour…not sure whether we are happy to keep this behaviour for now?
51e97e3
to
4baa904
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments.
app/views/editions/secondary_nav_tabs/_add-another_checkbox.html.erb
Outdated
Show resolved
Hide resolved
app/views/editions/secondary_nav_tabs/_add-another_fieldset.html.erb
Outdated
Show resolved
Hide resolved
a5498f4
to
de82064
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only outstanding issues are around how validation works, but they don't need to block this PR from being merged.
- Create view/partials to render the UI - Update `editions_controller` to add a `update_related_external_links` action - Update routes for `update_related_external_links` action - Add references to the JS/CSS for the "Add another" component - Update controller test for `update_related_external_links` method - Update `edition_edit` test for `related external links` tab - Add new `edition_external_links_test` integration test for JS scenarios
aae0dbc
to
4e8e915
Compare
Trello
This gives the user the ability to add/delete/edit external links to a document. It uses the Add another component, which provides a different UI in JavaScript and non-JavaScript scenarios (shown below).
One aspect of the Acceptance Criteria that is not covered so far is to display an error message when both the "Title" and "URL" fields are blank: it continues to follow the current behaviour of displaying a success message while not saving the changes. This proved problematic because in a non-JS scenario it is in fact acceptable to submit empty fields because these are always provided by the component and may not be used.