From 552c645932b14fb54594a3bca75ea6e08a3c425f Mon Sep 17 00:00:00 2001 From: loischen68 Date: Fri, 7 Jun 2024 02:37:52 +0800 Subject: [PATCH] feat/SecondaryProgramPage-data-setup --- src/components/common/GiftPlanTag.tsx | 10 +- src/hasura.d.ts | 1802 ++++++++--------- src/hooks/program.ts | 34 +- .../Primary/ProgramContentListSection.tsx | 4 +- src/pages/ProgramPage/ProgramPageContent.tsx | 2 +- .../Secondary/ProgramIntroTabs/index.tsx | 26 +- .../CollapseContentBlock.tsx | 68 + .../CollapseContentCard.tsx | 13 +- .../index.tsx | 98 +- .../Secondary/SecondaryProgramInfoCard.tsx | 25 +- .../SecondaryProgramPageContent/index.tsx | 33 +- .../SecondaryPriceLabel.tsx | 35 +- .../SecondaryProgramPlanCard/index.tsx | 43 +- src/pages/ProgramPage/index.tsx | 4 +- src/types/program.ts | 26 +- 15 files changed, 1151 insertions(+), 1072 deletions(-) create mode 100644 src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentBlock.tsx diff --git a/src/components/common/GiftPlanTag.tsx b/src/components/common/GiftPlanTag.tsx index 8cbfdfbd3..cfa5811fb 100644 --- a/src/components/common/GiftPlanTag.tsx +++ b/src/components/common/GiftPlanTag.tsx @@ -1,21 +1,21 @@ import React from 'react' import { defineMessages, useIntl } from 'react-intl' import styled from 'styled-components' -const StyledTag = styled.p` +const StyledTag = styled.p<{ color?: string }>` padding: 2px 6px; font-size: 12px; letter-spacing: 0.6px; - color: ${props => props.theme['@primary-color']}; - border: 1px solid ${props => props.theme['@primary-color']}; + color: ${props => (!!props.color ? props.color : props.theme['@primary-color'])}; + border: 1px solid ${props => (!!props.color ? props.color : props.theme['@primary-color'])}; border-radius: 4px; ` const messages = defineMessages({ hasGiftPlan: { id: 'common.label.hasGiftPlan', defaultMessage: '附贈品' }, }) -const GiftPlanTag: React.VFC = () => { +const GiftPlanTag: React.VFC<{ color?: string }> = ({ color }) => { const { formatMessage } = useIntl() - return {formatMessage(messages.hasGiftPlan)} + return {formatMessage(messages.hasGiftPlan)} } export default GiftPlanTag diff --git a/src/hasura.d.ts b/src/hasura.d.ts index 61697a74e..d82cef4b8 100644 --- a/src/hasura.d.ts +++ b/src/hasura.d.ts @@ -14,7 +14,6 @@ export type Scalars = { bpchar: any; date: any; float8: any; - json: any; jsonb: any; numeric: any; timestamp: any; @@ -15309,6 +15308,7 @@ export type card = { card_products: Array; /** An aggregate relationship */ card_products_aggregate: card_product_aggregate; + created_at?: Maybe; /** An object relationship */ creator?: Maybe; creator_id?: Maybe; @@ -15473,6 +15473,7 @@ export type card_bool_exp = { card_enrollments_aggregate?: InputMaybe; card_products?: InputMaybe; card_products_aggregate?: InputMaybe; + created_at?: InputMaybe; creator?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; @@ -15992,6 +15993,7 @@ export type card_insert_input = { card_discounts?: InputMaybe; card_enrollments?: InputMaybe; card_products?: InputMaybe; + created_at?: InputMaybe; creator?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; @@ -16012,6 +16014,7 @@ export type card_insert_input = { export type card_max_fields = { __typename?: 'card_max_fields'; app_id?: Maybe; + created_at?: Maybe; creator_id?: Maybe; deleted_at?: Maybe; description?: Maybe; @@ -16030,6 +16033,7 @@ export type card_max_fields = { /** order by max() on columns of table "card" */ export type card_max_order_by = { app_id?: InputMaybe; + created_at?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; description?: InputMaybe; @@ -16049,6 +16053,7 @@ export type card_max_order_by = { export type card_min_fields = { __typename?: 'card_min_fields'; app_id?: Maybe; + created_at?: Maybe; creator_id?: Maybe; deleted_at?: Maybe; description?: Maybe; @@ -16067,6 +16072,7 @@ export type card_min_fields = { /** order by min() on columns of table "card" */ export type card_min_order_by = { app_id?: InputMaybe; + created_at?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; description?: InputMaybe; @@ -16112,6 +16118,7 @@ export type card_order_by = { card_discounts_aggregate?: InputMaybe; card_enrollments_aggregate?: InputMaybe; card_products_aggregate?: InputMaybe; + created_at?: InputMaybe; creator?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; @@ -16420,6 +16427,8 @@ export enum card_select_column { /** column name */ app_id = 'app_id', /** column name */ + created_at = 'created_at', + /** column name */ creator_id = 'creator_id', /** column name */ deleted_at = 'deleted_at', @@ -16448,6 +16457,7 @@ export enum card_select_column { /** input type for updating data in table "card" */ export type card_set_input = { app_id?: InputMaybe; + created_at?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; description?: InputMaybe; @@ -16507,6 +16517,7 @@ export type card_stream_cursor_input = { /** Initial value of the column from where the streaming should start */ export type card_stream_cursor_value_input = { app_id?: InputMaybe; + created_at?: InputMaybe; creator_id?: InputMaybe; deleted_at?: InputMaybe; description?: InputMaybe; @@ -16538,6 +16549,8 @@ export enum card_update_column { /** column name */ app_id = 'app_id', /** column name */ + created_at = 'created_at', + /** column name */ creator_id = 'creator_id', /** column name */ deleted_at = 'deleted_at', @@ -31264,19 +31277,6 @@ export type iszn_coursereply_updates = { where: iszn_coursereply_bool_exp; }; -/** Boolean expression to compare columns of type "json". All fields are combined with logical 'AND'. */ -export type json_comparison_exp = { - _eq?: InputMaybe; - _gt?: InputMaybe; - _gte?: InputMaybe; - _in?: InputMaybe>; - _is_null?: InputMaybe; - _lt?: InputMaybe; - _lte?: InputMaybe; - _neq?: InputMaybe; - _nin?: InputMaybe>; -}; - export type jsonb_cast_exp = { String?: InputMaybe; }; @@ -48417,6 +48417,14 @@ export type mutation_root = { delete_program_content_video_by_pk?: Maybe; /** delete data from the table: "program_editor" */ delete_program_editor?: Maybe; + /** delete data from the table: "program_layout_template" */ + delete_program_layout_template?: Maybe; + /** delete single row from the table: "program_layout_template" */ + delete_program_layout_template_by_pk?: Maybe; + /** delete data from the table: "program_layout_template_config" */ + delete_program_layout_template_config?: Maybe; + /** delete single row from the table: "program_layout_template_config" */ + delete_program_layout_template_config_by_pk?: Maybe; /** delete data from the table: "program_package" */ delete_program_package?: Maybe; /** delete single row from the table: "program_package" */ @@ -48453,14 +48461,6 @@ export type mutation_root = { delete_program_tag?: Maybe; /** delete single row from the table: "program_tag" */ delete_program_tag_by_pk?: Maybe; - /** delete data from the table: "program_template" */ - delete_program_template?: Maybe; - /** delete single row from the table: "program_template" */ - delete_program_template_by_pk?: Maybe; - /** delete data from the table: "program_template_config" */ - delete_program_template_config?: Maybe; - /** delete single row from the table: "program_template_config" */ - delete_program_template_config_by_pk?: Maybe; /** delete data from the table: "program_tempo_delivery" */ delete_program_tempo_delivery?: Maybe; /** delete single row from the table: "program_tempo_delivery" */ @@ -49465,6 +49465,14 @@ export type mutation_root = { insert_program_editor?: Maybe; /** insert a single row into the table: "program_editor" */ insert_program_editor_one?: Maybe; + /** insert data into the table: "program_layout_template" */ + insert_program_layout_template?: Maybe; + /** insert data into the table: "program_layout_template_config" */ + insert_program_layout_template_config?: Maybe; + /** insert a single row into the table: "program_layout_template_config" */ + insert_program_layout_template_config_one?: Maybe; + /** insert a single row into the table: "program_layout_template" */ + insert_program_layout_template_one?: Maybe; /** insert a single row into the table: "program" */ insert_program_one?: Maybe; /** insert data into the table: "program_package" */ @@ -49503,14 +49511,6 @@ export type mutation_root = { insert_program_tag?: Maybe; /** insert a single row into the table: "program_tag" */ insert_program_tag_one?: Maybe; - /** insert data into the table: "program_template" */ - insert_program_template?: Maybe; - /** insert data into the table: "program_template_config" */ - insert_program_template_config?: Maybe; - /** insert a single row into the table: "program_template_config" */ - insert_program_template_config_one?: Maybe; - /** insert a single row into the table: "program_template" */ - insert_program_template_one?: Maybe; /** insert data into the table: "program_tempo_delivery" */ insert_program_tempo_delivery?: Maybe; /** insert a single row into the table: "program_tempo_delivery" */ @@ -50891,6 +50891,18 @@ export type mutation_root = { update_program_editor?: Maybe; /** update multiples rows of table: "program_editor" */ update_program_editor_many?: Maybe>>; + /** update data of the table: "program_layout_template" */ + update_program_layout_template?: Maybe; + /** update single row of the table: "program_layout_template" */ + update_program_layout_template_by_pk?: Maybe; + /** update data of the table: "program_layout_template_config" */ + update_program_layout_template_config?: Maybe; + /** update single row of the table: "program_layout_template_config" */ + update_program_layout_template_config_by_pk?: Maybe; + /** update multiples rows of table: "program_layout_template_config" */ + update_program_layout_template_config_many?: Maybe>>; + /** update multiples rows of table: "program_layout_template" */ + update_program_layout_template_many?: Maybe>>; /** update multiples rows of table: "program" */ update_program_many?: Maybe>>; /** update data of the table: "program_package" */ @@ -50947,18 +50959,6 @@ export type mutation_root = { update_program_tag_by_pk?: Maybe; /** update multiples rows of table: "program_tag" */ update_program_tag_many?: Maybe>>; - /** update data of the table: "program_template" */ - update_program_template?: Maybe; - /** update single row of the table: "program_template" */ - update_program_template_by_pk?: Maybe; - /** update data of the table: "program_template_config" */ - update_program_template_config?: Maybe; - /** update single row of the table: "program_template_config" */ - update_program_template_config_by_pk?: Maybe; - /** update multiples rows of table: "program_template_config" */ - update_program_template_config_many?: Maybe>>; - /** update multiples rows of table: "program_template" */ - update_program_template_many?: Maybe>>; /** update data of the table: "program_tempo_delivery" */ update_program_tempo_delivery?: Maybe; /** update single row of the table: "program_tempo_delivery" */ @@ -53575,6 +53575,30 @@ export type mutation_rootdelete_program_editorArgs = { }; +/** mutation root */ +export type mutation_rootdelete_program_layout_templateArgs = { + where: program_layout_template_bool_exp; +}; + + +/** mutation root */ +export type mutation_rootdelete_program_layout_template_by_pkArgs = { + id: Scalars['uuid']; +}; + + +/** mutation root */ +export type mutation_rootdelete_program_layout_template_configArgs = { + where: program_layout_template_config_bool_exp; +}; + + +/** mutation root */ +export type mutation_rootdelete_program_layout_template_config_by_pkArgs = { + id: Scalars['uuid']; +}; + + /** mutation root */ export type mutation_rootdelete_program_packageArgs = { where: program_package_bool_exp; @@ -53683,30 +53707,6 @@ export type mutation_rootdelete_program_tag_by_pkArgs = { }; -/** mutation root */ -export type mutation_rootdelete_program_templateArgs = { - where: program_template_bool_exp; -}; - - -/** mutation root */ -export type mutation_rootdelete_program_template_by_pkArgs = { - id: Scalars['uuid']; -}; - - -/** mutation root */ -export type mutation_rootdelete_program_template_configArgs = { - where: program_template_config_bool_exp; -}; - - -/** mutation root */ -export type mutation_rootdelete_program_template_config_by_pkArgs = { - id: Scalars['uuid']; -}; - - /** mutation root */ export type mutation_rootdelete_program_tempo_deliveryArgs = { where: program_tempo_delivery_bool_exp; @@ -57084,6 +57084,34 @@ export type mutation_rootinsert_program_editor_oneArgs = { }; +/** mutation root */ +export type mutation_rootinsert_program_layout_templateArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type mutation_rootinsert_program_layout_template_configArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type mutation_rootinsert_program_layout_template_config_oneArgs = { + object: program_layout_template_config_insert_input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type mutation_rootinsert_program_layout_template_oneArgs = { + object: program_layout_template_insert_input; + on_conflict?: InputMaybe; +}; + + /** mutation root */ export type mutation_rootinsert_program_oneArgs = { object: program_insert_input; @@ -57217,34 +57245,6 @@ export type mutation_rootinsert_program_tag_oneArgs = { }; -/** mutation root */ -export type mutation_rootinsert_program_templateArgs = { - objects: Array; - on_conflict?: InputMaybe; -}; - - -/** mutation root */ -export type mutation_rootinsert_program_template_configArgs = { - objects: Array; - on_conflict?: InputMaybe; -}; - - -/** mutation root */ -export type mutation_rootinsert_program_template_config_oneArgs = { - object: program_template_config_insert_input; - on_conflict?: InputMaybe; -}; - - -/** mutation root */ -export type mutation_rootinsert_program_template_oneArgs = { - object: program_template_insert_input; - on_conflict?: InputMaybe; -}; - - /** mutation root */ export type mutation_rootinsert_program_tempo_deliveryArgs = { objects: Array; @@ -62616,6 +62616,66 @@ export type mutation_rootupdate_program_editor_manyArgs = { }; +/** mutation root */ +export type mutation_rootupdate_program_layout_templateArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + where: program_layout_template_bool_exp; +}; + + +/** mutation root */ +export type mutation_rootupdate_program_layout_template_by_pkArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + pk_columns: program_layout_template_pk_columns_input; +}; + + +/** mutation root */ +export type mutation_rootupdate_program_layout_template_configArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + where: program_layout_template_config_bool_exp; +}; + + +/** mutation root */ +export type mutation_rootupdate_program_layout_template_config_by_pkArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + pk_columns: program_layout_template_config_pk_columns_input; +}; + + +/** mutation root */ +export type mutation_rootupdate_program_layout_template_config_manyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type mutation_rootupdate_program_layout_template_manyArgs = { + updates: Array; +}; + + /** mutation root */ export type mutation_rootupdate_program_manyArgs = { updates: Array; @@ -62846,48 +62906,6 @@ export type mutation_rootupdate_program_tag_manyArgs = { }; -/** mutation root */ -export type mutation_rootupdate_program_templateArgs = { - _set?: InputMaybe; - where: program_template_bool_exp; -}; - - -/** mutation root */ -export type mutation_rootupdate_program_template_by_pkArgs = { - _set?: InputMaybe; - pk_columns: program_template_pk_columns_input; -}; - - -/** mutation root */ -export type mutation_rootupdate_program_template_configArgs = { - _inc?: InputMaybe; - _set?: InputMaybe; - where: program_template_config_bool_exp; -}; - - -/** mutation root */ -export type mutation_rootupdate_program_template_config_by_pkArgs = { - _inc?: InputMaybe; - _set?: InputMaybe; - pk_columns: program_template_config_pk_columns_input; -}; - - -/** mutation root */ -export type mutation_rootupdate_program_template_config_manyArgs = { - updates: Array; -}; - - -/** mutation root */ -export type mutation_rootupdate_program_template_manyArgs = { - updates: Array; -}; - - /** mutation root */ export type mutation_rootupdate_program_tempo_deliveryArgs = { _set?: InputMaybe; @@ -86780,7 +86798,6 @@ export type program = { list_price?: Maybe; meta_tag?: Maybe; metadata?: Maybe; - module_data?: Maybe; /** An array relationship */ package_items: Array; /** An aggregate relationship */ @@ -86823,6 +86840,10 @@ export type program = { /** An aggregate relationship */ program_enrollments_aggregate: program_enrollment_aggregate; /** An array relationship */ + program_layout_template_configs: Array; + /** An aggregate relationship */ + program_layout_template_configs_aggregate: program_layout_template_config_aggregate; + /** An array relationship */ program_package_programs: Array; /** An aggregate relationship */ program_package_programs_aggregate: program_package_program_aggregate; @@ -86844,9 +86865,6 @@ export type program = { program_tags: Array; /** An aggregate relationship */ program_tags_aggregate: program_tag_aggregate; - /** An object relationship */ - program_template?: Maybe; - program_template_id?: Maybe; published_at?: Maybe; sale_price?: Maybe; sold_at?: Maybe; @@ -86889,12 +86907,6 @@ export type programmetadataArgs = { }; -/** columns and relationships of "program" */ -export type programmodule_dataArgs = { - path?: InputMaybe; -}; - - /** columns and relationships of "program" */ export type programpackage_itemsArgs = { distinct_on?: InputMaybe>; @@ -87075,6 +87087,26 @@ export type programprogram_enrollments_aggregateArgs = { }; +/** columns and relationships of "program" */ +export type programprogram_layout_template_configsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "program" */ +export type programprogram_layout_template_configs_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "program" */ export type programprogram_package_programsArgs = { distinct_on?: InputMaybe>; @@ -87680,7 +87712,6 @@ export type program_announcement_updates = { export type program_append_input = { meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; support_locales?: InputMaybe; }; @@ -88098,7 +88129,6 @@ export type program_bool_exp = { list_price?: InputMaybe; meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; package_items?: InputMaybe; package_items_aggregate?: InputMaybe; position?: InputMaybe; @@ -88120,6 +88150,8 @@ export type program_bool_exp = { program_duration?: InputMaybe; program_enrollments?: InputMaybe; program_enrollments_aggregate?: InputMaybe; + program_layout_template_configs?: InputMaybe; + program_layout_template_configs_aggregate?: InputMaybe; program_package_programs?: InputMaybe; program_package_programs_aggregate?: InputMaybe; program_plans?: InputMaybe; @@ -88131,8 +88163,6 @@ export type program_bool_exp = { program_roles_aggregate?: InputMaybe; program_tags?: InputMaybe; program_tags_aggregate?: InputMaybe; - program_template?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -94651,7 +94681,6 @@ export type program_content_video_updates = { export type program_delete_at_path_input = { meta_tag?: InputMaybe>; metadata?: InputMaybe>; - module_data?: InputMaybe>; support_locales?: InputMaybe>; }; @@ -94659,7 +94688,6 @@ export type program_delete_at_path_input = { export type program_delete_elem_input = { meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; support_locales?: InputMaybe; }; @@ -94667,7 +94695,6 @@ export type program_delete_elem_input = { export type program_delete_key_input = { meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; support_locales?: InputMaybe; }; @@ -95187,7 +95214,6 @@ export type program_insert_input = { list_price?: InputMaybe; meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; package_items?: InputMaybe; position?: InputMaybe; program_announcements?: InputMaybe; @@ -95200,14 +95226,13 @@ export type program_insert_input = { program_content_sections?: InputMaybe; program_duration?: InputMaybe; program_enrollments?: InputMaybe; + program_layout_template_configs?: InputMaybe; program_package_programs?: InputMaybe; program_plans?: InputMaybe; program_related_items?: InputMaybe; program_review_score?: InputMaybe; program_roles?: InputMaybe; program_tags?: InputMaybe; - program_template?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -95217,6 +95242,586 @@ export type program_insert_input = { views?: InputMaybe; }; +/** columns and relationships of "program_layout_template" */ +export type program_layout_template = { + __typename?: 'program_layout_template'; + created_at: Scalars['timestamptz']; + description?: Maybe; + id: Scalars['uuid']; + module_name?: Maybe; + name: Scalars['String']; + /** An array relationship */ + program_layout_template_configs: Array; + /** An aggregate relationship */ + program_layout_template_configs_aggregate: program_layout_template_config_aggregate; + updated_at?: Maybe; + variant?: Maybe; +}; + + +/** columns and relationships of "program_layout_template" */ +export type program_layout_templatemodule_nameArgs = { + path?: InputMaybe; +}; + + +/** columns and relationships of "program_layout_template" */ +export type program_layout_templateprogram_layout_template_configsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "program_layout_template" */ +export type program_layout_templateprogram_layout_template_configs_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** aggregated selection of "program_layout_template" */ +export type program_layout_template_aggregate = { + __typename?: 'program_layout_template_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "program_layout_template" */ +export type program_layout_template_aggregate_fields = { + __typename?: 'program_layout_template_aggregate_fields'; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "program_layout_template" */ +export type program_layout_template_aggregate_fieldscountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** append existing jsonb value of filtered columns with new jsonb value */ +export type program_layout_template_append_input = { + module_name?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "program_layout_template". All fields are combined with a logical 'AND'. */ +export type program_layout_template_bool_exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + created_at?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + module_name?: InputMaybe; + name?: InputMaybe; + program_layout_template_configs?: InputMaybe; + program_layout_template_configs_aggregate?: InputMaybe; + updated_at?: InputMaybe; + variant?: InputMaybe; +}; + +/** columns and relationships of "program_layout_template_config" */ +export type program_layout_template_config = { + __typename?: 'program_layout_template_config'; + created_at: Scalars['timestamptz']; + id: Scalars['uuid']; + is_active: Scalars['Boolean']; + module_data?: Maybe; + /** An object relationship */ + program: program; + program_id: Scalars['uuid']; + /** An object relationship */ + program_layout_template: program_layout_template; + program_layout_template_id: Scalars['uuid']; + updated_at?: Maybe; +}; + + +/** columns and relationships of "program_layout_template_config" */ +export type program_layout_template_configmodule_dataArgs = { + path?: InputMaybe; +}; + +/** aggregated selection of "program_layout_template_config" */ +export type program_layout_template_config_aggregate = { + __typename?: 'program_layout_template_config_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +export type program_layout_template_config_aggregate_bool_exp = { + bool_and?: InputMaybe; + bool_or?: InputMaybe; + count?: InputMaybe; +}; + +export type program_layout_template_config_aggregate_bool_exp_bool_and = { + arguments: program_layout_template_config_select_column_program_layout_template_config_aggregate_bool_exp_bool_and_arguments_columns; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Boolean_comparison_exp; +}; + +export type program_layout_template_config_aggregate_bool_exp_bool_or = { + arguments: program_layout_template_config_select_column_program_layout_template_config_aggregate_bool_exp_bool_or_arguments_columns; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Boolean_comparison_exp; +}; + +export type program_layout_template_config_aggregate_bool_exp_count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_comparison_exp; +}; + +/** aggregate fields of "program_layout_template_config" */ +export type program_layout_template_config_aggregate_fields = { + __typename?: 'program_layout_template_config_aggregate_fields'; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "program_layout_template_config" */ +export type program_layout_template_config_aggregate_fieldscountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "program_layout_template_config" */ +export type program_layout_template_config_aggregate_order_by = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** append existing jsonb value of filtered columns with new jsonb value */ +export type program_layout_template_config_append_input = { + module_data?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "program_layout_template_config" */ +export type program_layout_template_config_arr_rel_insert_input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "program_layout_template_config". All fields are combined with a logical 'AND'. */ +export type program_layout_template_config_bool_exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + created_at?: InputMaybe; + id?: InputMaybe; + is_active?: InputMaybe; + module_data?: InputMaybe; + program?: InputMaybe; + program_id?: InputMaybe; + program_layout_template?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** unique or primary key constraints on table "program_layout_template_config" */ +export enum program_layout_template_config_constraint { + /** unique or primary key constraint on columns "id" */ + program_template_config_pkey = 'program_template_config_pkey' +} + +/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */ +export type program_layout_template_config_delete_at_path_input = { + module_data?: InputMaybe>; +}; + +/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */ +export type program_layout_template_config_delete_elem_input = { + module_data?: InputMaybe; +}; + +/** delete key/value pair or string element. key/value pairs are matched based on their key value */ +export type program_layout_template_config_delete_key_input = { + module_data?: InputMaybe; +}; + +/** input type for inserting data into table "program_layout_template_config" */ +export type program_layout_template_config_insert_input = { + created_at?: InputMaybe; + id?: InputMaybe; + is_active?: InputMaybe; + module_data?: InputMaybe; + program?: InputMaybe; + program_id?: InputMaybe; + program_layout_template?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate max on columns */ +export type program_layout_template_config_max_fields = { + __typename?: 'program_layout_template_config_max_fields'; + created_at?: Maybe; + id?: Maybe; + program_id?: Maybe; + program_layout_template_id?: Maybe; + updated_at?: Maybe; +}; + +/** order by max() on columns of table "program_layout_template_config" */ +export type program_layout_template_config_max_order_by = { + created_at?: InputMaybe; + id?: InputMaybe; + program_id?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate min on columns */ +export type program_layout_template_config_min_fields = { + __typename?: 'program_layout_template_config_min_fields'; + created_at?: Maybe; + id?: Maybe; + program_id?: Maybe; + program_layout_template_id?: Maybe; + updated_at?: Maybe; +}; + +/** order by min() on columns of table "program_layout_template_config" */ +export type program_layout_template_config_min_order_by = { + created_at?: InputMaybe; + id?: InputMaybe; + program_id?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** response of any mutation on the table "program_layout_template_config" */ +export type program_layout_template_config_mutation_response = { + __typename?: 'program_layout_template_config_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** on_conflict condition type for table "program_layout_template_config" */ +export type program_layout_template_config_on_conflict = { + constraint: program_layout_template_config_constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "program_layout_template_config". */ +export type program_layout_template_config_order_by = { + created_at?: InputMaybe; + id?: InputMaybe; + is_active?: InputMaybe; + module_data?: InputMaybe; + program?: InputMaybe; + program_id?: InputMaybe; + program_layout_template?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** primary key columns input for table: program_layout_template_config */ +export type program_layout_template_config_pk_columns_input = { + id: Scalars['uuid']; +}; + +/** prepend existing jsonb value of filtered columns with new jsonb value */ +export type program_layout_template_config_prepend_input = { + module_data?: InputMaybe; +}; + +/** select columns of table "program_layout_template_config" */ +export enum program_layout_template_config_select_column { + /** column name */ + created_at = 'created_at', + /** column name */ + id = 'id', + /** column name */ + is_active = 'is_active', + /** column name */ + module_data = 'module_data', + /** column name */ + program_id = 'program_id', + /** column name */ + program_layout_template_id = 'program_layout_template_id', + /** column name */ + updated_at = 'updated_at' +} + +/** select "program_layout_template_config_aggregate_bool_exp_bool_and_arguments_columns" columns of table "program_layout_template_config" */ +export enum program_layout_template_config_select_column_program_layout_template_config_aggregate_bool_exp_bool_and_arguments_columns { + /** column name */ + is_active = 'is_active' +} + +/** select "program_layout_template_config_aggregate_bool_exp_bool_or_arguments_columns" columns of table "program_layout_template_config" */ +export enum program_layout_template_config_select_column_program_layout_template_config_aggregate_bool_exp_bool_or_arguments_columns { + /** column name */ + is_active = 'is_active' +} + +/** input type for updating data in table "program_layout_template_config" */ +export type program_layout_template_config_set_input = { + created_at?: InputMaybe; + id?: InputMaybe; + is_active?: InputMaybe; + module_data?: InputMaybe; + program_id?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** Streaming cursor of the table "program_layout_template_config" */ +export type program_layout_template_config_stream_cursor_input = { + /** Stream column input with initial value */ + initial_value: program_layout_template_config_stream_cursor_value_input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type program_layout_template_config_stream_cursor_value_input = { + created_at?: InputMaybe; + id?: InputMaybe; + is_active?: InputMaybe; + module_data?: InputMaybe; + program_id?: InputMaybe; + program_layout_template_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** update columns of table "program_layout_template_config" */ +export enum program_layout_template_config_update_column { + /** column name */ + created_at = 'created_at', + /** column name */ + id = 'id', + /** column name */ + is_active = 'is_active', + /** column name */ + module_data = 'module_data', + /** column name */ + program_id = 'program_id', + /** column name */ + program_layout_template_id = 'program_layout_template_id', + /** column name */ + updated_at = 'updated_at' +} + +export type program_layout_template_config_updates = { + /** append existing jsonb value of filtered columns with new jsonb value */ + _append?: InputMaybe; + /** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */ + _delete_at_path?: InputMaybe; + /** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */ + _delete_elem?: InputMaybe; + /** delete key/value pair or string element. key/value pairs are matched based on their key value */ + _delete_key?: InputMaybe; + /** prepend existing jsonb value of filtered columns with new jsonb value */ + _prepend?: InputMaybe; + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: program_layout_template_config_bool_exp; +}; + +/** unique or primary key constraints on table "program_layout_template" */ +export enum program_layout_template_constraint { + /** unique or primary key constraint on columns "id" */ + program_template_pkey = 'program_template_pkey' +} + +/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */ +export type program_layout_template_delete_at_path_input = { + module_name?: InputMaybe>; +}; + +/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */ +export type program_layout_template_delete_elem_input = { + module_name?: InputMaybe; +}; + +/** delete key/value pair or string element. key/value pairs are matched based on their key value */ +export type program_layout_template_delete_key_input = { + module_name?: InputMaybe; +}; + +/** input type for inserting data into table "program_layout_template" */ +export type program_layout_template_insert_input = { + created_at?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + module_name?: InputMaybe; + name?: InputMaybe; + program_layout_template_configs?: InputMaybe; + updated_at?: InputMaybe; + variant?: InputMaybe; +}; + +/** aggregate max on columns */ +export type program_layout_template_max_fields = { + __typename?: 'program_layout_template_max_fields'; + created_at?: Maybe; + description?: Maybe; + id?: Maybe; + name?: Maybe; + updated_at?: Maybe; + variant?: Maybe; +}; + +/** aggregate min on columns */ +export type program_layout_template_min_fields = { + __typename?: 'program_layout_template_min_fields'; + created_at?: Maybe; + description?: Maybe; + id?: Maybe; + name?: Maybe; + updated_at?: Maybe; + variant?: Maybe; +}; + +/** response of any mutation on the table "program_layout_template" */ +export type program_layout_template_mutation_response = { + __typename?: 'program_layout_template_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "program_layout_template" */ +export type program_layout_template_obj_rel_insert_input = { + data: program_layout_template_insert_input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "program_layout_template" */ +export type program_layout_template_on_conflict = { + constraint: program_layout_template_constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "program_layout_template". */ +export type program_layout_template_order_by = { + created_at?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + module_name?: InputMaybe; + name?: InputMaybe; + program_layout_template_configs_aggregate?: InputMaybe; + updated_at?: InputMaybe; + variant?: InputMaybe; +}; + +/** primary key columns input for table: program_layout_template */ +export type program_layout_template_pk_columns_input = { + id: Scalars['uuid']; +}; + +/** prepend existing jsonb value of filtered columns with new jsonb value */ +export type program_layout_template_prepend_input = { + module_name?: InputMaybe; +}; + +/** select columns of table "program_layout_template" */ +export enum program_layout_template_select_column { + /** column name */ + created_at = 'created_at', + /** column name */ + description = 'description', + /** column name */ + id = 'id', + /** column name */ + module_name = 'module_name', + /** column name */ + name = 'name', + /** column name */ + updated_at = 'updated_at', + /** column name */ + variant = 'variant' +} + +/** input type for updating data in table "program_layout_template" */ +export type program_layout_template_set_input = { + created_at?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + module_name?: InputMaybe; + name?: InputMaybe; + updated_at?: InputMaybe; + variant?: InputMaybe; +}; + +/** Streaming cursor of the table "program_layout_template" */ +export type program_layout_template_stream_cursor_input = { + /** Stream column input with initial value */ + initial_value: program_layout_template_stream_cursor_value_input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type program_layout_template_stream_cursor_value_input = { + created_at?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + module_name?: InputMaybe; + name?: InputMaybe; + updated_at?: InputMaybe; + variant?: InputMaybe; +}; + +/** update columns of table "program_layout_template" */ +export enum program_layout_template_update_column { + /** column name */ + created_at = 'created_at', + /** column name */ + description = 'description', + /** column name */ + id = 'id', + /** column name */ + module_name = 'module_name', + /** column name */ + name = 'name', + /** column name */ + updated_at = 'updated_at', + /** column name */ + variant = 'variant' +} + +export type program_layout_template_updates = { + /** append existing jsonb value of filtered columns with new jsonb value */ + _append?: InputMaybe; + /** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */ + _delete_at_path?: InputMaybe; + /** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */ + _delete_elem?: InputMaybe; + /** delete key/value pair or string element. key/value pairs are matched based on their key value */ + _delete_key?: InputMaybe; + /** prepend existing jsonb value of filtered columns with new jsonb value */ + _prepend?: InputMaybe; + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: program_layout_template_bool_exp; +}; + /** aggregate max on columns */ export type program_max_fields = { __typename?: 'program_max_fields'; @@ -95231,7 +95836,6 @@ export type program_max_fields = { id?: Maybe; list_price?: Maybe; position?: Maybe; - program_template_id?: Maybe; published_at?: Maybe; sale_price?: Maybe; sold_at?: Maybe; @@ -95253,7 +95857,6 @@ export type program_max_order_by = { id?: InputMaybe; list_price?: InputMaybe; position?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -95276,7 +95879,6 @@ export type program_min_fields = { id?: Maybe; list_price?: Maybe; position?: Maybe; - program_template_id?: Maybe; published_at?: Maybe; sale_price?: Maybe; sold_at?: Maybe; @@ -95298,7 +95900,6 @@ export type program_min_order_by = { id?: InputMaybe; list_price?: InputMaybe; position?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -95357,7 +95958,6 @@ export type program_order_by = { list_price?: InputMaybe; meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; package_items_aggregate?: InputMaybe; position?: InputMaybe; program_announcements_aggregate?: InputMaybe; @@ -95370,14 +95970,13 @@ export type program_order_by = { program_content_sections_aggregate?: InputMaybe; program_duration?: InputMaybe; program_enrollments_aggregate?: InputMaybe; + program_layout_template_configs_aggregate?: InputMaybe; program_package_programs_aggregate?: InputMaybe; program_plans_aggregate?: InputMaybe; program_related_items_aggregate?: InputMaybe; program_review_score?: InputMaybe; program_roles_aggregate?: InputMaybe; program_tags_aggregate?: InputMaybe; - program_template?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -99242,7 +99841,6 @@ export type program_plan_variance_order_by = { export type program_prepend_input = { meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; support_locales?: InputMaybe; }; @@ -100046,12 +100644,8 @@ export enum program_select_column { /** column name */ metadata = 'metadata', /** column name */ - module_data = 'module_data', - /** column name */ position = 'position', /** column name */ - program_template_id = 'program_template_id', - /** column name */ published_at = 'published_at', /** column name */ sale_price = 'sale_price', @@ -100144,9 +100738,7 @@ export type program_set_input = { list_price?: InputMaybe; meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; position?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -100400,9 +100992,7 @@ export type program_stream_cursor_value_input = { list_price?: InputMaybe; meta_tag?: InputMaybe; metadata?: InputMaybe; - module_data?: InputMaybe; position?: InputMaybe; - program_template_id?: InputMaybe; published_at?: InputMaybe; sale_price?: InputMaybe; sold_at?: InputMaybe; @@ -100751,598 +101341,6 @@ export type program_tag_variance_order_by = { position?: InputMaybe; }; -/** columns and relationships of "program_template" */ -export type program_template = { - __typename?: 'program_template'; - config_id?: Maybe; - created_at: Scalars['timestamptz']; - created_by?: Maybe; - description?: Maybe; - id: Scalars['uuid']; - module_name?: Maybe; - name: Scalars['String']; - /** An object relationship */ - program_template_config?: Maybe; - status?: Maybe; - updated_at?: Maybe; - updated_by?: Maybe; -}; - - -/** columns and relationships of "program_template" */ -export type program_templatemodule_nameArgs = { - path?: InputMaybe; -}; - -/** aggregated selection of "program_template" */ -export type program_template_aggregate = { - __typename?: 'program_template_aggregate'; - aggregate?: Maybe; - nodes: Array; -}; - -/** aggregate fields of "program_template" */ -export type program_template_aggregate_fields = { - __typename?: 'program_template_aggregate_fields'; - count: Scalars['Int']; - max?: Maybe; - min?: Maybe; -}; - - -/** aggregate fields of "program_template" */ -export type program_template_aggregate_fieldscountArgs = { - columns?: InputMaybe>; - distinct?: InputMaybe; -}; - -/** Boolean expression to filter rows from the table "program_template". All fields are combined with a logical 'AND'. */ -export type program_template_bool_exp = { - _and?: InputMaybe>; - _not?: InputMaybe; - _or?: InputMaybe>; - config_id?: InputMaybe; - created_at?: InputMaybe; - created_by?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - module_name?: InputMaybe; - name?: InputMaybe; - program_template_config?: InputMaybe; - status?: InputMaybe; - updated_at?: InputMaybe; - updated_by?: InputMaybe; -}; - -/** columns and relationships of "program_template_config" */ -export type program_template_config = { - __typename?: 'program_template_config'; - cover_mobile_url?: Maybe; - cover_thumbnail_url?: Maybe; - cover_url?: Maybe; - created_at: Scalars['timestamptz']; - display_footer?: Maybe; - display_header?: Maybe; - id: Scalars['uuid']; - is_enrolled_count_visible?: Maybe; - is_introduction_section_visible?: Maybe; - is_issues_open?: Maybe; - module_data?: Maybe; - support_locales?: Maybe; - updated_at?: Maybe; - version?: Maybe; -}; - - -/** columns and relationships of "program_template_config" */ -export type program_template_configmodule_dataArgs = { - path?: InputMaybe; -}; - - -/** columns and relationships of "program_template_config" */ -export type program_template_configsupport_localesArgs = { - path?: InputMaybe; -}; - -/** aggregated selection of "program_template_config" */ -export type program_template_config_aggregate = { - __typename?: 'program_template_config_aggregate'; - aggregate?: Maybe; - nodes: Array; -}; - -/** aggregate fields of "program_template_config" */ -export type program_template_config_aggregate_fields = { - __typename?: 'program_template_config_aggregate_fields'; - avg?: Maybe; - count: Scalars['Int']; - max?: Maybe; - min?: Maybe; - stddev?: Maybe; - stddev_pop?: Maybe; - stddev_samp?: Maybe; - sum?: Maybe; - var_pop?: Maybe; - var_samp?: Maybe; - variance?: Maybe; -}; - - -/** aggregate fields of "program_template_config" */ -export type program_template_config_aggregate_fieldscountArgs = { - columns?: InputMaybe>; - distinct?: InputMaybe; -}; - -/** aggregate avg on columns */ -export type program_template_config_avg_fields = { - __typename?: 'program_template_config_avg_fields'; - version?: Maybe; -}; - -/** Boolean expression to filter rows from the table "program_template_config". All fields are combined with a logical 'AND'. */ -export type program_template_config_bool_exp = { - _and?: InputMaybe>; - _not?: InputMaybe; - _or?: InputMaybe>; - cover_mobile_url?: InputMaybe; - cover_thumbnail_url?: InputMaybe; - cover_url?: InputMaybe; - created_at?: InputMaybe; - display_footer?: InputMaybe; - display_header?: InputMaybe; - id?: InputMaybe; - is_enrolled_count_visible?: InputMaybe; - is_introduction_section_visible?: InputMaybe; - is_issues_open?: InputMaybe; - module_data?: InputMaybe; - support_locales?: InputMaybe; - updated_at?: InputMaybe; - version?: InputMaybe; -}; - -/** unique or primary key constraints on table "program_template_config" */ -export enum program_template_config_constraint { - /** unique or primary key constraint on columns "id" */ - program_template_config_pkey = 'program_template_config_pkey' -} - -/** input type for incrementing numeric columns in table "program_template_config" */ -export type program_template_config_inc_input = { - version?: InputMaybe; -}; - -/** input type for inserting data into table "program_template_config" */ -export type program_template_config_insert_input = { - cover_mobile_url?: InputMaybe; - cover_thumbnail_url?: InputMaybe; - cover_url?: InputMaybe; - created_at?: InputMaybe; - display_footer?: InputMaybe; - display_header?: InputMaybe; - id?: InputMaybe; - is_enrolled_count_visible?: InputMaybe; - is_introduction_section_visible?: InputMaybe; - is_issues_open?: InputMaybe; - module_data?: InputMaybe; - support_locales?: InputMaybe; - updated_at?: InputMaybe; - version?: InputMaybe; -}; - -/** aggregate max on columns */ -export type program_template_config_max_fields = { - __typename?: 'program_template_config_max_fields'; - cover_mobile_url?: Maybe; - cover_thumbnail_url?: Maybe; - cover_url?: Maybe; - created_at?: Maybe; - id?: Maybe; - updated_at?: Maybe; - version?: Maybe; -}; - -/** aggregate min on columns */ -export type program_template_config_min_fields = { - __typename?: 'program_template_config_min_fields'; - cover_mobile_url?: Maybe; - cover_thumbnail_url?: Maybe; - cover_url?: Maybe; - created_at?: Maybe; - id?: Maybe; - updated_at?: Maybe; - version?: Maybe; -}; - -/** response of any mutation on the table "program_template_config" */ -export type program_template_config_mutation_response = { - __typename?: 'program_template_config_mutation_response'; - /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']; - /** data from the rows affected by the mutation */ - returning: Array; -}; - -/** input type for inserting object relation for remote table "program_template_config" */ -export type program_template_config_obj_rel_insert_input = { - data: program_template_config_insert_input; - /** upsert condition */ - on_conflict?: InputMaybe; -}; - -/** on_conflict condition type for table "program_template_config" */ -export type program_template_config_on_conflict = { - constraint: program_template_config_constraint; - update_columns?: Array; - where?: InputMaybe; -}; - -/** Ordering options when selecting data from "program_template_config". */ -export type program_template_config_order_by = { - cover_mobile_url?: InputMaybe; - cover_thumbnail_url?: InputMaybe; - cover_url?: InputMaybe; - created_at?: InputMaybe; - display_footer?: InputMaybe; - display_header?: InputMaybe; - id?: InputMaybe; - is_enrolled_count_visible?: InputMaybe; - is_introduction_section_visible?: InputMaybe; - is_issues_open?: InputMaybe; - module_data?: InputMaybe; - support_locales?: InputMaybe; - updated_at?: InputMaybe; - version?: InputMaybe; -}; - -/** primary key columns input for table: program_template_config */ -export type program_template_config_pk_columns_input = { - id: Scalars['uuid']; -}; - -/** select columns of table "program_template_config" */ -export enum program_template_config_select_column { - /** column name */ - cover_mobile_url = 'cover_mobile_url', - /** column name */ - cover_thumbnail_url = 'cover_thumbnail_url', - /** column name */ - cover_url = 'cover_url', - /** column name */ - created_at = 'created_at', - /** column name */ - display_footer = 'display_footer', - /** column name */ - display_header = 'display_header', - /** column name */ - id = 'id', - /** column name */ - is_enrolled_count_visible = 'is_enrolled_count_visible', - /** column name */ - is_introduction_section_visible = 'is_introduction_section_visible', - /** column name */ - is_issues_open = 'is_issues_open', - /** column name */ - module_data = 'module_data', - /** column name */ - support_locales = 'support_locales', - /** column name */ - updated_at = 'updated_at', - /** column name */ - version = 'version' -} - -/** input type for updating data in table "program_template_config" */ -export type program_template_config_set_input = { - cover_mobile_url?: InputMaybe; - cover_thumbnail_url?: InputMaybe; - cover_url?: InputMaybe; - created_at?: InputMaybe; - display_footer?: InputMaybe; - display_header?: InputMaybe; - id?: InputMaybe; - is_enrolled_count_visible?: InputMaybe; - is_introduction_section_visible?: InputMaybe; - is_issues_open?: InputMaybe; - module_data?: InputMaybe; - support_locales?: InputMaybe; - updated_at?: InputMaybe; - version?: InputMaybe; -}; - -/** aggregate stddev on columns */ -export type program_template_config_stddev_fields = { - __typename?: 'program_template_config_stddev_fields'; - version?: Maybe; -}; - -/** aggregate stddev_pop on columns */ -export type program_template_config_stddev_pop_fields = { - __typename?: 'program_template_config_stddev_pop_fields'; - version?: Maybe; -}; - -/** aggregate stddev_samp on columns */ -export type program_template_config_stddev_samp_fields = { - __typename?: 'program_template_config_stddev_samp_fields'; - version?: Maybe; -}; - -/** Streaming cursor of the table "program_template_config" */ -export type program_template_config_stream_cursor_input = { - /** Stream column input with initial value */ - initial_value: program_template_config_stream_cursor_value_input; - /** cursor ordering */ - ordering?: InputMaybe; -}; - -/** Initial value of the column from where the streaming should start */ -export type program_template_config_stream_cursor_value_input = { - cover_mobile_url?: InputMaybe; - cover_thumbnail_url?: InputMaybe; - cover_url?: InputMaybe; - created_at?: InputMaybe; - display_footer?: InputMaybe; - display_header?: InputMaybe; - id?: InputMaybe; - is_enrolled_count_visible?: InputMaybe; - is_introduction_section_visible?: InputMaybe; - is_issues_open?: InputMaybe; - module_data?: InputMaybe; - support_locales?: InputMaybe; - updated_at?: InputMaybe; - version?: InputMaybe; -}; - -/** aggregate sum on columns */ -export type program_template_config_sum_fields = { - __typename?: 'program_template_config_sum_fields'; - version?: Maybe; -}; - -/** update columns of table "program_template_config" */ -export enum program_template_config_update_column { - /** column name */ - cover_mobile_url = 'cover_mobile_url', - /** column name */ - cover_thumbnail_url = 'cover_thumbnail_url', - /** column name */ - cover_url = 'cover_url', - /** column name */ - created_at = 'created_at', - /** column name */ - display_footer = 'display_footer', - /** column name */ - display_header = 'display_header', - /** column name */ - id = 'id', - /** column name */ - is_enrolled_count_visible = 'is_enrolled_count_visible', - /** column name */ - is_introduction_section_visible = 'is_introduction_section_visible', - /** column name */ - is_issues_open = 'is_issues_open', - /** column name */ - module_data = 'module_data', - /** column name */ - support_locales = 'support_locales', - /** column name */ - updated_at = 'updated_at', - /** column name */ - version = 'version' -} - -export type program_template_config_updates = { - /** increments the numeric columns with given value of the filtered values */ - _inc?: InputMaybe; - /** sets the columns of the filtered rows to the given values */ - _set?: InputMaybe; - /** filter the rows which have to be updated */ - where: program_template_config_bool_exp; -}; - -/** aggregate var_pop on columns */ -export type program_template_config_var_pop_fields = { - __typename?: 'program_template_config_var_pop_fields'; - version?: Maybe; -}; - -/** aggregate var_samp on columns */ -export type program_template_config_var_samp_fields = { - __typename?: 'program_template_config_var_samp_fields'; - version?: Maybe; -}; - -/** aggregate variance on columns */ -export type program_template_config_variance_fields = { - __typename?: 'program_template_config_variance_fields'; - version?: Maybe; -}; - -/** unique or primary key constraints on table "program_template" */ -export enum program_template_constraint { - /** unique or primary key constraint on columns "id" */ - program_template_pkey = 'program_template_pkey' -} - -/** input type for inserting data into table "program_template" */ -export type program_template_insert_input = { - config_id?: InputMaybe; - created_at?: InputMaybe; - created_by?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - module_name?: InputMaybe; - name?: InputMaybe; - program_template_config?: InputMaybe; - status?: InputMaybe; - updated_at?: InputMaybe; - updated_by?: InputMaybe; -}; - -/** aggregate max on columns */ -export type program_template_max_fields = { - __typename?: 'program_template_max_fields'; - config_id?: Maybe; - created_at?: Maybe; - created_by?: Maybe; - description?: Maybe; - id?: Maybe; - name?: Maybe; - status?: Maybe; - updated_at?: Maybe; - updated_by?: Maybe; -}; - -/** aggregate min on columns */ -export type program_template_min_fields = { - __typename?: 'program_template_min_fields'; - config_id?: Maybe; - created_at?: Maybe; - created_by?: Maybe; - description?: Maybe; - id?: Maybe; - name?: Maybe; - status?: Maybe; - updated_at?: Maybe; - updated_by?: Maybe; -}; - -/** response of any mutation on the table "program_template" */ -export type program_template_mutation_response = { - __typename?: 'program_template_mutation_response'; - /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']; - /** data from the rows affected by the mutation */ - returning: Array; -}; - -/** input type for inserting object relation for remote table "program_template" */ -export type program_template_obj_rel_insert_input = { - data: program_template_insert_input; - /** upsert condition */ - on_conflict?: InputMaybe; -}; - -/** on_conflict condition type for table "program_template" */ -export type program_template_on_conflict = { - constraint: program_template_constraint; - update_columns?: Array; - where?: InputMaybe; -}; - -/** Ordering options when selecting data from "program_template". */ -export type program_template_order_by = { - config_id?: InputMaybe; - created_at?: InputMaybe; - created_by?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - module_name?: InputMaybe; - name?: InputMaybe; - program_template_config?: InputMaybe; - status?: InputMaybe; - updated_at?: InputMaybe; - updated_by?: InputMaybe; -}; - -/** primary key columns input for table: program_template */ -export type program_template_pk_columns_input = { - id: Scalars['uuid']; -}; - -/** select columns of table "program_template" */ -export enum program_template_select_column { - /** column name */ - config_id = 'config_id', - /** column name */ - created_at = 'created_at', - /** column name */ - created_by = 'created_by', - /** column name */ - description = 'description', - /** column name */ - id = 'id', - /** column name */ - module_name = 'module_name', - /** column name */ - name = 'name', - /** column name */ - status = 'status', - /** column name */ - updated_at = 'updated_at', - /** column name */ - updated_by = 'updated_by' -} - -/** input type for updating data in table "program_template" */ -export type program_template_set_input = { - config_id?: InputMaybe; - created_at?: InputMaybe; - created_by?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - module_name?: InputMaybe; - name?: InputMaybe; - status?: InputMaybe; - updated_at?: InputMaybe; - updated_by?: InputMaybe; -}; - -/** Streaming cursor of the table "program_template" */ -export type program_template_stream_cursor_input = { - /** Stream column input with initial value */ - initial_value: program_template_stream_cursor_value_input; - /** cursor ordering */ - ordering?: InputMaybe; -}; - -/** Initial value of the column from where the streaming should start */ -export type program_template_stream_cursor_value_input = { - config_id?: InputMaybe; - created_at?: InputMaybe; - created_by?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - module_name?: InputMaybe; - name?: InputMaybe; - status?: InputMaybe; - updated_at?: InputMaybe; - updated_by?: InputMaybe; -}; - -/** update columns of table "program_template" */ -export enum program_template_update_column { - /** column name */ - config_id = 'config_id', - /** column name */ - created_at = 'created_at', - /** column name */ - created_by = 'created_by', - /** column name */ - description = 'description', - /** column name */ - id = 'id', - /** column name */ - module_name = 'module_name', - /** column name */ - name = 'name', - /** column name */ - status = 'status', - /** column name */ - updated_at = 'updated_at', - /** column name */ - updated_by = 'updated_by' -} - -export type program_template_updates = { - /** sets the columns of the filtered rows to the given values */ - _set?: InputMaybe; - /** filter the rows which have to be updated */ - where: program_template_bool_exp; -}; - /** columns and relationships of "program_tempo_delivery" */ export type program_tempo_delivery = { __typename?: 'program_tempo_delivery'; @@ -102004,12 +102002,8 @@ export enum program_update_column { /** column name */ metadata = 'metadata', /** column name */ - module_data = 'module_data', - /** column name */ position = 'position', /** column name */ - program_template_id = 'program_template_id', - /** column name */ published_at = 'published_at', /** column name */ sale_price = 'sale_price', @@ -107797,6 +107791,18 @@ export type query_root = { program_enrollment: Array; /** fetch aggregated fields from the table: "program_enrollment" */ program_enrollment_aggregate: program_enrollment_aggregate; + /** fetch data from the table: "program_layout_template" */ + program_layout_template: Array; + /** fetch aggregated fields from the table: "program_layout_template" */ + program_layout_template_aggregate: program_layout_template_aggregate; + /** fetch data from the table: "program_layout_template" using primary key columns */ + program_layout_template_by_pk?: Maybe; + /** fetch data from the table: "program_layout_template_config" */ + program_layout_template_config: Array; + /** fetch aggregated fields from the table: "program_layout_template_config" */ + program_layout_template_config_aggregate: program_layout_template_config_aggregate; + /** fetch data from the table: "program_layout_template_config" using primary key columns */ + program_layout_template_config_by_pk?: Maybe; /** fetch data from the table: "program_package" */ program_package: Array; /** fetch aggregated fields from the table: "program_package" */ @@ -107875,18 +107881,6 @@ export type query_root = { program_tag_aggregate: program_tag_aggregate; /** fetch data from the table: "program_tag" using primary key columns */ program_tag_by_pk?: Maybe; - /** fetch data from the table: "program_template" */ - program_template: Array; - /** fetch aggregated fields from the table: "program_template" */ - program_template_aggregate: program_template_aggregate; - /** fetch data from the table: "program_template" using primary key columns */ - program_template_by_pk?: Maybe; - /** fetch data from the table: "program_template_config" */ - program_template_config: Array; - /** fetch aggregated fields from the table: "program_template_config" */ - program_template_config_aggregate: program_template_config_aggregate; - /** fetch data from the table: "program_template_config" using primary key columns */ - program_template_config_by_pk?: Maybe; /** fetch data from the table: "program_tempo_delivery" */ program_tempo_delivery: Array; /** fetch aggregated fields from the table: "program_tempo_delivery" */ @@ -113792,6 +113786,52 @@ export type query_rootprogram_enrollment_aggregateArgs = { }; +export type query_rootprogram_layout_templateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type query_rootprogram_layout_template_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type query_rootprogram_layout_template_by_pkArgs = { + id: Scalars['uuid']; +}; + + +export type query_rootprogram_layout_template_configArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type query_rootprogram_layout_template_config_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type query_rootprogram_layout_template_config_by_pkArgs = { + id: Scalars['uuid']; +}; + + export type query_rootprogram_packageArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -114107,52 +114147,6 @@ export type query_rootprogram_tag_by_pkArgs = { }; -export type query_rootprogram_templateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type query_rootprogram_template_aggregateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type query_rootprogram_template_by_pkArgs = { - id: Scalars['uuid']; -}; - - -export type query_rootprogram_template_configArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type query_rootprogram_template_config_aggregateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type query_rootprogram_template_config_by_pkArgs = { - id: Scalars['uuid']; -}; - - export type query_rootprogram_tempo_deliveryArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -124406,6 +124400,22 @@ export type subscription_root = { program_enrollment_aggregate: program_enrollment_aggregate; /** fetch data from the table in a streaming manner: "program_enrollment" */ program_enrollment_stream: Array; + /** fetch data from the table: "program_layout_template" */ + program_layout_template: Array; + /** fetch aggregated fields from the table: "program_layout_template" */ + program_layout_template_aggregate: program_layout_template_aggregate; + /** fetch data from the table: "program_layout_template" using primary key columns */ + program_layout_template_by_pk?: Maybe; + /** fetch data from the table: "program_layout_template_config" */ + program_layout_template_config: Array; + /** fetch aggregated fields from the table: "program_layout_template_config" */ + program_layout_template_config_aggregate: program_layout_template_config_aggregate; + /** fetch data from the table: "program_layout_template_config" using primary key columns */ + program_layout_template_config_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "program_layout_template_config" */ + program_layout_template_config_stream: Array; + /** fetch data from the table in a streaming manner: "program_layout_template" */ + program_layout_template_stream: Array; /** fetch data from the table: "program_package" */ program_package: Array; /** fetch aggregated fields from the table: "program_package" */ @@ -124516,22 +124526,6 @@ export type subscription_root = { program_tag_by_pk?: Maybe; /** fetch data from the table in a streaming manner: "program_tag" */ program_tag_stream: Array; - /** fetch data from the table: "program_template" */ - program_template: Array; - /** fetch aggregated fields from the table: "program_template" */ - program_template_aggregate: program_template_aggregate; - /** fetch data from the table: "program_template" using primary key columns */ - program_template_by_pk?: Maybe; - /** fetch data from the table: "program_template_config" */ - program_template_config: Array; - /** fetch aggregated fields from the table: "program_template_config" */ - program_template_config_aggregate: program_template_config_aggregate; - /** fetch data from the table: "program_template_config" using primary key columns */ - program_template_config_by_pk?: Maybe; - /** fetch data from the table in a streaming manner: "program_template_config" */ - program_template_config_stream: Array; - /** fetch data from the table in a streaming manner: "program_template" */ - program_template_stream: Array; /** fetch data from the table: "program_tempo_delivery" */ program_tempo_delivery: Array; /** fetch aggregated fields from the table: "program_tempo_delivery" */ @@ -132365,6 +132359,66 @@ export type subscription_rootprogram_enrollment_streamArgs = { }; +export type subscription_rootprogram_layout_templateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type subscription_rootprogram_layout_template_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type subscription_rootprogram_layout_template_by_pkArgs = { + id: Scalars['uuid']; +}; + + +export type subscription_rootprogram_layout_template_configArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type subscription_rootprogram_layout_template_config_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type subscription_rootprogram_layout_template_config_by_pkArgs = { + id: Scalars['uuid']; +}; + + +export type subscription_rootprogram_layout_template_config_streamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + +export type subscription_rootprogram_layout_template_streamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + export type subscription_rootprogram_packageArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -132792,66 +132846,6 @@ export type subscription_rootprogram_tag_streamArgs = { }; -export type subscription_rootprogram_templateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type subscription_rootprogram_template_aggregateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type subscription_rootprogram_template_by_pkArgs = { - id: Scalars['uuid']; -}; - - -export type subscription_rootprogram_template_configArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type subscription_rootprogram_template_config_aggregateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type subscription_rootprogram_template_config_by_pkArgs = { - id: Scalars['uuid']; -}; - - -export type subscription_rootprogram_template_config_streamArgs = { - batch_size: Scalars['Int']; - cursor: Array>; - where?: InputMaybe; -}; - - -export type subscription_rootprogram_template_streamArgs = { - batch_size: Scalars['Int']; - cursor: Array>; - where?: InputMaybe; -}; - - export type subscription_rootprogram_tempo_deliveryArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -150946,7 +150940,7 @@ export type GET_PUBLISHED_PROGRAM_COLLECTIONVariables = Exact<{ }>; -export type GET_PUBLISHED_PROGRAM_COLLECTION = { __typename?: 'query_root', program: Array<{ __typename?: 'program', id: any, cover_url?: string | null, cover_mobile_url?: string | null, cover_thumbnail_url?: string | null, title: string, abstract?: string | null, support_locales?: any | null, published_at?: any | null, is_subscription: boolean, is_sold_out?: boolean | null, is_private: boolean, is_enrolled_count_visible: boolean, list_price?: any | null, sale_price?: any | null, sold_at?: any | null, program_categories: Array<{ __typename?: 'program_category', id: any, category: { __typename?: 'category', id: string, name: string, position: number } }>, program_roles: Array<{ __typename?: 'program_role', id: any, name: string, member_id: string }>, program_plans: Array<{ __typename?: 'program_plan', id: any, type: number, title: string, description?: string | null, gains?: any | null, list_price: any, sale_price?: any | null, sold_at?: any | null, discount_down_price: any, period_amount?: any | null, period_type?: string | null, started_at?: any | null, ended_at?: any | null, is_participants_visible: boolean, published_at?: any | null, currency: { __typename?: 'currency', id: string, label: string, unit: string, name: string } }>, program_content_sections: Array<{ __typename?: 'program_content_section', id: any, collapsed_status: boolean, program_contents_aggregate: { __typename?: 'program_content_aggregate', aggregate?: { __typename?: 'program_content_aggregate_fields', sum?: { __typename?: 'program_content_sum_fields', duration?: any | null } | null } | null } }> }> }; +export type GET_PUBLISHED_PROGRAM_COLLECTION = { __typename?: 'query_root', program: Array<{ __typename?: 'program', id: any, cover_url?: string | null, cover_mobile_url?: string | null, cover_thumbnail_url?: string | null, title: string, abstract?: string | null, support_locales?: any | null, published_at?: any | null, is_subscription: boolean, is_sold_out?: boolean | null, is_private: boolean, is_enrolled_count_visible: boolean, list_price?: any | null, sale_price?: any | null, sold_at?: any | null, program_categories: Array<{ __typename?: 'program_category', id: any, category: { __typename?: 'category', id: string, name: string, position: number } }>, program_roles: Array<{ __typename?: 'program_role', id: any, name: string, member_id: string, member?: { __typename?: 'member_public', name?: string | null } | null }>, program_plans: Array<{ __typename?: 'program_plan', id: any, type: number, title: string, description?: string | null, gains?: any | null, list_price: any, sale_price?: any | null, sold_at?: any | null, discount_down_price: any, period_amount?: any | null, period_type?: string | null, started_at?: any | null, ended_at?: any | null, is_participants_visible: boolean, published_at?: any | null, currency: { __typename?: 'currency', id: string, label: string, unit: string, name: string } }>, program_content_sections: Array<{ __typename?: 'program_content_section', id: any, collapsed_status: boolean, program_contents_aggregate: { __typename?: 'program_content_aggregate', aggregate?: { __typename?: 'program_content_aggregate_fields', sum?: { __typename?: 'program_content_sum_fields', duration?: any | null } | null } | null } }> }> }; export type GET_LATEST_PROGRAM_IDSVariables = Exact<{ limit?: InputMaybe; @@ -150960,7 +150954,7 @@ export type GetProgramVariables = Exact<{ }>; -export type GetProgram = { __typename?: 'query_root', program_by_pk?: { __typename?: 'program', id: any, cover_url?: string | null, cover_mobile_url?: string | null, cover_thumbnail_url?: string | null, title: string, abstract?: string | null, published_at?: any | null, is_subscription: boolean, is_sold_out?: boolean | null, list_price?: any | null, sale_price?: any | null, sold_at?: any | null, description?: string | null, cover_video_url?: string | null, meta_tag?: any | null, is_issues_open: boolean, is_private: boolean, is_countdown_timer_visible: boolean, is_introduction_section_visible: boolean, is_enrolled_count_visible: boolean, display_header: boolean, display_footer: boolean, editors: Array<{ __typename?: 'program_editor', member_id?: string | null }>, program_plans: Array<{ __typename?: 'program_plan', id: any }>, program_categories: Array<{ __typename?: 'program_category', id: any, category: { __typename?: 'category', id: string, name: string } }>, program_tags: Array<{ __typename?: 'program_tag', tag: { __typename?: 'tag', name: string } }>, program_roles: Array<{ __typename?: 'program_role', id: any, name: string, member_id: string }>, program_review_score?: { __typename?: 'program_review_score', score?: any | null } | null, program_duration?: { __typename?: 'program_duration', duration?: any | null } | null, program_content_sections: Array<{ __typename?: 'program_content_section', id: any, title: string, description?: string | null, collapsed_status: boolean, program_contents: Array<{ __typename?: 'program_content', id: any, title: string, abstract?: string | null, metadata?: any | null, duration?: any | null, published_at?: any | null, display_mode: string, list_price?: any | null, sale_price?: any | null, sold_at?: any | null, content_body_id: any, pinned_status: boolean, program_content_type?: { __typename?: 'program_content_type', id?: any | null, type?: string | null } | null, program_content_videos: Array<{ __typename?: 'program_content_video', attachment: { __typename?: 'attachment', id: any, size: any, options?: any | null, data?: any | null } }>, program_content_audios: Array<{ __typename?: 'program_content_audio', data: any }>, program_content_ebook?: { __typename?: 'program_content_ebook', id: any, data: any, program_content_ebook_tocs: Array<{ __typename?: 'program_content_ebook_toc', id: any, label: string, href: string, position: any, subitems: Array<{ __typename?: 'program_content_ebook_toc', id: any, label: string, href: string, position: any }> }> } | null }> }> } | null }; +export type GetProgram = { __typename?: 'query_root', program_by_pk?: { __typename?: 'program', id: any, cover_url?: string | null, cover_mobile_url?: string | null, cover_thumbnail_url?: string | null, title: string, abstract?: string | null, published_at?: any | null, is_subscription: boolean, is_sold_out?: boolean | null, list_price?: any | null, sale_price?: any | null, sold_at?: any | null, description?: string | null, cover_video_url?: string | null, meta_tag?: any | null, is_issues_open: boolean, is_private: boolean, is_countdown_timer_visible: boolean, is_introduction_section_visible: boolean, is_enrolled_count_visible: boolean, display_header: boolean, display_footer: boolean, program_layout_template_configs: Array<{ __typename?: 'program_layout_template_config', id: any, program_layout_template_id: any, module_data?: any | null, program_layout_template: { __typename?: 'program_layout_template', id: any, variant?: string | null } }>, editors: Array<{ __typename?: 'program_editor', member_id?: string | null }>, program_plans: Array<{ __typename?: 'program_plan', id: any }>, program_categories: Array<{ __typename?: 'program_category', id: any, category: { __typename?: 'category', id: string, name: string } }>, program_tags: Array<{ __typename?: 'program_tag', tag: { __typename?: 'tag', name: string } }>, program_roles: Array<{ __typename?: 'program_role', id: any, name: string, member_id: string, member?: { __typename?: 'member_public', name?: string | null, description?: string | null, abstract?: string | null, picture_url?: string | null } | null }>, program_review_score?: { __typename?: 'program_review_score', score?: any | null } | null, program_duration?: { __typename?: 'program_duration', duration?: any | null } | null, program_content_sections: Array<{ __typename?: 'program_content_section', id: any, title: string, description?: string | null, collapsed_status: boolean, program_contents: Array<{ __typename?: 'program_content', id: any, title: string, abstract?: string | null, metadata?: any | null, duration?: any | null, published_at?: any | null, display_mode: string, list_price?: any | null, sale_price?: any | null, sold_at?: any | null, content_body_id: any, pinned_status: boolean, program_content_type?: { __typename?: 'program_content_type', id?: any | null, type?: string | null } | null, program_content_videos: Array<{ __typename?: 'program_content_video', attachment: { __typename?: 'attachment', id: any, size: any, options?: any | null, data?: any | null } }>, program_content_audios: Array<{ __typename?: 'program_content_audio', data: any }>, program_content_ebook?: { __typename?: 'program_content_ebook', id: any, data: any, program_content_ebook_tocs: Array<{ __typename?: 'program_content_ebook_toc', id: any, label: string, href: string, position: any, subitems: Array<{ __typename?: 'program_content_ebook_toc', id: any, label: string, href: string, position: any }> }> } | null }> }> } | null }; export type GetProgramPlansVariables = Exact<{ programId: Scalars['uuid']; diff --git a/src/hooks/program.ts b/src/hooks/program.ts index 2d10de8e9..cffef93da 100644 --- a/src/hooks/program.ts +++ b/src/hooks/program.ts @@ -48,7 +48,6 @@ export const usePublishedProgramCollection = (options?: { list_price sale_price sold_at - program_categories { id category { @@ -61,6 +60,9 @@ export const usePublishedProgramCollection = (options?: { id name member_id + member { + name + } } program_plans(where: { published_at: { _lte: "now()" } }, order_by: { created_at: asc }) { id @@ -144,7 +146,6 @@ export const usePublishedProgramCollection = (options?: { isSubscription: program.is_subscription, isSoldOut: program.is_sold_out, isPrivate: program.is_private, - listPrice: program.list_price, salePrice: program.sale_price, soldAt: program.sold_at && new Date(program.sold_at), @@ -158,7 +159,7 @@ export const usePublishedProgramCollection = (options?: { id: programRole.id, name: programRole.name as ProgramRoleName, memberId: programRole.member_id, - memberName: programRole.member_id, + memberName: programRole?.member?.name || '', })), plans: program.program_plans.map(programPlan => ({ id: programPlan.id, @@ -261,6 +262,15 @@ export const useProgram = (programId: string) => { is_enrolled_count_visible display_header display_footer + program_layout_template_configs(where: { is_active: { _eq: true } }) { + id + program_layout_template_id + module_data + program_layout_template { + id + variant + } + } editors { member_id } @@ -283,6 +293,12 @@ export const useProgram = (programId: string) => { id name member_id + member { + name + description + abstract + picture_url + } } program_review_score { score @@ -409,6 +425,11 @@ export const useProgram = (programId: string) => { editors: data?.program_by_pk?.editors.map(v => v?.member_id || ''), displayHeader: data?.program_by_pk?.display_header ?? true, displayFooter: data?.program_by_pk?.display_footer ?? true, + programLayoutTemplateId: + data?.program_by_pk?.program_layout_template_configs[0]?.program_layout_template_id || undefined, + moduleData: data?.program_by_pk?.program_layout_template_configs[0]?.module_data, + programLayoutTemplateVariant: + data?.program_by_pk?.program_layout_template_configs[0]?.program_layout_template?.variant, categories: data?.program_by_pk?.program_categories.map(programCategory => ({ id: programCategory.category.id, @@ -419,7 +440,10 @@ export const useProgram = (programId: string) => { id: programRole.id, name: programRole.name as ProgramRoleName, memberId: programRole.member_id, - memberName: programRole.member_id, + memberName: programRole?.member?.name || '', + pictureUrl: programRole?.member?.picture_url || '', + abstract: programRole?.member?.abstract || '', + description: programRole?.member?.description || '', })) || [], plans: programPlans?.program_plan.map(programPlan => ({ @@ -458,7 +482,7 @@ export const useProgram = (programId: string) => { id: programContentSection.id, title: programContentSection.title, description: programContentSection.description || '', - collapsed_status: programContentSection.collapsed_status, + collapsedStatus: programContentSection.collapsed_status, contents: programContentSection.program_contents.map(programContent => ({ id: programContent.id, title: programContent.title, diff --git a/src/pages/ProgramPage/Primary/ProgramContentListSection.tsx b/src/pages/ProgramPage/Primary/ProgramContentListSection.tsx index 299b4c278..a861e3a4f 100644 --- a/src/pages/ProgramPage/Primary/ProgramContentListSection.tsx +++ b/src/pages/ProgramPage/Primary/ProgramContentListSection.tsx @@ -148,7 +148,7 @@ const ProgramContentListSection: React.VFC<{ id: programContentSection.id, title: programContentSection.title, description: programContentSection.description, - collapsed_status: programContentSection.collapsed_status, + collapsedStatus: programContentSection.collapsedStatus, contents: isEquityProgram ? programContentSection.contents : programContentSection.contents.filter(programContent => @@ -164,7 +164,7 @@ const ProgramContentListSection: React.VFC<{ const isAllPinned = sec.contents.every(content => content.pinnedStatus) acc[sec.id] = { - isCollapsed: isAllPinned ? true : sec.collapsed_status, + isCollapsed: isAllPinned ? true : sec.collapsedStatus, isAllPinned: isAllPinned, } diff --git a/src/pages/ProgramPage/ProgramPageContent.tsx b/src/pages/ProgramPage/ProgramPageContent.tsx index 44786cfc1..d9896e0ed 100644 --- a/src/pages/ProgramPage/ProgramPageContent.tsx +++ b/src/pages/ProgramPage/ProgramPageContent.tsx @@ -1,7 +1,7 @@ import PrimaryProgramPageContent from './Primary/PrimaryProgramPageContent' import SecondaryProgramContent from './Secondary/SecondaryProgramPageContent' -const ProgramPageContent: React.FC<{ variant: string }> = ({ variant }) => { +const ProgramPageContent: React.FC<{ variant: string | null | undefined }> = ({ variant }) => { switch (variant) { case 'primary': return diff --git a/src/pages/ProgramPage/Secondary/ProgramIntroTabs/index.tsx b/src/pages/ProgramPage/Secondary/ProgramIntroTabs/index.tsx index 2ae6fc215..eaf0f7273 100644 --- a/src/pages/ProgramPage/Secondary/ProgramIntroTabs/index.tsx +++ b/src/pages/ProgramPage/Secondary/ProgramIntroTabs/index.tsx @@ -3,7 +3,8 @@ import { BREAK_POINT } from 'lodestar-app-element/src/components/common/Responsi import { BraftContent } from 'lodestar-app-element/src/components/common/StyledBraftEditor' import React from 'react' import styled from 'styled-components' -import { Program, ProgramRole } from '../../../../types/program' +import { useEquityProgramByProgramId } from '../../../../hooks/program' +import { DisplayModeEnum, Program, ProgramRole } from '../../../../types/program' import SecondaryInstructorCollectionBlock from '../SecondaryInstructorCollectionBlock' import SecondaryProgramContentListSection from '../SecondaryProgramContentListSection' import { colors } from '../style' @@ -30,6 +31,23 @@ const ProgramIntroTabs: React.VFC<{ roles: ProgramRole[] } }> = ({ program }) => { + const { isEquityProgram } = useEquityProgramByProgramId(program.id) + const programContentSections = program.contentSections + .filter(programContentSection => programContentSection.contents.length) + .map(programContentSection => ({ + id: programContentSection.id, + title: programContentSection.title, + description: programContentSection.description, + collapsedStatus: programContentSection.collapsedStatus, + contents: isEquityProgram + ? programContentSection.contents + : programContentSection.contents.filter(programContent => + program.isIntroductionSectionVisible + ? programContent + : programContent.displayMode === DisplayModeEnum.trial || + programContent.displayMode === DisplayModeEnum.loginToTrial, + ), + })) return ( @@ -43,7 +61,11 @@ const ProgramIntroTabs: React.VFC<{ {program.description} - + diff --git a/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentBlock.tsx b/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentBlock.tsx new file mode 100644 index 000000000..31c843aef --- /dev/null +++ b/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentBlock.tsx @@ -0,0 +1,68 @@ +import { Box } from '@chakra-ui/react' +import styled from 'styled-components' +import { usePostPreviewCollection } from '../../../../hooks/blog' +import { usePodcastProgramCollection } from '../../../../hooks/podcast' +import { usePublishedProgramCollection } from '../../../../hooks/program' +import EmptyCover from '../../../../images/empty-cover.png' +import CollapseContent from './CollapseContent' +import CollapseContentCard from './CollapseContentCard' + +const StyledCollapseContentWrapper = styled(Box)` + display: grid; + grid-row-gap: 12px; + margin-top: 24px; + grid-template-columns: 1fr; + place-items: center; + padding-bottom: 24px; +` + +const CollapseContentBlock: React.FC<{ creatorId: string }> = ({ creatorId }) => { + const { programs } = usePublishedProgramCollection({ + instructorId: creatorId, + isPrivate: false, + }) + + const { podcastPrograms } = usePodcastProgramCollection(creatorId) + const { posts } = usePostPreviewCollection({ authorId: creatorId }) + return ( + <> + + + {programs.map(program => ( + + {program.title} + + ))} + + + + + {podcastPrograms.map(podcast => ( + + {podcast.title} + + ))} + + + + + {posts.map(post => ( + + {post.title} + + ))} + + + + ) +} + +export default CollapseContentBlock diff --git a/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentCard.tsx b/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentCard.tsx index abc8432b4..fbcbda0b3 100644 --- a/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentCard.tsx +++ b/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/CollapseContentCard.tsx @@ -1,15 +1,17 @@ -import { Box, Image } from '@chakra-ui/react' +import { Box } from '@chakra-ui/react' import { Link } from 'react-router-dom' import styled from 'styled-components' +import { ProgramCover } from '../../../../components/common/Image' import { colors } from '../style' -const Card = styled(Link)` +const StyledCard = styled(Link)` width: 98%; height: 85px; border-radius: 4px; box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.06); background-color: #fff; display: flex; + gap: 16px; justify-content: start; align-items: center; padding: 12px; @@ -20,7 +22,6 @@ const Card = styled(Link)` const ImageWrapper = styled(Box)` width: 100px; - height: 60px; border-radius: 4px; ` @@ -30,12 +31,12 @@ const CollapseContentCard: React.VFC<{ href: string; imgSrc?: string; children: href, }) => { return ( - + - + {children} - + ) } diff --git a/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/index.tsx b/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/index.tsx index 8f666b9b5..88827a47f 100644 --- a/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/index.tsx +++ b/src/pages/ProgramPage/Secondary/SecondaryInstructorCollectionBlock/index.tsx @@ -1,115 +1,39 @@ -import { Box, TabList, TabPanels, Tabs } from '@chakra-ui/react' +import { TabList, TabPanels, Tabs } from '@chakra-ui/react' import { BraftContent } from 'lodestar-app-element/src/components/common/StyledBraftEditor' import React from 'react' -import styled from 'styled-components' import { Program, ProgramRole } from '../../../../types/program' -import CollapseContent from './CollapseContent' -import CollapseContentCard from './CollapseContentCard' +import CollapseContentBlock from './CollapseContentBlock' import InstructorPanel from './InstructorPanel' import InstructorTab from './InstructorTab' import NormalContent from './NormalContent' -const CollapseContentWrapper = styled(Box)` - display: grid; - grid-row-gap: 12px; - margin-top: 24px; - grid-template-columns: 1fr; - place-items: center; - padding-bottom: 24px; -` - const SecondaryInstructorCollectionBlock: React.VFC<{ program: Program & { roles: ProgramRole[] } title?: string }> = ({ program }) => { - const instructors = [ - { - name: '黃麗燕', - nameWithEnglish: '黃麗燕 Margaret', - avatarUrl: '', - instructorSubtitle: '品牌操盤手', - programs: [ - { id: '12345', title: '超屌課程', imgSrc: '' }, - { id: '123456', title: '超屌課程', imgSrc: '' }, - ], - podcasts: [ - { id: '12345', title: '超屌廣播', imgSrc: '' }, - { id: '123467', title: '超屌廣播', imgSrc: '' }, - ], - articles: [ - { id: '12345', title: '超屌文章', imgSrc: '' }, - { id: '123467', title: '超屌文章', imgSrc: '' }, - ], - }, - { - name: '高一成', - nameWithEnglish: '高一成 Logan', - avatarUrl: '', - instructorSubtitle: '工程高手', - programs: [ - { id: '12345', title: 'L超屌課程', imgSrc: '' }, - { id: '123456', title: 'L超屌課程', imgSrc: '' }, - ], - podcasts: [ - { id: '12345', title: 'L超屌廣播', imgSrc: '' }, - { id: '123467', title: 'L超屌廣播', imgSrc: '' }, - ], - articles: [ - { id: '12345', title: 'L超屌文章', imgSrc: '' }, - { id: '123467', title: 'L超屌文章', imgSrc: '' }, - ], - }, - ] - return ( - {instructors.map(instructor => ( - {instructor.name} + {program.roles.map(instructor => ( + {instructor.memberName} ))} - {instructors.map(instructor => ( + {program.roles.map(instructor => ( - {'TODO: use member.description'} + {instructor.description} - - - {instructor.programs.map(program => ( - - {program.title} - - ))} - - - - - {instructor.podcasts.map(podcast => ( - - {podcast.title} - - ))} - - - - - {instructor.articles.map(article => ( - - {article.title} - - ))} - - + ))} diff --git a/src/pages/ProgramPage/Secondary/SecondaryProgramInfoCard.tsx b/src/pages/ProgramPage/Secondary/SecondaryProgramInfoCard.tsx index 570134be8..d0c25a920 100644 --- a/src/pages/ProgramPage/Secondary/SecondaryProgramInfoCard.tsx +++ b/src/pages/ProgramPage/Secondary/SecondaryProgramInfoCard.tsx @@ -1,4 +1,4 @@ -import { sum } from 'ramda' +import dayjs from 'dayjs' import React from 'react' import { useIntl } from 'react-intl' import styled from 'styled-components' @@ -49,37 +49,25 @@ const SecondaryProgramInfoCard: React.FC<{ }> = ({ program }) => { const { formatMessage } = useIntl() - const totalDuration = sum( - program.contentSections?.map(programContentSection => - sum(programContentSection.contents.map(programContent => programContent.duration || 0) || []), - ) || [], - ) - return (
預計開課 - - {Math.floor(totalDuration / 60)} - {formatMessage(commonMessages.unit.min)} - + {dayjs(program.moduleData.expectedStartDate.value).format('YYYY/MM/DD')}
預計時長 - - {Math.floor(totalDuration / 60)} - {formatMessage(commonMessages.unit.min)} - + {program.moduleData.expectedDuration.value}
預計章節 - {program.contentSections.filter(programContentSection => programContentSection.contents.length).length} + {program.moduleData.expectedSections.value} {formatMessage(commonMessages.unit.chapter)}
@@ -87,10 +75,7 @@ const SecondaryProgramInfoCard: React.FC<{
全數上架 - - {Math.floor(totalDuration / 60)} - {formatMessage(commonMessages.unit.min)} - + {dayjs(program.moduleData.completeRelease.value).format('YYYY/MM/DD')}
) diff --git a/src/pages/ProgramPage/Secondary/SecondaryProgramPageContent/index.tsx b/src/pages/ProgramPage/Secondary/SecondaryProgramPageContent/index.tsx index 3824d2cf9..24c3143df 100644 --- a/src/pages/ProgramPage/Secondary/SecondaryProgramPageContent/index.tsx +++ b/src/pages/ProgramPage/Secondary/SecondaryProgramPageContent/index.tsx @@ -37,18 +37,18 @@ const StyledIntroWrapper = styled.div` padding-left: 35px; `)} ` -const ProgramAbstract = styled.span` +const StyledProgramAbstract = styled.span` font-size: 16px; font-weight: 500; display: inline-block; width: 100%; ` -const VideoIframe = styled.iframe` +const StyledVideoIframe = styled.iframe` width: 100%; height: 315px; ` -const ContentWrapper = styled.div` +const StyledContentWrapper = styled.div` height: 100%; display: grid; grid-template-columns: 1fr; @@ -56,7 +56,7 @@ const ContentWrapper = styled.div` margin-bottom: 3rem; ` -const ProgramIntroBlock = styled.div` +const StyledProgramIntroBlock = styled.div` position: relative; padding-top: 2.5rem; padding-bottom: 6rem; @@ -68,7 +68,7 @@ const ProgramIntroBlock = styled.div` } ` -const FixedBottomBlock = styled.div<{ bottomSpace?: string }>` +const StyledFixedBottomBlock = styled.div<{ bottomSpace?: string }>` margin: auto; position: fixed; width: 100%; @@ -183,7 +183,12 @@ const SecondaryProgramPageContent: React.VFC = () => { } return ( - 1 ? '60px' : '132px'}> + 1 ? '60px' : '132px'} + noHeader={loadingProgram ? true : !program.displayHeader} + noFooter={loadingProgram ? true : !program.displayFooter} + > {!loadingApp && }
@@ -196,20 +201,20 @@ const SecondaryProgramPageContent: React.VFC = () => { scrollToPlanBlock={scrollToPlanBlock} /> - +
- + - {program?.abstract} + {program?.abstract} {program.coverVideoUrl && (
- +
)} -
+
{
- +
{!isEnrolledByProgramPackage && ( - + {Number(settings['layout.program_page']) ? ( @@ -269,7 +274,7 @@ const SecondaryProgramPageContent: React.VFC = () => { )} - + )} diff --git a/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/SecondaryPriceLabel.tsx b/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/SecondaryPriceLabel.tsx index 357ce6801..ad4915fe9 100644 --- a/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/SecondaryPriceLabel.tsx +++ b/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/SecondaryPriceLabel.tsx @@ -1,6 +1,8 @@ import { Flex, Text } from '@chakra-ui/react' +import ShortenPeriodTypeLabel from 'lodestar-app-element/src/components/labels/ShortenPeriodTypeLabel' import { useCurrency } from 'lodestar-app-element/src/hooks/util' import styled from 'styled-components' +import { PeriodType } from '../../../../types/program' import { colors } from '../style' const DisplayPrice = styled(Text)` @@ -18,16 +20,37 @@ const DeletePrice = styled(Text)` const SecondaryPriceLabel: React.VFC<{ listPrice: number salePrice: number | null | undefined - downPrice: number currencyId: string -}> = ({ salePrice, listPrice, downPrice, currencyId }) => { + periodType?: PeriodType + periodAmount?: number | null +}> = ({ salePrice, listPrice, currencyId, periodAmount, periodType }) => { const { formatCurrency } = useCurrency(currencyId) - const displayPrice = downPrice || salePrice || listPrice - const deletePrice = salePrice || listPrice + + const periodElem = !!periodType && ( + <> + {` / ${periodAmount && periodAmount > 1 ? periodAmount : ''}`} + 1} /> + + ) + return ( - {formatCurrency(displayPrice)} - {deletePrice !== displayPrice && {formatCurrency(deletePrice)}} + {salePrice === null ? ( + + {formatCurrency(listPrice)} + {periodElem} + + ) : ( + <> + + {formatCurrency(Number(salePrice))} + {periodElem} + + + {formatCurrency(listPrice)} {periodElem} + + + )} ) } diff --git a/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/index.tsx b/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/index.tsx index 644219469..8f8415a6e 100644 --- a/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/index.tsx +++ b/src/pages/ProgramPage/Secondary/SecondaryProgramPlanCard/index.tsx @@ -1,8 +1,9 @@ -import { Divider } from '@chakra-ui/react' +import { Divider, Flex } from '@chakra-ui/react' import { BraftContent } from 'lodestar-app-element/src/components/common/StyledBraftEditor' import CheckoutProductModal from 'lodestar-app-element/src/components/modals/CheckoutProductModal' import { useApp } from 'lodestar-app-element/src/contexts/AppContext' import { useAuth } from 'lodestar-app-element/src/contexts/AuthContext' +import { useProductGiftPlan } from 'lodestar-app-element/src/hooks/giftPlan' import React, { useContext } from 'react' import ReactGA from 'react-ga' import { useIntl } from 'react-intl' @@ -11,6 +12,7 @@ import styled from 'styled-components' import { AuthModalContext } from '../../../../components/auth/AuthModal' import AdminCard from '../../../../components/common/AdminCard' import CountDownTimeBlock from '../../../../components/common/CountDownTimeBlock' +import GiftPlanTag from '../../../../components/common/GiftPlanTag' import { commonMessages, productMessages } from '../../../../helpers/translation' import { useEnrolledPlanIds } from '../../../../hooks/program' import { ProgramPlan } from '../../../../types/program' @@ -74,8 +76,9 @@ const SecondaryProgramPlanCard: React.VFC<{ const { enabledModules } = useApp() const { programPlanIds: enrolledProgramIds } = useEnrolledPlanIds() + const { productGiftPlan } = useProductGiftPlan(`ProgramPlan_${programPlan?.id}`) - const { salePrice, listPrice, discountDownPrice, currency, isSubscription } = programPlan + const { salePrice, listPrice, currency, isSubscription, periodType, periodAmount } = programPlan const currencyId = currency.id || 'TWD' const isOnSale = (programPlan.soldAt?.getTime() || 0) > Date.now() const enrolled = enrolledProgramIds.includes(programPlan.id) @@ -85,31 +88,35 @@ const SecondaryProgramPlanCard: React.VFC<{

{programPlan.title}

- - - - -
} - expiredAt={new Date(new Date().getFullYear(), 6, 24)} //TODO: Remove mock data - /> - + + + + + {productGiftPlan.id && } + + {programPlan.isCountdownTimerVisible && programPlan.soldAt && isOnSale && ( + +
} expiredAt={programPlan?.soldAt} /> + + )}
+ {programPlan.description} - {programPlan.isParticipantsVisible && enrollmentCount && ( + {programPlan.isParticipantsVisible && !!enrollmentCount && ( {enrollmentCount} {formatMessage(commonMessages.unit.people)} )} + {isProgramSoldOut ? ( {formatMessage(commonMessages.button.soldOut)} ) : enrolled ? ( diff --git a/src/pages/ProgramPage/index.tsx b/src/pages/ProgramPage/index.tsx index 5f0d770ca..c18a0469c 100644 --- a/src/pages/ProgramPage/index.tsx +++ b/src/pages/ProgramPage/index.tsx @@ -5,6 +5,7 @@ import { useTracking } from 'lodestar-app-element/src/hooks/tracking' import React, { useEffect } from 'react' import { useParams } from 'react-router-dom' import { StringParam, useQueryParam } from 'use-query-params' +import { useProgram } from '../../hooks/program' import ProgramPageContent from './ProgramPageContent' const ProgramPage: React.VFC = () => { @@ -13,6 +14,7 @@ const ProgramPage: React.VFC = () => { const tracking = useTracking() const { programId } = useParams<{ programId: string }>() const { id: appId } = useApp() + const { program } = useProgram(programId) const { isAuthenticating } = useAuth() const { loading: loadingResourceCollection, resourceCollection } = useResourceCollection( [`${appId}:program:${programId}`], @@ -26,7 +28,7 @@ const ProgramPage: React.VFC = () => { } }, [resourceCollection, tracking, pageFrom, utmSource, isAuthenticating, loadingResourceCollection]) - return + return } export default ProgramPage diff --git a/src/types/program.ts b/src/types/program.ts index 6e0fd082b..7a0656128 100644 --- a/src/types/program.ts +++ b/src/types/program.ts @@ -61,6 +61,14 @@ export type Program = ProgramBriefProps & { roles: ProgramRole[] displayHeader: boolean displayFooter: boolean + programLayoutTemplateId: string + moduleData: { + [key: string]: { + id: string + value: string + } + } + programLayoutTemplateVariant?: string | null | undefined plans: (ProgramPlan & { isSubscription: boolean groupBuyingPeople: number @@ -85,6 +93,9 @@ export type ProgramRole = { name: ProgramRoleName memberId: string memberName: string + pictureUrl?: string + abstract?: string + description?: string createdAt?: Date } @@ -113,10 +124,23 @@ export type ProgramContentSection = { id: string title: string description: string | null - collapsed_status: boolean + collapsedStatus: boolean // materialsCount?: number } +export type ProgramContentSectionType = { + contentSections: (ProgramContentSection & { + contents: ProgramContent[] + })[] +} + +export type contentTitleCollapsedType = { + [key: string]: { + isCollapsed: boolean + isAllPinned: boolean + } +} + export type DisplayMode = keyof typeof DisplayModeEnum export enum DisplayModeEnum {