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

User confirms closed records status once for all metadata #77

Merged
merged 25 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8ad3442
First pass at CSV upload (technical prototype)
garethfoote Jan 30, 2024
01df6a1
Updates for implementation and content work
garethfoote Feb 14, 2024
04838a8
Minor copy changes
garethfoote Feb 15, 2024
f84aa2b
Minor copy change
garethfoote Feb 15, 2024
c7ba89e
Removed CSV where possible
garethfoote Feb 16, 2024
fe920fb
Copy edits
garethfoote Feb 16, 2024
9ad9b67
Copy edits
garethfoote Feb 16, 2024
4da0a5d
Copy edits
garethfoote Feb 16, 2024
83e721d
Pairing back results page features.
garethfoote Feb 16, 2024
af19e28
Adding a option to bypass metadata
garethfoote Feb 16, 2024
0ac4985
Missing copy
garethfoote Feb 19, 2024
63cfdb5
Error page
garethfoote Feb 28, 2024
f890eff
New pages for errors
garethfoote Mar 5, 2024
b366e52
Completing journey so we can use back btn in prototype
garethfoote Mar 6, 2024
9e8a2f8
Merge branch 'TDR-3757-copy-changes-to-production' into TDR-3731-csv-…
garethfoote Mar 6, 2024
8e9dc79
Completing journey
garethfoote Mar 6, 2024
4045975
Merge branch 'TUX-12-uploaded-wrong-file-type' into TUX-24-metadata-u…
garethfoote Mar 6, 2024
f15b4e6
First pass at adding in closure status for entire journey
garethfoote Mar 13, 2024
c62d55c
Version 2
garethfoote Mar 13, 2024
51e675b
Wrong link
garethfoote Mar 14, 2024
16d8178
Added attachment component.
garethfoote Mar 25, 2024
39a459b
Changed title
garethfoote Mar 25, 2024
e48d027
Updates to review and confirm status journey
garethfoote Mar 25, 2024
de2e1ac
Confirm closure version 2
garethfoote Mar 27, 2024
e1151a7
Correct link
garethfoote Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions app/assets/sass/_da-attachment.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
$thumbnail-width: 70px;
$thumbnail-height: 100px;
$thumbnail-border-width: 5px;
$thumbnail-background: govuk-colour("white");
$thumbnail-border-colour: rgba(11, 12, 12, .1);
$thumbnail-shadow-colour: rgba(11, 12, 12, .4);
$thumbnail-shadow-width: 0 2px 2px;
$thumbnail-icon-border-colour: govuk-colour("mid-grey");

.da-attachment {
@include govuk-font(19);
@include govuk-clearfix;
position: relative;

.govuk-details {
margin: govuk-spacing(3) 0;
}
}

.da-attachment__thumbnail-image {
display: block;
width: auto; // for IE8
max-width: $thumbnail-width;
height: $thumbnail-height;
border: $thumbnail-border-colour; // for IE9 & IE10
outline: $thumbnail-border-width solid $thumbnail-border-colour;
background: $thumbnail-background;
box-shadow: $thumbnail-shadow-width $thumbnail-shadow-colour;
fill: $thumbnail-icon-border-colour;
stroke: $thumbnail-icon-border-colour;
}


.da-attachment__thumbnail {
position: relative;
width: auto;
margin-right: govuk-spacing(5);
margin-bottom: govuk-spacing(3);
padding: $thumbnail-border-width;
float: left;
}

.da-attachment__details {
padding-left: $thumbnail-width + $thumbnail-border-width * 2 + govuk-spacing(5);
}

.da-attachment__title {
@include govuk-font($size: 27);
margin: 0 0 govuk-spacing(3);
}

.da-attachment__link {
line-height: 1.29;
}

.da-attachment__metadata {
@include govuk-font($size: 19);
margin: 0 0 govuk-spacing(3);
color: $govuk-secondary-text-colour;

&:last-of-type {
margin-bottom: 0;
}

.da-attachment__attribute {
// From the Design System
// Automatic wrapping for unbreakable text (e.g. URLs)
word-wrap: break-word; // Fallback for older browsers only
overflow-wrap: break-word;
}
}

