Skip to content

Commit

Permalink
The many many bug fixes on the frontend
Browse files Browse the repository at this point in the history
Fixed a whole host of bugs on the frontend and made it more robust for
putting in front of users.
  • Loading branch information
j-maynard committed Sep 21, 2024
1 parent fcb54ff commit dfc9e0f
Show file tree
Hide file tree
Showing 23 changed files with 540 additions and 331 deletions.
10 changes: 5 additions & 5 deletions src/enums/source-type.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable no-shadow */
/* eslint-disable no-unused-vars */
export enum SourceType {
DATAVALUES = 'DataValues',
FOOTNOTES = 'Footnotes',
DIMENSION = 'Dimension',
IGNORE = 'IGNORE',
UNKNOWN = 'UNKNOWN'
UNKNOWN = 'UNKNOWN',
DATAVALUES = 'DATAVALUES',
DIMENSION = 'DIMENSION',
FOOTNOTES = 'FOOTNOTES',
IGNORE = 'IGNORE'
}
2 changes: 1 addition & 1 deletion src/middleware/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function createRedisConnection() {

createRedisConnection()
.then((result) => logger.info(result))
.catch((ex) => logger.error(ex));
.catch((ex) => logger.error(`REDIS: ${ex}`));

if (process.env.REDIS_URL) {
store = new RedisStore({
Expand Down
8 changes: 4 additions & 4 deletions src/middleware/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const ENGLISH = 'en-GB';
const WELSH = 'cy-GB';

i18next
.use(Backend)
.use(i18nextMiddleware.LanguageDetector)
.use(Backend)
.init({
detection: {
order: ['path', 'header'],
Expand All @@ -16,10 +16,10 @@ i18next
ignoreRoutes: ['/healthcheck', '/public', '/css', '/assets']
},
backend: {
loadPath: `${__dirname}/../resources/locales/{{lng}}.json`
loadPath: `${__dirname}/translations/{{lng}}.json`
},
fallbackLng: ENGLISH,
preload: [ENGLISH, WELSH],
fallbackLng: 'en',
preload: ['en', 'cy'],
debug: false
});

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
{
"greeting": "Hello",
"beta": "Beta",
"menu": "Menu",
"publish-dataset": "Publish a Dataset",
"upload-csv": "Upload CSV",
"list-data-files": "List Datasets",
"feedback": "This is a new service – your feedback will help us to improve it.",
"share-page": "Share this page",
"top-of-page": "Back to top",
"status-field": "statws",
"app-running": "App is running",
"health-notes": "Expand endpoint to check for database connection and other services.",
"datalake-error": "Unable to connect to get Datalake",
"developer_warning": "<strong class=\"govuk-tag govuk-tag--red govuk-phase-banner__content__tag\">Warning</strong> This is a developer page and has not been through user research",
"developer_tag": "<span class=\"govuk-tag govuk-tag--yellow govuk-phase-banner__content__tag\">Developer Page</span>",
"status": {
"warning": "Warning"
},
"buttons": {
"continue": "Continue",
"back": "Back",
"cancel": "Cancel",
"upload_csv": "Upload CSV File",
"choose_different": "Choose a different data table"
},
"pagination": {
Expand All @@ -30,15 +28,39 @@
"google": "Login with Google"
},
"error": {
"summary-title": "There is a problem",
"summary_title": "There is a problem",
"generic": "You could not be logged in. Please try again later.",
"expired": "Your session has expired. Please log in again."
}
},
"header": {
"beta": "Beta",
"feedback": "This is a new service – your <a href=\"/en-GB/feedback/\">feedback</a> will help us to improve it.",
"navigation": {
"menu": "Menu",
"skip_to_content": "Skip to main content",
"publish-dataset": "Publish a Dataset",
"list-datasets": "List Datasets",
"logout": "Logout"
}
},
"footer": {
"support_link": "Support Links",
"project_reports": "Project Reports",
"github_repo": "GitHub Repository",
"help": "Help",
"cookies": "Cookies",
"contact": "Contact",
"terms": "Terms and conditions",
"copyright_notice": "All content is available under the <a class=\"govuk-footer__link\" href=\"https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/\" rel=\"license\">Open Government Licence v3.0</a>, except where otherwise stated",
"crown_copyright": "© Crown copyright",
"welsh_gov": "Welsh Government"
},
"homepage": {
"title": "Welcome to StatsWales Beta",
"welcome": "We're going to use the GovUK Design system until we're able to get hold of the Welsh Government GEL",
"apitext": "You can find our api at "
"title": "Welcome to the StatsWales Beta",
"welcome": "This is a test page for development from here you can do the following:",
"uploaded_already": "See whats been uploaded already",
"dataset_creation": "Start a new dataset creation journey"
},
"publish": {
"start": {
Expand All @@ -56,7 +78,7 @@
},
"upload": {
"title": "Upload the data table",
"note": "The file must be in CSV format"
"note": "The file should be in a CSV format"
},
"preview": {
"heading": "Check the data table",
Expand All @@ -69,16 +91,31 @@
"showing": "Showing rows"
},
"sources": {
"heading": "What does each column in the data table contain?"
"heading": "What does each column in the data table contain?",
"types": {
"DATAVALUES": "Data values",
"FOOTNOTES": "Notes code",
"DIMENSION": "Dimension",
"IGNORE": "This column can be ignored",
"UNKNOWN": "Select"
}
}
},
"upload": {
"title": "Upload a CSV file",
"description": "Upload a CSV file to the data lake",
"datasetName": "Dataset Name",
"datasetDescription": "Dataset Description",
"selectCSV": "Select a CSV file",
"uploadBtn": "Upload CSV"
"view": {
"list": {
"heading": "List Datasets"
},
"display": {
"heading": "Display a Dataset",
"title": "Title:",
"description": "Description:",
"notes": "Notes",
"contents": "Contents",
"summary": "Summary",
"dimension": "Dimension",
"revision": "Revision",
"import": "File Import"
}
},
"errors": {
"session": {
Expand All @@ -87,50 +124,38 @@
"current_import_missing": "Current import is missing from the session",
"no_sources_on_import": "Current import has no sources present on it, was the CSV empty?"
},
"source": {
"sources": {
"unknowns_found": "You need to tell us what each column contains",
"multiple_datavalues": "You can only specify one column as containing data values",
"multiple_footnotes": "You can only specify one column as containing notes",
"dimension_creation_failed": "Something went wrong trying to create the dimensions. Please try again."
},
"missing": "Filename Missing",
"view": {
"list": {
"no_datasets": "No datasets are currently listed in the database. If you need help please reach out to a member of the development team."
},
"display": {
"no_dimensions": "This dataset has not been completed with dimensions",
"no_revisions": "This dataset has not been completed with revisions"
}
},
"datalake_error": "Unable to connect to Datalake",
"blob_storage_errror": "Unable to connect to Blob Storage Service",
"problem": "There is a problem",
"name_missing": "Dataset Name Missing",
"dataset_missing": "No dataset found with this ID",
"title": {
"missing": "Title Missing",
"missing": "Either a title was not entered or there is a problem.",
"duplicate": "Title already exists"
},
"upload": {
"no-csv": "No CSV data provided",
"no-csv-data": "No CSV data available"
"no_csv": "No CSV data provided",
"no_csv_data": "No CSV data available"
}
},
"list": {
"title": "Display Data"
},
"display": {
"title": "Displaying Data for",
"description": "Description:"
},
"api": {
"available": "API is available"
},
"header": {

},
"footer": {
"support-link": "Support Links",
"project-reports": "Project Reports",
"github-repo": "GitHub Repository",
"help": "Help",
"cookies": "Cookies",
"contact": "Contact",
"terms": "Terms and conditions",
"copyright-notice": "All content is available under the <a class=\"govuk-footer__link\" href=\"https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/\" rel=\"license\">Open Government Licence v3.0</a>, except where otherwise stated",
"crown-copyright": "© Crown copyright",
"welsh-gov": "Welsh Government"
},
"routes": {
"healthcheck": "healthcheck",
"upload": "upload",
Expand Down
Loading

0 comments on commit dfc9e0f

Please sign in to comment.