From 5c7b0e45fa7046124baec1ba4dc5209f97ff1d94 Mon Sep 17 00:00:00 2001 From: Alex Saunders Date: Tue, 6 Aug 2024 15:21:16 +0100 Subject: [PATCH] MLPAB-1540: Send application-deleted event, add supporter fixtures page (#1406) --- README.md | 10 +-- go.sum | 9 +- internal/app/app.go | 2 +- internal/donor/mock_EventClient_test.go | 47 +++++++++++ internal/donor/store.go | 10 +++ internal/donor/store_test.go | 100 +++++++++++++++++++---- internal/event/client.go | 4 + internal/event/client_test.go | 5 ++ internal/event/events.go | 4 + internal/page/fixtures/fixtures.go | 5 ++ internal/page/fixtures/supporter.go | 38 +++++++-- web/template/layout/fixtures-page.gohtml | 7 +- web/template/supporter_fixtures.gohtml | 52 ++++++++++++ 13 files changed, 249 insertions(+), 44 deletions(-) create mode 100644 web/template/supporter_fixtures.gohtml diff --git a/README.md b/README.md index 17e0c2e5c2..058d314b99 100644 --- a/README.md +++ b/README.md @@ -45,18 +45,12 @@ asdf install ### Local development -To run the app in dev mode on amd64/intel: +To run the app in dev mode: ```shell make up-dev ``` -or the following for arm64/apple silicon: - -```shell -make up-dev-arm -``` - Dev mode adds hot reloading via [air](https://github.com/cosmtrek/air) which will watch `.go` and `.gohtml` for changes and recompile the app. @@ -73,7 +67,7 @@ localhost. Example VSCode debug config: "mode": "remote", "port": 2345, "host": "127.0.0.1", - "trace": "verbose", + "trace": "verbose" } ``` diff --git a/go.sum b/go.sum index 737c8c1300..885d304249 100644 --- a/go.sum +++ b/go.sum @@ -139,8 +139,6 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/opensearch-project/opensearch-go/v4 v4.1.0 h1:YXNaMpMU0PC7suGyP13EuczkDT3K54QajgDnLKCZAz8= github.com/opensearch-project/opensearch-go/v4 v4.1.0/go.mod h1:aSTMFGSLEoiG19US6Oo5udvWCjHap3mRcWBNV8rAFak= -github.com/pact-foundation/pact-go/v2 v2.0.6 h1:ed4Dg5wAnOf3mVAcDXwG1CfD/I1FzpzaLdoJdLi5Ep8= -github.com/pact-foundation/pact-go/v2 v2.0.6/go.mod h1:2WpSPUzITjRZfLYfo1OuH3EmTltlM2DkgeA3WTDEUA8= github.com/pact-foundation/pact-go/v2 v2.0.7 h1:4yELx7b54ampFcSD+qhU1wFULGxxxlXWI8dhoLr6Adk= github.com/pact-foundation/pact-go/v2 v2.0.7/go.mod h1:2WpSPUzITjRZfLYfo1OuH3EmTltlM2DkgeA3WTDEUA8= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= @@ -192,8 +190,7 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/vektra/mockery/v2 v2.43.2 h1:OdivAsQL/uoQ55UnTt25tliRI8kaj5j6caHk9xaAUD0= -github.com/vektra/mockery/v2 v2.43.2/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= +github.com/vektra/mockery/v2 v2.44.1 h1:lfvocO3HklLp68gezPBVaHl+5rKXloGCO7eTEXh71dA= github.com/vektra/mockery/v2 v2.44.1/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/wI2L/jsondiff v0.6.0 h1:zrsH3FbfVa3JO9llxrcDy/XLkYPLgoMX6Mz3T2PP2AI= github.com/wI2L/jsondiff v0.6.0/go.mod h1:D6aQ5gKgPF9g17j+E9N7aasmU1O+XvfmWm1y8UMmNpw= @@ -233,8 +230,6 @@ go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= @@ -251,8 +246,6 @@ golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= diff --git a/internal/app/app.go b/internal/app/app.go index 46c60ebbb3..1b2dc14006 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -123,7 +123,7 @@ func App( handleRoot(page.Paths.AttorneyFixtures, None, fixtures.Attorney(tmpls.Get("attorney_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore, attorneyStore, eventClient, lpaStoreClient, organisationStore, memberStore, shareCodeStore)) handleRoot(page.Paths.SupporterFixtures, None, - fixtures.Supporter(sessionStore, organisationStore, donorStore, memberStore, lpaDynamoClient, searchClient, shareCodeStore, certificateProviderStore, attorneyStore, documentStore, eventClient, lpaStoreClient)) + fixtures.Supporter(tmpls.Get("supporter_fixtures.gohtml"), sessionStore, organisationStore, donorStore, memberStore, lpaDynamoClient, searchClient, shareCodeStore, certificateProviderStore, attorneyStore, documentStore, eventClient, lpaStoreClient)) handleRoot(page.Paths.DashboardFixtures, None, fixtures.Dashboard(tmpls.Get("dashboard_fixtures.gohtml"), sessionStore, donorStore, certificateProviderStore, attorneyStore, shareCodeStore)) } diff --git a/internal/donor/mock_EventClient_test.go b/internal/donor/mock_EventClient_test.go index 85d9c81260..6e8dd35b1e 100644 --- a/internal/donor/mock_EventClient_test.go +++ b/internal/donor/mock_EventClient_test.go @@ -22,6 +22,53 @@ func (_m *mockEventClient) EXPECT() *mockEventClient_Expecter { return &mockEventClient_Expecter{mock: &_m.Mock} } +// SendApplicationDeleted provides a mock function with given fields: _a0, _a1 +func (_m *mockEventClient) SendApplicationDeleted(_a0 context.Context, _a1 event.ApplicationDeleted) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for SendApplicationDeleted") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, event.ApplicationDeleted) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockEventClient_SendApplicationDeleted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendApplicationDeleted' +type mockEventClient_SendApplicationDeleted_Call struct { + *mock.Call +} + +// SendApplicationDeleted is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 event.ApplicationDeleted +func (_e *mockEventClient_Expecter) SendApplicationDeleted(_a0 interface{}, _a1 interface{}) *mockEventClient_SendApplicationDeleted_Call { + return &mockEventClient_SendApplicationDeleted_Call{Call: _e.mock.On("SendApplicationDeleted", _a0, _a1)} +} + +func (_c *mockEventClient_SendApplicationDeleted_Call) Run(run func(_a0 context.Context, _a1 event.ApplicationDeleted)) *mockEventClient_SendApplicationDeleted_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(event.ApplicationDeleted)) + }) + return _c +} + +func (_c *mockEventClient_SendApplicationDeleted_Call) Return(_a0 error) *mockEventClient_SendApplicationDeleted_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockEventClient_SendApplicationDeleted_Call) RunAndReturn(run func(context.Context, event.ApplicationDeleted) error) *mockEventClient_SendApplicationDeleted_Call { + _c.Call.Return(run) + return _c +} + // SendApplicationUpdated provides a mock function with given fields: _a0, _a1 func (_m *mockEventClient) SendApplicationUpdated(_a0 context.Context, _a1 event.ApplicationUpdated) error { ret := _m.Called(_a0, _a1) diff --git a/internal/donor/store.go b/internal/donor/store.go index 7917f326d2..725fec972a 100644 --- a/internal/donor/store.go +++ b/internal/donor/store.go @@ -54,6 +54,7 @@ type UidClient interface { type EventClient interface { SendUidRequested(context.Context, event.UidRequested) error + SendApplicationDeleted(context.Context, event.ApplicationDeleted) error SendApplicationUpdated(context.Context, event.ApplicationUpdated) error SendPreviousApplicationLinked(context.Context, event.PreviousApplicationLinked) error SendReducedFeeRequested(context.Context, event.ReducedFeeRequested) error @@ -386,6 +387,15 @@ func (s *donorStore) Delete(ctx context.Context) error { return errors.New("cannot access data of another donor") } + provided, err := s.Get(ctx) + if err != nil { + return err + } + + if err = s.eventClient.SendApplicationDeleted(ctx, event.ApplicationDeleted{UID: provided.LpaUID}); err != nil { + return err + } + return s.dynamoClient.DeleteKeys(ctx, keys) } diff --git a/internal/donor/store_test.go b/internal/donor/store_test.go index 086a69e9c2..544c037f7a 100644 --- a/internal/donor/store_test.go +++ b/internal/donor/store_test.go @@ -15,6 +15,7 @@ import ( "github.com/ministryofjustice/opg-modernising-lpa/internal/date" "github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" "github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" + "github.com/ministryofjustice/opg-modernising-lpa/internal/event" "github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" "github.com/ministryofjustice/opg-modernising-lpa/internal/place" "github.com/ministryofjustice/opg-modernising-lpa/internal/search" @@ -645,11 +646,18 @@ func TestDonorStoreDelete(t *testing.T) { dynamoClient.EXPECT(). AllKeysByPK(ctx, dynamo.LpaKey("123")). Return(keys, nil) + dynamoClient.ExpectOne(ctx, dynamo.LpaKey("123"), dynamo.DonorKey("an-id"), + &donordata.Provided{LpaUID: "lpa-uid"}, nil) dynamoClient.EXPECT(). DeleteKeys(ctx, keys). Return(nil) - donorStore := &donorStore{dynamoClient: dynamoClient} + eventClient := newMockEventClient(t) + eventClient.EXPECT(). + SendApplicationDeleted(ctx, event.ApplicationDeleted{UID: "lpa-uid"}). + Return(nil) + + donorStore := &donorStore{dynamoClient: dynamoClient, eventClient: eventClient} err := donorStore.Delete(ctx) assert.Nil(t, err) @@ -675,32 +683,94 @@ func TestDonorStoreDeleteWhenOtherDonor(t *testing.T) { assert.NotNil(t, err) } -func TestDonorStoreDeleteWhenAllKeysByPKErrors(t *testing.T) { +func TestDonorStoreDeleteWhenDynamoClientErrors(t *testing.T) { ctx := appcontext.ContextWithSession(context.Background(), &appcontext.Session{SessionID: "an-id", LpaID: "123"}) - dynamoClient := newMockDynamoClient(t) - dynamoClient.EXPECT(). - AllKeysByPK(ctx, dynamo.LpaKey("123")). - Return(nil, expectedError) + testCases := map[string]struct { + dynamoClient func(t *testing.T) *mockDynamoClient + eventClient func(t *testing.T) *mockEventClient + }{ + "AllKeysByPK": { + dynamoClient: func(t *testing.T) *mockDynamoClient { + dynamoClient := newMockDynamoClient(t) + dynamoClient.EXPECT(). + AllKeysByPK(mock.Anything, mock.Anything). + Return(nil, expectedError) + return dynamoClient + }, + eventClient: func(t *testing.T) *mockEventClient { + return newMockEventClient(t) + }, + }, + "One": { + dynamoClient: func(t *testing.T) *mockDynamoClient { + dynamoClient := newMockDynamoClient(t) + dynamoClient.EXPECT(). + AllKeysByPK(mock.Anything, mock.Anything). + Return([]dynamo.Keys{{PK: dynamo.LpaKey("123"), SK: dynamo.DonorKey("an-id")}}, nil) + dynamoClient.ExpectOne(mock.Anything, mock.Anything, mock.Anything, + &donordata.Provided{}, expectedError) + return dynamoClient + }, + eventClient: func(t *testing.T) *mockEventClient { + return newMockEventClient(t) + }, + }, + "DeleteKeys": { + dynamoClient: func(t *testing.T) *mockDynamoClient { + dynamoClient := newMockDynamoClient(t) + dynamoClient.EXPECT(). + AllKeysByPK(mock.Anything, mock.Anything). + Return([]dynamo.Keys{{PK: dynamo.LpaKey("123"), SK: dynamo.DonorKey("an-id")}}, nil) + dynamoClient.ExpectOne(mock.Anything, mock.Anything, mock.Anything, + &donordata.Provided{}, nil) + dynamoClient.EXPECT(). + DeleteKeys(ctx, mock.Anything). + Return(expectedError) + return dynamoClient + }, + eventClient: func(t *testing.T) *mockEventClient { + eventClient := newMockEventClient(t) + eventClient.EXPECT(). + SendApplicationDeleted(mock.Anything, mock.Anything). + Return(nil) + return eventClient + }, + }, + } - donorStore := &donorStore{dynamoClient: dynamoClient} + for name, tc := range testCases { + t.Run(name, func(tt *testing.T) { + donorStore := &donorStore{dynamoClient: tc.dynamoClient(tt), eventClient: tc.eventClient(tt)} - err := donorStore.Delete(ctx) - assert.Equal(t, expectedError, err) + err := donorStore.Delete(ctx) + assert.Equal(tt, expectedError, err) + }) + } } -func TestDonorStoreDeleteWhenDeleteKeysErrors(t *testing.T) { +func TestDonorStoreDeleteWhenEventClientError(t *testing.T) { ctx := appcontext.ContextWithSession(context.Background(), &appcontext.Session{SessionID: "an-id", LpaID: "123"}) + keys := []dynamo.Keys{ + {PK: dynamo.LpaKey("123"), SK: dynamo.DonorKey("sk1")}, + {PK: dynamo.LpaKey("123"), SK: dynamo.DonorKey("sk2")}, + {PK: dynamo.LpaKey("123"), SK: dynamo.DonorKey("an-id")}, + } + dynamoClient := newMockDynamoClient(t) dynamoClient.EXPECT(). - AllKeysByPK(ctx, dynamo.LpaKey("123")). - Return([]dynamo.Keys{{PK: dynamo.LpaKey("123"), SK: dynamo.DonorKey("an-id")}}, nil) - dynamoClient.EXPECT(). - DeleteKeys(ctx, mock.Anything). + AllKeysByPK(mock.Anything, mock.Anything). + Return(keys, nil) + dynamoClient.ExpectOne(mock.Anything, mock.Anything, mock.Anything, + &donordata.Provided{}, nil) + + eventClient := newMockEventClient(t) + eventClient.EXPECT(). + SendApplicationDeleted(ctx, mock.Anything). Return(expectedError) - donorStore := &donorStore{dynamoClient: dynamoClient} + donorStore := &donorStore{dynamoClient: dynamoClient, eventClient: eventClient} err := donorStore.Delete(ctx) assert.Equal(t, expectedError, err) diff --git a/internal/event/client.go b/internal/event/client.go index 4ba74b443f..52a5ec62e0 100644 --- a/internal/event/client.go +++ b/internal/event/client.go @@ -34,6 +34,10 @@ func (c *Client) SendUidRequested(ctx context.Context, event UidRequested) error return c.send(ctx, "uid-requested", event) } +func (c *Client) SendApplicationDeleted(ctx context.Context, event ApplicationDeleted) error { + return c.send(ctx, "application-deleted", event) +} + func (c *Client) SendApplicationUpdated(ctx context.Context, event ApplicationUpdated) error { return c.send(ctx, "application-updated", event) } diff --git a/internal/event/client_test.go b/internal/event/client_test.go index deec001fd7..166a907d0f 100644 --- a/internal/event/client_test.go +++ b/internal/event/client_test.go @@ -26,6 +26,11 @@ func TestClientSendEvents(t *testing.T) { return func(client *Client) error { return client.SendUidRequested(ctx, event) }, event }, + "application-deleted": func() (func(*Client) error, any) { + event := ApplicationDeleted{UID: "a"} + + return func(client *Client) error { return client.SendApplicationDeleted(ctx, event) }, event + }, "application-updated": func() (func(*Client) error, any) { event := ApplicationUpdated{UID: "a"} diff --git a/internal/event/events.go b/internal/event/events.go index a6908559e2..3f2a999017 100644 --- a/internal/event/events.go +++ b/internal/event/events.go @@ -17,6 +17,10 @@ type UidRequested struct { Donor uid.DonorDetails } +type ApplicationDeleted struct { + UID string `json:"uid"` +} + type ApplicationUpdated struct { UID string `json:"uid"` Type string `json:"type"` diff --git a/internal/page/fixtures/fixtures.go b/internal/page/fixtures/fixtures.go index dcf1a87960..563cb00a44 100644 --- a/internal/page/fixtures/fixtures.go +++ b/internal/page/fixtures/fixtures.go @@ -41,12 +41,17 @@ type fixturesData struct { Sub string DonorEmail string Errors validation.List + Members []Name } type Name struct { Firstnames, Lastname string } +func (n Name) Email() string { + return strings.ToLower(fmt.Sprintf("%s-%s@example.org", n.Firstnames, n.Lastname)) +} + var ( attorneyNames = []Name{ {Firstnames: "Jessie", Lastname: "Jones"}, diff --git a/internal/page/fixtures/supporter.go b/internal/page/fixtures/supporter.go index 6f5a13d31a..5c32b99ed3 100644 --- a/internal/page/fixtures/supporter.go +++ b/internal/page/fixtures/supporter.go @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/ministryofjustice/opg-go-common/template" "github.com/ministryofjustice/opg-modernising-lpa/internal/actor" "github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext" "github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" @@ -44,6 +45,7 @@ type ShareCodeStore interface { } func Supporter( + tmpl template.Template, sessionStore *sesh.Store, organisationStore OrganisationStore, donorStore DonorStore, @@ -73,14 +75,32 @@ func Supporter( setLPAProgress = r.FormValue("setLPAProgress") == "1" accessCode = r.FormValue("accessCode") linkDonor = r.FormValue("linkDonor") == "1" - - supporterSub = random.String(16) - supporterSessionID = base64.StdEncoding.EncodeToString([]byte(supporterSub)) - supporterCtx = appcontext.ContextWithSession(r.Context(), &appcontext.Session{SessionID: supporterSessionID, Email: testEmail}) + supporterSub = r.FormValue("supporterSub") ) + if supporterSub == "" { + supporterSub = random.String(16) + } + + supporterSessionID := base64.StdEncoding.EncodeToString([]byte(supporterSub)) + + supporterCtx := appcontext.ContextWithSession(r.Context(), &appcontext.Session{SessionID: supporterSessionID, Email: testEmail}) + loginSession := &sesh.LoginSession{Sub: supporterSub, Email: testEmail} + if asMember != "" { + supporterCtx = appcontext.ContextWithSession(r.Context(), &appcontext.Session{SessionID: supporterSessionID, Email: asMember}) + loginSession = &sesh.LoginSession{Sub: supporterSub, Email: asMember} + } + + if r.Method != http.MethodPost && !r.URL.Query().Has("redirect") { + return tmpl(w, &fixturesData{ + App: appData, + Sub: supporterSub, + Members: orgMemberNames, + }) + } + if organisation == "1" { member, err := memberStore.Create(supporterCtx, random.String(12), random.String(12)) if err != nil { @@ -216,8 +236,6 @@ func Supporter( break } - email := strings.ToLower(fmt.Sprintf("%s-%s@example.org", member.Firstnames, member.Lastname)) - now := time.Now() if expireInvites { now = now.Add(time.Hour * -time.Duration(48)) @@ -225,11 +243,11 @@ func Supporter( invite := &supporterdata.MemberInvite{ PK: dynamo.OrganisationKey(org.ID), - SK: dynamo.MemberInviteKey(email), + SK: dynamo.MemberInviteKey(member.Email()), CreatedAt: now, OrganisationID: org.ID, OrganisationName: org.Name, - Email: email, + Email: member.Email(), FirstNames: member.Firstnames, LastName: member.Lastname, Permission: supporterdata.PermissionAdmin, @@ -296,7 +314,9 @@ func Supporter( return err } - if redirect != page.Paths.Supporter.EnterOrganisationName.Format() && redirect != page.Paths.Supporter.EnterYourName.Format() && redirect != page.Paths.EnterAccessCode.Format() { + if redirect == "" { + redirect = page.Paths.Supporter.Dashboard.Format() + } else if redirect != page.Paths.Supporter.EnterOrganisationName.Format() && redirect != page.Paths.Supporter.EnterYourName.Format() && redirect != page.Paths.EnterAccessCode.Format() { redirect = "/supporter" + redirect } diff --git a/web/template/layout/fixtures-page.gohtml b/web/template/layout/fixtures-page.gohtml index 9e0edaf8b3..98cddd1fde 100644 --- a/web/template/layout/fixtures-page.gohtml +++ b/web/template/layout/fixtures-page.gohtml @@ -8,11 +8,12 @@
  • Certificate provider
  • Attorney
  • Dashboard
  • +
  • Supporter
  • {{ template "pageTitle" . }}

    - + {{ template "fixtures-main" . }} @@ -28,12 +29,12 @@