@vonq/hapi-elements-types 1.49.0 → 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_window/api.types.ts +32 -1
- package/_window/sdk.types.ts +8 -3
- package/_window/service.types.ts +1 -0
- package/_window/state.types.ts +4 -0
- package/_window/utils.types.ts +21 -1
- package/_window/validation.types.ts +2 -0
- package/_window/window.ts +5 -18
- package/alert/enums.ts +1 -0
- package/alert/index.ts +1 -0
- package/alert/index.ts.bak +1 -0
- package/alert/types.ts +7 -0
- package/ats/types.ts +1 -0
- package/basket/service.types.ts +5 -0
- package/basket/utils.types.ts +4 -0
- package/campaign/api.types.ts +13 -1
- package/campaign/service.types.ts +2 -2
- package/campaign/types.ts +53 -4
- package/campaign/utils.types.ts +0 -1
- package/common/events/EventCommand/enums.ts +1 -0
- package/common/logger/types.ts +2 -0
- package/common/types.ts +1 -1
- package/common/validations.types.ts +4 -0
- package/contract/index.ts +9 -8
- package/contract/index.ts.bak +2 -0
- package/contract/service.types.ts +8 -3
- package/contract/state.types.ts +1 -0
- package/contract/types.ts +2 -0
- package/contract/utils.types.ts +7 -0
- package/experimental/api.types.ts +2 -16
- package/experimental/index.ts +3 -3
- package/experimental/index.ts.bak +5 -0
- package/experimental/service.types.ts +1 -36
- package/experimental/state.types.ts +0 -15
- package/index.ts +17 -16
- package/index.ts.bak +1 -0
- package/modal/enums.ts +1 -0
- package/modal/service.types.ts +2 -4
- package/modal/types.ts +10 -8
- package/orderJourney/service.types.ts +37 -4
- package/orderJourney/state.types.ts +18 -0
- package/orderJourney/types.ts +5 -2
- package/orderJourney/utils.types.ts +12 -0
- package/package.json +1 -1
- package/product/api.types.ts +21 -0
- package/product/enums.ts +4 -0
- package/product/index.ts +1 -0
- package/product/index.ts.bak +1 -0
- package/product/service.types.ts +22 -0
- package/product/state.types.ts +11 -0
- package/product/types.ts +45 -0
- package/product/utils.types.ts +14 -2
- package/ui/enums.ts +9 -0
- package/ui/index.ts +4 -0
- package/ui/index.ts.bak +5 -1
- package/ui/service.types.ts +3 -0
- package/ui/state.types.ts +3 -0
- package/ui/types.ts +10 -0
- package/ui/utils.types.ts +10 -0
- package/ui/validations.types.ts +18 -0
- package/experimental/enums.ts +0 -5
- package/experimental/types.ts +0 -14
@@ -7,13 +7,14 @@ import {
|
|
7
7
|
Contract,
|
8
8
|
ContractCredential,
|
9
9
|
ContractDirectApplyChannelPrefillVariablesMap,
|
10
|
-
ContractGroup,
|
11
10
|
ContractDirectApplyPostingRequirementQuestionnaireQuestionBody,
|
12
|
-
ContractDirectApplyPostingRequirementQuestionnaireRules,
|
13
11
|
ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason,
|
12
|
+
ContractDirectApplyPostingRequirementQuestionnaireRules,
|
13
|
+
ContractGroup,
|
14
14
|
} from "./types"
|
15
15
|
import {
|
16
16
|
PaginatedAPIResponseV1,
|
17
|
+
PaginationResponseV1,
|
17
18
|
PostingRequirementOption,
|
18
19
|
PostingRequirementsAutocompleteRequestOption,
|
19
20
|
TransformedPostingRequirement,
|
@@ -21,7 +22,6 @@ import {
|
|
21
22
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
22
23
|
import { Modals } from "../modal"
|
23
24
|
import { ContractDirectApplyChannelName } from "./enums"
|
24
|
-
import { ProductSupportingContractsComplete } from "../product"
|
25
25
|
import { OrderJourneyChannelPostingRequirementsStepOptions } from "../orderJourney"
|
26
26
|
|
27
27
|
export type ContractServiceGetContractPostingRequirementOptionsHandler = (
|
@@ -33,6 +33,7 @@ export type ContractServiceGetContractPostingRequirementOptionsHandler = (
|
|
33
33
|
export type ContractServiceGetContractsHandler = (
|
34
34
|
offset: number,
|
35
35
|
queryParams?: URLSearchParams,
|
36
|
+
shouldAppendResults?: boolean,
|
36
37
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
37
38
|
|
38
39
|
export type ContractServiceGetFilteredContractsHandler = (
|
@@ -118,6 +119,9 @@ export type ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHan
|
|
118
119
|
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
119
120
|
forceRefresh?: boolean,
|
120
121
|
) => Promise<PostingRequirementOption[]>
|
122
|
+
export type ContractServiceLoadMoreContractsHandler = () => Promise<
|
123
|
+
PaginatedAPIResponseV1<Contract>
|
124
|
+
>
|
121
125
|
|
122
126
|
export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
123
127
|
{
|
@@ -140,6 +144,7 @@ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
|
140
144
|
getContractChannelPostingRequirementQuestionnaireRulesForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyHandler>
|
141
145
|
setContractChannelPostingRequirementQuestionnaireOptionsDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceSetContractChannelPostingRequirementQuestionnaireOptionsDirectApplyHandler>
|
142
146
|
getContractPostingRequirementOptionsFromCacheOrAPI: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler>
|
147
|
+
loadMoreContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceLoadMoreContractsHandler>
|
143
148
|
initiateOauthLogin: (
|
144
149
|
contractId: string | number,
|
145
150
|
orderJourneyStepActive: OrderJourneyStepKey,
|
package/contract/state.types.ts
CHANGED
@@ -20,6 +20,7 @@ export type ContractState = {
|
|
20
20
|
contractForm: ContractCreateForm | ContractEditForm
|
21
21
|
contractCreateError: any
|
22
22
|
contractFormIsValid: boolean | null
|
23
|
+
contractListShouldBeInfiniteScroll: boolean
|
23
24
|
/* Contracts Groups */
|
24
25
|
groups: ContractGroup[]
|
25
26
|
groupSelected: ContractGroupSelected
|
package/contract/types.ts
CHANGED
package/contract/utils.types.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
ContractDirectApplyChannelPrefillVariablesMap,
|
5
5
|
ContractFilterQueryParams,
|
6
6
|
ContractGroupCreateForm,
|
7
|
+
ContractUserProvidedFilters,
|
7
8
|
} from "./types"
|
8
9
|
import { WindowHapiUtils } from "../_window/utils.types"
|
9
10
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
@@ -11,6 +12,7 @@ import {
|
|
11
12
|
ContractDirectApplyChannelName,
|
12
13
|
ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode,
|
13
14
|
} from "./enums"
|
15
|
+
import { PaginationResponseV1 } from "../common"
|
14
16
|
|
15
17
|
export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
|
16
18
|
{
|
@@ -24,8 +26,13 @@ export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
|
|
24
26
|
getInitialGroupForm: () => ContractGroupCreateForm
|
25
27
|
getContractsQueryParams: (
|
26
28
|
params: Partial<ContractFilterQueryParams>,
|
29
|
+
paginationOptions?: PaginationResponseV1 | null,
|
27
30
|
) => URLSearchParams
|
31
|
+
getUserProvidedFilters: () => ContractUserProvidedFilters
|
28
32
|
getContractNameWithGroupSuffix: (contract: Contract) => string
|
33
|
+
getNextPageOffsetAndLimit: (
|
34
|
+
meta: PaginationResponseV1,
|
35
|
+
) => PaginationResponseV1
|
29
36
|
},
|
30
37
|
{ readonly utils: WindowHapiUtils }
|
31
38
|
>
|
@@ -1,22 +1,8 @@
|
|
1
1
|
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
2
2
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
|
-
import { AxiosRequestConfig } from "axios/index"
|
4
|
-
import { PostingRequirement } from "../common"
|
5
3
|
|
6
|
-
export type WindowHapiAPIExperimentalConfigs = {
|
7
|
-
|
8
|
-
getPostingRequirements: AxiosRequestConfig
|
9
|
-
}
|
10
|
-
export type WindowHapiAPIExperimentalRequests = {
|
11
|
-
getPostingRequirementOptions: (
|
12
|
-
productId: string,
|
13
|
-
fieldName: string,
|
14
|
-
autocompleteRequestOptions: Record<string, string | string[]>,
|
15
|
-
) => Promise<any>
|
16
|
-
getPostingRequirements: (
|
17
|
-
productId: string | number,
|
18
|
-
) => Promise<PostingRequirement[]>
|
19
|
-
}
|
4
|
+
export type WindowHapiAPIExperimentalConfigs = {}
|
5
|
+
export type WindowHapiAPIExperimentalRequests = {}
|
20
6
|
export type WindowHapiAPIExperimental = WindowHapiModuleWithConstructorArgs<
|
21
7
|
WindowHapiAPIModule<
|
22
8
|
WindowHapiAPIExperimentalRequests,
|
package/experimental/index.ts
CHANGED
@@ -1,44 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
HapiServiceFunctionWithLifecycleHooks,
|
3
2
|
WindowHapiService,
|
4
3
|
} from "../_window/service.types"
|
5
4
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
6
|
-
import {
|
7
|
-
NestedValidatorKeys,
|
8
|
-
PostingRequirement,
|
9
|
-
PostingRequirementsAutocompleteRequestOption,
|
10
|
-
UseValidatorResult,
|
11
|
-
} from "../common"
|
12
|
-
import { MessageDescriptor } from "react-intl"
|
13
|
-
|
14
|
-
export type ExperimentalServiceGetProductPostingRequirementOptionsHandler = (
|
15
|
-
productId: string,
|
16
|
-
fieldName: string,
|
17
|
-
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
18
|
-
) => Promise<any>
|
19
|
-
|
20
|
-
export type ExperimentalServiceGetProductPostingRequirementsHandler = (
|
21
|
-
productId: string | number,
|
22
|
-
) => Promise<PostingRequirement[]>
|
23
5
|
|
24
6
|
export type WindowHapiServiceExperimental = WindowHapiModuleWithConstructorArgs<
|
25
|
-
{
|
26
|
-
getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementOptionsHandler>
|
27
|
-
getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ExperimentalServiceGetProductPostingRequirementsHandler>
|
28
|
-
setProductStepsBlurredFields: (
|
29
|
-
fields: Record<string, Record<string, boolean>>,
|
30
|
-
) => Record<string, UseValidatorResult> | null
|
31
|
-
setProductStepsErrorMessages: (
|
32
|
-
messages: Record<
|
33
|
-
string,
|
34
|
-
Record<string, MessageDescriptor | boolean>
|
35
|
-
>,
|
36
|
-
) => void
|
37
|
-
setProductStepsSubmittedSteps: (steps: Record<string, boolean>) => void
|
38
|
-
setProductStepsValidators: (
|
39
|
-
validators: NestedValidatorKeys,
|
40
|
-
replaceAsIs: boolean,
|
41
|
-
) => void
|
42
|
-
},
|
7
|
+
{},
|
43
8
|
{ readonly service: WindowHapiService }
|
44
9
|
>
|
@@ -1,7 +1,3 @@
|
|
1
|
-
import { MessageDescriptor } from "react-intl"
|
2
|
-
import { NestedValidatorKeys, UseValidatorResult } from "../common"
|
3
|
-
import { OrderJourneyProductStep } from "./types"
|
4
|
-
|
5
1
|
export type ExperimentalState = {
|
6
2
|
snakeIndex: number
|
7
3
|
snakeCurrent: number[]
|
@@ -10,15 +6,4 @@ export type ExperimentalState = {
|
|
10
6
|
snakeScore: number
|
11
7
|
snakeSpeed: number
|
12
8
|
snakeInterval: number
|
13
|
-
/* Product Fields */
|
14
|
-
productSteps: OrderJourneyProductStep[]
|
15
|
-
productStepsBlurredFields: Record<string, Record<string, boolean>>
|
16
|
-
productStepsSubmittedSteps: Record<string, boolean>
|
17
|
-
productStepsErrorMessages: Record<
|
18
|
-
string,
|
19
|
-
Record<string, MessageDescriptor | MessageDescriptor[]>
|
20
|
-
>
|
21
|
-
productStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
22
|
-
productStepsData: Record<string, Record<string, any>>
|
23
|
-
productStepsValidations: Record<string, UseValidatorResult> | null
|
24
9
|
}
|
package/index.ts
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
2
|
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
7
|
-
export * from
|
8
|
-
export * from
|
9
|
-
export * from
|
10
|
-
export * from
|
11
|
-
export * from
|
12
|
-
export * from
|
13
|
-
export * from
|
14
|
-
export * from
|
15
|
-
export * from
|
16
|
-
export * from
|
17
|
-
export * from
|
18
|
-
export * from
|
3
|
+
export * from './_window';
|
4
|
+
export * from './alert';
|
5
|
+
export * from './ats';
|
6
|
+
export * from './basket';
|
7
|
+
export * from './campaign';
|
8
|
+
export * from './common';
|
9
|
+
export * from './contract';
|
10
|
+
export * from './debugging';
|
11
|
+
export * from './experimental';
|
12
|
+
export * from './language';
|
13
|
+
export * from './modal';
|
14
|
+
export * from './orderJourney';
|
15
|
+
export * from './product';
|
16
|
+
export * from './routing';
|
17
|
+
export * from './theming';
|
18
|
+
export * from './ui';
|
19
|
+
export * from './wallet';
|
package/index.ts.bak
CHANGED
package/modal/enums.ts
CHANGED
@@ -17,6 +17,7 @@ export enum ModalKeys {
|
|
17
17
|
basketRemoveProductConfirmation = "remove-product-from-basket",
|
18
18
|
basketProductBundleParentClashConfirmation = "basket-product-bundle-parent-clash-confirmation",
|
19
19
|
basketProductBundleChildClashConfirmation = "basket-product-bundle-child-clash-confirmation",
|
20
|
+
basketProductCPAClashConfirmation = "basket-product-cpa-clash-confirmation",
|
20
21
|
contractRemoveConfirmation = "contract-remove-confirmation",
|
21
22
|
contractGroupRemoveConfirmation = "contract-group-remove-confirmation",
|
22
23
|
contractGroupUpdateConfirmation = "contract-group-update-confirmation",
|
package/modal/service.types.ts
CHANGED
@@ -2,16 +2,14 @@ import { ModalOptions } from "./types"
|
|
2
2
|
import { ModalKeys, ModalZone } from "./enums"
|
3
3
|
import { Product } from "../product/types"
|
4
4
|
import { Contract } from "../contract/types"
|
5
|
-
import { IObservableValue } from "mobx"
|
6
5
|
import { AnyNonFunction } from "../common/types"
|
7
6
|
import { WindowHapiService } from "../_window/service.types"
|
8
7
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
9
|
-
import { ExperimentalModalKeys } from "../experimental/enums"
|
10
8
|
|
11
9
|
export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
|
12
10
|
{
|
13
11
|
openModal: (
|
14
|
-
key: ModalKeys
|
12
|
+
key: ModalKeys,
|
15
13
|
props: AnyNonFunction<
|
16
14
|
| { product: Product }
|
17
15
|
| {
|
@@ -26,7 +24,7 @@ export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
|
|
26
24
|
options?: ModalOptions,
|
27
25
|
zone?: ModalZone,
|
28
26
|
) => void
|
29
|
-
closeModal: (key: ModalKeys
|
27
|
+
closeModal: (key: ModalKeys) => void
|
30
28
|
},
|
31
29
|
{ readonly service: WindowHapiService }
|
32
30
|
>
|
package/modal/types.ts
CHANGED
@@ -10,10 +10,6 @@ import { Campaign } from "../campaign"
|
|
10
10
|
import { OrderJourneyPaymentMethod } from "../orderJourney"
|
11
11
|
import { PickerDisplayMode } from "filestack-js"
|
12
12
|
import { HapiSiteTheme } from "../theming"
|
13
|
-
import {
|
14
|
-
ExperimentalFilePickerModalPropsActionFor,
|
15
|
-
ExperimentalModalKeys,
|
16
|
-
} from "../experimental/enums"
|
17
13
|
|
18
14
|
export type ProductDetailModalProps = {
|
19
15
|
id: string
|
@@ -49,6 +45,11 @@ export type BasketProductBundleParentClashConfirmationProps = {
|
|
49
45
|
bundleProduct: Product
|
50
46
|
childProducts: Product[]
|
51
47
|
}
|
48
|
+
export type BasketProductCPAClashConfirmationModalProps = {
|
49
|
+
itemsBeingClashed: (Product | Contract)[]
|
50
|
+
itemBeingAdded: Product | Contract
|
51
|
+
}
|
52
|
+
|
52
53
|
export type CampaignEditModalProps = {
|
53
54
|
campaign?: Campaign
|
54
55
|
}
|
@@ -92,9 +93,7 @@ export type FilePickerModalPropsActionData =
|
|
92
93
|
FilePickerModalPropsActionDataPostingRequirements
|
93
94
|
|
94
95
|
export type FilePickerModalProps = {
|
95
|
-
actionFor:
|
96
|
-
| FilePickerModalPropsActionFor
|
97
|
-
| ExperimentalFilePickerModalPropsActionFor
|
96
|
+
actionFor: FilePickerModalPropsActionFor
|
98
97
|
actionData?: FilePickerModalPropsActionData
|
99
98
|
}
|
100
99
|
|
@@ -109,6 +108,9 @@ export type ModalProps = AnyNonFunction<
|
|
109
108
|
| FilePickerModalProps
|
110
109
|
| BasketModalProps
|
111
110
|
| WalletModalProps
|
111
|
+
| BasketProductCPAClashConfirmationModalProps
|
112
|
+
| BasketProductBundleParentClashConfirmationModalProps
|
113
|
+
| BasketProductBundleParentClashConfirmationProps
|
112
114
|
>
|
113
115
|
|
114
116
|
export type ModalOptions = {
|
@@ -122,7 +124,7 @@ export type ModalOptions = {
|
|
122
124
|
|
123
125
|
export type Modal = {
|
124
126
|
zone: ModalZone
|
125
|
-
key: ModalKeys
|
127
|
+
key: ModalKeys
|
126
128
|
props: ModalProps | undefined
|
127
129
|
options: ModalOptions
|
128
130
|
}
|
@@ -4,9 +4,14 @@ import {
|
|
4
4
|
} from "../_window/service.types"
|
5
5
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
6
6
|
import { NestedValidatorKeys, UseValidatorResult } from "../common"
|
7
|
-
import {
|
7
|
+
import {
|
8
|
+
OrderJourneyStep,
|
9
|
+
OrderJourneyStepKeyType,
|
10
|
+
OrderJourneyUTMStepValidations,
|
11
|
+
} from "./types"
|
8
12
|
import { MessageDescriptor } from "react-intl"
|
9
13
|
import { OrderJourneyStepKey } from "./enums"
|
14
|
+
import { CampaignCreateForm, CampaignEditForm } from "../campaign"
|
10
15
|
|
11
16
|
export type OrderJourneyServiceSwitchToNextStepHandler = () => Promise<void>
|
12
17
|
export type OrderJourneyServiceSwitchToPreviousStepHandler = () => Promise<void>
|
@@ -26,6 +31,11 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
26
31
|
getStepValidators: (
|
27
32
|
stepKey: string | undefined,
|
28
33
|
) => NestedValidatorKeys | undefined
|
34
|
+
getValidationResultsOfStep: (stepKey: string) => any
|
35
|
+
getValidations: () => Record<
|
36
|
+
OrderJourneyStepKeyType,
|
37
|
+
UseValidatorResult
|
38
|
+
>
|
29
39
|
setOnboardingStep: (step: OrderJourneyStep) => UseValidatorResult
|
30
40
|
setSelectProductsStep: (step: OrderJourneyStep) => UseValidatorResult
|
31
41
|
setAddContractsStep: (step: OrderJourneyStep) => UseValidatorResult
|
@@ -58,13 +68,36 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
58
68
|
validators: NestedValidatorKeys,
|
59
69
|
replaceAsIs: boolean,
|
60
70
|
) => void
|
71
|
+
setProductStepsBlurredFields: (
|
72
|
+
fields: Record<string, Record<string, boolean>>,
|
73
|
+
) => Record<string, UseValidatorResult> | null
|
74
|
+
setProductStepsErrorMessages: (
|
75
|
+
messages: Record<
|
76
|
+
string,
|
77
|
+
Record<string, MessageDescriptor | boolean>
|
78
|
+
>,
|
79
|
+
) => void
|
80
|
+
setProductStepsSubmittedSteps: (
|
81
|
+
steps: Record<string, boolean>
|
82
|
+
) => void
|
83
|
+
setProductStepsValidators: (
|
84
|
+
validators: NestedValidatorKeys,
|
85
|
+
replaceAsIs: boolean,
|
86
|
+
) => void
|
87
|
+
setStepsAccordionsAreExpanded: (
|
88
|
+
expandedMap: Record<OrderJourneyStepKeyType, boolean>,
|
89
|
+
replaceAsIs: boolean,
|
90
|
+
) => void
|
61
91
|
|
62
92
|
getSetters: (
|
63
93
|
steps: Record<string, boolean>,
|
64
94
|
) => Record<string, (step: OrderJourneyStep) => any>
|
65
|
-
getData: (
|
66
|
-
|
67
|
-
|
95
|
+
getData: () => Record<string, Record<string, any>>
|
96
|
+
getDataOfStep: (stepKey: string) => Record<string, any>
|
97
|
+
getCampaignFormDataByStepKey: (
|
98
|
+
campaignForm: CampaignCreateForm | CampaignEditForm,
|
99
|
+
stepKey: OrderJourneyStepKeyType,
|
100
|
+
) => Record<string, any>
|
68
101
|
getSetBlurredFieldsAndSetSubmittedFunctions: (
|
69
102
|
stepKey: string | undefined,
|
70
103
|
) => {
|
@@ -17,7 +17,9 @@ import {
|
|
17
17
|
OrderJourneyOrderErrorsPostingDetailsURLs,
|
18
18
|
OrderJourneyOrderErrorsPostingDetailsWorkingLocation,
|
19
19
|
OrderJourneyOrderReviewStepData,
|
20
|
+
OrderJourneyProductStep,
|
20
21
|
OrderJourneyStep,
|
22
|
+
OrderJourneyStepKeyType,
|
21
23
|
OrderJourneyUTMStepData,
|
22
24
|
OrderJourneyUTMStepValidations,
|
23
25
|
} from "./types"
|
@@ -28,6 +30,8 @@ export type OrderJourneyState = {
|
|
28
30
|
stepsEnabled: (OrderJourneyStepKey | OrderJourneyStepKey[])[]
|
29
31
|
steps: (OrderJourneyStep | OrderJourneyStep[])[]
|
30
32
|
stepsAreGroups: boolean
|
33
|
+
stepsAccordionsShouldBeEnabled: boolean
|
34
|
+
stepsAccordionsAreExpanded: Record<OrderJourneyStepKeyType, boolean>
|
31
35
|
flattenedSteps: OrderJourneyStep[]
|
32
36
|
stepPreviousIndex: number
|
33
37
|
stepActiveIndex: number
|
@@ -36,6 +40,9 @@ export type OrderJourneyState = {
|
|
36
40
|
stepLastIndex: number
|
37
41
|
stepPrevious: OrderJourneyStep | null
|
38
42
|
stepActive: OrderJourneyStep | null
|
43
|
+
stepActiveGroup: OrderJourneyStep | OrderJourneyStep[] | null
|
44
|
+
stepActiveErrors: Record<OrderJourneyStepKeyType, UseValidatorResult | null> | null
|
45
|
+
stepActiveData: Record<OrderJourneyStepKeyType, any> | null
|
39
46
|
stepNext: OrderJourneyStep | null
|
40
47
|
stepsPopulatedAreHidden: boolean
|
41
48
|
stepIsSwitching: boolean
|
@@ -123,6 +130,17 @@ export type OrderJourneyState = {
|
|
123
130
|
Record<string, OrderJourneyChannelPostingRequirementsStepOptions>
|
124
131
|
>
|
125
132
|
contractStepsValidations: Record<string, UseValidatorResult> | null
|
133
|
+
/* Product Fields */
|
134
|
+
productSteps: OrderJourneyProductStep[]
|
135
|
+
productStepsBlurredFields: Record<string, Record<string, boolean>>
|
136
|
+
productStepsSubmittedSteps: Record<string, boolean>
|
137
|
+
productStepsErrorMessages: Record<
|
138
|
+
string,
|
139
|
+
Record<string, MessageDescriptor | MessageDescriptor[]>
|
140
|
+
>
|
141
|
+
productStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
142
|
+
productStepsData: Record<string, Record<string, any>>
|
143
|
+
productStepsValidations: Record<string, UseValidatorResult> | null
|
126
144
|
/* UTM Codes */
|
127
145
|
utmCodesStep: OrderJourneyStep
|
128
146
|
utmCodesStepData: OrderJourneyUTMStepData
|
package/orderJourney/types.ts
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
import { MessageDescriptor } from "react-intl"
|
2
2
|
import { OrderJourneyStepKey } from "./enums"
|
3
3
|
import {
|
4
|
-
PostingRequirementOption,
|
5
4
|
TransformedPostingRequirementOption,
|
6
5
|
UseValidatorResult,
|
7
6
|
} from "../common"
|
8
|
-
import { OrderJourneyProductStep } from "../experimental"
|
9
7
|
|
10
8
|
export type OrderJourneyStepBlurredFields = {
|
11
9
|
[k: string]:
|
@@ -31,6 +29,11 @@ export type OrderJourneyStep = {
|
|
31
29
|
errorMessagesIntlDescriptors?: OrderJourneyStepErrorMessages
|
32
30
|
}
|
33
31
|
|
32
|
+
export type OrderJourneyProductStep = Omit<
|
33
|
+
OrderJourneyStep,
|
34
|
+
"blurredFields" | "isSubmitted" | "errorMessagesIntlDescriptors"
|
35
|
+
>
|
36
|
+
|
34
37
|
export type OrderJourneyContractStep = Omit<
|
35
38
|
OrderJourneyStep,
|
36
39
|
"blurredFields" | "isSubmitted" | "errorMessagesIntlDescriptors"
|
@@ -3,6 +3,7 @@ import { WindowHapiUtils } from "../_window/utils.types"
|
|
3
3
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
4
4
|
import { Contract } from "../contract"
|
5
5
|
import { Product } from "../product"
|
6
|
+
import { OrderJourneyStep, OrderJourneyStepKeyType } from "./types"
|
6
7
|
|
7
8
|
export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
|
8
9
|
{
|
@@ -10,6 +11,17 @@ export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
|
|
10
11
|
paymentMethodKeys: typeof OrderJourneyPaymentMethod
|
11
12
|
orderJourneyGetContractIdFromContractStepKey: (key: string) => string
|
12
13
|
orderJourneyGetContractStepKey: (contractId: string) => string
|
14
|
+
orderJourneyGetStepKeyFromContractOrProductStepKey: (key: string) =>
|
15
|
+
| OrderJourneyStepKey.contractChannelPostingRequirements
|
16
|
+
| OrderJourneyStepKey.productChannelPostingRequirements
|
17
|
+
| undefined
|
18
|
+
getKeyFromStepKey: (
|
19
|
+
stepKey: OrderJourneyStepKeyType
|
20
|
+
) => OrderJourneyStepKey | undefined
|
21
|
+
getGroupOfStep: (
|
22
|
+
stepsOrStepsGroups: OrderJourneyStep[][],
|
23
|
+
stepKey: OrderJourneyStepKeyType,
|
24
|
+
) => OrderJourneyStep[] | undefined
|
13
25
|
updateProductUTMsFromBasketItemData: (
|
14
26
|
basketItemData: (Contract | Product)[],
|
15
27
|
) => void
|
package/package.json
CHANGED
package/product/api.types.ts
CHANGED
@@ -6,6 +6,9 @@ import {
|
|
6
6
|
ProductJobTitle,
|
7
7
|
ProductLocation,
|
8
8
|
ProductOrderDeliveryTime,
|
9
|
+
ProductSearchFiltersSuggestionCreateRequest,
|
10
|
+
ProductSearchFiltersSuggestionCreateRequestResponse,
|
11
|
+
ProductSearchFiltersSuggestionsGetRequestResponse,
|
9
12
|
ProductSupportingContractsComplete,
|
10
13
|
ProductSupportingContractsPartial,
|
11
14
|
ProductWithSupportForContractsFilters,
|
@@ -29,6 +32,10 @@ export type WindowHapiAPIProductConfigs = {
|
|
29
32
|
getJobTitles: AxiosRequestConfig
|
30
33
|
getLocations: AxiosRequestConfig
|
31
34
|
calculateDeliveryTime: AxiosRequestConfig
|
35
|
+
getPostingRequirements: AxiosRequestConfig
|
36
|
+
getPostingRequirementOptions: AxiosRequestConfig
|
37
|
+
getSuggestionOfSearchFilters: AxiosRequestConfig
|
38
|
+
createSuggestionOfSearchFilters: AxiosRequestConfig
|
32
39
|
}
|
33
40
|
export type WindowHapiAPIProductRequests = {
|
34
41
|
getProduct: (productId: number | string) => Promise<Product>
|
@@ -57,6 +64,20 @@ export type WindowHapiAPIProductRequests = {
|
|
57
64
|
calculateDeliveryTime: (
|
58
65
|
productIds: (string | number)[],
|
59
66
|
) => Promise<ProductOrderDeliveryTime>
|
67
|
+
getPostingRequirementOptions: (
|
68
|
+
productId: string,
|
69
|
+
fieldName: string,
|
70
|
+
autocompleteRequestOptions: Record<string, string | string[]>,
|
71
|
+
) => Promise<any>
|
72
|
+
getPostingRequirements: (
|
73
|
+
productId: string | number,
|
74
|
+
) => Promise<PostingRequirement[]>
|
75
|
+
getSuggestionOfSearchFilters: (
|
76
|
+
suggestionId: string,
|
77
|
+
) => Promise<ProductSearchFiltersSuggestionsGetRequestResponse>
|
78
|
+
createSuggestionOfSearchFilters: (
|
79
|
+
payload: ProductSearchFiltersSuggestionCreateRequest,
|
80
|
+
) => Promise<ProductSearchFiltersSuggestionCreateRequestResponse>
|
60
81
|
}
|
61
82
|
export type WindowHapiAPIProduct = WindowHapiModuleWithConstructorArgs<
|
62
83
|
WindowHapiAPIModule<
|
package/product/enums.ts
CHANGED
package/product/index.ts
CHANGED
package/product/index.ts.bak
CHANGED
package/product/service.types.ts
CHANGED
@@ -9,6 +9,8 @@ import {
|
|
9
9
|
ProductJobFunction,
|
10
10
|
ProductJobTitle,
|
11
11
|
ProductLocation,
|
12
|
+
ProductSearchFiltersSuggestionCreateRequestResponse,
|
13
|
+
ProductSearchFiltersSuggestionsGetRequestResponse,
|
12
14
|
ProductSupportingContractsComplete,
|
13
15
|
ProductSupportingContractsPartial,
|
14
16
|
} from "./types"
|
@@ -72,6 +74,22 @@ export type ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler = (
|
|
72
74
|
forceRefresh?: boolean,
|
73
75
|
) => Promise<ProductSupportingContractsComplete | undefined>
|
74
76
|
|
77
|
+
export type ProductServiceGetProductPostingRequirementsHandler = (
|
78
|
+
productId: string | number,
|
79
|
+
) => Promise<PostingRequirement[]>
|
80
|
+
export type ProductServiceGetProductPostingRequirementOptionsHandler = (
|
81
|
+
productId: string,
|
82
|
+
fieldName: string,
|
83
|
+
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
84
|
+
) => Promise<any>
|
85
|
+
export type ProductServiceCreateSuggestionOfSearchFiltersHandler = (
|
86
|
+
customDescription?: string,
|
87
|
+
customContextObject?: Record<string, any>,
|
88
|
+
) => Promise<ProductSearchFiltersSuggestionCreateRequestResponse>
|
89
|
+
export type ProductServiceGetSuggestionOfSearchFiltersHandler = (
|
90
|
+
taskId: string,
|
91
|
+
) => Promise<ProductSearchFiltersSuggestionsGetRequestResponse>
|
92
|
+
|
75
93
|
export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
|
76
94
|
{
|
77
95
|
loadMoreProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreProductsHandler>
|
@@ -89,6 +107,10 @@ export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
|
|
89
107
|
getJobFunctions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetJobFunctionsHandler>
|
90
108
|
getIndustries: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetIndustriesHandler>
|
91
109
|
getProductSupportingContractsFromCacheOrAPI: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler>
|
110
|
+
getProductPostingRequirements: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductPostingRequirementsHandler>
|
111
|
+
getProductPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductPostingRequirementOptionsHandler>
|
112
|
+
createSuggestionOfSearchFilters: HapiServiceFunctionWithLifecycleHooks<ProductServiceCreateSuggestionOfSearchFiltersHandler>
|
113
|
+
getSuggestionOfSearchFilters: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetSuggestionOfSearchFiltersHandler>
|
92
114
|
},
|
93
115
|
{ readonly service: WindowHapiService }
|
94
116
|
>
|
package/product/state.types.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
ProductJobFunction,
|
5
5
|
ProductJobTitle,
|
6
6
|
ProductLocation,
|
7
|
+
ProductSuggestionStatus,
|
7
8
|
ProductSupportingContractsPartial,
|
8
9
|
} from "./types"
|
9
10
|
import { PaginationResponseV1 } from "../common/types"
|
@@ -12,6 +13,7 @@ import {
|
|
12
13
|
ProductPriceCurrency,
|
13
14
|
ProductSortBy,
|
14
15
|
} from "./enums"
|
16
|
+
import { CampaignSuggestionStatus } from "../campaign"
|
15
17
|
|
16
18
|
export type ProductState = {
|
17
19
|
/* Products */
|
@@ -51,4 +53,13 @@ export type ProductState = {
|
|
51
53
|
searchTextInput: string
|
52
54
|
/* Product Type */
|
53
55
|
searchTypeFilterBy: ProductTypeFilterBy
|
56
|
+
/* Vacancy Fields Suggestions */
|
57
|
+
searchFiltersSuggestionsPollingIntervalsMap: Record<string, number>
|
58
|
+
searchFiltersSuggestionsPollingStatusMap: Record<
|
59
|
+
string,
|
60
|
+
{
|
61
|
+
createdAt: string
|
62
|
+
status: ProductSuggestionStatus
|
63
|
+
}
|
64
|
+
>
|
54
65
|
}
|