Skip to content

Commit

Permalink
Add enableSystemLicenceView toggle to missed links
Browse files Browse the repository at this point in the history
When doing the original work on adding the feature flags some redirects and links where missed.

This change adds the toggle to the links / redirects picked up when in test.

https://eaflood.atlassian.net/browse/WATER-4466

Previous work - #1130
  • Loading branch information
jonathangoulding committed Jun 28, 2024
1 parent ba1e63a commit 888138a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions app/controllers/return-requirements.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
*/

const AbstractionPeriodService = require('../services/return-requirements/abstraction-period.service.js')
const AdditionalSubmissionOptionsService = require('../services/return-requirements/additional-submission-options.service.js')
const AddService = require('../services/return-requirements/add.service.js')
const AdditionalSubmissionOptionsService = require('../services/return-requirements/additional-submission-options.service.js')
const AgreementsExceptionsService = require('../services/return-requirements/agreements-exceptions.service.js')
const CancelService = require('../services/return-requirements/cancel.service.js')
const CheckService = require('../services/return-requirements/check.service.js')
const DeleteNoteService = require('../services/return-requirements/delete-note.service.js')
const ExistingService = require('../services/return-requirements/existing.service.js')
const FeatureFlagsConfig = require('../../config/feature-flags.config.js')
const FrequencyCollectedService = require('../services/return-requirements/frequency-collected.service.js')
const FrequencyReportedService = require('../services/return-requirements/frequency-reported.service.js')
const NoReturnsRequiredService = require('../services/return-requirements/no-returns-required.service.js')
Expand Down Expand Up @@ -295,7 +296,11 @@ async function submitCancel (request, h) {

await SubmitCancel.go(sessionId)

return h.redirect(`/licences/${licenceId}#charge`)
if (FeatureFlagsConfig.enableSystemLicenceView) {
return h.redirect(`/system/licences/${licenceId}/set-up`)
} else {
return h.redirect(`/licences/${licenceId}#charge`)
}
}

async function submitCheck (request, h) {
Expand Down
7 changes: 6 additions & 1 deletion app/presenters/return-requirements/start-date.presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @module StartDatePresenter
*/

const FeatureFlagsConfig = require('../../../config/feature-flags.config.js')
const { formatLongDate } = require('../base.presenter.js')

/**
Expand Down Expand Up @@ -44,7 +45,11 @@ function _backLink (session) {
return `/system/return-requirements/${id}/check`
}

return `/licences/${licence.id}#charge`
if (FeatureFlagsConfig.enableSystemLicenceView) {
return `/system/licences/${licence.id}/set-up`
} else {
return `/licences/${licence.id}#charge`
}
}

function _licenceVersionStartDate (licence) {
Expand Down

0 comments on commit 888138a

Please sign in to comment.