Skip to content

Commit

Permalink
implementation of directing to CUI dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
velimd committed Aug 30, 2024
1 parent 89dd441 commit c9ea93c
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/cmc-citizen-frontend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: cmc-citizen-frontend
home: https://github.com/hmcts/cmc-citizen-frontend
version: 4.1.54
version: 4.1.55
description: Helm chart for the HMCTS CMC Citizen Frontend service
# be aware when bumping version that it is used elsewhere, e.g.:
# chart-cmc - demo: https://github.com/hmcts/chart-cmc/tree/master/cmc
Expand Down
2 changes: 2 additions & 0 deletions charts/cmc-citizen-frontend/values.aat.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ nodejs:
FEATURE_TESTING_SUPPORT: true
FEATURE_RETURN_ERROR_TO_USER: true
PAY_RETURN_URL: https://${SERVICE_FQDN}
CIVIL_CITIZEN_URL: https://civil-citizen-ui.aat.platform.hmcts.net
CIVIL_CITIZEN_UI_REDIRECT: true
1 change: 1 addition & 0 deletions charts/cmc-citizen-frontend/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ nodejs:
FEATURE_TOGGLES_API_URL: http://${SERVICE_NAME}-ftr-tgl
CLAIM_STORE_URL: http://${SERVICE_NAME}-claim-store
PAY_RETURN_URL: https://${SERVICE_FQDN}
CIVIL_CITIZEN_UI_REDIRECT: false

# config to make non prod testing easier
FEATURE_TESTING_SUPPORT: true
Expand Down
2 changes: 2 additions & 0 deletions charts/cmc-citizen-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ nodejs:
FEES_URL: http://fees-register-api-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal
DRAFT_STORE_URL: http://draft-store-service-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal
CLAIM_STORE_URL: http://cmc-claim-store-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal
CIVIL_CITIZEN_URL: https://civil-citizen-ui.{{ .Values.global.environment }}.platform.hmcts.net
CIVIL_CITIZEN_UI_REDIRECT: false

UV_THREADPOOL_SIZE: 64

Expand Down
4 changes: 4 additions & 0 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,9 @@
"pcq":
{
"url":"PCQ_URL"
},
"civil-citizen-ui": {
"url": "CIVIL_CITIZEN_URL",
"sign-out-redirect": "CIVIL_CITIZEN_UI_REDIRECT"
}
}
4 changes: 4 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,9 @@
"pcq":
{
"url":"http://localhost:4001"
},
"civil-citizen-ui": {
"url": "http://localhost:ENTER_PORT_HERE",
"sign-out-redirect": false
}
}
2 changes: 1 addition & 1 deletion src/main/features/ccj/views/confirmation-ccj.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<p><a target="_blank" rel="noreferrer noopener" href="https://www.smartsurvey.co.uk/s/CMCMVPT1/">{{ t('What did you think of this service? (opens in new tab).') }}</a></p>

<p>{{ internalLink('Go to your account', DashboardPaths.dashboardPage.uri, 'button') | safe }}</p>
<p>{{ internalLink('Go to your account', dashboardUrl, 'button') | safe }}</p>

