diff --git a/assets/src/bundles/add_forge/forge-admin-email.ejs b/assets/src/bundles/add_forge/forge-admin-email.ejs --- a/assets/src/bundles/add_forge/forge-admin-email.ejs +++ b/assets/src/bundles/add_forge/forge-admin-email.ejs @@ -18,9 +18,13 @@ public repositories it contains and clone them into the Software Heritage archive. -Would you be so kind as to reply to this message to acknowledge the reception -of this email and let us know if there are any special steps we should take in -order to properly archive the public repositories hosted on your infrastructure? +Please let us know if there are any technical issues to consider before we +launch the archival of the public repositories hosted on your infrastructure. +(use "Reply all" to ensure our system will process your answer properly) + +In the absence of an answer to this message, we will start to archive your +forge in the coming weeks (only the publicly accessible repositories will be +archived) Thank you in advance for your help. diff --git a/assets/src/bundles/add_forge/request-dashboard.js b/assets/src/bundles/add_forge/request-dashboard.js --- a/assets/src/bundles/add_forge/request-dashboard.js +++ b/assets/src/bundles/add_forge/request-dashboard.js @@ -5,7 +5,7 @@ * See top-level LICENSE file for more information */ -import {handleFetchError, csrfPost, getHumanReadableDate} from 'utils/functions'; +import { handleFetchError, csrfPost, getHumanReadableDate } from 'utils/functions'; import emailTempate from './forge-admin-email.ejs'; import requestHistoryItem from './add-request-history-item.ejs'; @@ -19,12 +19,12 @@ contactForgeAdmin(event); }); - $('#updateRequestForm').submit(async function(event) { + $('#updateRequestForm').submit(async function (event) { event.preventDefault(); try { const response = await csrfPost($(this).attr('action'), - {'Content-Type': 'application/x-www-form-urlencoded'}, - $(this).serialize()); + { 'Content-Type': 'application/x-www-form-urlencoded' }, + $(this).serialize()); handleFetchError(response); $('#userMessage').text('The request status has been updated '); $('#userMessage').removeClass('badge-danger'); @@ -58,7 +58,7 @@ // Setting data for the email, now adding static data $('#contactForgeAdmin').attr('emailTo', forgeRequest.forge_contact_email); $('#contactForgeAdmin').attr('emailCc', forgeRequest.inbound_email_address); - $('#contactForgeAdmin').attr('emailSubject', `Software Heritage archival request for ${forgeRequest.forge_domain}`); + $('#contactForgeAdmin').attr('emailSubject', `Software Heritage archival notification for ${forgeRequest.forge_domain}`); populateRequestHistory(data.history); populateDecisionSelectOption(forgeRequest.status); } catch (e) { @@ -131,7 +131,7 @@ const mailTo = encodeURIComponent($('#contactForgeAdmin').attr('emailTo')); const mailCc = encodeURIComponent($('#contactForgeAdmin').attr('emailCc')); const subject = encodeURIComponent($('#contactForgeAdmin').attr('emailSubject')); - const emailText = encodeURIComponent(emailTempate({'forgeUrl': forgeRequest.forge_url}).trim().replace(/\n/g, '\r\n')); + const emailText = encodeURIComponent(emailTempate({ 'forgeUrl': forgeRequest.forge_url }).trim().replace(/\n/g, '\r\n')); const w = window.open('', '_blank', '', true); w.location.href = `mailto:${mailTo}?Cc=${mailCc}&Reply-To=${mailCc}&Subject=${subject}&body=${emailText}`; w.focus(); diff --git a/cypress/e2e/add-forge-now-request-dashboard.cy.js b/cypress/e2e/add-forge-now-request-dashboard.cy.js --- a/cypress/e2e/add-forge-now-request-dashboard.cy.js +++ b/cypress/e2e/add-forge-now-request-dashboard.cy.js @@ -51,7 +51,7 @@ To: ${requestData.forge_contact_email} Cc: ${requestInboundEmailAddress} Reply-To: ${requestInboundEmailAddress} -Subject: Software Heritage archival request for test.example.com +Subject: Software Heritage archival notification for test.example.com Content-Language: en-US From: Test Admin Content-Type: text/plain; charset=UTF-8; format=flowed @@ -71,9 +71,13 @@ public repositories it contains and clone them into the Software Heritage archive. -Would you be so kind as to reply to this message to acknowledge the reception -of this email and let us know if there are any special steps we should take in -order to properly archive the public repositories hosted on your infrastructure? +Please let us know if there are any technical issues to consider before we +launch the archival of the public repositories hosted on your infrastructure. +(use "Reply all" to ensure our system will process your answer properly) + +In the absence of an answer to this message, we will start to archive your +forge in the coming weeks (only the publicly accessible repositories will be +archived) Thank you in advance for your help. @@ -82,14 +86,14 @@ `; } -describe('Test add forge now request dashboard load', function() { +describe('Test add forge now request dashboard load', function () { - before(function() { + before(function () { // Create an add-forge-request object in the DB createDummyRequest(this.Urls); }); - beforeEach(function() { + beforeEach(function () { const url = this.Urls.add_forge_now_request_dashboard(requestId); // request dashboard require admin permissions to view cy.adminLogin(); @@ -99,7 +103,7 @@ .should('have.class', 'active'); }); - it('should load add forge request details', function() { + it('should load add forge request details', function () { cy.wait('@forgeRequestGet'); cy.get('#requestStatus') .should('contain', 'Pending'); @@ -126,7 +130,7 @@ .should('contain', 'test comment'); }); - it('should show send message link', function() { + it('should show send message link', function () { cy.wait('@forgeRequestGet'); cy.get('#contactForgeAdmin') @@ -138,7 +142,7 @@ .and('include', `Software Heritage archival request for ${requestForgeDomain}`); }); - it('should not show any error message', function() { + it('should not show any error message', function () { cy.wait('@forgeRequestGet'); cy.get('#fetchError') @@ -147,13 +151,13 @@ .should('not.have.class', 'd-none'); }); - it('should show error message for an api error', function() { + it('should show error message for an api error', function () { // requesting with a non existing request ID const invalidRequestId = requestId + 10; const url = this.Urls.add_forge_now_request_dashboard(invalidRequestId); cy.intercept(`${this.Urls.api_1_add_forge_request_get(invalidRequestId)}**`, - {statusCode: 400}).as('forgeAddInvalidRequest'); + { statusCode: 400 }).as('forgeAddInvalidRequest'); cy.visit(url); cy.wait('@forgeAddInvalidRequest'); @@ -163,7 +167,7 @@ .should('have.class', 'd-none'); }); - it('should load add forge request history', function() { + it('should load add forge request history', function () { cy.wait('@forgeRequestGet'); cy.get('#requestHistory') @@ -178,7 +182,7 @@ .should('contain', 'From user (SUBMITTER)'); }); - it('should load possible next status', function() { + it('should load possible next status', function () { cy.wait('@forgeRequestGet'); // 3 possible next status and the comment option cy.get('#decisionOptions') @@ -193,9 +197,9 @@ cy.get('#updateRequestForm').submit(); } -describe('Test add forge now request update', function() { +describe('Test add forge now request update', function () { - beforeEach(function() { + beforeEach(function () { createDummyRequest(this.Urls).then(() => { this.url = this.Urls.add_forge_now_request_dashboard(requestId); @@ -210,7 +214,7 @@ }); }); - it('should submit correct details', function() { + it('should submit correct details', function () { populateAndSubmitForm(); // Making sure posting the right data @@ -220,7 +224,7 @@ .should('include', 'WAITING_FOR_FEEDBACK'); }); - it('should show success message', function() { + it('should show success message', function () { populateAndSubmitForm(); // Making sure showing the success message @@ -231,7 +235,7 @@ .should('have.class', 'badge-success'); }); - it('should update the dashboard after submit', function() { + it('should update the dashboard after submit', function () { populateAndSubmitForm(); // Making sure the UI is updated after the submit @@ -260,7 +264,7 @@ .should('have.length', 2); }); - it('should update the dashboard after receiving email', function() { + it('should update the dashboard after receiving email', function () { const emailSrc = genEmailSrc(); cy.task('processAddForgeNowInboundEmail', emailSrc); @@ -279,7 +283,7 @@ cy.get('#historyItemBody1') .find('a') .should('contain', 'Open original message in email client') - .should('have.prop', 'href').and('contain', '/message-source/').then(function(href) { + .should('have.prop', 'href').and('contain', '/message-source/').then(function (href) { cy.request(href).then((response) => { expect(response.headers['content-type']) .to.equal('text/email'); @@ -293,10 +297,10 @@ }); }); - it('should show an error on API failure', function() { + it('should show an error on API failure', function () { cy.intercept('POST', - `${this.Urls.api_1_add_forge_request_update(requestId)}**`, - {forceNetworkError: true}) + `${this.Urls.api_1_add_forge_request_update(requestId)}**`, + { forceNetworkError: true }) .as('updateFailedRequest'); cy.get('#updateComment').type('This is an update comment'); cy.get('#updateRequestForm').submit();