Skip to content

Commit

Permalink
Merge pull request #775 from digital-land/736-add-back-button-to-issu…
Browse files Browse the repository at this point in the history
…es-pages

Add back button to issues pages
  • Loading branch information
DilwoarH authored Jan 15, 2025
2 parents aca66bd + a9cfdaa commit 9ba4482
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"type": "module",
"scripts": {
"prepare": "husky",
"dev": "docker-compose -f docker-compose-real-backend-minus-frontend.yml up -d && npm run start:local",
"dev": "docker compose -f docker-compose-real-backend-minus-frontend.yml up -d && npm run start:local",
"start": "node index.js",
"start:watch": "concurrently \"nodemon --exec 'npm run build && npm run start'\" \"npm run scss:watch\"",
"start:test": "NODE_ENV=test node index.js",
"start:local": "NODE_ENV=local node index.js",
"start:wiremock": "docker-compose up -d --force-recreate --build && NODE_ENV=wiremock node index.js",
"start:wiremock": "docker compose up -d --force-recreate --build && NODE_ENV=wiremock node index.js",
"start:development": "NODE_ENV=development node index.js",
"start:local:watch": "NODE_ENV=test npm run start:watch",
"docker-security-scan": "docker-compose -f docker-compose.security.yml run --rm zap",
"docker-security-scan": "docker compose -f docker-compose.security.yml run --rm zap",
"static-security-scan": "npm audit --json > npm-audit-report.json",
"scan:zap": "npm run docker-security-scan && npm run static-security-scan",
"mock:api": "node ./test/mock-api/index.js",
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ of [package.json](package.json)) for more examples.
```
- Run the application using docker
```
docker-compose -f docker-compose-real-backend.yml up
docker compose -f docker-compose-real-backend.yml up
```
- Run the application (without the frontend) using docker
```
docker-compose -f docker-compose-real-backend-minus-frontend.yml up
docker compose -f docker-compose-real-backend-minus-frontend.yml up
```
- Run external services in containers and start application
```
Expand Down
5 changes: 3 additions & 2 deletions src/middleware/common.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export function getErrorSummaryItems (req, res, next) {

export const prepareIssueDetailsTemplateParams = (req, res, next) => {
const { entry, pagination, dataRange, errorSummary, dataset, orgInfo } = req
const { issue_type: issueType, pageNumber } = req.parsedParams
const { issue_type: issueType, issue_field: issueField, pageNumber } = req.parsedParams

// schema: OrgIssueDetails
req.templateParams = {
Expand All @@ -637,6 +637,7 @@ export const prepareIssueDetailsTemplateParams = (req, res, next) => {
errorSummary,
entry,
issueType,
issueField,
pagination,
pageNumber,
dataRange
Expand All @@ -658,7 +659,7 @@ export const fetchSources = fetchMany({
SELECT
rhe.endpoint,
rhe.endpoint_url,
case
case
when rhe.status = '' or rhe.status is null then null
else cast(rhe.status as int)
end as status,
Expand Down
1 change: 1 addition & 0 deletions src/routes/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export const OrgIssueDetails = v.strictObject({
dataset: DatasetNameField,
errorSummary: errorSummaryParams,
issueType: NonEmptyString,
issueField: NonEmptyString,
entry: v.strictObject({
title: NonEmptyString,
fields: v.array(v.strictObject({
Expand Down
15 changes: 14 additions & 1 deletion src/views/organisations/issueDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
href: '/organisations/' + organisation.organisation + '/' + dataset.dataset
},
{
text: issueType | capitalize
text: issueType | capitalize,
href: '/organisations/' + organisation.organisation + '/' + dataset.dataset + '/' + issueType + '/' + issueField | urlencode
},
{
text: entry.title
}
]
}) }}
Expand All @@ -45,6 +49,15 @@

{% block content %}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{{ govukBackLink({
text: "Back to dataset table",
href: '/organisations/' + organisation.organisation + '/' + dataset.dataset + '/' + issueType + '/' + issueField | urlencode
}) }}
</div>
</div>

<div class="govuk-grid-row">
{% include "includes/_dataset-page-header.html" %}
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/views/organisations/issueTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@

{% block content %}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{{ govukBackLink({
text: "Back to task list",
href: '/organisations/' + organisation.organisation | urlencode + '/' + dataset.dataset | urlencode
}) }}
</div>
</div>

<div class="govuk-grid-row">
{% include "includes/_dataset-page-header.html" %}
Expand Down
1 change: 1 addition & 0 deletions test/unit/middleware/entityIssueDetails.middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ describe('issueDetails.middleware.js', () => {
geometries: ['POINT(0 0)']
},
issueType: 'test-issue-type',
issueField: 'test-issue-field',
pagination: {
items: [{
current: true,
Expand Down
1 change: 1 addition & 0 deletions test/unit/middleware/entryIssueDetails.middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ describe('entryIssueDetails.middleware.test.js', () => {
geometries: ['POINT(0 0)']
},
issueType: 'test-issue-type',
issueField: 'test-issue-field',
pagination: {
items: [{
current: true,
Expand Down

0 comments on commit 9ba4482

Please sign in to comment.