diff --git a/cypress/integration/vault.spec.js b/cypress/integration/vault.spec.js --- a/cypress/integration/vault.spec.js +++ b/cypress/integration/vault.spec.js @@ -1,5 +1,5 @@ /** - * Copyright (C) 2019 The Software Heritage developers + * Copyright (C) 2019-2020 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information @@ -13,11 +13,18 @@ 'done': 'rgb(92, 184, 92)' }; -function checkVaultCookingTask(objectType) { - cy.contains('button', 'Actions') - .click(); +function adminLogin() { + cy.visit('/admin/') + .get('input[name="username"]') + .type('admin') + .get('input[name="password"]') + .type('admin') + .get('form') + .submit(); +} - cy.contains('.dropdown-item', 'Download') +function checkVaultCookingTask(objectType) { + cy.contains('button', 'Download') .click(); cy.contains('.dropdown-item', objectType) @@ -124,7 +131,8 @@ response: this.genVaultDirCookingResponse('new') }).as('createVaultCookingTask'); - checkVaultCookingTask('as tarball'); + cy.contains('button', 'Download') + .click(); cy.route({ method: 'GET', @@ -189,6 +197,7 @@ }); it('should create a revision cooking task and report its status', function() { + adminLogin(); // Browse a revision cy.visit(this.revisionUrl); @@ -358,7 +367,8 @@ }).as('fetchCookedArchive'); // Create a vault cooking task through the GUI - checkVaultCookingTask('as tarball'); + cy.contains('button', 'Download') + .click(); // Start archive download through the GUI cy.get('.modal-dialog') @@ -370,7 +380,7 @@ }); it('should offer to immediately download a revision gitfast archive if already cooked', function() { - + adminLogin(); // Browse a directory cy.visit(this.revisionUrl); @@ -416,7 +426,8 @@ response: this.genVaultDirCookingResponse('failed') }).as('checkVaultCookingTask'); - checkVaultCookingTask('as tarball'); + cy.contains('button', 'Download') + .click(); // Check that recooking the directory is offered to user cy.get('.modal-dialog') diff --git a/swh/web/browse/snapshot_context.py b/swh/web/browse/snapshot_context.py --- a/swh/web/browse/snapshot_context.py +++ b/swh/web/browse/snapshot_context.py @@ -851,7 +851,7 @@ "readme_html": readme_html, "snapshot_context": snapshot_context, "vault_cooking": vault_cooking, - "show_actions_menu": True, + "show_actions": True, "swhids_info": swhids_info, }, ) @@ -1037,7 +1037,7 @@ "top_right_link": top_right_link, "snapshot_context": snapshot_context, "vault_cooking": None, - "show_actions_menu": True, + "show_actions": True, "swhids_info": swhids_info, "error_code": content_data.get("error_code"), "error_message": content_data.get("error_message"), @@ -1187,7 +1187,7 @@ "top_right_link": None, "snapshot_context": snapshot_context, "vault_cooking": None, - "show_actions_menu": True, + "show_actions": True, "swhids_info": swhids_info, }, ) @@ -1436,6 +1436,6 @@ "next_releases_url": next_releases_url, "snapshot_context": snapshot_context, "vault_cooking": None, - "show_actions_menu": False, + "show_actions": False, }, ) diff --git a/swh/web/browse/views/content.py b/swh/web/browse/views/content.py --- a/swh/web/browse/views/content.py +++ b/swh/web/browse/views/content.py @@ -401,7 +401,7 @@ }, "snapshot_context": snapshot_context, "vault_cooking": None, - "show_actions_menu": True, + "show_actions": True, "swhids_info": swhids_info, "error_code": content_data["error_code"], "error_message": content_data["error_message"], diff --git a/swh/web/browse/views/directory.py b/swh/web/browse/views/directory.py --- a/swh/web/browse/views/directory.py +++ b/swh/web/browse/views/directory.py @@ -215,7 +215,7 @@ "readme_html": readme_html, "snapshot_context": snapshot_context, "vault_cooking": vault_cooking, - "show_actions_menu": True, + "show_actions": True, "swhids_info": swhids_info, }, ) diff --git a/swh/web/browse/views/origin.py b/swh/web/browse/views/origin.py --- a/swh/web/browse/views/origin.py +++ b/swh/web/browse/views/origin.py @@ -270,7 +270,7 @@ "origin_info": origin_info, "snapshot_context": snapshot_context, "vault_cooking": None, - "show_actions_menu": False, + "show_actions": False, }, ) diff --git a/swh/web/browse/views/release.py b/swh/web/browse/views/release.py --- a/swh/web/browse/views/release.py +++ b/swh/web/browse/views/release.py @@ -232,7 +232,7 @@ "swh_object_metadata": release_metadata, "release": release, "snapshot_context": snapshot_context, - "show_actions_menu": True, + "show_actions": True, "breadcrumbs": None, "vault_cooking": vault_cooking, "top_right_link": None, diff --git a/swh/web/browse/views/revision.py b/swh/web/browse/views/revision.py --- a/swh/web/browse/views/revision.py +++ b/swh/web/browse/views/revision.py @@ -299,7 +299,7 @@ "top_right_link": None, "snapshot_context": snapshot_context, "vault_cooking": None, - "show_actions_menu": True, + "show_actions": True, "swhids_info": None, }, ) @@ -597,7 +597,7 @@ "top_right_link": top_right_link, "vault_cooking": vault_cooking, "diff_revision_url": diff_revision_url, - "show_actions_menu": True, + "show_actions": True, "swhids_info": swhids_info, "error_code": error_code, "error_message": error_message, diff --git a/swh/web/templates/includes/show-metadata.html b/swh/web/templates/includes/show-metadata.html --- a/swh/web/templates/includes/show-metadata.html +++ b/swh/web/templates/includes/show-metadata.html @@ -1,5 +1,5 @@ {% comment %} -Copyright (C) 2017-2019 The Software Heritage developers +Copyright (C) 2017-2020 The Software Heritage developers See the AUTHORS file at the top-level directory of this distribution License: GNU Affero General Public License version 3, or any later version See top-level LICENSE file for more information @@ -7,9 +7,10 @@ {% load swh_templatetags %} -
+