Page MenuHomeSoftware Heritage

templates/top-navigation: Update action buttons layout
ClosedPublic

Authored by anlambert on Fri, Jun 19, 4:16 PM.

Details

Summary

Remove the Actions dropdown and replace with simple buttons instead: "Download",
"New snapshot" and "Show metadata".

Hide the "Download as git" and "Show metadata" action for non staff users.

Related to T2326

Before:

After:

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Fri, Jun 19, 4:16 PM

Build is green

Patch application report for D3319 (id=11757)

Rebasing onto 9358473580...

Current branch diff-target is up to date.
Changes applied before test
commit 8e0fa87b22d7196d72ab580882a61804e7c84912
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Jun 19 15:28:16 2020 +0200

    templates/top-navigation: Update action buttons layout
    
    Remove the Actions dropdown and replace with simple buttons instead: "Download",
    "New snapshot" and "Show metadata".
    
    Hide the "Download as git" and "Show metadata" action for non staff users.
    
    Related to T2326

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/208/ for more details.

ardumont accepted this revision.Mon, Jun 22, 9:47 AM
ardumont added a subscriber: ardumont.

Looks good.

One question above ;)

cypress/integration/vault.spec.js
24

I read in the cypress doc that it'd be best to avoid using the ui to login and
use internal authentication api instead. I tried to start something about it
but failed to make it ok ¯\_(ツ)_/¯ so far.

I guess, we'll tackle this later.

Although, note that we kinda use this snippet in multiple locations now (each
time we need to login in the admin page so that'd be deposit, the main admin
page test and here i guess).

Maybe there we could define this as a main function we can reuse?

What do you think?

This revision is now accepted and ready to land.Mon, Jun 22, 9:47 AM
anlambert added inline comments.Mon, Jun 22, 11:30 AM
cypress/integration/vault.spec.js
24

I read in the cypress doc that it'd be best to avoid using the ui to login and
use internal authentication api instead. I tried to start something about it
but failed to make it ok ¯\_(ツ)_/¯ so far.

I guess, we'll tackle this later.

I do not think we need to do that. The idea to go through the UI is to ensure the login process does not break as the webapp code evolves.

Although, note that we kinda use this snippet in multiple locations now (each
time we need to login in the admin page so that'd be deposit, the main admin
page test and here i guess).

Maybe there we could define this as a main function we can reuse?

What do you think?

Ack, will put that function in the cypress/utils/index.js file.

anlambert added inline comments.Mon, Jun 22, 1:16 PM
cypress/integration/vault.spec.js
24

I do not think we need to do that. The idea to go through the UI is to ensure the login process > does not break as the webapp code evolves.

Just found your comment while trying to factorize login process.

I think I know how to do that. I will open a new diff instead of updating that one.

anlambert added inline comments.Mon, Jun 22, 1:56 PM
cypress/integration/vault.spec.js
24