{{ supportWidget() }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
{% include "includes/service-survey-link-defendant.njk" %}
{% endif %}

<p>{{ internalLink('Go to your account', DashboardPaths.dashboardPage.uri, 'button') | safe }}</p>
<p>{{ internalLink('Go to your account', dashboardUrl, 'button') | safe }}</p>

{{ supportWidget() }}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/main/features/claim/views/confirmation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
{% else %}
{{ claimConfirmation(claim) }}
{% endif %}

{% include "includes/service-survey-link-claimant.njk" %}
{{ internalLink(t('Go to your account'), DashboardPaths.dashboardPage.uri, 'button') }}
{{ internalLink(t('Go to your account'), dashboardUrl, 'button') }}
{{ supportWidget() }}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/features/claimant-response/views/confirmation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

{% include "includes/service-survey-link-claimant.njk" %}

<p>{{ internalLink(t('Go to your account'), DashboardPaths.dashboardPage.uri, 'button') }}</p>
<p>{{ internalLink(t('Go to your account'), dashboardUrl, 'button') }}</p>

{{ supportWidget() }}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/main/features/dashboard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DraftService } from 'services/draftService'
import { DraftClaim } from 'drafts/models/draftClaim'
import { OAuthHelper } from 'idam/oAuthHelper'
import { PaymentSchedule } from 'claims/models/response/core/paymentSchedule'
import { Paths } from 'dashboard/paths'
import { dashboardUrl, Paths } from 'dashboard/paths'
import { Claim } from 'claims/models/claim'
import { ClaimStatusFlow } from 'dashboard/helpers/claimStatusFlow'
import { app } from 'main/app'
Expand Down Expand Up @@ -54,6 +54,7 @@ export class DashboardFeature {

if (app.settings.nunjucksEnv.globals) {
app.settings.nunjucksEnv.globals.DashboardPaths = Paths
app.settings.nunjucksEnv.globals.dashboardUrl = dashboardUrl
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/main/features/dashboard/paths.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import * as config from 'config'

import { RoutablePath } from 'shared/router/routablePath'
import { paidInFullPath } from 'paid-in-full/paths'

const baseCivilCitizenUrl = config.get('civil-citizen-ui.url')
const redirectToCivil = config.get('civil-citizen-ui.sign-out-redirect')

export class Paths {
static readonly dashboardPage = new RoutablePath('/dashboard/index')
static readonly claimantPage = new RoutablePath('/dashboard/:externalId/claimant')
Expand All @@ -9,3 +14,5 @@ export class Paths {
static readonly contactThemPage = new RoutablePath('/dashboard/:externalId/contact-them')
static readonly datePaidPage = new RoutablePath(`${paidInFullPath}/date-paid`)
}

export const dashboardUrl = redirectToCivil ? `${baseCivilCitizenUrl}/dashboard` : Paths.dashboardPage.uri
2 changes: 1 addition & 1 deletion src/main/features/offer/views/settled.njk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{% include "includes/service-survey-link-defendant.njk" %}

<p>
{{ internalLink(t('Go to your account'), DashboardPaths.dashboardPage.uri, 'button') }}
{{ internalLink(t('Go to your account'), dashboardUrl, 'button') }}
</p>

{{ supportWidget() }}
Expand Down
2 changes: 1 addition & 1 deletion src/main/features/orders/views/confirmation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<p>{{ t('A judge will then review the order and any comments. We’ll contact you both by post to tell you what to do next.') }}</p>
<p>{{ t('Continue doing everything the order tells you to do unless you hear that a judge has changed it.') }}</p>

<p>{{ internalLink('Go to your account', DashboardPaths.dashboardPage.uri, 'button') | safe }}</p>
<p>{{ internalLink('Go to your account', dashboardUrl, 'button') | safe }}</p>

{{ supportWidget() }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/features/paid-in-full/views/confirmation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
{% include "includes/service-survey-link-claimant.njk" %}

<p>{{ internalLink(t('Go to your account'), DashboardPaths.dashboardPage.uri, 'button') }}</p>
<p>{{ internalLink(t('Go to your account'), dashboardUrl, 'button') }}</p>

{{ supportWidget() }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/features/response/views/confirmation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

{% include "includes/service-survey-link-defendant.njk" %}

<p>{{ internalLink(t('Go to your account'), DashboardPaths.dashboardPage.uri, 'button') }}</p>
<p>{{ internalLink(t('Go to your account'), dashboardUrl, 'button') }}</p>

{{ supportWidget() }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<p>{{ t('Make sure you get receipts for any payments.') }}</p>
{% endif %}
{% include "includes/service-survey-link-defendant.njk" %}
{{ internalLink('Go to your account', DashboardPaths.dashboardPage.uri, 'button') }}
{{ internalLink('Go to your account', dashboardUrl, 'button') }}
{{ supportWidget() }}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/main/views/includes/propositional_navigation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
{{ internalLink(t('Menu'), '#proposition-links', 'js-header-toggle menu') }}
<nav id="proposition-menu">
{% if serviceName %}
{{ internalLink(t(serviceName), AppPaths.homePage.uri, id='proposition-name') }}
{{ internalLink(t(serviceName), dashboardUrl, id='proposition-name') }}
{% endif %}
<ul id="proposition-links" class="pull-right">
{% if isLoggedIn === true and isFirstContactPath === false %}
<li>{{ internalLink(t('My account'), DashboardPaths.dashboardPage.uri) }}</li>
<li>{{ internalLink(t('My account'), dashboardUrl) }}</li>
<li>{{ internalLink(t('Sign out'), AppPaths.logoutReceiver.uri) }}</li>
{% endif %}
</ul>
Expand Down

0 comments on commit c9ea93c

Please sign in to comment.