Skip to content

Commit

Permalink
feat: add autoProgress param to the conversational form from branding… (
Browse files Browse the repository at this point in the history
#143)

* feat: add autoProgress param to the conversational form from branding settings

* bump ui-library version to 0.1.21
  • Loading branch information
mohsinht authored Jul 28, 2023
1 parent 83bc7a2 commit 863d3c6
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 97 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@apollo/client": "^3.7.2",
"@awell_health/ui-library": "0.1.19",
"@awell_health/ui-library": "0.1.21",
"@formsort/react-embed": "^3.1.1",
"@sentry/nextjs": "^7.59.3",
"date-fns": "^2.29.3",
Expand Down
3 changes: 3 additions & 0 deletions src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ErrorPage } from '../ErrorPage'
import { addSentryBreadcrumb } from '../../services/ErrorReporter'
import { BreadcrumbCategory } from '../../services/ErrorReporter/addSentryBreadcrumb'
import useLocalStorage from 'use-local-storage'
import { useHostedSession } from '../../hooks/useHostedSession'

interface FormProps {
activity: Activity
Expand All @@ -25,6 +26,7 @@ export const Form: FC<FormProps> = ({ activity }) => {
const { t } = useTranslation()
const [evaluateFormRules] = useEvaluateFormRules(activity.object.id)
const { onSubmit } = useSubmitForm({ activity })
const { branding } = useHostedSession()

const [formProgress, setFormProgress] = useLocalStorage(activity.id, '')

Expand Down Expand Up @@ -114,6 +116,7 @@ export const Form: FC<FormProps> = ({ activity }) => {
evaluateDisplayConditions={handleEvaluateFormRules}
storedAnswers={formProgress}
onAnswersChange={handleOnAnswersChange}
autoProgress={branding?.hosted_page_auto_progress ?? false}
/>
)
}
Expand Down
21 changes: 11 additions & 10 deletions src/hooks/useHostedSession/graphql/getHostedSession.graphql
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# import 'HostedSession'
query GetHostedSession {
hostedSession {
session {
...HostedSession
}
branding {
logo_url
hosted_page_title
accent_color
}
hostedSession {
session {
...HostedSession
}
}
branding {
logo_url
hosted_page_title
accent_color
hosted_page_auto_progress
}
}
}
6 changes: 5 additions & 1 deletion src/types/generated/types-orchestration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ export enum BooleanOperator {
export type BrandingSettings = {
__typename?: 'BrandingSettings';
accent_color?: Maybe<Scalars['String']>;
/** Auto advance in radio questions in conversational display mode. */
hosted_page_auto_progress?: Maybe<Scalars['Boolean']>;
hosted_page_title?: Maybe<Scalars['String']>;
logo_url?: Maybe<Scalars['String']>;
};
Expand Down Expand Up @@ -690,6 +692,7 @@ export type FilterActivitiesParams = {
activity_status?: InputMaybe<StringArrayFilter>;
activity_type?: InputMaybe<StringArrayFilter>;
pathway_definition_id?: InputMaybe<StringArrayFilter>;
pathway_status?: InputMaybe<StringArrayFilter>;
patient_id?: InputMaybe<TextFilterEquals>;
stakeholders?: InputMaybe<StringArrayFilter>;
};
Expand Down Expand Up @@ -2219,7 +2222,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 } | 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 } | null } };

