@vonq/hapi-elements-types 1.9.0 → 1.10.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 +5 -0
- package/_window/auth.types.ts +1 -0
- package/_window/events.types.ts +5 -4
- package/_window/instances.types.ts +2 -0
- package/_window/service.types.ts +1 -0
- package/_window/state.types.ts +4 -2
- package/_window/utils.types.ts +5 -4
- package/_window/window.ts +3 -0
- package/alert/enums.ts +1 -0
- package/alert/types.ts +3 -0
- package/ats/api.types.ts +8 -1
- package/ats/service.types.ts +8 -1
- package/ats/types.ts +14 -0
- package/basket/service.types.ts +3 -3
- package/basket/utils.types.ts +2 -0
- package/campaign/service.types.ts +1 -0
- package/campaign/types.ts +5 -3
- package/campaign/utils.types.ts +1 -3
- package/campaign/validations.types.ts +6 -4
- package/common/events/EventCommand/enums.ts +2 -1
- package/common/events/types.ts +1 -1
- package/contract/types.ts +3 -1
- package/modal/enums.ts +1 -0
- package/modal/types.ts +6 -1
- package/orderJourney/enums.ts +1 -1
- package/orderJourney/state.types.ts +0 -1
- package/orderJourney/types.ts +0 -5
- package/orderJourney/utils.types.ts +2 -0
- package/package.json +1 -1
- package/product/types.ts +1 -1
- package/product/validations.types.ts +2 -1
- package/theming/types.ts +1 -0
package/_window/api.types.ts
CHANGED
@@ -67,6 +67,11 @@ export type WindowHapiAPI = WindowHapiModuleWithConstructorArgs<
|
|
67
67
|
headers: RawAxiosRequestHeaders
|
68
68
|
setHeaders: (headers: RawAxiosRequestHeaders) => void
|
69
69
|
baseRequestConfig: RawAxiosRequestConfig<any>
|
70
|
+
makeDataRequest: (
|
71
|
+
method: "get" | "put" | "patch",
|
72
|
+
endpoint: string,
|
73
|
+
data?: any,
|
74
|
+
) => Promise<any>
|
70
75
|
[WindowHapiModuleName.contract]: WindowHapiAPIContract
|
71
76
|
[WindowHapiModuleName.wallet]: WindowHapiAPIWallet
|
72
77
|
[WindowHapiModuleName.product]: WindowHapiAPIProduct
|
package/_window/auth.types.ts
CHANGED
@@ -7,6 +7,7 @@ export type WindowHapiAuth = WindowHapiModuleWithConstructorArgs<
|
|
7
7
|
{
|
8
8
|
partnerId: string | undefined
|
9
9
|
clientId: string | undefined
|
10
|
+
partnerToken: string | undefined // used for impersonation
|
10
11
|
clientToken: string | undefined
|
11
12
|
},
|
12
13
|
{ readonly core: WindowHapiClassInterface }
|
package/_window/events.types.ts
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
import {
|
2
|
+
WindowHapiEventCommandData,
|
2
3
|
WindowHapiEventCommandNames,
|
3
4
|
WindowHapiEventCommandStatus,
|
4
|
-
WindowHapiEventCommandData,
|
5
5
|
} from "../common/events/EventCommand/types"
|
6
6
|
import {
|
7
|
+
WindowHapiEventCommand,
|
7
8
|
WindowHapiEventCommandCallbackHandler,
|
9
|
+
WindowHapiEventListener,
|
8
10
|
WindowHapiEventMediatorGetInstancesHandler,
|
9
11
|
WindowHapiEventMediatorInstances,
|
10
|
-
WindowHapiEventCommand,
|
11
12
|
WindowHapiEventStrategy,
|
12
|
-
WindowHapiEventListener,
|
13
13
|
} from "../common/events/types"
|
14
14
|
import {
|
15
|
-
WindowHapiModuleWithConstructorArgs,
|
16
15
|
WindowHapiClassInterface,
|
16
|
+
WindowHapiModuleWithConstructorArgs,
|
17
17
|
} from "./window"
|
18
18
|
import { WindowHapiSubmoduleName } from "../common/enums"
|
19
19
|
import { WindowHapiInstance } from "./instances.types"
|
@@ -145,6 +145,7 @@ export type WindowHapiEvents = WindowHapiModuleWithConstructorArgs<
|
|
145
145
|
eventServiceStrategy: WindowHapiEventStrategy
|
146
146
|
eventQAStrategy: WindowHapiEventStrategy
|
147
147
|
eventDOMStrategy: WindowHapiEventStrategy
|
148
|
+
eventConfigStrategy: WindowHapiEventStrategy
|
148
149
|
getInstances: () => {
|
149
150
|
source: WindowHapiInstance
|
150
151
|
targets: WindowHapiInstance[]
|
@@ -7,6 +7,7 @@ import { WindowHapiLogger } from "../common/logger/types"
|
|
7
7
|
export type WindowHapiInstances = WindowHapiModuleWithConstructorArgs<
|
8
8
|
{
|
9
9
|
instances: WindowHapiInstance[]
|
10
|
+
readyInstances: string[]
|
10
11
|
getFrameWindowByName: (name: string) => Window | undefined
|
11
12
|
hasInstance: (instanceName: string) => boolean
|
12
13
|
getInstanceByName: (
|
@@ -17,6 +18,7 @@ export type WindowHapiInstances = WindowHapiModuleWithConstructorArgs<
|
|
17
18
|
removeInstance: (instanceName: string) => void
|
18
19
|
onAfterAddInstance: (instance: WindowHapiInstance) => void
|
19
20
|
onAfterRemoveInstance: (instance: WindowHapiInstance) => void
|
21
|
+
setInstanceReadyByName: (instanceName: string, isReady: boolean) => void
|
20
22
|
},
|
21
23
|
{ readonly core: WindowHapiClassInterface }
|
22
24
|
>
|
package/_window/service.types.ts
CHANGED
package/_window/state.types.ts
CHANGED
@@ -43,6 +43,7 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
|
43
43
|
[WindowHapiModuleName.ats]: WindowHapiStateModule<ATSState>
|
44
44
|
basePropertiesThatShouldNotBeDocumented: string[]
|
45
45
|
handleDefaultStateFromQueryParams: (params: string | string[]) => void
|
46
|
+
onBeforeStateChange: () => void
|
46
47
|
onAfterStateChange: () => void
|
47
48
|
stores: {
|
48
49
|
alert: WindowHapiStateModule<AlertState>
|
@@ -78,11 +79,12 @@ export type WindowHapiStatesJSON = {
|
|
78
79
|
[WindowHapiModuleName.ats]: ATSState
|
79
80
|
}
|
80
81
|
|
81
|
-
export type WindowHapiStateBase = {
|
82
|
+
export type WindowHapiStateBase<T> = {
|
82
83
|
propertiesThatShouldNotBeDocumented: string[]
|
83
84
|
__elementsStateModuleName: string
|
84
85
|
toJSON: any
|
85
86
|
addClassPropertiesObserver: () => void
|
87
|
+
validations: StateValidations<T>
|
86
88
|
}
|
87
89
|
|
88
90
|
export type HapiStateValueWithListener<T> = {
|
@@ -90,7 +92,7 @@ export type HapiStateValueWithListener<T> = {
|
|
90
92
|
value: T
|
91
93
|
}
|
92
94
|
|
93
|
-
export type WindowHapiStateModule<T> = WindowHapiStateBase & {
|
95
|
+
export type WindowHapiStateModule<T> = WindowHapiStateBase<T> & {
|
94
96
|
[P in keyof T]:
|
95
97
|
| T[P]
|
96
98
|
| HapiStateValueWithListener<T[P]>
|
package/_window/utils.types.ts
CHANGED
@@ -8,14 +8,15 @@ import {
|
|
8
8
|
WindowHapiModuleWithConstructorArgs,
|
9
9
|
WindowHapiClassInterface,
|
10
10
|
} from "./window"
|
11
|
+
import { RecursivePartial } from "../common"
|
11
12
|
|
12
13
|
export type WindowHapiUtils = WindowHapiModuleWithConstructorArgs<
|
13
14
|
{
|
14
15
|
isObject: (item: any) => boolean
|
15
|
-
mergeDeepOverwriteArrays: (
|
16
|
-
original:
|
17
|
-
overwrites:
|
18
|
-
) =>
|
16
|
+
mergeDeepOverwriteArrays: <T>(
|
17
|
+
original: T,
|
18
|
+
overwrites: RecursivePartial<T>,
|
19
|
+
) => T
|
19
20
|
getComponentNameIndexSuffix: (instanceName: string) => string
|
20
21
|
getIframeLoadingSpinner: () => HTMLDivElement
|
21
22
|
product: WindowHapiUtilsProduct
|
package/_window/window.ts
CHANGED
@@ -85,10 +85,12 @@ export type WindowHapiConfigSubmodule = {
|
|
85
85
|
apiHost: string
|
86
86
|
initialState: RecursivePartial<any>
|
87
87
|
partnerId: string
|
88
|
+
partnerToken: string
|
88
89
|
clientId: string
|
89
90
|
clientToken: string
|
90
91
|
loadingSpinnerDefaultFillColor: string
|
91
92
|
appOrigin: string
|
93
|
+
docsOrigin: string
|
92
94
|
enableLogs: boolean
|
93
95
|
webComponents: HapiWebComponent[]
|
94
96
|
isInvalidToken: boolean
|
@@ -122,6 +124,7 @@ export type WindowHapiClassInterface = {
|
|
122
124
|
instance: WindowHapiInstance
|
123
125
|
qa: WindowHapiQASubmodule
|
124
126
|
isProduction: boolean
|
127
|
+
enableLogs: boolean
|
125
128
|
}
|
126
129
|
|
127
130
|
export type WindowHapi = {
|
package/alert/enums.ts
CHANGED
@@ -5,6 +5,7 @@ export enum AlertKey {
|
|
5
5
|
contractCreateSuccess = "contract-created",
|
6
6
|
contractGroupCreateSuccess = "contract-group-created",
|
7
7
|
campaignTakeOfflineSuccess = "campaign-take-offline-success",
|
8
|
+
"campaignCopyContractWarning" = "campaign-copy-contract-warning",
|
8
9
|
campaignOrderSuccess = "campaign-order-success",
|
9
10
|
campaignCopySuccess = "campaign-copy-success",
|
10
11
|
buttonCopySuccess = "copy-button-success",
|
package/alert/types.ts
CHANGED
@@ -36,6 +36,8 @@ export type CampaignOrderSuccessAlertProps = {}
|
|
36
36
|
|
37
37
|
export type CampaignCopySuccessAlertProps = {}
|
38
38
|
|
39
|
+
export type DiscardedContractsDuringCampaignCopyAlertProps = {}
|
40
|
+
|
39
41
|
export type CampaignTakeOfflineSuccessAlertProps = {}
|
40
42
|
|
41
43
|
export type ProductAddToBasketSuccessAlertProps = {}
|
@@ -44,6 +46,7 @@ export type ProductRemoveFromBasketWarningAlertProps = {}
|
|
44
46
|
|
45
47
|
export type AlertProps = AnyNonFunction<
|
46
48
|
| ContractCreateSuccessAlertProps
|
49
|
+
| DiscardedContractsDuringCampaignCopyAlertProps
|
47
50
|
| ContractRemoveSuccessAlertProps
|
48
51
|
| ContractGroupCreateSuccessAlertProps
|
49
52
|
| BackendErrorMessageAlertProps
|
package/ats/api.types.ts
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
import { AxiosRequestConfig } from "axios/index"
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
ATSDataResponse,
|
4
|
+
ATSMessage,
|
5
|
+
ATSSettings,
|
6
|
+
ATSUserTokenResponse,
|
7
|
+
} from "./types"
|
3
8
|
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
4
9
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
5
10
|
|
@@ -13,6 +18,8 @@ export type WindowHapiAPIATSRequests = {
|
|
13
18
|
getUserSettings: () => Promise<ATSSettings>
|
14
19
|
refreshJWTToken: () => Promise<ATSUserTokenResponse>
|
15
20
|
validateJWTToken: () => Promise<boolean>
|
21
|
+
getMessages: () => Promise<ATSMessage[]>
|
22
|
+
sendMessage: (ticket: ATSMessage) => Promise<ATSMessage[]>
|
16
23
|
}
|
17
24
|
export type WindowHapiAPIATS = WindowHapiModuleWithConstructorArgs<
|
18
25
|
WindowHapiAPIModule<WindowHapiAPIATSRequests, WindowHapiAPIATSConfigs>,
|
package/ats/service.types.ts
CHANGED
@@ -2,16 +2,23 @@ import {
|
|
2
2
|
HapiServiceFunctionWithLifecycleHooks,
|
3
3
|
WindowHapiService,
|
4
4
|
} from "../_window/service.types"
|
5
|
-
import { ATSSettings } from "./types"
|
5
|
+
import { ATSMessage, ATSSettings } from "./types"
|
6
6
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
7
7
|
|
8
8
|
export type ATSServiceGetUserSettingsHandler = () => Promise<
|
9
9
|
ATSSettings | undefined
|
10
10
|
>
|
11
|
+
export type ATSServiceGetMessagesHandler = () => Promise<ATSMessage[]>
|
12
|
+
|
13
|
+
export type ATSServiceSendMessageHandler = (
|
14
|
+
message: ATSMessage,
|
15
|
+
) => Promise<ATSMessage[]>
|
11
16
|
|
12
17
|
export type WindowHapiServiceATS = WindowHapiModuleWithConstructorArgs<
|
13
18
|
{
|
14
19
|
getUserSettings: HapiServiceFunctionWithLifecycleHooks<ATSServiceGetUserSettingsHandler>
|
20
|
+
getMessages: HapiServiceFunctionWithLifecycleHooks<ATSServiceGetMessagesHandler>
|
21
|
+
sendMessage: HapiServiceFunctionWithLifecycleHooks<ATSServiceSendMessageHandler>
|
15
22
|
},
|
16
23
|
{ readonly service: WindowHapiService }
|
17
24
|
>
|
package/ats/types.ts
CHANGED
@@ -25,3 +25,17 @@ export type ATSSettings = {
|
|
25
25
|
export type ATSUserTokenResponse = {
|
26
26
|
token: string
|
27
27
|
}
|
28
|
+
|
29
|
+
export type ATSMessage = {
|
30
|
+
id?: string
|
31
|
+
sender: "ats" | "vonq"
|
32
|
+
createdAt?: string
|
33
|
+
message: string
|
34
|
+
}
|
35
|
+
|
36
|
+
export type ATSDataResponse = {
|
37
|
+
data: {
|
38
|
+
messages: ATSMessage[]
|
39
|
+
}
|
40
|
+
type: "elements"
|
41
|
+
}
|
package/basket/service.types.ts
CHANGED
@@ -7,9 +7,9 @@ import {
|
|
7
7
|
} from "../_window/service.types"
|
8
8
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
9
9
|
|
10
|
-
export type BasketServiceGetProductsHandler = (
|
11
|
-
|
12
|
-
>
|
10
|
+
export type BasketServiceGetProductsHandler = (
|
11
|
+
products?: BasketProduct[],
|
12
|
+
) => Promise<(Product | Contract)[]>
|
13
13
|
export type BasketServiceAddProductOrContractByIdHandler = (
|
14
14
|
contractOrProductId: string,
|
15
15
|
isProduct: boolean,
|
package/basket/utils.types.ts
CHANGED
@@ -12,6 +12,7 @@ import {
|
|
12
12
|
getBasketProductBoardType,
|
13
13
|
getConflictingContractsWithDifferentGroupsInBasket,
|
14
14
|
} from "../../common/basket/utils"
|
15
|
+
import { Campaign, CampaignCreateForm } from "../campaign"
|
15
16
|
|
16
17
|
export type WindowHapiUtilsBasket = WindowHapiModuleWithConstructorArgs<
|
17
18
|
{
|
@@ -41,6 +42,7 @@ export type WindowHapiUtilsBasket = WindowHapiModuleWithConstructorArgs<
|
|
41
42
|
contract: Contract,
|
42
43
|
basketProducts: (Contract | Product)[],
|
43
44
|
) => (Product | Contract)[]
|
45
|
+
getBasketProductMetaFromCampaignForm: (form: Campaign) => any[]
|
44
46
|
},
|
45
47
|
{ readonly utils: WindowHapiUtils }
|
46
48
|
>
|
@@ -31,6 +31,7 @@ export type CampaignServiceGetSenioritiesHandler = () => Promise<
|
|
31
31
|
export type CampaignServiceOrderCampaignHandler = () => Promise<Campaign>
|
32
32
|
export type CampaignServiceCopyCampaignHandler = (
|
33
33
|
campaign: Campaign,
|
34
|
+
withExistingProducts: boolean,
|
34
35
|
) => Promise<Campaign>
|
35
36
|
|
36
37
|
export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
|
package/campaign/types.ts
CHANGED
@@ -117,6 +117,7 @@ export type Campaign = {
|
|
117
117
|
campaignName: string | null
|
118
118
|
companyId: string
|
119
119
|
createdOn: string
|
120
|
+
poNumber: string | null
|
120
121
|
customerId: string
|
121
122
|
orderReference: string | null
|
122
123
|
orderedProducts: string[]
|
@@ -141,7 +142,7 @@ export type CampaignCreateFormTargetGroupIndustry = ProductIndustry
|
|
141
142
|
|
142
143
|
export type CampaignCreateFormTargetGroupJobCategory = {
|
143
144
|
label: string
|
144
|
-
value: number
|
145
|
+
value: number | string
|
145
146
|
}
|
146
147
|
|
147
148
|
export type CampaignCreateFormTargetGroup = {
|
@@ -162,6 +163,7 @@ export type CampaignCreateFormOrderedProductSpec =
|
|
162
163
|
|
163
164
|
export type CampaignCreateForm = {
|
164
165
|
companyId: string
|
166
|
+
currency: ProductPriceCurrency
|
165
167
|
campaignName?: string | null
|
166
168
|
poNumber: string | null
|
167
169
|
paymentMethod: OrderJourneyPaymentMethod | null
|
@@ -215,12 +217,12 @@ export type TaxonomyEducationLevelName = CampaignTaxonomyNameWithLanguage
|
|
215
217
|
export type TaxonomySeniorityName = CampaignTaxonomyNameWithLanguage
|
216
218
|
|
217
219
|
export type TaxonomySeniority = {
|
218
|
-
id: number
|
220
|
+
id: number | string
|
219
221
|
name: TaxonomySeniorityName[]
|
220
222
|
}
|
221
223
|
|
222
224
|
export type TaxonomyEducationAndSeniorityLevel = {
|
223
|
-
id: number
|
225
|
+
id: number | string
|
224
226
|
name: TaxonomyEducationLevelName[]
|
225
227
|
}
|
226
228
|
|
package/campaign/utils.types.ts
CHANGED
@@ -26,9 +26,7 @@ export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
|
26
26
|
campaign: Partial<Campaign>,
|
27
27
|
) => void
|
28
28
|
getOrderCampaignRequestBody: () => CampaignOrderRequestBody
|
29
|
-
getCopyCampaignRequestBody: (
|
30
|
-
campaign: Campaign,
|
31
|
-
) => CampaignOrderRequestBody
|
29
|
+
getCopyCampaignRequestBody: (campaign: Campaign) => CampaignCreateForm
|
32
30
|
getPostBodyValuesForTargetGroupProperty: (
|
33
31
|
selectValue:
|
34
32
|
| CampaignCreateFormTargetGroupEducationLevel[]
|
@@ -87,13 +87,13 @@ export type ZodCampaignTaxonomyNameWithLanguage = ZodObject<{
|
|
87
87
|
value: ZodString
|
88
88
|
}>
|
89
89
|
export type ZodCampaignTaxonomyEducationLevel = ZodObject<{
|
90
|
-
id: ZodNumber
|
90
|
+
id: ZodUnion<[ZodNumber, ZodString]>
|
91
91
|
name: ZodArray<ZodCampaignTaxonomyNameWithLanguage>
|
92
92
|
}>
|
93
93
|
export type ZodCampaignTaxonomyEducationLevels =
|
94
94
|
ZodArray<ZodCampaignTaxonomyEducationLevel>
|
95
95
|
export type ZodCampaignTaxonomySeniority = ZodObject<{
|
96
|
-
id: ZodNumber
|
96
|
+
id: ZodUnion<[ZodNumber, ZodString]>
|
97
97
|
name: ZodArray<ZodCampaignTaxonomyNameWithLanguage>
|
98
98
|
}>
|
99
99
|
export type ZodCampaignTaxonomySeniorities =
|
@@ -165,11 +165,13 @@ export type ZodCampaignCreateFormPostingDetails = ZodObject<{
|
|
165
165
|
export type ZodCampaignCreateFormTargetGroup = ZodObject<{
|
166
166
|
educationLevel: ZodCampaignTaxonomyEducationLevels
|
167
167
|
seniority: ZodCampaignTaxonomySeniorities
|
168
|
-
industry: ZodArray<
|
168
|
+
industry: ZodArray<
|
169
|
+
ZodObject<{ id: ZodUnion<[ZodNumber, ZodString]>; name: ZodString }>
|
170
|
+
>
|
169
171
|
jobCategory: ZodArray<
|
170
172
|
ZodObject<{
|
171
173
|
label: ZodString
|
172
|
-
value: ZodNumber
|
174
|
+
value: ZodUnion<[ZodNumber, ZodString]>
|
173
175
|
}>
|
174
176
|
>
|
175
177
|
}>
|
@@ -1,6 +1,5 @@
|
|
1
1
|
export enum WindowHapiEventCommandName {
|
2
2
|
/* State */
|
3
|
-
stateLoad = "state:load",
|
4
3
|
stateHydrate = "state:hydrate",
|
5
4
|
|
6
5
|
/* Service */
|
@@ -14,11 +13,13 @@ export enum WindowHapiEventCommandName {
|
|
14
13
|
|
15
14
|
/* Config */
|
16
15
|
configSetPartnerId = "config:partnerId",
|
16
|
+
configSetPartnerToken = "config:partnerToken", // used for impersonation purposes
|
17
17
|
configSetClientId = "config:clientId",
|
18
18
|
configSetAreLogsEnabled = "config:areLogsEnabled",
|
19
19
|
|
20
20
|
/* App */
|
21
21
|
appLoad = "app:load",
|
22
|
+
appReady = "app:ready",
|
22
23
|
|
23
24
|
/* API */
|
24
25
|
apiRequest = "api:request",
|
package/common/events/types.ts
CHANGED
@@ -36,7 +36,7 @@ export type WindowHapiEventCommand = {
|
|
36
36
|
|
37
37
|
export type WindowHapiEventCommandCallbackHandler = (
|
38
38
|
data: any,
|
39
|
-
event: WindowHapiEventCommand,
|
39
|
+
event: WindowHapiEventCommand | WindowHapiEventListener,
|
40
40
|
) => void
|
41
41
|
export type WindowHapiEventCommandCommitHandler = (
|
42
42
|
...args: any[]
|
package/contract/types.ts
CHANGED
@@ -5,13 +5,15 @@ export type ContractProduct = {
|
|
5
5
|
title: string
|
6
6
|
}
|
7
7
|
|
8
|
+
export type ContractCredentialOption = { key: string; label: string }
|
9
|
+
|
8
10
|
export type ContractCredential = {
|
9
11
|
description?: string | null
|
10
12
|
label: string
|
11
13
|
name: string
|
12
14
|
sort: string
|
13
15
|
url: string | null
|
14
|
-
options:
|
16
|
+
options: ContractCredentialOption[] | null
|
15
17
|
}
|
16
18
|
|
17
19
|
export type ContractFacet = {}
|
package/modal/enums.ts
CHANGED
@@ -9,6 +9,7 @@ export enum ModalKeys {
|
|
9
9
|
productInfo = "product-info",
|
10
10
|
campaignTakeOfflineConfirmation = "campaign-confirm-take-offline",
|
11
11
|
campaignCopyConfirmation = "campaign-confirm-copy",
|
12
|
+
campaignCopySelection = "contract-copy-selection",
|
12
13
|
basketRemoveProductConfirmation = "remove-product-from-basket",
|
13
14
|
contractRemoveConfirmation = "contract-remove-confirmation",
|
14
15
|
contractGroupConflictInfo = "contract-group-conflict-info",
|
package/modal/types.ts
CHANGED
@@ -2,7 +2,7 @@ import { Product } from "../product/types"
|
|
2
2
|
import { Contract } from "../contract/types"
|
3
3
|
import { ModalKeys, ModalZone } from "./enums"
|
4
4
|
import { AnyNonFunction } from "../common/types"
|
5
|
-
import { TransformedPostingRequirement } from "../campaign"
|
5
|
+
import { Campaign, TransformedPostingRequirement } from "../campaign"
|
6
6
|
|
7
7
|
export type ProductDetailModalProps = {
|
8
8
|
id: string
|
@@ -17,6 +17,10 @@ export type ContractGroupConflictInfoModalProps = {
|
|
17
17
|
contract: Contract
|
18
18
|
conflictingContracts: Contract[]
|
19
19
|
}
|
20
|
+
export type CampaignCopySelectionModalProps = {
|
21
|
+
products: (Product | Contract)[]
|
22
|
+
campaign: Campaign
|
23
|
+
}
|
20
24
|
export type ContractPostingRequirementsSmartFillResponseModalProps = {
|
21
25
|
response: Record<string, any>
|
22
26
|
postingRequirements: Record<string, TransformedPostingRequirement>
|
@@ -45,6 +49,7 @@ export type ModalProps = AnyNonFunction<
|
|
45
49
|
|
46
50
|
export type ModalOptions = {
|
47
51
|
showCloseButton?: boolean
|
52
|
+
showBottomCloseButton?: boolean
|
48
53
|
showBackdrop?: boolean
|
49
54
|
unstyled?: boolean
|
50
55
|
disableVerticalScroll?: boolean
|
package/orderJourney/enums.ts
CHANGED
@@ -82,7 +82,6 @@ export type OrderJourneyState = {
|
|
82
82
|
string,
|
83
83
|
Record<string, MessageDescriptor>
|
84
84
|
>
|
85
|
-
contractStepsHideFields: Record<string, boolean>
|
86
85
|
contractStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
87
86
|
contractStepsData: Record<string, Record<string, any>>
|
88
87
|
contractStepsValidations: Record<string, UseValidatorResult> | null
|
package/orderJourney/types.ts
CHANGED
@@ -16,10 +16,6 @@ export type OrderJourneyStepErrorMessages = {
|
|
16
16
|
| Record<string, MessageDescriptor | OrderJourneyStepErrorMessage>
|
17
17
|
}
|
18
18
|
|
19
|
-
export type OrderJourneyStepHideFields = {
|
20
|
-
[k: string]: boolean | Record<string, boolean | OrderJourneyStepHideFields>
|
21
|
-
}
|
22
|
-
|
23
19
|
export type OrderJourneyStepKeyType = OrderJourneyStepKey | string
|
24
20
|
export type OrderJourneyStep = {
|
25
21
|
key: OrderJourneyStepKeyType
|
@@ -28,7 +24,6 @@ export type OrderJourneyStep = {
|
|
28
24
|
isSubmitted?: boolean
|
29
25
|
blurredFields?: OrderJourneyStepBlurredFields
|
30
26
|
errorMessagesIntlDescriptors?: OrderJourneyStepErrorMessages
|
31
|
-
hideFields?: OrderJourneyStepHideFields
|
32
27
|
}
|
33
28
|
|
34
29
|
export type OrderJourneyContractStep = Omit<
|
@@ -3,11 +3,13 @@ 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 { orderJourneyGetContractIdFromContractStepKey } from "../../common/orderJourney/utils"
|
6
7
|
|
7
8
|
export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
|
8
9
|
{
|
9
10
|
stepKeys: typeof OrderJourneyStepKey
|
10
11
|
paymentMethodKeys: typeof OrderJourneyPaymentMethod
|
12
|
+
orderJourneyGetContractIdFromContractStepKey: (key: string) => string
|
11
13
|
updateProductUTMsFromBasketItemData: (
|
12
14
|
basketItemData: (Contract | Product)[],
|
13
15
|
) => void
|
package/package.json
CHANGED
package/product/types.ts
CHANGED
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
ZodObject,
|
8
8
|
ZodOptional,
|
9
9
|
ZodString,
|
10
|
+
ZodUnion,
|
10
11
|
} from "zod"
|
11
12
|
import { ProductPriceCurrency } from "./enums"
|
12
13
|
import { ZodPaginationResponseV1 } from "../common/validations.types"
|
@@ -30,7 +31,7 @@ export type ZodProductDuration = ZodObject<{
|
|
30
31
|
}>
|
31
32
|
|
32
33
|
export type ZodProductIndustry = ZodObject<{
|
33
|
-
id: ZodNumber
|
34
|
+
id: ZodUnion<[ZodNumber, ZodString]>
|
34
35
|
name: ZodString
|
35
36
|
}>
|
36
37
|
export type ZodProductIndustries = ZodArray<ZodProductIndustry>
|