From 6c80728bd8cc50f51216d5791b73fd59d0f86d25 Mon Sep 17 00:00:00 2001 From: HappyNTH Date: Mon, 15 Apr 2024 16:29:13 +0000 Subject: [PATCH 1/4] Show production-level information in booking flow --- .../production/ProductionBasicInfoFragment.gql | 1 + .../[slug]/book/[performanceId]/warnings.vue | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/graphql/fragments/production/ProductionBasicInfoFragment.gql b/graphql/fragments/production/ProductionBasicInfoFragment.gql index 428ccb539..b4c71632d 100644 --- a/graphql/fragments/production/ProductionBasicInfoFragment.gql +++ b/graphql/fragments/production/ProductionBasicInfoFragment.gql @@ -31,5 +31,6 @@ fragment ProductionBasicInfo on ProductionNode { longDescription } } + productionAlert isBookable } diff --git a/pages/production/[slug]/book/[performanceId]/warnings.vue b/pages/production/[slug]/book/[performanceId]/warnings.vue index 0e81436e3..b0005c4d2 100644 --- a/pages/production/[slug]/book/[performanceId]/warnings.vue +++ b/pages/production/[slug]/book/[performanceId]/warnings.vue @@ -9,10 +9,18 @@ class="w-full mb-2" > {{ booking.performance.description }} +
+

+ + Production Warnings +

+
+

{{ production.productionAlert }}

+

@@ -26,7 +34,6 @@ }}.

-
{ return ( - production.contentWarnings.length > 0 || booking?.performance?.description + production.contentWarnings.length > 0 || + booking?.performance?.description || + production.productionAlert ); } }); From 7733dd60fb4a02e8bf68ee87f709fd0899ec3f4a Mon Sep 17 00:00:00 2001 From: HappyNTH Date: Mon, 15 Apr 2024 16:42:35 +0000 Subject: [PATCH 2/4] Allow production warnings to be added/edited through the production editor --- components/production/editor/ProductionEditor.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/production/editor/ProductionEditor.vue b/components/production/editor/ProductionEditor.vue index 05e89bd0e..52836dea0 100644 --- a/components/production/editor/ProductionEditor.vue +++ b/components/production/editor/ProductionEditor.vue @@ -125,6 +125,18 @@

+ + Production Warnings + + +
Date: Mon, 6 May 2024 11:44:55 +0000 Subject: [PATCH 3/4] Update AudienceWarningsStage unit test to reflect page changes --- .../stages/AudienceWarningsStage.spec.js | 29 +++++++++++++++---- tests/unit/support/fixtures/Production.js | 1 + 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/tests/unit/pages/booking/stages/AudienceWarningsStage.spec.js b/tests/unit/pages/booking/stages/AudienceWarningsStage.spec.js index 4b7374843..ddc52b6bd 100644 --- a/tests/unit/pages/booking/stages/AudienceWarningsStage.spec.js +++ b/tests/unit/pages/booking/stages/AudienceWarningsStage.spec.js @@ -24,13 +24,20 @@ describe('Audience Warnings Stage', () => { }); it('doesnt display any production description', () => { - expect(warningComponent.text()).to.not.contain('Performance Information'); + expect(warningComponent.text()).to.not.contain( + 'Performance-Specific Information' + ); expect(warningComponent.text()).to.not.contain( 'the performance description' ); }); - it('displays the warnings', () => { + it('displays the production warning', () => { + expect(warningComponent.text()).to.contain('Production Warnings'); + expect(warningComponent.text()).to.contain('This is a production alert.'); + }); + + it('displays the content warnings', () => { expect(warningComponent.text()).to.contain('Strobe Lighting'); expect(warningComponent.text()).to.contain('Nudity'); }); @@ -46,18 +53,30 @@ describe('Audience Warnings Stage', () => { warningComponent = await mount(AudienceWarningsStage, { shallow: false, propsData: { - production: Production({ contentWarnings: [] }), + production: Production({ + contentWarnings: [], + productionAlert: null + }), booking: BookingCls.fromAPIData(Booking()) } }); }); it('displays the production description', () => { - expect(warningComponent.text()).to.contain('Performance Information'); + expect(warningComponent.text()).to.contain( + 'Performance-Specific Information' + ); expect(warningComponent.text()).to.contain('the performance description'); }); - it('doesnt display any warnings', () => { + it('doesnt display the production warning', () => { + expect(warningComponent.text()).to.not.contain('Production Warnings'); + expect(warningComponent.text()).to.not.contain( + 'This is a production alert.' + ); + }); + + it('doesnt display any content warnings', () => { expect(warningComponent.text()).to.not.contain('Strobe Lighting'); expect(warningComponent.text()).to.not.contain('Nudity'); }); diff --git a/tests/unit/support/fixtures/Production.js b/tests/unit/support/fixtures/Production.js index c752907dd..6be058d0a 100644 --- a/tests/unit/support/fixtures/Production.js +++ b/tests/unit/support/fixtures/Production.js @@ -41,6 +41,7 @@ export default (overrides = {}, includePerformance = false) => { { warning: { shortDescription: 'Strobe Lighting' } }, { warning: { shortDescription: 'Nudity' } } ], + productionAlert: 'This is a production alert.', performances: includePerformance ? GenericNodeConnection([Performance()]) : GenericNodeConnection() From e8105fbd5aec06174d56a5a4d9d9fcbf65a006e3 Mon Sep 17 00:00:00 2001 From: HappNTH Date: Thu, 10 Oct 2024 21:36:23 +0000 Subject: [PATCH 4/4] Fix some issues with saving alerts (needs API fix too) --- components/production/editor/ProductionEditor.vue | 1 + graphql/queries/admin/productions/AdminProductionEdit.gql | 1 + 2 files changed, 2 insertions(+) diff --git a/components/production/editor/ProductionEditor.vue b/components/production/editor/ProductionEditor.vue index 52836dea0..d7ee2a448 100644 --- a/components/production/editor/ProductionEditor.vue +++ b/components/production/editor/ProductionEditor.vue @@ -399,6 +399,7 @@ export default { ageRating: this.production.ageRating, facebookEvent: this.production.facebookEvent, contactEmail: this.production.contactEmail, + productionAlert: this.production.productionAlert, contentWarnings: (this.production.contentWarnings ?? []).map((cw) => ({ id: cw.warning.id, information: cw.information diff --git a/graphql/queries/admin/productions/AdminProductionEdit.gql b/graphql/queries/admin/productions/AdminProductionEdit.gql index 1883c7b03..eb058ec8d 100644 --- a/graphql/queries/admin/productions/AdminProductionEdit.gql +++ b/graphql/queries/admin/productions/AdminProductionEdit.gql @@ -36,6 +36,7 @@ query adminProductionEdit($slug: String!) { } ageRating facebookEvent + productionAlert performances(orderBy: "start") { edges { node {