diff --git a/src/controllers/publish.ts b/src/controllers/publish.ts
index 7efbc90..8c17cf0 100644
--- a/src/controllers/publish.ts
+++ b/src/controllers/publish.ts
@@ -134,7 +134,7 @@ export const uploadFile = async (req: Request, res: Response, next: NextFunction
}
}
- res.render('publish/upload', { revisit, errors });
+ res.render('publish/upload', { revisit, errors, uploadType: false });
};
export const factTablePreview = async (req: Request, res: Response, next: NextFunction) => {
@@ -319,7 +319,7 @@ export const uploadLookupTable = async (req: Request, res: Response, next: NextF
res.status(400);
logger.error('Lookup table did not match data in the fact table.', err);
const failurePreview = JSON.parse(error.body as string) as ViewErrDTO;
- res.render('publish/period-match-failure', {
+ res.render('publish/dimension-match-failure', {
...failurePreview,
patchRequest: { dimension_type: DimensionType.LookupTable },
dimension
@@ -341,7 +341,7 @@ export const uploadLookupTable = async (req: Request, res: Response, next: NextF
}
}
- res.render('publish/upload', { revisit, errors });
+ res.render('publish/upload', { revisit, errors, uploadType: 'lookup' });
};
export const lookupReview = async (req: Request, res: Response, next: NextFunction) => {
diff --git a/src/i18n/en.json b/src/i18n/en.json
index b2a8cfa..1b822ab 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -186,6 +186,19 @@
"heading": "What format is used for months in the dimension?",
"example": "For example, {{example}}"
},
+ "dimension_match_failure": {
+ "lookup_heading": "Lookup table data cannot be matched to the data table",
+ "heading": "Reference data cannot be matched to the data table",
+ "information": "{{failureCount, number}} date codes in the dimension do not match the date formatting you have indicated. You should check:",
+ "formatting": "the reference codes used in the data table are correct",
+ "choices": "you selected the correct lookup table",
+ "subheading": "Reference codes that cannot be matched",
+ "actions": "Actions",
+ "upload_different_file": "Upload corrected or different data table",
+ "upload_different_file_warning": "(This will remove reference data from all dimensions)",
+ "try_different_format": "Select a different lookup table",
+ "no_matches": "None of the dates matched the format supplied"
+ },
"period_match_failure": {
"heading": "Date formatting cannot be matched to the dimension",
"information": "{{failureCount, number}} date codes in the dimension do not match the date formatting you have indicated. You should check:",
@@ -443,6 +456,8 @@
},
"upload": {
"title": "Upload the data table",
+ "lookup_heading": "Upload a lookup table",
+ "measure_heading": "Upload a measure table",
"note": "The file should be in a CSV format"
},
"preview": {
diff --git a/src/views/publish/dimension-chooser.ejs b/src/views/publish/dimension-chooser.ejs
index 59db893..e617842 100644
--- a/src/views/publish/dimension-chooser.ejs
+++ b/src/views/publish/dimension-chooser.ejs
@@ -12,8 +12,6 @@
<%= t('publish.dimension_type_chooser.heading') %>
- <%= t('publish.dimension_type_chooser.subheading') %>
-
<% if (locals?.errors) { %>
@@ -48,10 +46,10 @@
<% locals.headers.forEach(function(cell, idx) { %>
<% }); %>
diff --git a/src/views/publish/dimension-match-failure.ejs b/src/views/publish/dimension-match-failure.ejs
new file mode 100644
index 0000000..199c834
--- /dev/null
+++ b/src/views/publish/dimension-match-failure.ejs
@@ -0,0 +1,48 @@
+<%- include("../partials/header", t); %>
+
+
+
+
+
+ <% if (locals.patchRequest.dimension_type === 'lookup_table') { %>
+ <%= t('publish.dimension_match_failure.lookup_heading') %>
+ <% } else { %>
+ <%= t('publish.dimension_match_failure.heading') %>
+ <% } %>
+
+ <%= t('publish.dimension_match_failure.information', {failureCount: locals.extension.totalNonMatching}) %>
+
+ - <%= t('publish.dimension_match_failure.formatting') %>
+ - <%= t('publish.dimension_match_failure.choices') %>
+
+
+ <%= t('publish.dimension_match_failure.subheading') %>
+
+
+ <% if (locals.extension.nonMatchingValues.length === 0) { %>
+ - <%= t('publish.dimension_match_failure.no_matches') %>
+ <% } else { %>
+ <% locals.extension.nonMatchingValues.forEach((value) => { %>
+ - <%= value %>
+ <% });%>
+ <% } %>
+
+
+ <%= t('publish.dimension_match_failure.actions') %>
+
+
+ <%= t('publish.dimension_match_failure.upload_different_file')%>
+
+ <%= t('publish.dimension_match_failure.upload_different_file_warning')%>
+
+
+ <%= t('publish.dimension_match_failure.try_different_format')%>
+
+
+
+<%- include("../partials/footer"); %>
diff --git a/src/views/publish/upload.ejs b/src/views/publish/upload.ejs
index 48cd8d6..da443a2 100644
--- a/src/views/publish/upload.ejs
+++ b/src/views/publish/upload.ejs
@@ -6,7 +6,7 @@
<% if (locals.revisit) { %>
<% } %>
-
<%= t('publish.upload.title') %>
+ <% if (locals.uploadType === 'lookup') { %>
+
<%= t('publish.upload.lookup_heading') %>
+ <% } else if (locals.uploadType === 'measure') { %>
+
<%= t('publish.upload.measure_heading') %>
+ <% } else { %>
+
<%= t('publish.upload.title') %>
+ <% } %>
+
<%- include("../partials/error-handler"); %>
+