.da-attachment__metadata--compact {
margin-bottom: 0;
}
9 changes: 9 additions & 0 deletions app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

// Add extra styles here
@import './da-attachment.scss';
@import 'node_modules/@nationalarchives/tdr-components/components/multi-select-search/_index';
@import 'node_modules/@nationalarchives/tdr-components/components/nested-navigation/_index';
@import './prototype-history.scss';
Expand Down Expand Up @@ -119,6 +120,11 @@
width: 100%;
}

.hidden {
visibility: hidden;
height:0;
}

.showBanner {
animation: showBlock 0s 10s forwards;
visibility: hidden;
Expand Down Expand Up @@ -490,3 +496,6 @@
text-align: center;
}

.govuk-list--inline-pre pre {
display: inline;
}
40 changes: 40 additions & 0 deletions app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,46 @@ const populateWithClosureData = (req, res) => {

// Add your routes here


/*
* When confirm closure has a radio button that redirects user to
* an info page if they select 'no' which provides further info
*/
router.post(
"/:ticketId/confirm-closure-v2",
function(req, res){
if(req.session.data["confirmClosureStatus"] == "no-1"){
res.redirect(`/${req.params.ticketId}/confirm-closure-no-1`)
} else if(req.session.data["confirmClosureStatus"] == "no-2"){
res.redirect(`/${req.params.ticketId}/confirm-closure-no-2`);
} else {
res.redirect(`/${req.params.ticketId}/${req.session.data["confirmClosureStatus"]}`);
}
})

router.get(
"/:ticketId/has-closed-records",
function(req, res){

// req.session.data[req.params.ticketId] = req.session.data[req.params.ticketId] || [];
req.session.data['hasClosedRecords'] = req.session.data["has-closed-records"] == "true"

res.redirect(`/${req.params.ticketId}/upload-checks`)
})

router.post(
"/:ticketId/metadata-route",
function(req, res){

const route = req.session.data['metadata-route']
if (route == "csv"){
res.redirect(`/${req.params.ticketId}/upload-csv`)
} else {
// response.redirect("/ineligible-country")
}

})

router.get(
"/metadata/descriptive-metadata/confirm-delete-metadata",
function (req, res) {
Expand Down
66 changes: 66 additions & 0 deletions app/views/TDR-3731/csv-checks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% extends "layouts/main.html" %}

{% block pageTitle %}
Checking your metadata
{% endblock %}

{% block content %}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<span class="govuk-caption-l">Step 5 of 7</span>
<h1 class="govuk-heading-l">
Checking your metadata
</h1>

<p class="govuk-body">Please wait while we check your metadata against the uploaded records. This may take a few minutes. </p>

<div id="checks-banner" class="hidden">
<div class="govuk-notification-banner" role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner">
<div class="govuk-notification-banner__header">
<h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title">
Important
</h2>
</div>
<div class="govuk-notification-banner__content">
<h3 class="govuk-notification-banner__heading">
Your metadata has been checked.
</h3>
<p class="govuk-body">Please click 'Continue' to see your results.</p>
</div>
</div>
</div>

<div class="govuk-button-group">
<a href="./csv-results" id="next-step-btn" role="button" disabled="true" draggable="false" class="govuk-button" data-module="govuk-button">
Continue
</a>
</div>

</div>
<div class="govuk-grid-column-one-third">
<details class="govuk-details" data-module="govuk-details">
<summary class="govuk-details__summary">
<span class="govuk-details__summary-text">
Consignment reference
</span>
</summary>
<div class="govuk-details__text">
MOCK-123-TDR
</div>
</details>
</div>
</div>


<script type="text/javascript">
setTimeout(() => {
const banner = document.getElementById("checks-banner")
const button = document.getElementById("next-step-btn")
button.removeAttribute("disabled");
banner.classList.remove("hidden");
}, 5000);
</script>

{% endblock %}
Loading