Skip to content

Commit

Permalink
feat(form): add trademark, autosave setting, bump version (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulkeerthi authored Aug 9, 2023
1 parent af90d52 commit 7e2896b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hosted-pages",
"version": "0.0.57",
"version": "0.0.58",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -13,7 +13,7 @@
},
"dependencies": {
"@apollo/client": "^3.7.2",
"@awell_health/ui-library": "0.1.22",
"@awell_health/ui-library": "0.1.23",
"@formsort/react-embed": "^3.1.1",
"@sentry/nextjs": "^7.59.3",
"date-fns": "^2.29.3",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const Form: FC<FormProps> = ({ activity }) => {
evaluateDisplayConditions={handleEvaluateFormRules}
storedAnswers={formProgress}
onAnswersChange={handleOnAnswersChange}
autosaveAnswers={branding?.hosted_page_autosave ?? true}
/>
) : (
<ConversationalForm
Expand All @@ -117,6 +118,7 @@ export const Form: FC<FormProps> = ({ activity }) => {
storedAnswers={formProgress}
onAnswersChange={handleOnAnswersChange}
autoProgress={branding?.hosted_page_auto_progress ?? false}
autosaveAnswers={branding?.hosted_page_autosave ?? true}
/>
)
}
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useForm/graphql/Form.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
fragment Form on Form {
id
title
trademark
questions {
...Question
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ query GetHostedSession {
hosted_page_title
accent_color
hosted_page_auto_progress
hosted_page_autosave
}
}
}
13 changes: 9 additions & 4 deletions src/types/generated/types-orchestration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,10 @@ export enum BooleanOperator {
export type BrandingSettings = {
__typename?: 'BrandingSettings';
accent_color?: Maybe<Scalars['String']>;
/** Auto advance in radio questions in conversational display mode. */
/** Auto progress to the next question when using the conversational display mode in Awell Hosted Pages. */
hosted_page_auto_progress?: Maybe<Scalars['Boolean']>;
/** Automatically save question answers locally in Awell Hosted Pages */
hosted_page_autosave?: Maybe<Scalars['Boolean']>;
hosted_page_title?: Maybe<Scalars['String']>;
logo_url?: Maybe<Scalars['String']>;
};
Expand Down Expand Up @@ -735,6 +737,7 @@ export type Form = {
questions: Array<Question>;
release_id: Scalars['String'];
title: Scalars['String'];
trademark?: Maybe<Scalars['String']>;
};

export enum FormDisplayMode {
Expand Down Expand Up @@ -2188,14 +2191,14 @@ export type GetExtensionActivityDetailsQueryVariables = Exact<{

export type GetExtensionActivityDetailsQuery = { __typename?: 'Query', extensionActivityRecord: { __typename?: 'ExtensionActivityRecordPayload', record: { __typename?: 'ExtensionActivityRecord', id: string, activity_id: string, pathway_id: string, plugin_key: string, plugin_action_key: string, date: string, data_points: Array<{ __typename?: 'ExtensionDataPoint', label: string, value: string }>, fields: Array<{ __typename?: 'ExtensionActionField', id: string, type: ExtensionActionFieldType, label: string, value: string }>, settings?: Array<{ __typename?: 'PluginActionSettingsProperty', value: string, label: string, key: string }> | null } } };

export type FormFragment = { __typename?: 'Form', id: string, title: string, questions: Array<{ __typename?: 'Question', id: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value: number, label: string }> | null, questionConfig?: { __typename?: 'QuestionConfig', recode_enabled?: boolean | null, mandatory: boolean, use_select?: boolean | null, slider?: { __typename?: 'SliderConfig', min: number, max: number, step_value: number, display_marks: boolean, min_label: string, max_label: string, is_value_tooltip_on: boolean, show_min_max_values: boolean } | null } | null }> };
export type FormFragment = { __typename?: 'Form', id: string, title: string, trademark?: string | null, questions: Array<{ __typename?: 'Question', id: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value: number, label: string }> | null, questionConfig?: { __typename?: 'QuestionConfig', recode_enabled?: boolean | null, mandatory: boolean, use_select?: boolean | null, slider?: { __typename?: 'SliderConfig', min: number, max: number, step_value: number, display_marks: boolean, min_label: string, max_label: string, is_value_tooltip_on: boolean, show_min_max_values: boolean } | null } | null }> };

export type GetFormQueryVariables = Exact<{
id: Scalars['String'];
}>;


export type GetFormQuery = { __typename?: 'Query', form: { __typename?: 'FormPayload', form?: { __typename?: 'Form', id: string, title: string, questions: Array<{ __typename?: 'Question', id: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value: number, label: string }> | null, questionConfig?: { __typename?: 'QuestionConfig', recode_enabled?: boolean | null, mandatory: boolean, use_select?: boolean | null, slider?: { __typename?: 'SliderConfig', min: number, max: number, step_value: number, display_marks: boolean, min_label: string, max_label: string, is_value_tooltip_on: boolean, show_min_max_values: boolean } | null } | null }> } | null } };
export type GetFormQuery = { __typename?: 'Query', form: { __typename?: 'FormPayload', form?: { __typename?: 'Form', id: string, title: string, trademark?: string | null, questions: Array<{ __typename?: 'Question', id: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value: number, label: string }> | null, questionConfig?: { __typename?: 'QuestionConfig', recode_enabled?: boolean | null, mandatory: boolean, use_select?: boolean | null, slider?: { __typename?: 'SliderConfig', min: number, max: number, step_value: number, display_marks: boolean, min_label: string, max_label: string, is_value_tooltip_on: boolean, show_min_max_values: boolean } | null } | null }> } | null } };

