Skip to content

Commit

Permalink
Remove ID verified tag from summary pages (#775)
Browse files Browse the repository at this point in the history
hawx authored Oct 18, 2023
1 parent baa2f1c commit c379820
Showing 7 changed files with 13 additions and 57 deletions.
18 changes: 4 additions & 14 deletions internal/page/certificateprovider/guidance.go
Original file line number Diff line number Diff line change
@@ -4,19 +4,17 @@ import (
"net/http"

"github.com/ministryofjustice/opg-go-common/template"
"github.com/ministryofjustice/opg-modernising-lpa/internal/actor"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page"
"github.com/ministryofjustice/opg-modernising-lpa/internal/validation"
)

type guidanceData struct {
App page.AppData
Errors validation.List
Lpa *page.Lpa
CertificateProvider *actor.CertificateProviderProvidedDetails
App page.AppData
Errors validation.List
Lpa *page.Lpa
}

func Guidance(tmpl template.Template, donorStore DonorStore, certificateProviderStore CertificateProviderStore) page.Handler {
func Guidance(tmpl template.Template, donorStore DonorStore) page.Handler {
return func(appData page.AppData, w http.ResponseWriter, r *http.Request) error {
data := &guidanceData{
App: appData,
@@ -30,14 +28,6 @@ func Guidance(tmpl template.Template, donorStore DonorStore, certificateProvider
data.Lpa = lpa
}

if certificateProviderStore != nil {
certificateProvider, err := certificateProviderStore.Get(r.Context())
if err != nil {
return err
}
data.CertificateProvider = certificateProvider
}

return tmpl(w, data)
}
}
31 changes: 5 additions & 26 deletions internal/page/certificateprovider/guidance_test.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ import (
"net/http/httptest"
"testing"

"github.com/ministryofjustice/opg-modernising-lpa/internal/actor"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page"
"github.com/stretchr/testify/assert"
)
@@ -15,24 +14,18 @@ func TestGuidance(t *testing.T) {
r, _ := http.NewRequest(http.MethodGet, "/", nil)

lpa := &page.Lpa{}
certificateProvider := &actor.CertificateProviderProvidedDetails{}

donorStore := newMockDonorStore(t)
donorStore.
On("GetAny", r.Context()).
Return(lpa, nil)

certificateProviderStore := newMockCertificateProviderStore(t)
certificateProviderStore.
On("Get", r.Context()).
Return(certificateProvider, nil)

template := newMockTemplate(t)
template.
On("Execute", w, &guidanceData{App: testAppData, Lpa: lpa, CertificateProvider: certificateProvider}).
On("Execute", w, &guidanceData{App: testAppData, Lpa: lpa}).
Return(nil)

err := Guidance(template.Execute, donorStore, certificateProviderStore)(testAppData, w, r)
err := Guidance(template.Execute, donorStore)(testAppData, w, r)
resp := w.Result()

assert.Nil(t, err)
@@ -49,7 +42,7 @@ func TestGuidanceWhenNilDataStores(t *testing.T) {

r, _ := http.NewRequest(http.MethodGet, "/", nil)

err := Guidance(template.Execute, nil, nil)(testAppData, w, r)
err := Guidance(template.Execute, nil)(testAppData, w, r)
resp := w.Result()

assert.Nil(t, err)
@@ -67,21 +60,7 @@ func TestGuidanceWhenDonorStoreErrors(t *testing.T) {
On("GetAny", r.Context()).
Return(lpa, expectedError)

err := Guidance(nil, donorStore, nil)(testAppData, w, r)

assert.Equal(t, expectedError, err)
}

func TestGuidanceWhenCertificateProviderStoreErrors(t *testing.T) {
w := httptest.NewRecorder()
r, _ := http.NewRequest(http.MethodGet, "/", nil)

certificateProviderStore := newMockCertificateProviderStore(t)
certificateProviderStore.
On("Get", r.Context()).
Return(&actor.CertificateProviderProvidedDetails{}, expectedError)

err := Guidance(nil, nil, certificateProviderStore)(testAppData, w, r)
err := Guidance(nil, donorStore)(testAppData, w, r)

assert.Equal(t, expectedError, err)
}
@@ -100,7 +79,7 @@ func TestGuidanceWhenTemplateErrors(t *testing.T) {
On("Execute", w, &guidanceData{App: testAppData, Lpa: &page.Lpa{}}).
Return(expectedError)

err := Guidance(template.Execute, donorStore, nil)(testAppData, w, r)
err := Guidance(template.Execute, donorStore)(testAppData, w, r)

assert.Equal(t, expectedError, err)
}
8 changes: 4 additions & 4 deletions internal/page/certificateprovider/register.go
Original file line number Diff line number Diff line change
@@ -109,10 +109,10 @@ func Register(
handleCertificateProvider(page.Paths.CertificateProvider.ConfirmYourDetails,
ConfirmYourDetails(tmpls.Get("certificate_provider_confirm_your_details.gohtml"), donorStore, certificateProviderStore))
handleCertificateProvider(page.Paths.CertificateProvider.YourRole,
Guidance(tmpls.Get("certificate_provider_your_role.gohtml"), donorStore, nil))
Guidance(tmpls.Get("certificate_provider_your_role.gohtml"), donorStore))

handleCertificateProvider(page.Paths.CertificateProvider.WhatYoullNeedToConfirmYourIdentity,
Guidance(tmpls.Get("certificate_provider_what_youll_need_to_confirm_your_identity.gohtml"), donorStore, nil))
Guidance(tmpls.Get("certificate_provider_what_youll_need_to_confirm_your_identity.gohtml"), donorStore))

for path, page := range map[page.CertificateProviderPath]int{
page.Paths.CertificateProvider.SelectYourIdentityOptions: 0,
@@ -148,11 +148,11 @@ func Register(
handleCertificateProvider(page.Paths.CertificateProvider.ReadTheLpa,
ReadTheLpa(tmpls.Get("certificate_provider_read_the_lpa.gohtml"), donorStore, certificateProviderStore))
handleCertificateProvider(page.Paths.CertificateProvider.WhatHappensNext,
Guidance(tmpls.Get("certificate_provider_what_happens_next.gohtml"), donorStore, nil))
Guidance(tmpls.Get("certificate_provider_what_happens_next.gohtml"), donorStore))
handleCertificateProvider(page.Paths.CertificateProvider.ProvideCertificate,
ProvideCertificate(tmpls.Get("provide_certificate.gohtml"), donorStore, time.Now, certificateProviderStore))
handleCertificateProvider(page.Paths.CertificateProvider.CertificateProvided,
Guidance(tmpls.Get("certificate_provided.gohtml"), donorStore, nil))
Guidance(tmpls.Get("certificate_provided.gohtml"), donorStore))
}

func makeHandle(mux *http.ServeMux, store sesh.Store, errorHandler page.ErrorHandler) func(page.Path, page.Handler) {
1 change: 0 additions & 1 deletion lang/cy.json
Original file line number Diff line number Diff line change
@@ -239,7 +239,6 @@
"iveCheckedThisLpaAndImHappyToShowToCertificateProvider": "Rydw i wedi gwirio’r LPA hon ac nid wyf am wneud unrhyw newidiadau",
"iveCheckedThisLpaAndImHappyToShareWithCertificateProvider": "Welsh",
"youveNowFinishedFillingInTheLpa": "Rydych chi nawr wedi gorffen llenwi eich LPA. Cyn i chi barhau, gwiriwch eich holl atebion yn ofalus.",
"idVerifiedTag": "ID wedi gwirio",
"lpaDecisions": "Penderfyniadau LPA",
"typeOfLpa": "Math o LPA",
"whenYourAttorneysCanUseYourLpa": "Pryd gall eich atwrneiod ddefnyddio eich LPA",
1 change: 0 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
@@ -228,7 +228,6 @@
"theBoxIfYouHaveCheckedAndHappyToShareLpa": "the box if you have checked your LPA and are happy to share it with your certificate provider",
"checkYourLpa": "Check your LPA",
"youveNowFinishedFillingInTheLpa": "You’ve now finished filling in your LPA. Before you continue, carefully check all your answers.",
"idVerifiedTag": "ID Verified",
"lpaDecisions": "LPA decisions",
"typeOfLpa": "Type of LPA",
"whoAreYourAttorneys": {
6 changes: 0 additions & 6 deletions web/template/layout/certificate-provider-details.gohtml
Original file line number Diff line number Diff line change
@@ -18,12 +18,6 @@
</a>
</dd>
{{ end }}
{{/* This is the only reason we need to inject cpStore in to the Guidance handler - revisit if knowing CP ID status is a must have*/}}
{{/* {{ if .CertificateProvider.CertificateProviderIdentityConfirmed }}*/}}
{{/* <dd class="govuk-summary-list__value">*/}}
{{/* <strong class="govuk-tag app-task-list__tag govuk-tag">{{ tr .App "idVerifiedTag" }}</strong>*/}}
{{/* </dd>*/}}
{{/* {{ end }}*/}}
</div>

<div class="govuk-summary-list__row">
5 changes: 0 additions & 5 deletions web/template/layout/donor-details.gohtml
Original file line number Diff line number Diff line change
@@ -10,11 +10,6 @@
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">{{ tr .App "name" }}</dt>
<dd class="govuk-summary-list__value">{{ .Lpa.Donor.FullName }}</dd>
{{ if .Lpa.DonorIdentityConfirmed }}
<dd class="govuk-summary-list__value">
<strong class="govuk-tag app-task-list__tag govuk-tag">{{ tr .App "idVerifiedTag" }}</strong>
</dd>
{{ end }}
{{ if $canChange }}
<dd class="govuk-summary-list__actions">
<a class="govuk-link govuk-link--no-visited-state" href="{{ link .App (.App.Paths.YourDetails.Format .App.LpaID) }}?from={{.App.Page}}#f-first-names">

0 comments on commit c379820

Please sign in to comment.