-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from cabinetoffice/NTRNL-529-update-endpoints…
…-for-the-github-additional-requests-page-to-match-the-new-structure Ntrnl 529 update endpoints for the GitHub additional requests page to match the new structure
- Loading branch information
Showing
22 changed files
with
172 additions
and
167 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const AdditionalRequestKey = 'additional_requests'; | ||
|
||
export const AdditionalRequestMappingKeys: (keyof AdditionalRequest)[] = [ | ||
'id', | ||
'context', | ||
'description' | ||
]; | ||
|
||
export interface AdditionalRequest { | ||
id?: string; | ||
context?: string; | ||
description?: string; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Router } from 'express'; | ||
|
||
import { checkValidations } from '../../middleware/validation.middleware'; | ||
import { authentication } from '../../middleware/authentication.middleware'; | ||
import { additionalRequest as additionalRequestValidation } from '../../validation/github/additional-request.validation'; | ||
|
||
import { get, post, getById, removeById, postById } from '../../controller/github/additional-request.controller'; | ||
import * as config from '../../config'; | ||
|
||
const additionalRequestRouter = Router(); | ||
|
||
additionalRequestRouter.get(config.GITHUB_URL + config.CREATE + config.ADDITIONAL_REQUEST_URL, authentication, get); | ||
additionalRequestRouter.post(config.GITHUB_URL + config.CREATE + config.ADDITIONAL_REQUEST_URL, authentication, ...additionalRequestValidation, checkValidations, post); | ||
|
||
additionalRequestRouter.get(config.GITHUB_URL + config.REMOVE + config.ADDITIONAL_REQUEST_URL + config.PARAM_ID, authentication, removeById); | ||
|
||
additionalRequestRouter.get(config.GITHUB_URL + config.UPDATE + config.ADDITIONAL_REQUEST_URL + config.PARAM_ID, authentication, getById); | ||
additionalRequestRouter.post(config.GITHUB_URL + config.UPDATE + config.ADDITIONAL_REQUEST_URL + config.PARAM_ID, authentication, ...additionalRequestValidation, checkValidations, postById); | ||
|
||
export default additionalRequestRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { body } from 'express-validator'; | ||
import { descriptionRequiredValidation } from '../fields/description-required.validation'; | ||
import { ErrorMessages } from '../error.messages'; | ||
|
||
export const additionalRequest = [ | ||
body('context').notEmpty({ ignore_whitespace: true }).withMessage(ErrorMessages.CONTEXT), ...descriptionRequiredValidation | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% set additionalRequestSummaryData = [] %} | ||
|
||
{% for additional_request in additional_requests %} | ||
|
||
{% set additionalRequestEditHref = "/github/update/additional-request/" + additional_request.id %} | ||
{% set additionalRequestDeleteHref = "/github/remove/additional-request/" + additional_request.id %} | ||
|
||
{% set additionalRequestSummaryData = (additionalRequestSummaryData.push({ | ||
key: { | ||
text: "Additional request context" | ||
}, | ||
value: { | ||
text: additional_request.context | ||
}, | ||
actions: { | ||
items: [ | ||
{ | ||
href: additionalRequestEditHref, | ||
text: "Edit", | ||
visuallyHiddenText: "Additional request context" | ||
}, | ||
{ | ||
href: additionalRequestDeleteHref, | ||
text: "Delete", | ||
visuallyHiddenText: "Additional request context" | ||
} | ||
] | ||
} | ||
}), additionalRequestSummaryData) %} | ||
|
||
{% endfor %} | ||
|
||
{{ govukSummaryList({ | ||
rows: additionalRequestSummaryData | ||
}) }} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.