export type GetFormResponseQueryVariables = Exact<{
pathway_id: Scalars['String'];
Expand All @@ -2222,7 +2225,7 @@ export type OnHostedSessionExpiredSubscription = { __typename?: 'Subscription',
export type GetHostedSessionQueryVariables = Exact<{ [key: string]: never; }>;


export type GetHostedSessionQuery = { __typename?: 'Query', hostedSession: { __typename?: 'HostedSessionPayload', session: { __typename?: 'HostedSession', id: string, pathway_id: string, status: HostedSessionStatus, success_url?: string | null, cancel_url?: string | null, stakeholder: { __typename?: 'HostedSessionStakeholder', id: string, type: HostedSessionStakeholderType, name: string } }, branding?: { __typename?: 'BrandingSettings', logo_url?: string | null, hosted_page_title?: string | null, accent_color?: string | null, hosted_page_auto_progress?: boolean | null } | null } };
export type GetHostedSessionQuery = { __typename?: 'Query', hostedSession: { __typename?: 'HostedSessionPayload', session: { __typename?: 'HostedSession', id: string, pathway_id: string, status: HostedSessionStatus, success_url?: string | null, cancel_url?: string | null, stakeholder: { __typename?: 'HostedSessionStakeholder', id: string, type: HostedSessionStakeholderType, name: string } }, branding?: { __typename?: 'BrandingSettings', logo_url?: string | null, hosted_page_title?: string | null, accent_color?: string | null, hosted_page_auto_progress?: boolean | null, hosted_page_autosave?: boolean | null } | null } };

export type GetMessageQueryVariables = Exact<{
id: Scalars['String'];
Expand Down Expand Up @@ -2315,6 +2318,7 @@ export const FormFragmentDoc = gql`
fragment Form on Form {
id
title
trademark
questions {
...Question
}
Expand Down Expand Up @@ -2711,6 +2715,7 @@ export const GetHostedSessionDocument = gql`
hosted_page_title
accent_color
hosted_page_auto_progress
hosted_page_autosave
}
}
}
Expand Down
14 changes: 10 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@
dependencies:
node-fetch "^2.6.1"

"@awell_health/[email protected].21":
version "0.1.21"
resolved "https://registry.yarnpkg.com/@awell_health/ui-library/-/ui-library-0.1.21.tgz#9561e5e93152ed81abe4278edd267f409ea1ed31"
integrity sha512-CKKuNXsbNoyyOXngVfSAOfkmQhnQgsau6b/C/SqXp6HdneIrsFVF94+1vK1vihwf2qyLg2CBhPDZ3WmY4ZAzhQ==
"@awell_health/[email protected].23":
version "0.1.23"
resolved "https://registry.yarnpkg.com/@awell_health/ui-library/-/ui-library-0.1.23.tgz#42ddd78827819acdc1a2d0ccb39a808a3afed714"
integrity sha512-FXypceEwa7S417wzWCqb7GqrwGyZhcmYR2r6BpEaCZG7WU2jdJBLqJVocww2k/oTs2iLXIqJEb9QahKkDo9n4g==
dependencies:
"@calcom/embed-react" "^1.0.10"
"@heroicons/react" "^2.0.13"
cloudinary-core "^2.13.0"
date-fns "^2.29.1"
dompurify "^2.4.0"
dotenv "^16.3.1"
escape-html "^1.0.3"
html-react-parser "^3.0.1"
react-date-picker "^8.4.0"
Expand Down Expand Up @@ -2545,6 +2546,11 @@ dotenv@^16.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.1.tgz#8f8f9d94876c35dac989876a5d3a82a267fdce1d"
integrity sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==

dotenv@^16.3.1:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==

dset@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.2.tgz#89c436ca6450398396dc6538ea00abc0c54cd45a"
Expand Down

0 comments on commit 7e2896b

Please sign in to comment.