diff --git a/assets/src/bundles/vault/vault-create-tasks.js b/assets/src/bundles/vault/vault-create-tasks.js --- a/assets/src/bundles/vault/vault-create-tasks.js +++ b/assets/src/bundles/vault/vault-create-tasks.js @@ -7,7 +7,7 @@ import * as EmailValidator from 'email-validator'; -import {handleFetchError, csrfPost, htmlAlert} from 'utils/functions'; +import {csrfPost, handleFetchError, htmlAlert} from 'utils/functions'; const alertStyle = { 'position': 'fixed', @@ -99,7 +99,7 @@ const cookingTaskCreatedAlert = $(htmlAlert('success', 'Archive cooking request successfully submitted.
' + - `Go to the Downloads page ` + + `Go to the Downloads page ` + 'to get the download link once it is ready.', true)); cookingTaskCreatedAlert.css(alertStyle); diff --git a/cypress/e2e/vault.cy.js b/cypress/e2e/vault.cy.js --- a/cypress/e2e/vault.cy.js +++ b/cypress/e2e/vault.cy.js @@ -174,7 +174,7 @@ updateVaultItemList(this.vaultItems); - cy.visit(this.Urls.browse_vault()); + cy.visit(this.Urls.vault()); cy.contains(`#vault-task-${CSS.escape(this.revision)} button`, 'Download') .click(); @@ -183,7 +183,7 @@ it('should display and upgrade previous cooking tasks from the legacy format', function() { updateVaultItemList(this.legacyVaultItems); - cy.visit(this.Urls.browse_vault()); + cy.visit(this.Urls.vault()); // Check it is displayed cy.contains(`#vault-task-${CSS.escape(this.revision)} button`, 'Download') @@ -246,7 +246,7 @@ .should('contain', 'Archive cooking request successfully submitted.'); // Go to Downloads page - cy.visit(this.Urls.browse_vault()); + cy.visit(this.Urls.vault()); cy.wait('@checkVaultCookingTask').then(() => { testStatus(this.directory, progressbarColors['new'], 'new', 'new'); @@ -334,7 +334,7 @@ .should('contain', 'Archive cooking request successfully submitted.'); // Go to Downloads page - cy.visit(this.Urls.browse_vault()); + cy.visit(this.Urls.vault()); cy.wait('@checkVaultCookingTask').then(() => { testStatus(this.revision, progressbarColors['new'], 'new', 'new'); @@ -454,7 +454,7 @@ } }).as('fetchCookedArchive'); - cy.visit(this.Urls.browse_vault()) + cy.visit(this.Urls.vault()) .get(`#vault-task-${CSS.escape(this.revision)} .vault-dl-link button`) .click(); @@ -483,7 +483,7 @@ updateVaultItemList(this.vaultItems); - cy.visit(this.Urls.browse_vault()) + cy.visit(this.Urls.vault()) .get(`#vault-task-${CSS.escape(this.revision)}`) .find('input[type="checkbox"]') .click({force: true}); diff --git a/docs/uri-scheme-api-vault.rst b/docs/uri-scheme-api-vault.rst --- a/docs/uri-scheme-api-vault.rst +++ b/docs/uri-scheme-api-vault.rst @@ -1,10 +1,10 @@ Vault ----- -.. autosimple:: swh.web.api.views.vault.api_vault_cook_directory +.. autosimple:: swh.web.vault.api_views.api_vault_cook_directory -.. autosimple:: swh.web.api.views.vault.api_vault_fetch_directory +.. autosimple:: swh.web.vault.api_views.api_vault_fetch_directory -.. autosimple:: swh.web.api.views.vault.api_vault_cook_revision_gitfast +.. autosimple:: swh.web.vault.api_views.api_vault_cook_revision_gitfast -.. autosimple:: swh.web.api.views.vault.api_vault_fetch_revision_gitfast +.. autosimple:: swh.web.vault.api_views.api_vault_fetch_revision_gitfast diff --git a/swh/web/api/urls.py b/swh/web/api/urls.py --- a/swh/web/api/urls.py +++ b/swh/web/api/urls.py @@ -17,6 +17,5 @@ import swh.web.api.views.revision # noqa import swh.web.api.views.snapshot # noqa import swh.web.api.views.stat # noqa -import swh.web.api.views.vault # noqa urlpatterns = APIUrls.get_url_patterns() diff --git a/swh/web/browse/templates/includes/top-navigation.html b/swh/web/browse/templates/includes/top-navigation.html --- a/swh/web/browse/templates/includes/top-navigation.html +++ b/swh/web/browse/templates/includes/top-navigation.html @@ -125,8 +125,10 @@ {% endif %} {% if show_actions %} - {% if not snapshot_context or not snapshot_context.is_empty %} - {% include "./vault-create-tasks.html" %} + {% if "swh.web.vault" in SWH_DJANGO_APPS %} + {% if not snapshot_context or not snapshot_context.is_empty %} + {% include "includes/vault-create-tasks.html" %} + {% endif %} {% endif %} {% if "swh.web.save_code_now" in SWH_DJANGO_APPS %} {% include "./take-new-snapshot.html" %} diff --git a/swh/web/browse/urls.py b/swh/web/browse/urls.py --- a/swh/web/browse/urls.py +++ b/swh/web/browse/urls.py @@ -36,14 +36,6 @@ ) -def _browse_vault_view(request: HttpRequest) -> HttpResponse: - return render( - request, - "browse-vault-ui.html", - {"heading": "Download archive content from the Vault"}, - ) - - def _browse_origin_save_view(request: HttpRequest) -> HttpResponse: return redirect(reverse("origin-save")) @@ -56,7 +48,6 @@ url(r"^browse/$", _browse_search_view), url(r"^browse/help/$", _browse_help_view, name="browse-help"), url(r"^browse/search/$", _browse_search_view, name="browse-search"), - url(r"^browse/vault/$", _browse_vault_view, name="browse-vault"), # for backward compatibility url(r"^browse/origin/save/$", _browse_origin_save_view, name="browse-origin-save"), url( diff --git a/swh/web/config.py b/swh/web/config.py --- a/swh/web/config.py +++ b/swh/web/config.py @@ -168,6 +168,7 @@ "swh.web.metrics", "swh.web.banners", "swh.web.jslicenses", + # "swh.web.vault", ], ), } diff --git a/swh/web/templates/layout.html b/swh/web/templates/layout.html --- a/swh/web/templates/layout.html +++ b/swh/web/templates/layout.html @@ -199,12 +199,14 @@

Search

- + {% if "swh.web.vault" in SWH_DJANGO_APPS %} + + {% endif %} {% if "swh.web.save_code_now" in SWH_DJANGO_APPS %}