diff --git a/kompassi-v2-frontend/src/__generated__/gql.ts b/kompassi-v2-frontend/src/__generated__/gql.ts index bbea07f8a..478bb8566 100644 --- a/kompassi-v2-frontend/src/__generated__/gql.ts +++ b/kompassi-v2-frontend/src/__generated__/gql.ts @@ -116,7 +116,7 @@ type Documents = { "\n query ProgramFormResponses(\n $eventSlug: String!\n $surveySlug: String!\n $locale: String\n $filters: [DimensionFilterInput!]\n ) {\n profile {\n forms {\n surveys(eventSlug: $eventSlug, relation: SUBSCRIBED) {\n slug\n }\n }\n }\n event(slug: $eventSlug) {\n name\n slug\n\n forms {\n survey(slug: $surveySlug, app: PROGRAM) {\n slug\n title(lang: $locale)\n purpose\n anonymity\n\n fields(lang: $locale, keyFieldsOnly: true)\n dimensions {\n ...DimensionFilter\n ...ColoredDimensionTableCell\n }\n\n countResponses\n responsesDeletionStatus\n\n responses(filters: $filters) {\n ...ProgramFormResponse\n }\n }\n }\n }\n }\n": typeof types.ProgramFormResponsesDocument, "\n mutation CreateProgramForm($input: CreateProgramFormInput!) {\n createProgramForm(input: $input) {\n survey {\n slug\n }\n }\n }\n": typeof types.CreateProgramFormDocument, "\n fragment OfferForm on FullSurveyType {\n slug\n title(lang: $locale)\n isActive\n activeFrom\n activeUntil\n countResponses\n purpose\n\n languages {\n language\n }\n }\n": typeof types.OfferFormFragmentDoc, - "\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE]\n ) {\n ...OfferForm\n }\n }\n }\n }\n": typeof types.ProgramFormsPageDocument, + "\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE, FOLLOWUP]\n ) {\n ...OfferForm\n }\n }\n }\n }\n": typeof types.ProgramFormsPageDocument, "\n fragment ProgramAdminHost on FullProgramHostType {\n person {\n firstName\n lastName\n nick\n }\n programs {\n slug\n title\n cachedDimensions\n }\n }\n": typeof types.ProgramAdminHostFragmentDoc, "\n query ProgramAdminHosts(\n $eventSlug: String!\n $filters: [DimensionFilterInput!]\n $locale: String\n ) {\n event(slug: $eventSlug) {\n name\n slug\n timezone\n\n program {\n programHostsExcelExportLink\n\n dimensions(isListFilter: true, publicOnly: false) {\n ...DimensionFilter\n }\n programHosts(programFilters: $filters) {\n ...ProgramAdminHost\n }\n }\n }\n }\n": typeof types.ProgramAdminHostsDocument, "\n fragment ProgramAdminInvitation on FullInvitationType {\n id\n email\n createdAt\n cachedDimensions\n\n program {\n slug\n title\n }\n }\n": typeof types.ProgramAdminInvitationFragmentDoc, @@ -365,7 +365,7 @@ const documents: Documents = { "\n query ProgramFormResponses(\n $eventSlug: String!\n $surveySlug: String!\n $locale: String\n $filters: [DimensionFilterInput!]\n ) {\n profile {\n forms {\n surveys(eventSlug: $eventSlug, relation: SUBSCRIBED) {\n slug\n }\n }\n }\n event(slug: $eventSlug) {\n name\n slug\n\n forms {\n survey(slug: $surveySlug, app: PROGRAM) {\n slug\n title(lang: $locale)\n purpose\n anonymity\n\n fields(lang: $locale, keyFieldsOnly: true)\n dimensions {\n ...DimensionFilter\n ...ColoredDimensionTableCell\n }\n\n countResponses\n responsesDeletionStatus\n\n responses(filters: $filters) {\n ...ProgramFormResponse\n }\n }\n }\n }\n }\n": types.ProgramFormResponsesDocument, "\n mutation CreateProgramForm($input: CreateProgramFormInput!) {\n createProgramForm(input: $input) {\n survey {\n slug\n }\n }\n }\n": types.CreateProgramFormDocument, "\n fragment OfferForm on FullSurveyType {\n slug\n title(lang: $locale)\n isActive\n activeFrom\n activeUntil\n countResponses\n purpose\n\n languages {\n language\n }\n }\n": types.OfferFormFragmentDoc, - "\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE]\n ) {\n ...OfferForm\n }\n }\n }\n }\n": types.ProgramFormsPageDocument, + "\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE, FOLLOWUP]\n ) {\n ...OfferForm\n }\n }\n }\n }\n": types.ProgramFormsPageDocument, "\n fragment ProgramAdminHost on FullProgramHostType {\n person {\n firstName\n lastName\n nick\n }\n programs {\n slug\n title\n cachedDimensions\n }\n }\n": types.ProgramAdminHostFragmentDoc, "\n query ProgramAdminHosts(\n $eventSlug: String!\n $filters: [DimensionFilterInput!]\n $locale: String\n ) {\n event(slug: $eventSlug) {\n name\n slug\n timezone\n\n program {\n programHostsExcelExportLink\n\n dimensions(isListFilter: true, publicOnly: false) {\n ...DimensionFilter\n }\n programHosts(programFilters: $filters) {\n ...ProgramAdminHost\n }\n }\n }\n }\n": types.ProgramAdminHostsDocument, "\n fragment ProgramAdminInvitation on FullInvitationType {\n id\n email\n createdAt\n cachedDimensions\n\n program {\n slug\n title\n }\n }\n": types.ProgramAdminInvitationFragmentDoc, @@ -937,7 +937,7 @@ export function graphql(source: "\n fragment OfferForm on FullSurveyType {\n /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE]\n ) {\n ...OfferForm\n }\n }\n }\n }\n"): (typeof documents)["\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE]\n ) {\n ...OfferForm\n }\n }\n }\n }\n"]; +export function graphql(source: "\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE, FOLLOWUP]\n ) {\n ...OfferForm\n }\n }\n }\n }\n"): (typeof documents)["\n query ProgramFormsPage($eventSlug: String!, $locale: String) {\n profile {\n forms {\n surveys(relation: ACCESSIBLE) {\n ...ProfileSurvey\n }\n }\n }\n\n event(slug: $eventSlug) {\n slug\n name\n\n forms {\n surveys(\n includeInactive: true\n app: PROGRAM\n purpose: [DEFAULT, INVITE, FOLLOWUP]\n ) {\n ...OfferForm\n }\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/kompassi-v2-frontend/src/__generated__/graphql.ts b/kompassi-v2-frontend/src/__generated__/graphql.ts index d50797cab..841168eef 100644 --- a/kompassi-v2-frontend/src/__generated__/graphql.ts +++ b/kompassi-v2-frontend/src/__generated__/graphql.ts @@ -541,6 +541,7 @@ export enum SurveyDefaultDimensionsUniverse { /** An enumeration. */ export enum SurveyPurpose { Default = 'DEFAULT', + Followup = 'FOLLOWUP', Invite = 'INVITE' } @@ -2292,7 +2293,7 @@ export const ProgramFormResponseEditPageDocument = {"kind":"Document","definitio export const ProgramFormResponseDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramFormResponseDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"surveySlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"responseId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"event"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"survey"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"surveySlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"app"},"value":{"kind":"EnumValue","value":"PROGRAM"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"purpose"}},{"kind":"Field","name":{"kind":"Name","value":"dimensions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"publicOnly"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DimensionValueSelect"}}]}},{"kind":"Field","name":{"kind":"Name","value":"response"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"responseId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProgramFormResponseDetail"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullSelectedProfile"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SelectedProfileType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"nick"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"phoneNumber"}},{"kind":"Field","name":{"kind":"Name","value":"discordHandle"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullProfileFieldSelector"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProfileFieldSelectorType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"nick"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"phoneNumber"}},{"kind":"Field","name":{"kind":"Name","value":"discordHandle"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResponseRevision"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LimitedResponseType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"revisionCreatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"revisionCreatedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResponseHistorySidebar"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullResponseType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"sequenceNumber"}},{"kind":"Field","name":{"kind":"Name","value":"originalCreatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"originalCreatedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullSelectedProfile"}}]}},{"kind":"Field","name":{"kind":"Name","value":"revisionCreatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"revisionCreatedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fullName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"form"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"survey"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"profileFieldSelector"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullProfileFieldSelector"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"supersededBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResponseRevision"}}]}},{"kind":"Field","name":{"kind":"Name","value":"oldVersions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResponseRevision"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DimensionValueSelect"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullDimensionType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isTechnical"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiValue"}},{"kind":"Field","name":{"kind":"Name","value":"values"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProgramFormResponseDetail"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullResponseType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResponseHistorySidebar"}},{"kind":"Field","name":{"kind":"Name","value":"values"}},{"kind":"Field","name":{"kind":"Name","value":"cachedDimensions"}},{"kind":"Field","name":{"kind":"Name","value":"form"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fields"}},{"kind":"Field","name":{"kind":"Name","value":"survey"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"profileFieldSelector"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullProfileFieldSelector"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"canEdit"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"mode"},"value":{"kind":"EnumValue","value":"ADMIN"}}]},{"kind":"Field","name":{"kind":"Name","value":"canAccept"}},{"kind":"Field","name":{"kind":"Name","value":"canCancel"}},{"kind":"Field","name":{"kind":"Name","value":"canDelete"}}]}}]} as unknown as DocumentNode; export const ProgramFormResponsesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramFormResponses"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"surveySlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DimensionFilterInput"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"surveys"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"eventSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"relation"},"value":{"kind":"EnumValue","value":"SUBSCRIBED"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"event"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"survey"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"surveySlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"app"},"value":{"kind":"EnumValue","value":"PROGRAM"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"purpose"}},{"kind":"Field","name":{"kind":"Name","value":"anonymity"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}},{"kind":"Argument","name":{"kind":"Name","value":"keyFieldsOnly"},"value":{"kind":"BooleanValue","value":true}}]},{"kind":"Field","name":{"kind":"Name","value":"dimensions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DimensionFilter"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ColoredDimensionTableCell"}}]}},{"kind":"Field","name":{"kind":"Name","value":"countResponses"}},{"kind":"Field","name":{"kind":"Name","value":"responsesDeletionStatus"}},{"kind":"Field","name":{"kind":"Name","value":"responses"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProgramFormResponse"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DimensionFilterValue"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DimensionValueType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DimensionFilter"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullDimensionType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isMultiValue"}},{"kind":"Field","name":{"kind":"Name","value":"isListFilter"}},{"kind":"Field","name":{"kind":"Name","value":"isKeyDimension"}},{"kind":"Field","name":{"kind":"Name","value":"values"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DimensionFilterValue"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ColoredDimensionTableCell"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullDimensionType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isKeyDimension"}},{"kind":"Field","name":{"kind":"Name","value":"isTechnical"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiValue"}},{"kind":"Field","name":{"kind":"Name","value":"values"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"color"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProgramFormResponse"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LimitedResponseType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"sequenceNumber"}},{"kind":"Field","name":{"kind":"Name","value":"revisionCreatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"revisionCreatedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"values"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"keyFieldsOnly"},"value":{"kind":"BooleanValue","value":true}}]},{"kind":"Field","name":{"kind":"Name","value":"cachedDimensions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"keyDimensionsOnly"},"value":{"kind":"BooleanValue","value":true}}]}]}}]} as unknown as DocumentNode; export const CreateProgramFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateProgramForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateProgramFormInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createProgramForm"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"survey"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]}}]} as unknown as DocumentNode; -export const ProgramFormsPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramFormsPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"surveys"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"relation"},"value":{"kind":"EnumValue","value":"ACCESSIBLE"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProfileSurvey"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"event"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"surveys"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"includeInactive"},"value":{"kind":"BooleanValue","value":true}},{"kind":"Argument","name":{"kind":"Name","value":"app"},"value":{"kind":"EnumValue","value":"PROGRAM"}},{"kind":"Argument","name":{"kind":"Name","value":"purpose"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"DEFAULT"},{"kind":"EnumValue","value":"INVITE"}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OfferForm"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProfileSurvey"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullSurveyType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"event"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OfferForm"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullSurveyType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"activeFrom"}},{"kind":"Field","name":{"kind":"Name","value":"activeUntil"}},{"kind":"Field","name":{"kind":"Name","value":"countResponses"}},{"kind":"Field","name":{"kind":"Name","value":"purpose"}},{"kind":"Field","name":{"kind":"Name","value":"languages"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"language"}}]}}]}}]} as unknown as DocumentNode; +export const ProgramFormsPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramFormsPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"surveys"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"relation"},"value":{"kind":"EnumValue","value":"ACCESSIBLE"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProfileSurvey"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"event"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"forms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"surveys"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"includeInactive"},"value":{"kind":"BooleanValue","value":true}},{"kind":"Argument","name":{"kind":"Name","value":"app"},"value":{"kind":"EnumValue","value":"PROGRAM"}},{"kind":"Argument","name":{"kind":"Name","value":"purpose"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"DEFAULT"},{"kind":"EnumValue","value":"INVITE"},{"kind":"EnumValue","value":"FOLLOWUP"}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OfferForm"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProfileSurvey"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullSurveyType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"event"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OfferForm"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullSurveyType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"activeFrom"}},{"kind":"Field","name":{"kind":"Name","value":"activeUntil"}},{"kind":"Field","name":{"kind":"Name","value":"countResponses"}},{"kind":"Field","name":{"kind":"Name","value":"purpose"}},{"kind":"Field","name":{"kind":"Name","value":"languages"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"language"}}]}}]}}]} as unknown as DocumentNode; export const ProgramAdminHostsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramAdminHosts"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DimensionFilterInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"event"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"program"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"programHostsExcelExportLink"}},{"kind":"Field","name":{"kind":"Name","value":"dimensions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"isListFilter"},"value":{"kind":"BooleanValue","value":true}},{"kind":"Argument","name":{"kind":"Name","value":"publicOnly"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DimensionFilter"}}]}},{"kind":"Field","name":{"kind":"Name","value":"programHosts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programFilters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProgramAdminHost"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DimensionFilterValue"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DimensionValueType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DimensionFilter"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullDimensionType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]},{"kind":"Field","name":{"kind":"Name","value":"isMultiValue"}},{"kind":"Field","name":{"kind":"Name","value":"isListFilter"}},{"kind":"Field","name":{"kind":"Name","value":"isKeyDimension"}},{"kind":"Field","name":{"kind":"Name","value":"values"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DimensionFilterValue"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProgramAdminHost"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullProgramHostType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"person"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"nick"}}]}},{"kind":"Field","name":{"kind":"Name","value":"programs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"cachedDimensions"}}]}}]}}]} as unknown as DocumentNode; export const ProgramAdminInvitationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramAdminInvitations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"event"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"program"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"invitations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProgramAdminInvitation"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProgramAdminInvitation"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FullInvitationType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"cachedDimensions"}},{"kind":"Field","name":{"kind":"Name","value":"program"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; export const UpdateMessageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateMessage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateMessageInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateMessage"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"message"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/[surveySlug]/page.tsx b/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/[surveySlug]/page.tsx index 9b2c4f3a4..40fa0ec5d 100644 --- a/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/[surveySlug]/page.tsx +++ b/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/[surveySlug]/page.tsx @@ -171,7 +171,7 @@ export default async function SurveyPage(props: Props) { } } - if (purpose !== SurveyPurpose.Default) { + if (purpose === SurveyPurpose.Invite) { return ( {t.specialPurposeSurvey.title} @@ -233,7 +233,11 @@ export default async function SurveyPage(props: Props) {
- {targetRegistry && profile ? ( + {purpose === SurveyPurpose.Followup ? ( +
+ {t.followupAlreadyConsented} +
+ ) : targetRegistry && profile ? ( ); - if (programForm.purpose !== SurveyPurpose.Default) { + if (programForm.purpose === SurveyPurpose.Invite) { return ( {editButton} @@ -240,35 +240,40 @@ export default async function ProgramFormsPage(props: Props) { return ( - {programForm.purpose === SurveyPurpose.Default && - (programForm.isActive ? ( - - {surveyT.actions.fillIn.title}… - - ) : ( - - ))} + {programForm.isActive ? ( + + {surveyT.actions.fillIn.title}… + + ) : ( + + )} {editButton} - - {t.actions.viewOffers}… - + {programForm.purpose === SurveyPurpose.Followup ? ( + + {surveyT.actions.viewResponses}… + + ) : ( + + {t.actions.viewOffers}… + + )} ); }, @@ -300,6 +305,10 @@ export default async function ProgramFormsPage(props: Props) { slug: "INVITE", title: t.attributes.purpose.choices.INVITE.title, }, + { + slug: "FOLLOWUP", + title: t.attributes.purpose.choices.FOLLOWUP.title, + }, ], }, getCopyFromDropdown(surveyT, data.profile?.forms.surveys || []), diff --git a/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/surveys/[surveySlug]/edit/models.ts b/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/surveys/[surveySlug]/edit/models.ts index dafdab0e0..9002703d5 100644 --- a/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/surveys/[surveySlug]/edit/models.ts +++ b/kompassi-v2-frontend/src/app/[locale]/[eventSlug]/surveys/[surveySlug]/edit/models.ts @@ -6,5 +6,5 @@ export interface Survey { languages: { language: string; }[]; - purpose: "DEFAULT" | "INVITE"; + purpose: "DEFAULT" | "INVITE" | "FOLLOWUP"; } diff --git a/kompassi-v2-frontend/src/translations/en.tsx b/kompassi-v2-frontend/src/translations/en.tsx index 68ef95872..f5c249b8e 100644 --- a/kompassi-v2-frontend/src/translations/en.tsx +++ b/kompassi-v2-frontend/src/translations/en.tsx @@ -1759,6 +1759,10 @@ const translations = { title: "Program host invite", shortTitle: "Invite", }, + FOLLOWUP: { + title: "Follow-up to program hosts", + shortTitle: "Follow-up", + }, }, }, programDimensionDefaults: { @@ -2957,6 +2961,8 @@ const translations = { countResponsesByCurrentUser === 1 ? "" : "s" } to this survey. The maximum number of responses per user is ${maxResponsesPerUser}.`, }, + followupAlreadyConsented: + "You have already consented to the processing of your personal data as a program host. These are the same data that this follow-up form shares with the organizers.", specialPurposeSurvey: { title: "Special purpose survey", defaultMessage: ( diff --git a/kompassi-v2-frontend/src/translations/fi.tsx b/kompassi-v2-frontend/src/translations/fi.tsx index e44d187dc..a53961554 100644 --- a/kompassi-v2-frontend/src/translations/fi.tsx +++ b/kompassi-v2-frontend/src/translations/fi.tsx @@ -1755,6 +1755,10 @@ const translations: Translations = { title: "Ohjelmanpitäjäkutsun hyväksyminen", shortTitle: "Kutsu", }, + FOLLOWUP: { + title: "Jatkokysely ohjelmanpitäjille", + shortTitle: "Jatkokysely", + }, }, }, programDimensionDefaults: { @@ -2963,6 +2967,8 @@ const translations: Translations = { maxResponsesPerUser === 1 ? "kerran" : "kertaa" }.`, }, + followupAlreadyConsented: + "Olet jo antanut suostumuksesi henkilötietojesi käsittelyyn ohjelmanpitäjänä. Nämä ovat samat tiedot, jotka tämä jatkokyselylomake jakaa järjestäjille.", specialPurposeSurvey: { title: "Kyselyyn ei voi vastata tätä kautta", defaultMessage: ( diff --git a/kompassi-v2-frontend/src/translations/sv.tsx b/kompassi-v2-frontend/src/translations/sv.tsx index 4b89d620a..5a7645aaf 100644 --- a/kompassi-v2-frontend/src/translations/sv.tsx +++ b/kompassi-v2-frontend/src/translations/sv.tsx @@ -1728,6 +1728,10 @@ const translations: Translations = { title: "Inbjudan till programvärd", shortTitle: "Inbjudan", }, + FOLLOWUP: { + title: "Uppföljning till programvärdar", + shortTitle: "Uppföljning", + }, }, }, programDimensionDefaults: { @@ -2904,6 +2908,8 @@ const translations: Translations = { countResponsesByCurrentUser === 1 ? "" : "en" } till denna undersökning. Det maximala antalet svar per användare är ${maxResponsesPerUser}.`, }, + followupAlreadyConsented: + "Du har redan samtyckt till behandlingen av dina personuppgifter som programvärd. Det är samma uppgifter som detta uppföljningsformulär delar med arrangörerna.", specialPurposeSurvey: { title: "Enkät för särskilt ändamål", defaultMessage: ( diff --git a/kompassi/forms/graphql/mutations/create_survey_response.py b/kompassi/forms/graphql/mutations/create_survey_response.py index 602d113e8..3cd4d978c 100644 --- a/kompassi/forms/graphql/mutations/create_survey_response.py +++ b/kompassi/forms/graphql/mutations/create_survey_response.py @@ -65,6 +65,9 @@ def mutate( if survey.login_required and not revision_created_by: raise Exception("Login required") + if not survey.workflow.can_be_responded_by(request): + raise Exception("You are not allowed to respond to this survey") + if survey.max_responses_per_user: # noqa: SIM102 if ( survey.current_responses.filter(revision_created_by=revision_created_by).count() @@ -72,7 +75,7 @@ def mutate( ): raise Exception("Maximum number of responses reached") - if survey.purpose != SurveyPurpose.DEFAULT and old_version is None: + if survey.purpose not in (SurveyPurpose.DEFAULT, SurveyPurpose.FOLLOWUP) and old_version is None: raise Exception("Special purpose surveys cannot be submitted via this endpoint") if survey.anonymity == "HARD": diff --git a/kompassi/forms/migrations/0059_survey_followup_purpose_and_parent.py b/kompassi/forms/migrations/0059_survey_followup_purpose_and_parent.py new file mode 100644 index 000000000..3ea8d7441 --- /dev/null +++ b/kompassi/forms/migrations/0059_survey_followup_purpose_and_parent.py @@ -0,0 +1,64 @@ +# Generated by Django 6.1.1 on 2026-10-02 13:45 + +import django.db.models.deletion +import django_enum.fields +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ # noqa: RUF012 + ("core", "0045_person_program_role_retention_policy"), + ("dimensions", "0020_propagate_annotation_form_fields_to_forms"), + ("forms", "0058_survey_retention_period"), + ("involvement", "0014_alter_involvementeventmeta_default_registry"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ # noqa: RUF012 + migrations.RemoveConstraint( + model_name="survey", + name="forms_Survey_purpose_SurveyPurpose", + ), + migrations.AddField( + model_name="response", + name="parent", + field=models.ForeignKey( + blank=True, + help_text="Reserved: the response a follow-up response follows up on. Must always point to the newest version of the parent response.", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="followups", + to="forms.response", + ), + ), + migrations.AddField( + model_name="survey", + name="parent", + field=models.ForeignKey( + blank=True, + help_text="Reserved for follow-up surveys that follow up on the responses of a parent survey.", + null=True, + on_delete=django.db.models.deletion.PROTECT, + related_name="followups", + to="forms.survey", + ), + ), + migrations.AlterField( + model_name="survey", + name="purpose", + field=django_enum.fields.EnumCharField( + choices=[("DEFAULT", "DEFAULT"), ("INVITE", "INVITE"), ("FOLLOWUP", "FOLLOWUP")], + default="DEFAULT", + help_text="Generic surveys and program offers are DEFAULT, program host invitations are INVITE, follow-up questions to existing program hosts are FOLLOWUP.", + max_length=8, + ), + ), + migrations.AddConstraint( + model_name="survey", + constraint=models.CheckConstraint( + condition=models.Q(("purpose__in", ["DEFAULT", "INVITE", "FOLLOWUP"])), + name="forms_Survey_purpose_SurveyPurpose", + ), + ), + ] diff --git a/kompassi/forms/models/enums.py b/kompassi/forms/models/enums.py index 0319f5c13..e5cb44515 100644 --- a/kompassi/forms/models/enums.py +++ b/kompassi/forms/models/enums.py @@ -24,6 +24,12 @@ class SurveyPurpose(Enum): # Responses are handled by accept_invitation mutation (involvement application) INVITE = "INVITE" + # FOLLOWUP surveys ask for more information from people who already have a relationship to the event. + # Program FOLLOWUP surveys are answered through the // endpoint + # by program hosts (Involvement of type PROGRAM_HOST); the workflow decides who may respond. + # Reserved for Surveys V2 (app=FORMS), where a follow-up shares the universe of its parent survey. + FOLLOWUP = "FOLLOWUP" + class EditMode(Enum): # The user is editing items owned by them diff --git a/kompassi/forms/models/response.py b/kompassi/forms/models/response.py index dac11d5a1..df40ef00c 100644 --- a/kompassi/forms/models/response.py +++ b/kompassi/forms/models/response.py @@ -24,6 +24,7 @@ from kompassi.graphql_api.language import SUPPORTED_LANGUAGES from .attachment import Attachment +from .enums import SurveyPurpose from .field import Field from .form import Form from .survey import DimensionApp, Survey @@ -102,6 +103,18 @@ class Response(models.Model): related_name="+", ) + parent = models.ForeignKey( + "self", + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name="followups", + help_text=( + "Reserved: the response a follow-up response follows up on. " + "Must always point to the newest version of the parent response." + ), + ) + # FK id fields (annotated for the type checker) revision_created_by_id: int | None original_created_by_id: int | None @@ -343,6 +356,8 @@ def admin_url(self) -> str: match self.survey.app: case DimensionApp.FORMS: return f"{settings.KOMPASSI_V2_BASE_URL}/{self.survey.event.slug}/surveys/{self.survey.slug}/responses/{self.id}" + case DimensionApp.PROGRAM if self.survey.purpose == SurveyPurpose.FOLLOWUP: + return f"{settings.KOMPASSI_V2_BASE_URL}/{self.survey.event.slug}/program-forms/{self.survey.slug}/responses/{self.id}" case DimensionApp.PROGRAM: return f"{settings.KOMPASSI_V2_BASE_URL}/{self.survey.event.slug}/program-offers/{self.id}" case _: diff --git a/kompassi/forms/models/survey.py b/kompassi/forms/models/survey.py index c229961d3..58ba95669 100644 --- a/kompassi/forms/models/survey.py +++ b/kompassi/forms/models/survey.py @@ -60,7 +60,18 @@ class Survey(models.Model): purpose: SurveyPurpose = EnumField( # type: ignore SurveyPurpose, default=SurveyPurpose.DEFAULT, - help_text="Generic surveys and program offers are DEFAULT, program host invitations are ACCEPT_INVITATION.", + help_text=( + "Generic surveys and program offers are DEFAULT, program host invitations are INVITE, " + "follow-up questions to existing program hosts are FOLLOWUP." + ), + ) + parent = models.ForeignKey( + "self", + on_delete=models.PROTECT, + null=True, + blank=True, + related_name="followups", + help_text="Reserved for follow-up surveys that follow up on the responses of a parent survey.", ) login_required = models.BooleanField( @@ -206,7 +217,7 @@ def involvement_type(self) -> InvolvementType | None: match self.app, self.purpose: case DimensionApp.PROGRAM, SurveyPurpose.DEFAULT: return InvolvementType.PROGRAM_OFFER - case DimensionApp.PROGRAM, SurveyPurpose.INVITE: + case DimensionApp.PROGRAM, SurveyPurpose.INVITE | SurveyPurpose.FOLLOWUP: return InvolvementType.PROGRAM_HOST case DimensionApp.FORMS, _: return InvolvementType.SURVEY_RESPONSE @@ -246,7 +257,7 @@ def _get_universe(self) -> Universe: )[0] case DimensionApp.PROGRAM: # Invite fields describe the program host, not the program item. - if self.purpose == SurveyPurpose.INVITE: + if self.purpose in (SurveyPurpose.INVITE, SurveyPurpose.FOLLOWUP): return self.event.involvement_universe return self.event.program_universe case _: @@ -417,8 +428,8 @@ def with_mandatory_fields(self) -> Self: self.responses_editable_until = self.event.end_time case DimensionApp.FORMS: - if self.purpose == SurveyPurpose.INVITE: - raise ValueError("ACCEPT_INVITATION is not a valid purpose for FORMS app") + if self.purpose in (SurveyPurpose.INVITE, SurveyPurpose.FOLLOWUP): + raise ValueError(f"{self.purpose} is not a valid purpose for FORMS app") if self.anonymity == Anonymity.NAME_AND_EMAIL: self.login_required = True @@ -426,6 +437,11 @@ def with_mandatory_fields(self) -> Self: case _: raise NotImplementedError(self.app) + if self.parent is not None and self.profile_field_selector | self.parent.profile_field_selector != ( + self.profile_field_selector + ): + raise ValueError("A follow-up survey must select at least the profile fields its parent selects") + return self @transaction.atomic diff --git a/kompassi/forms/models/workflow.py b/kompassi/forms/models/workflow.py index 2b3f05930..4ccbab308 100644 --- a/kompassi/forms/models/workflow.py +++ b/kompassi/forms/models/workflow.py @@ -266,6 +266,7 @@ def revoke_all_access(self, request: HttpRequest | None) -> int: @classmethod def get_workflow(cls, survey: Survey): + from kompassi.program_v2.workflows.program_followup import ProgramFollowupWorkflow from kompassi.program_v2.workflows.program_host_invitation import ProgramHostInvitationWorkflow from kompassi.program_v2.workflows.program_offer import ProgramOfferWorkflow @@ -274,9 +275,17 @@ def get_workflow(cls, survey: Survey): return ProgramOfferWorkflow(survey=survey) case DimensionApp.PROGRAM, SurveyPurpose.INVITE: return ProgramHostInvitationWorkflow(survey=survey) + case DimensionApp.PROGRAM, SurveyPurpose.FOLLOWUP: + return ProgramFollowupWorkflow(survey=survey) case _: return cls(survey=survey) + def can_be_responded_by(self, request: HttpRequest) -> bool: + """ + Whether the user may submit a new response. Checked in addition to login_required etc. + """ + return True + def is_response_active(self, response: Response) -> bool: # The basic survey workflow does not have a concept of active/inactive responses. return True diff --git a/kompassi/program_v2/models/meta.py b/kompassi/program_v2/models/meta.py index e5e9d16fc..1c5bcdedb 100644 --- a/kompassi/program_v2/models/meta.py +++ b/kompassi/program_v2/models/meta.py @@ -245,6 +245,14 @@ def accept_invitation_forms(self): purpose=SurveyPurpose.INVITE, ) + @property + def followup_forms(self): + return Survey.objects.filter( + event=self.event, + app=DimensionApp.PROGRAM, + purpose=SurveyPurpose.FOLLOWUP, + ) + @property def schedule_url(self): return f"{settings.KOMPASSI_V2_BASE_URL}/{self.event.slug}/program" diff --git a/kompassi/program_v2/tests.py b/kompassi/program_v2/tests.py index dcd738986..fcf879046 100644 --- a/kompassi/program_v2/tests.py +++ b/kompassi/program_v2/tests.py @@ -2,6 +2,7 @@ import pytest from django.db import transaction +from django.test import RequestFactory from django.utils.timezone import now from kompassi.access.models.email_alias_domain import EmailAliasDomain @@ -15,6 +16,7 @@ from kompassi.forms.models.form import Form from kompassi.forms.models.response import Response from kompassi.forms.models.survey import Survey +from kompassi.involvement.models.enums import InvolvementType from kompassi.involvement.models.involvement import Involvement from ..forms.utils.extract_annotations import extract_annotations_from_responses @@ -22,6 +24,7 @@ from .models.meta import ProgramV2EventMeta from .models.program import Program from .models.schedule_item import ScheduleItem +from .workflows.program_followup import ProgramFollowupWorkflow @pytest.mark.django_db @@ -494,3 +497,120 @@ def test_invite_survey_lives_in_involvement_universe_and_passes_values_forward() program.refresh_from_db() assert "test:hostNote" not in program.annotations + + +@pytest.mark.django_db +def test_program_followup_is_for_hosts_and_passes_values_to_their_involvements(monkeypatch): + meta, _ = ProgramV2EventMeta.get_or_create_dummy() + event = meta.event + EmailAliasDomain.get_or_create_dummy() + + host, _ = Person.get_or_create_dummy() + outsider, _ = Person.get_or_create_dummy(another=True, superuser=False) + + offer = Survey(event=event, slug="offer", app=DimensionApp.PROGRAM, purpose=SurveyPurpose.DEFAULT) + offer.with_mandatory_fields().save() + offer.workflow.handle_new_survey() + offer_en = Form( + event=event, + survey=offer, + language="en", + fields=[dict(slug="title", title="Title", type="SingleLineText", required=True)], + ) + offer_en.save() + offer.workflow.handle_form_update() + + followup = Survey(event=event, slug="followup", app=DimensionApp.PROGRAM, purpose=SurveyPurpose.FOLLOWUP) + followup.with_mandatory_fields().save() + followup.workflow.handle_new_survey() + assert followup.universe == event.involvement_universe + assert followup.involvement_type == InvolvementType.PROGRAM_HOST + + annotation = Annotation.objects.create( + slug="test:diet", + type=AnnotationDataType.STRING, + applies_to=AnnotationAppliesTo.INVOLVEMENT, + ) + UniverseAnnotation.objects.create(universe=followup.universe, annotation=annotation) + followup_en = Form( + event=event, + survey=followup, + language="en", + fields=[ + dict(slug="diet", title="Diet", type="SingleLineText", propagateToAnnotation="test:diet"), + dict(slug="note", title="Note", type="SingleLineText", propagateToAnnotation="test:diet"), + ], + ) + followup_en.save() + followup.workflow.handle_form_update() + + with transaction.atomic(): + program_offer = Response.objects.create( + form=offer_en, + form_data={"title": "Test program"}, + revision_created_by=host.user, + ip_address="127.0.0.1", + sequence_number=offer.get_next_sequence_number(), + ) + offer.workflow.handle_new_response_phase1(program_offer) + offer.workflow.handle_new_response_phase2(program_offer) + Program.from_program_offer(program_offer) + + def request_by(person): + request = RequestFactory().get("/") + request.user = person.user + return request + + assert followup.workflow.can_be_responded_by(request_by(host)) + assert not followup.workflow.can_be_responded_by(request_by(outsider)) + + with transaction.atomic(): + response = Response.objects.create( + form=followup_en, + form_data={"diet": "vegan"}, + revision_created_by=host.user, + original_created_by=host.user, + ip_address="127.0.0.1", + sequence_number=followup.get_next_sequence_number(), + ) + followup.workflow.handle_new_response_phase1(response) + notified: list = [] + monkeypatch.setattr( + ProgramFollowupWorkflow, + "notify_subscribers", + lambda self, response, old_version=None: notified.append(response.id), + ) + followup.workflow.handle_new_response_phase2(response) + assert notified == [response.id] + assert response.admin_url.endswith(f"/program-forms/followup/responses/{response.id}") + + (host_involvement,) = event.involvements.filter(person=host, type=InvolvementType.PROGRAM_HOST) + assert host_involvement.annotations["test:diet"] == "vegan" + assert not event.involvements.filter(person=outsider).exists() + + # an edit does not pass the annotation forward unless the field says so + with transaction.atomic(): + edited = Response.objects.create( + form=followup_en, + form_data={"diet": "omnivore"}, + revision_created_by=host.user, + original_created_by=host.user, + ip_address="127.0.0.1", + sequence_number=followup.get_next_sequence_number(), + ) + followup.workflow.handle_new_response_phase1(edited, old_version=response) + host_involvement.refresh_from_db() + assert host_involvement.annotations["test:diet"] == "vegan" + + # an admin changing dimensions is an edit: values marked for creation only are not passed forward again + followup.workflow.handle_response_dimension_update(edited) + host_involvement.refresh_from_db() + assert host_involvement.annotations["test:diet"] == "vegan" + + # the owner may edit only while they are still a program host + followup.responses_editable_until = now() + timedelta(days=1) + followup.save() + assert followup.workflow.response_can_be_edited_by_owner(edited, request_by(host)) + host_involvement.is_active = False + host_involvement.save(update_fields=["is_active"]) + assert not followup.workflow.response_can_be_edited_by_owner(edited, request_by(host)) diff --git a/kompassi/program_v2/workflows/program_followup.py b/kompassi/program_v2/workflows/program_followup.py new file mode 100644 index 000000000..ef540e4fa --- /dev/null +++ b/kompassi/program_v2/workflows/program_followup.py @@ -0,0 +1,97 @@ +from django.http import HttpRequest + +from kompassi.dimensions.utils.dimension_cache import DimensionCache +from kompassi.forms.models.response import Response +from kompassi.forms.models.workflow import Workflow +from kompassi.forms.utils.extract_annotations import extract_annotations_from_responses +from kompassi.forms.utils.extract_dimension_values import extract_dimension_values_from_response +from kompassi.involvement.models.enums import InvolvementType +from kompassi.involvement.models.involvement import Involvement + +from .program_host_invitation import ProgramHostInvitationWorkflow + + +class ProgramFollowupWorkflow(ProgramHostInvitationWorkflow): + """ + Asks program hosts for more information after their program offers have been accepted. + + Responses are about the host, not a specific program item. They create no Involvement: + values are passed forward to the respondent's existing PROGRAM_HOST involvements. + Shares the access and badge rules of host invitations, which are the other form of + information collected from program hosts. + """ + + def can_be_responded_by(self, request: HttpRequest) -> bool: + user = request.user + if not user.is_authenticated: + return False + + person = getattr(user, "person", None) + if person is None: + return False + + return self._program_host_involvements(person).exists() + + def response_can_be_edited_by_owner(self, response: Response, request: HttpRequest) -> bool: + # the owner may have stopped being a program host since responding + return self.can_be_responded_by(request) and super().response_can_be_edited_by_owner(response, request) + + def _program_host_involvements(self, person): + return self.survey.event.involvements.filter( + person=person, + type=InvolvementType.PROGRAM_HOST, + is_active=True, + ) + + def ensure_involvement( + self, + response: Response, + *, + old_version: Response | None = None, + cache: DimensionCache, + override_dimensions: bool = False, + on_edit: bool | None = None, + ) -> Involvement | None: + """ + :param on_edit: Whether to pass forward the values marked for edits instead of those marked for creation. + Inferred from old_version if not given. + """ + respondent = response.original_created_by + person = getattr(respondent, "person", None) + if person is None: + return None + + if on_edit is None: + on_edit = old_version is not None + + dimensions = extract_dimension_values_from_response(response, on_edit=on_edit) + annotations = extract_annotations_from_responses( + [response], + cache.universe.active_universe_annotations.all(), + on_edit=on_edit, + ) + + for involvement in self._program_host_involvements(person): + involvement.annotations = {**involvement.annotations, **annotations} + involvement.save(update_fields=["annotations"]) + if dimensions: + involvement.refresh_dimensions(dimensions, cache=cache) + involvement.refresh_dependents() + + return None + + def handle_response_dimension_update(self, response: Response): + self.ensure_involvement( + response, + cache=response.event.involvement_universe.preload_dimensions(), + on_edit=True, + ) + self.ensure_survey_to_badge(response) + + def handle_new_response_phase2( + self, + response: Response, + old_version: Response | None = None, + ): + # Skips the parent's refresh of program annotations: values were passed forward in ensure_involvement. + Workflow.handle_new_response_phase2(self, response, old_version)