export type GetMessageQueryVariables = Exact<{
id: Scalars['String'];
Expand Down Expand Up @@ -2707,6 +2710,7 @@ export const GetHostedSessionDocument = gql`
logo_url
hosted_page_title
accent_color
hosted_page_auto_progress
}
}
}
Expand Down
189 changes: 104 additions & 85 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
dependencies:
node-fetch "^2.6.1"

"@awell_health/[email protected].19":
version "0.1.19"
resolved "https://registry.yarnpkg.com/@awell_health/ui-library/-/ui-library-0.1.19.tgz#dc75bdaa3969a2192ff069f569001034e2ae201c"
integrity sha512-9oJ++tuldvMcPRRwAGCYdlDBoOErixtFzYH4DNBt8ByNcPkdwVdkdjK8D4HmHV/VH8oBjNUUJVetRBdp/rUZ3Q==
"@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==
dependencies:
"@calcom/embed-react" "^1.0.10"
"@heroicons/react" "^2.0.13"
Expand Down Expand Up @@ -1275,16 +1275,27 @@
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27"
integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA==

"@sentry/browser@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.34.0.tgz#6a521c5d95d535e6e89cf4eae85153f90c37d17a"
integrity sha512-5Jmjj0DLxx+31o12T+VH4U+gO7wz3L+ftjuTxcQaC8GeFVe5qCyXZoDmWKNV9NEyREiZ3azV62bJc5wojZrIIg==
"@sentry-internal/tracing@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.60.1.tgz#c20766a7e31589962ffe9ea9dc58b6f475432303"
integrity sha512-2vM+3/ddzmoBfi92OOD9FFTHXf0HdQhKtNM26+/RsmkKnTid+/inbvA7nKi+Qa7ExcnlC6eclEHQEg+0X3yDkQ==
dependencies:
"@sentry/core" "7.34.0"
"@sentry/replay" "7.34.0"
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
tslib "^1.9.3"
"@sentry/core" "7.60.1"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.60.1.tgz#d11e86f127f3f1b48a7156a4df63ab2b76e534ee"
integrity sha512-opZQee3S0c459LXt8YGpwOM/qiTlzluHEEnfW2q+D2yVCWh8iegsDX3kbRiv4i/mtQu9yPhM9M761KDnc/0eZw==
dependencies:
"@sentry-internal/tracing" "7.60.1"
"@sentry/core" "7.60.1"
"@sentry/replay" "7.60.1"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/cli@^1.74.6":
version "1.74.6"
Expand All @@ -1299,98 +1310,89 @@
proxy-from-env "^1.1.0"
which "^2.0.2"

"@sentry/core@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.34.0.tgz#bfda8d386cf7343200aa9fb7a7a26e99b839fc0c"
integrity sha512-J1oxsYZX1N0tkEcaHt/uuDqk6zOnaivyampp+EvBsUMCdemjg7rwKvawlRB0ZtBEQu3HAhi8zecm03mlpWfCDw==
"@sentry/core@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.60.1.tgz#789ebb2ba6808042e8c288f6881b82ff108c9c7c"
integrity sha512-yr/0VFYWOJyXj+F2nifkRYxXskotsNnDggUnFOZZN2ZgTG94IzRFsOZQ6RslHJ8nrYPTBNO74reU0C0GB++xRw==
dependencies:
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
tslib "^1.9.3"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/integrations@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.34.0.tgz#891dd31a7c021cd1b78b3a05dff80deddfbca71b"
integrity sha512-xbWnTvG4gkKeCVpmhhdPtMbQkPO0RAfEJ8VPO5TWmUMT23ZWy2kE0gTZHtnBopy7AXxg231XxTi4fxnwgQGxEQ==
"@sentry/integrations@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.60.1.tgz#2c0054d57ae337599d3c3a2d412226b4a7a62567"
integrity sha512-GkxGGUOGyRZ2aJrHfGPGJ40wh+r03xDHgjeM7SMHwdJdxTgFhv4xUZAl6NlywbxL5t2jhVwCMZNYIvy/vUrcFQ==
dependencies:
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
localforage "^1.8.1"
tslib "^1.9.3"
tslib "^2.4.1 || ^1.9.3"

"@sentry/nextjs@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.34.0.tgz#5c649c9cf02db171bce1f0b351e2aef9af37f97d"
integrity sha512-vXtlpONIDU2kT2eA5STLBuGvw5njM7K/7IqjvvkwTwYUpKWs7xZvp7NeHAHpH6LkDSBljokS45fnvfMijEqN7A==
"@sentry/nextjs@^7.59.3":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.60.1.tgz#67270948c200a4091f64efdb768552c0b88c9709"
integrity sha512-AwDbcvYudNOukYPndPId5Re8sRXdhA4iPS87QsRexAetUvPY/bCckFkdaGJok+OlMNBN8o3eudNNCytyZT2s+A==
dependencies:
"@rollup/plugin-commonjs" "24.0.0"
"@sentry/core" "7.34.0"
"@sentry/integrations" "7.34.0"
"@sentry/node" "7.34.0"
"@sentry/react" "7.34.0"
"@sentry/tracing" "7.34.0"
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
"@sentry/core" "7.60.1"
"@sentry/integrations" "7.60.1"
"@sentry/node" "7.60.1"
"@sentry/react" "7.60.1"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
"@sentry/webpack-plugin" "1.20.0"
chalk "3.0.0"
rollup "2.78.0"
tslib "^1.9.3"

"@sentry/[email protected]":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.34.0.tgz#acf51e40b1ecbd91d7bf2df55c47ae1b30c39b40"
integrity sha512-VM4XeydRdgeaNTRe8kwqYg2oNPddVyY74PlCFEFnPEN1NccycNuwiFno68kNrApeqxxLlTTmzkJy0BWo16x2Yg==
dependencies:
"@sentry/core" "7.34.0"
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
stacktrace-parser "^0.1.10"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.60.1.tgz#18e287995445588ebea630aed3932a3d21dda9ab"
integrity sha512-lBt3RqncY4XbzM+PlTbH/tUWeOsm24anwEzvA2DSDP1NL3WZ5MdvT77q7NqpvpVNd2LeGAQ6x7AXDzE53YBfnQ==
dependencies:
"@sentry-internal/tracing" "7.60.1"
"@sentry/core" "7.60.1"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
cookie "^0.4.1"
https-proxy-agent "^5.0.0"
lru_map "^0.3.3"
tslib "^1.9.3"
tslib "^2.4.1 || ^1.9.3"

"@sentry/react@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.34.0.tgz#8d69d3957736fe2692cd5547ad2d2f6f307e5590"
integrity sha512-vdonnZK9R8xyEBDaXNofHyoqy9biNRvlKrQXZp4x8WlYcBCwbU46qxZlSVsxa89pm7yUYS+KHq8cYL801+weqg==
"@sentry/react@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.60.1.tgz#ceeb35dadebb41454f488c17d0b9c2e5d59e5ff4"
integrity sha512-977wb5gp7SHv9kHPs1HZtL60slt2WBFY9/YJI9Av7BjjJ/A89OhtBwbVhIcKXZ4hwHQVWuOiFCJdMrIfZXpFPA==
dependencies:
"@sentry/browser" "7.34.0"
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
"@sentry/browser" "7.60.1"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"
hoist-non-react-statics "^3.3.2"
tslib "^1.9.3"

"@sentry/[email protected]":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.34.0.tgz#66d63b1e04d7e8068cac0c623a607f470d000751"
integrity sha512-4L4YZfWt8mcVNcI99RxHORPb308URI1R9xsFj97fagk0ATjexLKr5QCA2ApnKaSn8Q0q1Zdzd4XmFtW9anU45Q==
dependencies:
"@sentry/core" "7.34.0"
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/tracing@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.34.0.tgz#bc084389cad4f1e8520311ac195b070eced72b40"
integrity sha512-JtfSWBfcWslfIujcpGEPF5oOiAOCd5shMoWYrdTvCfruHhYjp4w5kv/ndkvq2EpFkcQYhdmtQEytXEO8IJIqRw==
"@sentry/replay@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.60.1.tgz#07ad56f47255706504ee099729bfe476538aa91d"
integrity sha512-WHQxEpJbHICs12L17LGgS/ql91yn9wJDH/hgb+1H90HaasjoR54ofWCKul29OvYV0snTWuHd6xauwtzyv9tzvg==
dependencies:
"@sentry/core" "7.34.0"
"@sentry/types" "7.34.0"
"@sentry/utils" "7.34.0"
tslib "^1.9.3"
"@sentry/core" "7.60.1"
"@sentry/types" "7.60.1"
"@sentry/utils" "7.60.1"

"@sentry/types@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.34.0.tgz#e0dc6a927dd13e4cacbca7bfee67a088885e8309"
integrity sha512-K+OeHIrl35PSYn6Zwqe4b8WWyAJQoI5NeWxHVkM7oQTGJ1YLG4BvLsR+UiUXnKdR5krE4EDtEA5jLsDlBEyPvw==
"@sentry/types@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.60.1.tgz#2f8740db56ae4cae87523ae7a0daf753308496f0"
integrity sha512-8lKKSCOhZ953cWxwnfZwoR3ZFFlZG4P3PQFTaFt/u4LxLh/0zYbdtgvtUqXRURjMCi5P6ddeE9Uw9FGnTJCsTw==

"@sentry/utils@7.34.0":
version "7.34.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.34.0.tgz#32fb6db8b352477d219ddff8200372959c68b445"
integrity sha512-VIHHXEBw0htzqxnU8A7WkXKvmsG2pZVqHlAn0H9W/yyFQtXMuP1j1i0NsjADB/3JXUKK83kTNWGzScXvp0o+Jg==
"@sentry/utils@7.60.1":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.60.1.tgz#27b20bd2926c877011eb39fcb4b2db95dc72243f"
integrity sha512-ik+5sKGBx4DWuvf6UUKPSafaDiASxP+Xvjg3C9ppop2I/JWxP1FfZ5g22n5ZmPmNahD6clTSoTWly8qyDUlUOw==
dependencies:
"@sentry/types" "7.34.0"
tslib "^1.9.3"
"@sentry/types" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "1.20.0"
Expand Down Expand Up @@ -5164,6 +5166,13 @@ sponge-case@^1.0.1:
dependencies:
tslib "^2.0.3"

stacktrace-parser@^0.1.10:
version "0.1.10"
resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a"
integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==
dependencies:
type-fest "^0.7.1"

streamsearch@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
Expand Down Expand Up @@ -5440,7 +5449,7 @@ tsconfig-paths@^3.14.1:
minimist "^1.2.6"
strip-bom "^3.0.0"

tslib@^1.8.1, tslib@^1.9.3:
tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
Expand All @@ -5450,6 +5459,11 @@ tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@~2.4
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

"tslib@^2.4.1 || ^1.9.3":
version "2.6.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410"
integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==

tslib@~2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
Expand Down Expand Up @@ -5489,6 +5503,11 @@ type-fest@^0.21.3:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==

type-fest@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48"
integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==

[email protected]:
version "4.7.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
Expand Down

0 comments on commit 863d3c6

Please sign in to comment.