Skip to content

Commit a58d26e

Browse files
authored
chore(deps): update @awell-health/ui-library to version 0.1.95 and refactor file upload configuration (#342)
- Bump @awell-health/ui-library to version 0.1.95 - Refactor file upload handling to use config_slug instead of config_id across components and GraphQL queries - Update related types and fragments to reflect the new configuration structure
1 parent 9865f72 commit a58d26e

File tree

7 files changed

+54
-23
lines changed

7 files changed

+54
-23
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"@apollo/client": "^3.8.6",
1818
"@awell-health/sol-scheduling": "0.3.33",
19-
"@awell-health/ui-library": "0.1.94",
19+
"@awell-health/ui-library": "0.1.95",
2020
"@formsort/react-embed": "^3.1.1",
2121
"@google-cloud/logging": "^11.0.0",
2222
"@localazy/cli": "^1.7.5",

src/components/Form/Form.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ export const Form: FC<FormProps> = ({ activity }) => {
127127

128128
const handleFileUpload = async (
129129
file: File,
130-
config_id?: string
130+
config_slug?: string
131131
): Promise<string> => {
132132
try {
133-
if (isNil(config_id)) {
133+
if (isNil(config_slug)) {
134134
throw new Error('Config ID is required')
135135
}
136136

@@ -139,7 +139,7 @@ export const Form: FC<FormProps> = ({ activity }) => {
139139
file_name: file.name,
140140
content_type: file.type,
141141
expires_in: 360000,
142-
config_id,
142+
config_slug,
143143
})
144144

145145
// Make sure we're using the exact content type that was used to generate the signed URL

src/hooks/useFileUpload/GetSignedUrl.graphql

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ query GetSignedUrl(
22
$content_type: String!
33
$expires_in: Float
44
$file_name: String!
5-
$config_id: String!
5+
$config_slug: String!
66
) {
77
getSignedUrl(
88
content_type: $content_type
99
expires_in: $expires_in
1010
file_name: $file_name
11-
config_id: $config_id
11+
config_slug: $config_slug
1212
) {
1313
upload_url
1414
file_url

src/hooks/useFileUpload/useFileUpload.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const useFileUpload = (): [
1818
file_url: string
1919
}> => {
2020
try {
21-
const { content_type, expires_in, file_name, config_id } = args
21+
const { content_type, expires_in, file_name, config_slug } = args
2222

2323
// Ensure content_type is properly set
2424
const safeContentType = content_type || 'application/octet-stream'
@@ -28,7 +28,7 @@ export const useFileUpload = (): [
2828
content_type: safeContentType,
2929
expires_in,
3030
file_name,
31-
config_id,
31+
config_slug,
3232
},
3333
})
3434

src/hooks/useForm/graphql/Question.graphql

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fragment Question on Question {
5353
include_date_of_response
5454
}
5555
file_storage {
56-
file_storage_destination_id
56+
file_storage_config_slug
5757
accepted_file_types
5858
}
5959
}

src/types/generated/types-orchestration.tsx

+41-10
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,25 @@ export type CancelScheduledTracksPayload = Payload & {
491491
unscheduled_ids: Array<Scalars['String']>;
492492
};
493493

494+
export type CareflowVersion = {
495+
__typename?: 'CareflowVersion';
496+
live?: Maybe<Scalars['Boolean']>;
497+
release_date?: Maybe<Scalars['String']>;
498+
release_id?: Maybe<Scalars['String']>;
499+
version?: Maybe<Scalars['Float']>;
500+
};
501+
502+
export type CareflowVersions = {
503+
__typename?: 'CareflowVersions';
504+
careflow_definition_id: Scalars['String'];
505+
versions?: Maybe<Array<CareflowVersion>>;
506+
};
507+
508+
export type CareflowVersionsPayload = {
509+
__typename?: 'CareflowVersionsPayload';
510+
careflowVersions: Array<CareflowVersions>;
511+
};
512+
494513
export type Checklist = {
495514
__typename?: 'Checklist';
496515
items: Array<Scalars['String']>;
@@ -552,6 +571,8 @@ export enum ConditionOperandType {
552571
export enum ConditionOperator {
553572
Contains = 'CONTAINS',
554573
DoesNotContain = 'DOES_NOT_CONTAIN',
574+
HasFileUploaded = 'HAS_FILE_UPLOADED',
575+
HasNoFileUploaded = 'HAS_NO_FILE_UPLOADED',
555576
IsAnyOf = 'IS_ANY_OF',
556577
IsEmpty = 'IS_EMPTY',
557578
IsEqualTo = 'IS_EQUAL_TO',
@@ -879,7 +900,7 @@ export type ExtensionDataPointInput = {
879900
export type FileStorageQuestionConfig = {
880901
__typename?: 'FileStorageQuestionConfig';
881902
accepted_file_types?: Maybe<Array<Scalars['String']>>;
882-
file_storage_destination_id?: Maybe<Scalars['String']>;
903+
file_storage_config_slug?: Maybe<Scalars['String']>;
883904
};
884905

885906
export type FileUploadGcsPayload = Payload & {
@@ -1737,6 +1758,7 @@ export type Query = {
17371758
forms: FormsPayload;
17381759
generateRetoolEmbedUrl: GenerateRetoolEmbedUrlPayload;
17391760
getOrchestrationFactsFromPrompt: OrchestrationFactsPromptPayload;
1761+
getPublishedCareflowVersions: CareflowVersionsPayload;
17401762
/** Generate a signed URL for file upload to GCS */
17411763
getSignedUrl: FileUploadGcsPayload;
17421764
getStatusForPublishedPathwayDefinitions: PublishedPathwayDefinitionsPayload;
@@ -1903,8 +1925,13 @@ export type QueryGetOrchestrationFactsFromPromptArgs = {
19031925
};
19041926

19051927

1928+
export type QueryGetPublishedCareflowVersionsArgs = {
1929+
careflow_definition_id?: InputMaybe<Scalars['String']>;
1930+
};
1931+
1932+
19061933
export type QueryGetSignedUrlArgs = {
1907-
config_id: Scalars['String'];
1934+
config_slug: Scalars['String'];
19081935
content_type: Scalars['String'];
19091936
expires_in?: InputMaybe<Scalars['Float']>;
19101937
file_name: Scalars['String'];
@@ -1931,6 +1958,7 @@ export type QueryMyActivitiesArgs = {
19311958
pagination?: InputMaybe<PaginationParams>;
19321959
pathway_id: Scalars['String'];
19331960
sorting?: InputMaybe<SortingParams>;
1961+
track_id?: InputMaybe<Scalars['String']>;
19341962
};
19351963

19361964

@@ -1943,6 +1971,7 @@ export type QueryPathwayActivitiesArgs = {
19431971
pagination?: InputMaybe<PaginationParams>;
19441972
pathway_id: Scalars['String'];
19451973
sorting?: InputMaybe<SortingParams>;
1974+
track_id?: InputMaybe<Scalars['String']>;
19461975
};
19471976

19481977

@@ -1965,6 +1994,7 @@ export type QueryPathwayDataPointsArgs = {
19651994

19661995
export type QueryPathwayElementsArgs = {
19671996
pathway_id: Scalars['String'];
1997+
track_id?: InputMaybe<Scalars['String']>;
19681998
};
19691999

19702000

@@ -2430,6 +2460,7 @@ export type SubActivity = {
24302460
error_category?: Maybe<Scalars['String']>;
24312461
id: Scalars['String'];
24322462
object?: Maybe<ActivityObject>;
2463+
scheduled_date?: Maybe<Scalars['String']>;
24332464
subject: ActivitySubject;
24342465
text?: Maybe<TranslatedText>;
24352466
};
@@ -2806,20 +2837,20 @@ export type GetSignedUrlQueryVariables = Exact<{
28062837
content_type: Scalars['String'];
28072838
expires_in?: InputMaybe<Scalars['Float']>;
28082839
file_name: Scalars['String'];
2809-
config_id: Scalars['String'];
2840+
config_slug: Scalars['String'];
28102841
}>;
28112842

28122843

28132844
export type GetSignedUrlQuery = { __typename?: 'Query', getSignedUrl: { __typename?: 'FileUploadGCSPayload', upload_url: string, file_url: string } };
28142845

2815-
export type FormFragment = { __typename?: 'Form', id: string, key: string, title: string, trademark?: string | null, definition_id: string, release_id: string, questions: Array<{ __typename?: 'Question', id: string, definition_id: string, key: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value_string: 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, phone?: { __typename?: 'PhoneConfig', default_country?: string | null, available_countries?: Array<string> | null } | null, number?: { __typename?: 'NumberConfig', range?: { __typename?: 'RangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null } | null, multiple_select?: { __typename?: 'MultipleSelectConfig', range?: { __typename?: 'ChoiceRangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null, exclusive_option?: { __typename?: 'ExclusiveOptionConfig', option_id?: string | null, enabled?: boolean | null } | null } | null, date?: { __typename?: 'DateConfig', allowed_dates?: AllowedDatesOptions | null, include_date_of_response?: boolean | null } | null, file_storage?: { __typename?: 'FileStorageQuestionConfig', file_storage_destination_id?: string | null, accepted_file_types?: Array<string> | null } | null } | null }> };
2846+
export type FormFragment = { __typename?: 'Form', id: string, key: string, title: string, trademark?: string | null, definition_id: string, release_id: string, questions: Array<{ __typename?: 'Question', id: string, definition_id: string, key: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value_string: 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, phone?: { __typename?: 'PhoneConfig', default_country?: string | null, available_countries?: Array<string> | null } | null, number?: { __typename?: 'NumberConfig', range?: { __typename?: 'RangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null } | null, multiple_select?: { __typename?: 'MultipleSelectConfig', range?: { __typename?: 'ChoiceRangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null, exclusive_option?: { __typename?: 'ExclusiveOptionConfig', option_id?: string | null, enabled?: boolean | null } | null } | null, date?: { __typename?: 'DateConfig', allowed_dates?: AllowedDatesOptions | null, include_date_of_response?: boolean | null } | null, file_storage?: { __typename?: 'FileStorageQuestionConfig', file_storage_config_slug?: string | null, accepted_file_types?: Array<string> | null } | null } | null }> };
28162847

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

28212852

2822-
export type GetFormQuery = { __typename?: 'Query', form: { __typename?: 'FormPayload', form?: { __typename?: 'Form', id: string, key: string, title: string, trademark?: string | null, definition_id: string, release_id: string, questions: Array<{ __typename?: 'Question', id: string, definition_id: string, key: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value_string: 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, phone?: { __typename?: 'PhoneConfig', default_country?: string | null, available_countries?: Array<string> | null } | null, number?: { __typename?: 'NumberConfig', range?: { __typename?: 'RangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null } | null, multiple_select?: { __typename?: 'MultipleSelectConfig', range?: { __typename?: 'ChoiceRangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null, exclusive_option?: { __typename?: 'ExclusiveOptionConfig', option_id?: string | null, enabled?: boolean | null } | null } | null, date?: { __typename?: 'DateConfig', allowed_dates?: AllowedDatesOptions | null, include_date_of_response?: boolean | null } | null, file_storage?: { __typename?: 'FileStorageQuestionConfig', file_storage_destination_id?: string | null, accepted_file_types?: Array<string> | null } | null } | null }> } | null } };
2853+
export type GetFormQuery = { __typename?: 'Query', form: { __typename?: 'FormPayload', form?: { __typename?: 'Form', id: string, key: string, title: string, trademark?: string | null, definition_id: string, release_id: string, questions: Array<{ __typename?: 'Question', id: string, definition_id: string, key: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value_string: 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, phone?: { __typename?: 'PhoneConfig', default_country?: string | null, available_countries?: Array<string> | null } | null, number?: { __typename?: 'NumberConfig', range?: { __typename?: 'RangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null } | null, multiple_select?: { __typename?: 'MultipleSelectConfig', range?: { __typename?: 'ChoiceRangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null, exclusive_option?: { __typename?: 'ExclusiveOptionConfig', option_id?: string | null, enabled?: boolean | null } | null } | null, date?: { __typename?: 'DateConfig', allowed_dates?: AllowedDatesOptions | null, include_date_of_response?: boolean | null } | null, file_storage?: { __typename?: 'FileStorageQuestionConfig', file_storage_config_slug?: string | null, accepted_file_types?: Array<string> | null } | null } | null }> } | null } };
28232854

28242855
export type GetFormResponseQueryVariables = Exact<{
28252856
pathway_id: Scalars['String'];
@@ -2829,7 +2860,7 @@ export type GetFormResponseQueryVariables = Exact<{
28292860

28302861
export type GetFormResponseQuery = { __typename?: 'Query', formResponse: { __typename?: 'FormResponsePayload', response: { __typename?: 'FormResponse', answers: Array<{ __typename?: 'Answer', question_id: string, value: string, value_type: DataPointValueType }> } } };
28312862

2832-
export type QuestionFragment = { __typename?: 'Question', id: string, definition_id: string, key: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value_string: 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, phone?: { __typename?: 'PhoneConfig', default_country?: string | null, available_countries?: Array<string> | null } | null, number?: { __typename?: 'NumberConfig', range?: { __typename?: 'RangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null } | null, multiple_select?: { __typename?: 'MultipleSelectConfig', range?: { __typename?: 'ChoiceRangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null, exclusive_option?: { __typename?: 'ExclusiveOptionConfig', option_id?: string | null, enabled?: boolean | null } | null } | null, date?: { __typename?: 'DateConfig', allowed_dates?: AllowedDatesOptions | null, include_date_of_response?: boolean | null } | null, file_storage?: { __typename?: 'FileStorageQuestionConfig', file_storage_destination_id?: string | null, accepted_file_types?: Array<string> | null } | null } | null };
2863+
export type QuestionFragment = { __typename?: 'Question', id: string, definition_id: string, key: string, title: string, dataPointValueType?: DataPointValueType | null, questionType?: QuestionType | null, userQuestionType?: UserQuestionType | null, options?: Array<{ __typename?: 'Option', id: string, value_string: 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, phone?: { __typename?: 'PhoneConfig', default_country?: string | null, available_countries?: Array<string> | null } | null, number?: { __typename?: 'NumberConfig', range?: { __typename?: 'RangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null } | null, multiple_select?: { __typename?: 'MultipleSelectConfig', range?: { __typename?: 'ChoiceRangeConfig', min?: number | null, max?: number | null, enabled?: boolean | null } | null, exclusive_option?: { __typename?: 'ExclusiveOptionConfig', option_id?: string | null, enabled?: boolean | null } | null } | null, date?: { __typename?: 'DateConfig', allowed_dates?: AllowedDatesOptions | null, include_date_of_response?: boolean | null } | null, file_storage?: { __typename?: 'FileStorageQuestionConfig', file_storage_config_slug?: string | null, accepted_file_types?: Array<string> | null } | null } | null };
28332864

28342865
export type HostedSessionFragment = { __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 } };
28352866

@@ -2969,7 +3000,7 @@ export const QuestionFragmentDoc = gql`
29693000
include_date_of_response
29703001
}
29713002
file_storage {
2972-
file_storage_destination_id
3003+
file_storage_config_slug
29733004
accepted_file_types
29743005
}
29753006
}
@@ -3196,12 +3227,12 @@ export type GetExtensionActivityDetailsQueryHookResult = ReturnType<typeof useGe
31963227
export type GetExtensionActivityDetailsLazyQueryHookResult = ReturnType<typeof useGetExtensionActivityDetailsLazyQuery>;
31973228
export type GetExtensionActivityDetailsQueryResult = Apollo.QueryResult<GetExtensionActivityDetailsQuery, GetExtensionActivityDetailsQueryVariables>;
31983229
export const GetSignedUrlDocument = gql`
3199-
query GetSignedUrl($content_type: String!, $expires_in: Float, $file_name: String!, $config_id: String!) {
3230+
query GetSignedUrl($content_type: String!, $expires_in: Float, $file_name: String!, $config_slug: String!) {
32003231
getSignedUrl(
32013232
content_type: $content_type
32023233
expires_in: $expires_in
32033234
file_name: $file_name
3204-
config_id: $config_id
3235+
config_slug: $config_slug
32053236
) {
32063237
upload_url
32073238
file_url
@@ -3224,7 +3255,7 @@ export const GetSignedUrlDocument = gql`
32243255
* content_type: // value for 'content_type'
32253256
* expires_in: // value for 'expires_in'
32263257
* file_name: // value for 'file_name'
3227-
* config_id: // value for 'config_id'
3258+
* config_slug: // value for 'config_slug'
32283259
* },
32293260
* });
32303261
*/

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@
112112
tailwindcss-animate "^1.0.7"
113113
zod "^3.21.4"
114114

115-
"@awell-health/ui-library@0.1.94":
116-
version "0.1.94"
117-
resolved "https://registry.yarnpkg.com/@awell-health/ui-library/-/ui-library-0.1.94.tgz#908c197b54e6b5565b2239c8d6734b2e390dd271"
118-
integrity sha512-qGwiSUAP2jJGKABvrwogzO0tMLyMg969fdQpfZNv9R9wK6kh9AJrWSYANjeyayugbEmkhXLHsMc4D6aIb50CwQ==
115+
"@awell-health/ui-library@0.1.95":
116+
version "0.1.95"
117+
resolved "https://registry.yarnpkg.com/@awell-health/ui-library/-/ui-library-0.1.95.tgz#9a3d89d4bc0ade487391468e22b4aee270a2be69"
118+
integrity sha512-vygaSvMsMBCBUTdFacldbIjFfzZkR45m8S8aVb+KgVP9rV/VA1UeonacCmsu96cAOdal9GajJtWPxrlKrNj+0w==
119119
dependencies:
120120
"@awell-health/design-system" "0.12.46"
121121
"@calcom/embed-react" "^1.5.1"

0 commit comments

Comments
 (0)