-
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.
* SIR-888: water-pollution/your-details (#205) Looks good to me :) * SIR-887 : Story – WP – Check your answers (#208) * SIR-888: water-pollution/your-details (#205) Looks good to me :) * WIP - WP CYA Page * Technical implementation for SIR-887 * Fixed all lint errors * Refactored code and added comments * Refactored code and logic update * Added unit tests for check your answers page * SIR-1102 map widget for check your answers (#207) * linting that i missed * Fixed unit test case issues * fixing unit tests * reverting date test am and AM having issues * CYA routing boilerplate * changing to form-layout otherwise post doesn''t work * Fixed sonar issues part 1 * Fixed lint issues * Fixed sonar issues part 2 * Fixed sonar issues part 3 * Added test coverage part 1 * Added test coverage part 2 * Added test coverage part 3 * Additional logic added for UI renderning * Added null check * Reduced code complexity for sonar * Reduced code complexity for sonar * Updated logic complexity * Additional test cases for more coverage * Updated code based on review comments * Check your answers routing (#210) * SIR-1066 pollution-substance routing from CYA * updating var name for sonarcloud * test coverage * SIR-892 pollution-appearance routing from CYA (#211) * SIR-892 pollution-appearance routing from CYA * SIR-890 change location from CYA (#212) * SIR-890 change location from CYA * removing .only from unit tests * sonarcloud * SIR-1068 CYA routing for WP source (#217) --------- Co-authored-by: Tedd <[email protected]> * SIR-893 images-and-videos CYA routing * SIR-891 - observed date time from cya (#220) * SIR-891 - observed date time from cya * sonarcloud stuff * further test coverage for dates * SIR-889 : Story – WP – Check your answers – Watercourse & Extent (#218) * CYA - Watercourse & Extent redirection implementation * CYA - Prepopulate answers for watercourse & Extent pages * WIP - Updated test case * WIP - CYA Test cases * Added test cases for CYA watercourse & extent * SIR-894 : Story – WP – Check your answers – Dead animals (#222) * Technical implementation for SIR-894 * Removed console logs * fixing test missed from merge * SIR-895 : Story – WP – Check your answers – Other text (#225) * Technical implementation for SIR-895 * Added logs to check data on server * Added logs to check data on server * Added logs to check data on server * Removed logs --------- Co-authored-by: Tedd Mason <[email protected]> * Reset the referer flag in case if the user restarts the WP journey before report submission (#228) --------- Co-authored-by: sujithvg <[email protected]>
- Loading branch information
Showing
66 changed files
with
2,752 additions
and
510 deletions.
There are no files selected for viewing
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,3 @@ | ||
import { initialiseMap } from '../map.js' | ||
|
||
export { initialiseMap } |
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 |
---|---|---|
|
@@ -25,5 +25,6 @@ const getLocation = async () => { | |
] | ||
} | ||
|
||
initialiseMap() | ||
initialiseLocationSearch() | ||
|
||
export { initialiseMap } |
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 |
---|---|---|
@@ -1,15 +1,37 @@ | ||
import constants from '../utils/constants.js' | ||
|
||
const onPostHandler = { | ||
plugin: { | ||
name: 'on-post-handler', | ||
register: (server, _options) => { | ||
server.ext('onPostHandler', async (request, h) => { | ||
if (request.response.variety === 'view' && request.method === 'get') { | ||
request.response.headers['cache-control'] = 'no-cache, no-store, must-revalidate' | ||
handleReferer(request) | ||
} | ||
return h.continue | ||
}) | ||
} | ||
} | ||
} | ||
|
||
const handleReferer = request => { | ||
if (request.headers.referer) { | ||
// If referer was a check route then set the session referer | ||
// Route then decides whether to redirect to referer or not | ||
const setReferer = constants.setReferer.find(item => request.headers.referer.indexOf(item) > -1) | ||
const clearReferer = constants.clearReferer.find(item => request.headers.referer.indexOf(item) > -1) | ||
if (setReferer) { | ||
request.yar.set(constants.redisKeys.REFERER, `/${setReferer}`) | ||
} else if (clearReferer) { | ||
request.yar.clear(constants.redisKeys.REFERER) | ||
} else { | ||
// do nothing for sonarcloud | ||
} | ||
} else { | ||
// If no referer then clear referer key because user has broken the journey | ||
request.yar.clear(constants.redisKeys.REFERER) | ||
} | ||
} | ||
|
||
export default onPostHandler |
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
Oops, something went wrong.