Skip to content
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

[#3242] Move Create button to main navigation bar #3308

Merged
merged 18 commits into from
May 9, 2019

Conversation

Maurier
Copy link
Member

@Maurier Maurier commented Apr 5, 2019

This PR adds a "Create" menu to the navigation bar and combines Help and About into a menu as well.
The "Create" button has been removed from the top left of My Resources page. These changes effectively remove the Create Resource page (the code will be left in place in case of need to rollback).

These changes can be tested at: https://playground.hydroshare.org

Create menu

image

Notification

Since the resource creation process can take some time, a notification message has been added to indicate that the resource is being created.

image

Note: This work is also going to be implemented at https://help.hydroshare.org/ and both PRs should be deployed at the same time for consistency.

Pull Request Checklist:

  • Positive Test Case Written by Dev
  • Automated Testing
  • Sufficient User and Developer Documentation
  • Passing Jenkins Build
  • Peer Code review and approval

Positive Test Case

  1. Access the site.
  2. Interact with the navigation items and verify the links work as expected.

$("#hs-nav-bar .res-dropdown ul > li> a").on("click", function () {
var formData = new FormData();

formData.append("csrfmiddlewaretoken", csrf_token);
Copy link
Member Author

@Maurier Maurier Apr 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkdash It would be good to get rid of these irods-related parameters from the backend if they are not needed in the requests anymore. I've added them here for now because without them the request doesn't go through.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add these defaults server side and resource-type default to composite. making it so you only have to pass the token. Actually with this new workflow, I think we could probably remove all of the irods parameters completely from the create method. @hyi Is there any reason we can't remove the irods paramaters from "/hsapi/_internal/create-resource/do/"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkdash @Maurier @sblack-usu These iRODS-related parameters in the request are for files selected from iRODS file browser when creating a resource using files from iRODS user zone or other third party iRODS zone, so we cannot get rid of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hyi - But with the new create resource workflow, these parameters will never be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sblack-usu OK. That makes sense. Then we can remove those parameters, or at least add a default when retrieving those request data, such as this line: https://github.com/hydroshare/hydroshare/blob/develop/hs_core/views/__init__.py#L1221 @Maurier @pkdash

}, timeout)
// Alert Types: "error", "success", "info"
// pass a duration value of -1 for persistent alerts
function customAlert(alertTitle, alertMessage, alertType, duration) {
Copy link
Member Author

@Maurier Maurier Apr 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had different methods implementing the same kind of alert functionality, so they have been consolidated into one method to avoid redundancy.

@Maurier
Copy link
Member Author

Maurier commented Apr 5, 2019

@dtarb, @Lizabrazil, @dtarb These changes can be tested at https://playground.hydroshare.org. Please have a look when you get a chance and let me know if you have any suggestions.

@dtarb
Copy link
Member

dtarb commented Apr 5, 2019

I like it. But a few tweaks.

  1. The empty resource landing page should probably not say "Congratulations!" We need to revise the message.
  2. Create Collection Fails
  3. The CREATE menu item should probably be there even when not logged in for consistency of look and feel. Behavior should be the same as currently for MyResources, requiring login.
  4. For HELP, I do not think we need a drop down. I think about is part of help. I do suggest, as noted in "Create" should be moved to the top navigation with a dropdown #3242 putting an about HydroShare in the footer.

Suggestion for revised message
"This is the landing page for the resource you just created. Add files in the content area below and enter metadata where needed. The following metadata is required for your resource to be published or made public" Then give the list.

@horsburgh
Copy link
Member

@dtarb - we currently have separate "help" and "about" links in the navigation at the top. @Maurier has consolidated them into one - I think this is consistent with what we talked about on the phone. Are you suggesting we should get rid of the "About" page? The About page is linked on the Help page, so I guess we really don't need About in the main navigation.

@dtarb
Copy link
Member

dtarb commented Apr 6, 2019

@horsburgh I am suggesting what I wrote in #3242.

@horsburgh
Copy link
Member

OK - fair enough. There's two sets of instructions in #3242, so I can see where @Maurier might have missed that.

@Maurier - I agree with the tweaks suggested by @dtarb above.

@Maurier
Copy link
Member Author

Maurier commented Apr 6, 2019

Got it, I'm working on it. I'll update the deployment with these changes sometime this weekend.

@Lizabrazil
Copy link
Contributor

Just reiterate, we just discussed and all agree that:
3. The CREATE menu item should probably be there even when not logged in for consistency of look and feel. Behavior should be the same as currently for MyResources, requiring login
4. Putting About in the footer, I also agree.

@Maurier
Copy link
Member Author

Maurier commented Apr 11, 2019

@dtarb, @Lizabrazil - I have made the changes now. Please have another look.

@sblack-usu
Copy link
Contributor

I've never touched the help codebase, but I wonder if it's even worth the trouble making the help pages mimic hydroshare. Why not just something like "Back to HydroShare" as a menu item at the top. You already can't see the user information in the top right corner of the help pages.

@sblack-usu
Copy link
Contributor

I found myself clicking the create menu item, which closed the popup box that opened when I hovered over. Maybe make it so it does not close upon clicking the create button?

@dtarb
Copy link
Member

dtarb commented Apr 11, 2019

I did some quick tests and it all seems to work as expected.

@Maurier
Copy link
Member Author

Maurier commented Apr 11, 2019

I found myself clicking the create menu item, which closed the popup box that opened when I hovered over. Maybe make it so it does not close upon clicking the create button?

Mobile devices still need to be able to click, so we would need to find another approach. The only other way I can think of is disabling the hover and trigger the popup only on click.

@Lizabrazil
Copy link
Contributor

The first time I went through clicking create and signing in, it went to My Resources and then very quickly loaded the empty resource landing page. I tested again on another browser and it only does it the first time, but i thought it was a little odd.

@Lizabrazil
Copy link
Contributor

Just read Scotts comment about this, so maybe it is already being addressed. Otherwise, looks good. I'm not sure what best practices are for hover versus click on main menu items.

@Lizabrazil
Copy link
Contributor

If we did ever want to be completely mobile first then yes we would need to require a click

@ghost
Copy link

ghost commented Apr 22, 2019

This has merge conflicts

…to 3242-move-create-to-navigation-bar

# Conflicts:
#	theme/static/js/generic-resource.js
@Maurier
Copy link
Member Author

Maurier commented Apr 25, 2019

I have updated the behavior to match that of @dtarb's comment quoted below:

I suggest the following

  1. Create menu item does not have triangle next to it. This is so that all menus look the same. This addresses point 3 above. I think it would also address 4 above in that without the triangle it would look OK where it is, though where these items are on the top menu is a lesser consideration for me.
  2. When not logged in Create menu item does not have dropdown. It behaves the same as My Resources menu item. It takes you to login, then after login you are on My Resources page. This addresses the cumbersome reroute of 1 above.
  3. When logged in clicking Create (positive click, not mouse over) results in the drop down appearing at which point a user selects resource type to create.
  4. On the help pages, recognizing that help is a separate site, the behavior is the same as not logged in. Clicking on Create would log you in (or if already logged in) take you to the My Resources page which has an active Create menu. This is the least likable item in this suggestion, but short of spending a whole lot of work to integrate Help with HydroShare, I think it is workable. There are also other differences between help and HydroShare - see Login shown on all tabs but Help and About. #3271, that I do not feel are worth spending effort on.

As item 4 needs to be implemented on the help system, once agreed, it would need to be implemented in a different PR.

Note that changes need to be made on the help pages later on to match this work.

https://playground.hydroshare.org

@Maurier
Copy link
Member Author

Maurier commented May 7, 2019

@sblack-usu, could you review this work? At this point we have decided to go with this implementation outlined by @dtarb in the list above.

Note that, before deploying this to www, changes to the footer need to be made through the admin interface to include a link to the About page (https://help.hydroshare.org/about-hydroshare/) and it needs to persist in the database from then on:
image

image

@@ -15,11 +93,9 @@
<a href="https://www.hydroshare.org/apps/">Apps</a>
</li>
<li class="" id="dropdown-menu-https:--help.hydroshare.org">
<a href="http://help.hydroshare.org">HELP</a>
</li>
<li class="" id="dropdown-menu-https:--help.hydroshare.org-about-hydroshare-">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so a link to about is going away? Just making sure this is intentional

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Here is the discussion behind this change: #3242 (comment)

Copy link
Contributor

@sblack-usu sblack-usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, the updates work very well. As for the help pages, I'm for removing the nav bar from the help pages and maybe just have a link back to hydroshare. Of course that is an ongoing conversation that should not hold this work back.

@Maurier
Copy link
Member Author

Maurier commented May 7, 2019

This looks great, the updates work very well. As for the help pages, I'm for removing the nav bar from the help pages and maybe just have a link back to hydroshare. Of course that is an ongoing conversation that should not hold this work back.

Thanks for reviewing! I will try to make the corresponding changes to the help pages today, and if all goes well we can proceed to merge this and have this ready for this release.

I will also follow up with another ticket where we can address removing unused iRODS related parameters from the requests used in this work.

@Maurier Maurier changed the title [WIP][#3242] Move Create button to main navigation bar [#3242] Move Create button to main navigation bar May 8, 2019
@Maurier
Copy link
Member Author

Maurier commented May 9, 2019

A PR with follow up changes for the Help pages has been approved here: hydroshare/hs_pages#16

This work can now be merged.

@Maurier Maurier merged commit 91695d4 into develop May 9, 2019
@Maurier Maurier deleted the 3242-move-create-to-navigation-bar branch May 17, 2019 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants