@vonq/hapi-elements-types 1.4.0 → 1.5.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/enums.ts +41 -0
- package/package.json +5 -7
- package/src/_window/api.types.ts +59 -0
- package/src/_window/auth.types.ts +11 -0
- package/src/_window/config.types.ts +30 -0
- package/src/_window/events.types.ts +157 -0
- package/src/_window/index.ts +16 -0
- package/src/_window/instances.types.ts +18 -0
- package/src/_window/qa.types.ts +28 -0
- package/src/_window/routing.types.ts +21 -0
- package/src/_window/sdk.types.ts +147 -0
- package/src/_window/service.types.ts +67 -0
- package/src/_window/state.types.ts +112 -0
- package/src/_window/ui.types.ts +13 -0
- package/src/_window/utils.types.ts +34 -0
- package/src/_window/validation.types.ts +43 -0
- package/src/_window/window.ts +56 -0
- package/src/alert/enums.ts +22 -0
- package/src/alert/functions.types.ts +13 -0
- package/src/alert/index.ts +9 -0
- package/src/alert/service.types.ts +15 -0
- package/src/alert/state.initial.ts +16 -0
- package/src/alert/state.types.ts +27 -0
- package/src/alert/state.validations.ts +11 -0
- package/src/alert/types.ts +63 -0
- package/src/ats/api.types.ts +16 -0
- package/src/ats/functions.types.ts +7 -0
- package/src/ats/index.ts +9 -0
- package/src/ats/service.types.ts +17 -0
- package/src/ats/state.initial.ts +5 -0
- package/src/ats/state.types.ts +5 -0
- package/src/ats/state.validations.ts +6 -0
- package/src/ats/types.ts +19 -0
- package/src/basket/consts.ts +1 -0
- package/src/basket/functions.types.ts +40 -0
- package/src/basket/index.ts +12 -0
- package/src/basket/service.types.ts +32 -0
- package/src/basket/state.initial.ts +11 -0
- package/src/basket/state.types.ts +34 -0
- package/src/basket/state.validations.ts +12 -0
- package/src/basket/types.ts +4 -0
- package/src/basket/utils.ts +79 -0
- package/src/basket/utils.types.ts +10 -0
- package/src/basket/validations.types.ts +25 -0
- package/src/campaign/api.types.ts +45 -0
- package/src/campaign/consts.ts +1 -0
- package/src/campaign/enums.ts +17 -0
- package/src/campaign/functions.types.ts +90 -0
- package/src/campaign/index.ts +15 -0
- package/src/campaign/qa.types.ts +12 -0
- package/src/campaign/service.types.ts +48 -0
- package/src/campaign/state.initial.ts +84 -0
- package/src/campaign/state.types.ts +55 -0
- package/src/campaign/state.validations.ts +16 -0
- package/src/campaign/types.ts +237 -0
- package/src/campaign/utils.ts +53 -0
- package/src/campaign/utils.types.ts +59 -0
- package/src/campaign/validations.types.ts +215 -0
- package/src/common/LocalStorage.ts +123 -0
- package/src/common/browser.ts +2 -0
- package/src/common/color.ts +9 -0
- package/src/common/events/EventCommand/enums.ts +49 -0
- package/src/common/events/EventCommand/index.ts +4 -0
- package/src/common/events/EventCommand/types.ts +18 -0
- package/src/common/events/index.ts +4 -0
- package/src/common/events/types.ts +52 -0
- package/src/common/immutable.ts +28 -0
- package/src/common/index.ts +22 -0
- package/src/common/instances/Instance.ts +13 -0
- package/src/common/instances/consts.ts +1 -0
- package/src/common/instances/index.ts +4 -0
- package/src/common/json.ts +25 -0
- package/src/common/logger/Logger.ts +70 -0
- package/src/common/logger/enums.ts +12 -0
- package/src/common/logger/index.ts +5 -0
- package/src/common/logger/types.ts +7 -0
- package/src/common/logger-datadog/LoggerDatadog.ts +42 -0
- package/src/common/logger-datadog/index.ts +3 -0
- package/src/common/misc.ts +114 -0
- package/src/common/promise.ts +161 -0
- package/src/common/proxy.ts +77 -0
- package/src/common/qa.types.ts +9 -0
- package/src/common/regExTest.ts +12 -0
- package/src/common/tree.ts +148 -0
- package/src/common/types.ts +110 -0
- package/src/common/utm.ts +19 -0
- package/src/common/validations.types.ts +89 -0
- package/src/common/validators.ts +21 -0
- package/src/common/webComponents.ts +26 -0
- package/src/config/functions.types.ts +23 -0
- package/src/config/index.ts +5 -0
- package/src/config/state.initial.ts +11 -0
- package/src/config/state.types.ts +15 -0
- package/src/consts.ts +980 -0
- package/src/contract/api.types.ts +47 -0
- package/src/contract/consts.ts +1 -0
- package/src/contract/functions.types.ts +112 -0
- package/src/contract/index.ts +14 -0
- package/src/contract/qa.types.ts +12 -0
- package/src/contract/service.types.ts +54 -0
- package/src/contract/state.initial.ts +39 -0
- package/src/contract/state.types.ts +74 -0
- package/src/contract/state.validations.ts +21 -0
- package/src/contract/types.ts +145 -0
- package/src/contract/utils.ts +36 -0
- package/src/contract/utils.types.ts +11 -0
- package/src/contract/validations.types.ts +104 -0
- package/src/debugging/functions.types.ts +34 -0
- package/src/debugging/index.ts +6 -0
- package/src/debugging/state.initial.ts +10 -0
- package/src/debugging/state.types.ts +18 -0
- package/src/debugging/state.validations.ts +10 -0
- package/src/index.ts +22 -0
- package/src/language/consts.ts +6 -0
- package/src/language/en.ts +530 -0
- package/src/language/functions.types.ts +29 -0
- package/src/language/index.ts +11 -0
- package/src/language/qa.types.ts +19 -0
- package/src/language/state.initial.ts +13 -0
- package/src/language/state.types.ts +25 -0
- package/src/language/state.validations.ts +10 -0
- package/src/language/utils.ts +17 -0
- package/src/language/validations.types.ts +13 -0
- package/src/modal/consts.ts +6 -0
- package/src/modal/enums.ts +14 -0
- package/src/modal/functions.types.ts +22 -0
- package/src/modal/index.ts +11 -0
- package/src/modal/service.types.ts +32 -0
- package/src/modal/state.initial.ts +9 -0
- package/src/modal/state.types.ts +8 -0
- package/src/modal/state.validations.ts +6 -0
- package/src/modal/store.types.ts +5 -0
- package/src/modal/types.ts +44 -0
- package/src/orderJourney/consts.ts +289 -0
- package/src/orderJourney/enums.ts +25 -0
- package/src/orderJourney/functions.types.ts +140 -0
- package/src/orderJourney/index.ts +13 -0
- package/src/orderJourney/qa.types.ts +16 -0
- package/src/orderJourney/state.initial.ts +401 -0
- package/src/orderJourney/state.types.ts +99 -0
- package/src/orderJourney/state.validations.ts +78 -0
- package/src/orderJourney/types.ts +31 -0
- package/src/orderJourney/utils.ts +7 -0
- package/src/orderJourney/utils.types.ts +11 -0
- package/src/orderJourney/validations.types.ts +34 -0
- package/src/product/api.types.ts +62 -0
- package/src/product/consts.ts +1 -0
- package/src/product/enums.ts +11 -0
- package/src/product/functions.types.ts +156 -0
- package/src/product/index.ts +14 -0
- package/src/product/qa.types.ts +11 -0
- package/src/product/service.types.ts +68 -0
- package/src/product/state.initial.ts +28 -0
- package/src/product/state.types.ts +93 -0
- package/src/product/state.validations.ts +25 -0
- package/src/product/types.ts +161 -0
- package/src/product/utils.types.ts +22 -0
- package/src/product/validations.types.ts +189 -0
- package/src/routing/functions.types.ts +48 -0
- package/src/routing/index.ts +5 -0
- package/src/routing/state.initial.ts +10 -0
- package/src/routing/state.types.ts +30 -0
- package/src/theming/consts.ts +7727 -0
- package/src/theming/functions.types.ts +13 -0
- package/src/theming/index.ts +11 -0
- package/src/theming/qa.types.ts +11 -0
- package/src/theming/state.initial.ts +16 -0
- package/src/theming/state.types.ts +6 -0
- package/src/theming/state.validations.ts +8 -0
- package/src/theming/types.ts +123 -0
- package/src/theming/utils.ts +581 -0
- package/src/theming/validations.types.ts +62 -0
- package/src/types.ts +229 -0
- package/src/ui/index.ts +3 -0
- package/src/ui/service.types.ts +26 -0
- package/src/utils.ts +3 -0
- package/src/wallet/api.types.ts +33 -0
- package/src/wallet/consts.ts +3 -0
- package/src/wallet/functions.types.ts +58 -0
- package/src/wallet/index.ts +11 -0
- package/src/wallet/service.types.ts +26 -0
- package/src/wallet/state.initial.ts +18 -0
- package/src/wallet/state.types.ts +58 -0
- package/src/wallet/state.validations.ts +18 -0
- package/src/wallet/types.ts +65 -0
- package/src/wallet/validations.types.ts +18 -0
- package/tsconfig.json +41 -0
- package/index.d.ts +0 -5207
@@ -0,0 +1,29 @@
|
|
1
|
+
import { MessageDescriptor } from "react-intl"
|
2
|
+
import { LanguageStoreTranslations } from "./state.types"
|
3
|
+
import { ProductPriceCurrency } from "../product/enums"
|
4
|
+
|
5
|
+
export type LanguageStoreFormatMessageHandler = (
|
6
|
+
isDebuggingEnabled: boolean,
|
7
|
+
message: MessageDescriptor,
|
8
|
+
values?: Record<string, any>,
|
9
|
+
) => any
|
10
|
+
export type LanguageStoreSetIntlInstanceHandler = (
|
11
|
+
locale: string,
|
12
|
+
messages: Record<string, string>,
|
13
|
+
) => void
|
14
|
+
export type LanguageStoreGetTranslationsHandler = (
|
15
|
+
locale: string,
|
16
|
+
) => LanguageStoreTranslations
|
17
|
+
export type LanguageStoreSetLocaleHandler = (locale: string) => void
|
18
|
+
export type LanguageStoreSetTranslationsHandler = (
|
19
|
+
translations: LanguageStoreTranslations,
|
20
|
+
) => void
|
21
|
+
export type LanguageStoreSetDisplayCurrencyHandler = (
|
22
|
+
currency: ProductPriceCurrency,
|
23
|
+
) => void
|
24
|
+
export type LanguageStoreFunctions = {
|
25
|
+
formatMessage: LanguageStoreFormatMessageHandler
|
26
|
+
setTranslations: LanguageStoreSetTranslationsHandler
|
27
|
+
setLocale: LanguageStoreSetLocaleHandler
|
28
|
+
setDisplayCurrency: LanguageStoreSetDisplayCurrencyHandler
|
29
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// created from 'create-ts-index'
|
2
|
+
|
3
|
+
export * from './consts';
|
4
|
+
export * from './en';
|
5
|
+
export * from './functions.types';
|
6
|
+
export * from './qa.types';
|
7
|
+
export * from './state.initial';
|
8
|
+
export * from './state.types';
|
9
|
+
export * from './state.validations';
|
10
|
+
export * from './utils';
|
11
|
+
export * from './validations.types';
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ProductPriceCurrency } from "../product/enums"
|
2
|
+
import { LanguageStoreTranslations } from "./state.types"
|
3
|
+
import { ModuleWithConstructorArgs } from "../types"
|
4
|
+
import { WindowHapiQA } from "../_window/qa.types"
|
5
|
+
|
6
|
+
export type WindowHapiQALanguage = ModuleWithConstructorArgs<
|
7
|
+
{
|
8
|
+
setLocale: (locale: string) => string
|
9
|
+
setDisplayCurrency: (
|
10
|
+
currency: ProductPriceCurrency,
|
11
|
+
) => ProductPriceCurrency
|
12
|
+
setTranslationByLocaleAndKey: (
|
13
|
+
locale: string,
|
14
|
+
key: string,
|
15
|
+
message: string,
|
16
|
+
) => LanguageStoreTranslations
|
17
|
+
},
|
18
|
+
{ readonly qa: WindowHapiQA }
|
19
|
+
>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { LanguageStoreState } from "./state.types"
|
2
|
+
import { LOCALES_DATA } from "./consts"
|
3
|
+
import { ProductPriceCurrency } from "../product/enums"
|
4
|
+
|
5
|
+
const locale = "en"
|
6
|
+
const translations = LOCALES_DATA
|
7
|
+
|
8
|
+
export const initialLanguageStoreState: LanguageStoreState = {
|
9
|
+
locale,
|
10
|
+
translations: translations,
|
11
|
+
displayCurrency: ProductPriceCurrency.USD,
|
12
|
+
supportedCurrencies: Object.values(ProductPriceCurrency),
|
13
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ProductPriceCurrency } from "../product/enums"
|
2
|
+
|
3
|
+
export type LanguageStoreLocaleTranslations = Record<string, string>
|
4
|
+
export type LanguageStoreTranslations = Record<
|
5
|
+
string,
|
6
|
+
LanguageStoreLocaleTranslations
|
7
|
+
>
|
8
|
+
export type LanguageStoreState = {
|
9
|
+
/**
|
10
|
+
* Locale of the user (navigator language) in RFC 5646 that can be changed via setLocale function
|
11
|
+
*/
|
12
|
+
locale: string
|
13
|
+
/**
|
14
|
+
* An object containing key-value parts where the key is the i18n key such as `test.example-string` and the value is the actual translation. Translations will be loaded by current locale and fallbacks will be used from American English defaults we have.
|
15
|
+
*/
|
16
|
+
translations: LanguageStoreTranslations
|
17
|
+
/**
|
18
|
+
* Current Display Currency of all the widgets
|
19
|
+
*/
|
20
|
+
displayCurrency: ProductPriceCurrency
|
21
|
+
/**
|
22
|
+
* Array of supported currencies. **This value changes automatically when user scrolls and should not be set from outside**
|
23
|
+
*/
|
24
|
+
supportedCurrencies: ProductPriceCurrency[]
|
25
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { LanguageStoreState } from "./state.types"
|
2
|
+
import { StateValidations } from "../_window/state.types"
|
3
|
+
|
4
|
+
export const languageStoreStateValidations: StateValidations<LanguageStoreState> =
|
5
|
+
{
|
6
|
+
locale: "common.genericString",
|
7
|
+
translations: "language.translations",
|
8
|
+
displayCurrency: "language.displayCurrency",
|
9
|
+
supportedCurrencies: "throwHasNoSetterError",
|
10
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { createIntl, createIntlCache } from "react-intl"
|
2
|
+
|
3
|
+
export const getIntlInstance = (
|
4
|
+
locale: string,
|
5
|
+
messages: Record<string, string>,
|
6
|
+
) => {
|
7
|
+
const cache = createIntlCache()
|
8
|
+
const intl = createIntl(
|
9
|
+
{
|
10
|
+
locale,
|
11
|
+
messages,
|
12
|
+
},
|
13
|
+
cache,
|
14
|
+
)
|
15
|
+
|
16
|
+
return intl
|
17
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ZodRecord, ZodString } from "zod"
|
2
|
+
import { ProductPriceCurrency } from "../product/enums"
|
3
|
+
|
4
|
+
export type ZodTranslations = ZodRecord<
|
5
|
+
ZodString,
|
6
|
+
ZodRecord<ZodString, ZodString>
|
7
|
+
>
|
8
|
+
export type WindowHapiValidationsLanguage = {
|
9
|
+
translations: ZodTranslations
|
10
|
+
supportedCurrencies: ProductPriceCurrency[]
|
11
|
+
supportedCurrenciesRegex: RegExp
|
12
|
+
displayCurrency: ZodString
|
13
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export enum ModalZone {
|
2
|
+
"primary" = "primary",
|
3
|
+
"secondary" = "secondary",
|
4
|
+
}
|
5
|
+
|
6
|
+
export enum ModalKeys {
|
7
|
+
wallet = "layout-wallet-modal",
|
8
|
+
basket = "layout-basket-modal",
|
9
|
+
productInfo = "product-info",
|
10
|
+
campaignTakeOfflineConfirmation = "campaign-confirm-take-offline",
|
11
|
+
campaignCopyConfirmation = "campaign-confirm-copy",
|
12
|
+
basketRemoveProductConfirmation = "remove-product-from-basket",
|
13
|
+
contractRemoveConfirmation = "contract-remove-confirmation",
|
14
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ModalKeys, ModalZone } from "./enums"
|
2
|
+
import { ModalOptions, ModalProps } from "./types"
|
3
|
+
|
4
|
+
export type ModalStoreOpenModalHandler = (
|
5
|
+
key: ModalKeys,
|
6
|
+
props: ModalProps | undefined,
|
7
|
+
options?: ModalOptions,
|
8
|
+
zone?: ModalZone,
|
9
|
+
) => void
|
10
|
+
|
11
|
+
export type ModalStoreCloseModalHandler = (key: ModalKeys) => void
|
12
|
+
|
13
|
+
export type ModalStoreFunctions = {
|
14
|
+
/**
|
15
|
+
* Shows a modal component by key on target layer
|
16
|
+
*/
|
17
|
+
openModal: ModalStoreOpenModalHandler
|
18
|
+
/**
|
19
|
+
* Hides a modal component by key
|
20
|
+
*/
|
21
|
+
closeModal: ModalStoreCloseModalHandler
|
22
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// created from 'create-ts-index'
|
2
|
+
|
3
|
+
export * from './consts';
|
4
|
+
export * from './enums';
|
5
|
+
export * from './functions.types';
|
6
|
+
export * from './service.types';
|
7
|
+
export * from './state.initial';
|
8
|
+
export * from './state.types';
|
9
|
+
export * from './state.validations';
|
10
|
+
export * from './store.types';
|
11
|
+
export * from './types';
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { ModalOptions } from "./types"
|
2
|
+
import { ModalKeys, ModalZone } from "./enums"
|
3
|
+
import { Product } from "../product/types"
|
4
|
+
import { Contract } from "../contract/types"
|
5
|
+
import { IObservableValue } from "mobx"
|
6
|
+
import { AnyNonFunction } from "../common/types"
|
7
|
+
import { ModuleWithConstructorArgs } from "../types"
|
8
|
+
import { WindowHapiService } from "../_window/service.types"
|
9
|
+
|
10
|
+
export type WindowHapiServiceModal = ModuleWithConstructorArgs<
|
11
|
+
{
|
12
|
+
openModal: (
|
13
|
+
key: ModalKeys,
|
14
|
+
props: AnyNonFunction<
|
15
|
+
| { product: Product }
|
16
|
+
| {
|
17
|
+
onClickAccept: (
|
18
|
+
productOrContract: Product | Contract,
|
19
|
+
) => void
|
20
|
+
onClickDecline: () => void
|
21
|
+
basketProduct: Product | Contract
|
22
|
+
}
|
23
|
+
| { campaignId: string }
|
24
|
+
| { partnerId?: IObservableValue<string> }
|
25
|
+
>,
|
26
|
+
options?: ModalOptions,
|
27
|
+
zone?: ModalZone,
|
28
|
+
) => void
|
29
|
+
closeModal: (key: ModalKeys) => void
|
30
|
+
},
|
31
|
+
{ readonly service: WindowHapiService }
|
32
|
+
>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { Product } from "../product/types"
|
2
|
+
import { Contract } from "../contract/types"
|
3
|
+
import { ModalKeys, ModalZone } from "./enums"
|
4
|
+
import { AnyNonFunction } from "../common/types"
|
5
|
+
|
6
|
+
export type ProductDetailModalProps = {
|
7
|
+
id: string
|
8
|
+
}
|
9
|
+
export type UTMCodesModalProps = {}
|
10
|
+
export type BasketRemoveProductConfirmationModalProps = {
|
11
|
+
basketProduct: Product | Contract
|
12
|
+
}
|
13
|
+
export type CampaignTakeOfflineConfirmationModalProps = { campaignId: string }
|
14
|
+
export type ContractRemoveConfirmationModalProps = { contractId: string }
|
15
|
+
export type BasketModalProps = {}
|
16
|
+
export type WalletModalProps = {}
|
17
|
+
|
18
|
+
export type ModalProps = AnyNonFunction<
|
19
|
+
| ProductDetailModalProps
|
20
|
+
| UTMCodesModalProps
|
21
|
+
| BasketRemoveProductConfirmationModalProps
|
22
|
+
| CampaignTakeOfflineConfirmationModalProps
|
23
|
+
| ContractRemoveConfirmationModalProps
|
24
|
+
| BasketModalProps
|
25
|
+
| WalletModalProps
|
26
|
+
>
|
27
|
+
|
28
|
+
export type ModalOptions = {
|
29
|
+
showCloseButton?: boolean
|
30
|
+
showBackdrop?: boolean
|
31
|
+
disableVerticalScroll?: boolean
|
32
|
+
}
|
33
|
+
|
34
|
+
export type Modal = {
|
35
|
+
zone: ModalZone
|
36
|
+
key: ModalKeys
|
37
|
+
props: ModalProps | undefined
|
38
|
+
options: ModalOptions
|
39
|
+
}
|
40
|
+
|
41
|
+
export type Modals = {
|
42
|
+
[ModalZone.primary]: Modal | null
|
43
|
+
[ModalZone.secondary]: Modal | null
|
44
|
+
}
|
@@ -0,0 +1,289 @@
|
|
1
|
+
import {
|
2
|
+
ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
3
|
+
ERROR_MESSAGE_SHOULD_BE_EMAIL,
|
4
|
+
ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO,
|
5
|
+
ERROR_MESSAGE_SHOULD_BE_URL,
|
6
|
+
} from "../consts"
|
7
|
+
import { OrderJourneyStepKey } from "./enums"
|
8
|
+
import { NestedValidatorKeys } from "../common/types"
|
9
|
+
|
10
|
+
/* Get Recommendations Step (User Journey) */
|
11
|
+
export const orderJourneySearchRecommendProductsBlurredFields = {
|
12
|
+
"productStore.jobTitlesIdsSelected": false,
|
13
|
+
"productStore.jobFunctionsIdsSelected": false,
|
14
|
+
"productStore.jobRegionsIdsSelected": false,
|
15
|
+
}
|
16
|
+
export const orderJourneysearchRecommendProductsErrorMessages = {
|
17
|
+
"productStore.jobTitlesIdsSelected": ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
18
|
+
"productStore.jobFunctionsIdsSelected": ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
19
|
+
"productStore.jobRegionsIdsSelected": ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
20
|
+
}
|
21
|
+
export const orderJourneySearchRecommendProductsValidators: NestedValidatorKeys =
|
22
|
+
{
|
23
|
+
"productStore.jobTitlesIdsSelected": "isNotEmpty",
|
24
|
+
"productStore.jobFunctionsIdsSelected": "isNotEmpty",
|
25
|
+
"productStore.jobRegionsIdsSelected": "isNotEmpty",
|
26
|
+
}
|
27
|
+
export const orderJourneySearchRecommendProductsHideFields = {
|
28
|
+
"productStore.jobTitlesIdsSelected": false,
|
29
|
+
"productStore.jobFunctionsIdsSelected": false,
|
30
|
+
"productStore.jobRegionsIdsSelected": false,
|
31
|
+
}
|
32
|
+
/* Select Products Step (User Journey) */
|
33
|
+
export const orderJourneySelectProductsStepErrorMessages = {
|
34
|
+
"basketStore.products": {
|
35
|
+
id: "campaign.select-channels.no-items-in-basket",
|
36
|
+
defaultMessage:
|
37
|
+
"You need at least one product or a contract added to campaign in order to proceed",
|
38
|
+
},
|
39
|
+
}
|
40
|
+
export const orderJourneySelectProductsBlurredFields = {}
|
41
|
+
export const orderJourneySelectProductsStepValidators: NestedValidatorKeys = {}
|
42
|
+
/* Add Contracts Step */
|
43
|
+
export const orderJourneyAddContractsErrorMessages = {}
|
44
|
+
export const orderJourneyAddContractsValidators = {}
|
45
|
+
export const orderJourneyAddContractsBlurredFields = {}
|
46
|
+
/* Select Contracts Step */
|
47
|
+
export const orderJourneySelectContractsErrorMessages = {}
|
48
|
+
export const orderJourneySelectContractsValidators = {}
|
49
|
+
export const orderJourneySelectContractsBlurredFields = {}
|
50
|
+
|
51
|
+
/* Basket Summary Step */
|
52
|
+
export const orderJourneyBasketSummaryValidators: NestedValidatorKeys = {
|
53
|
+
"basketStore.products": "isNotEmpty",
|
54
|
+
}
|
55
|
+
export const orderJourneyJBasketSummaryErrorMessages = {
|
56
|
+
"basketStore.products": {
|
57
|
+
id: "campaign.select-channels.no-items-in-basket",
|
58
|
+
defaultMessage:
|
59
|
+
"You need at least one product or a contract added to campaign in order to proceed",
|
60
|
+
},
|
61
|
+
}
|
62
|
+
export const orderJourneyBasketSummaryBlurredFields = {}
|
63
|
+
|
64
|
+
/* Target Group Step (Create Campaign Form) */
|
65
|
+
export const orderJourneyTargetGroupStepErrorMessages = {
|
66
|
+
educationLevel: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
67
|
+
seniority: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
68
|
+
industry: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
69
|
+
jobCategory: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
70
|
+
}
|
71
|
+
export const orderJourneyTargetGroupStepValidators: NestedValidatorKeys = {
|
72
|
+
educationLevel: "isNotEmpty",
|
73
|
+
seniority: "isNotEmpty",
|
74
|
+
industry: "isNotEmpty",
|
75
|
+
jobCategory: "isNotEmpty",
|
76
|
+
}
|
77
|
+
export const orderJourneyTargetGroupStepBlurredFields = {
|
78
|
+
educationLevel: false,
|
79
|
+
seniority: false,
|
80
|
+
industry: false,
|
81
|
+
jobCategory: false,
|
82
|
+
}
|
83
|
+
export const orderJourneyTargetGroupStepHideFields = {
|
84
|
+
educationLevel: false,
|
85
|
+
seniority: false,
|
86
|
+
industry: false,
|
87
|
+
jobCategory: false,
|
88
|
+
}
|
89
|
+
/* Recruiter Info Step (Create Campaign Form) */
|
90
|
+
export const orderJourneyRecruiterInfoStepErrorMessages = {
|
91
|
+
name: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
92
|
+
emailAddress: ERROR_MESSAGE_SHOULD_BE_EMAIL,
|
93
|
+
}
|
94
|
+
export const orderJourneyRecruiterInfoStepValidators: NestedValidatorKeys = {
|
95
|
+
name: "isNotEmpty",
|
96
|
+
//emailAddress: "isEmail", //Not required by IGB
|
97
|
+
}
|
98
|
+
export const orderJourneyRecruiterInfoStepBlurredFields = {
|
99
|
+
name: false,
|
100
|
+
emailAddress: false,
|
101
|
+
}
|
102
|
+
export const orderJourneyRecruiterInfoStepHideFields = {
|
103
|
+
name: false,
|
104
|
+
emailAddress: false,
|
105
|
+
}
|
106
|
+
/* Posting Details Step (Create Campaign Form) */
|
107
|
+
export const orderJourneyPostingDetailsStepErrorMessages = {
|
108
|
+
title: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
109
|
+
description: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
110
|
+
// yearsOfExperience: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO, //Not required by IGB
|
111
|
+
employmentType: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
112
|
+
weeklyWorkingHours: {
|
113
|
+
// from: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO, //Not required by IGB
|
114
|
+
to: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO,
|
115
|
+
},
|
116
|
+
salaryIndication: {
|
117
|
+
period: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
118
|
+
range: {
|
119
|
+
// from: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO, //Not required by IGB
|
120
|
+
to: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO,
|
121
|
+
currency: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
122
|
+
},
|
123
|
+
},
|
124
|
+
}
|
125
|
+
export const orderJourneyPostingDetailsStepValidators: NestedValidatorKeys = {
|
126
|
+
title: "isNotEmpty",
|
127
|
+
description: "isNotEmpty",
|
128
|
+
// yearsOfExperience: "isNotZero", //Not required by IGB
|
129
|
+
employmentType: "isNotEmpty",
|
130
|
+
weeklyWorkingHours: {
|
131
|
+
// from: "isNotZero", //Not required by IGB
|
132
|
+
to: "isNotZero",
|
133
|
+
},
|
134
|
+
salaryIndication: {
|
135
|
+
period: "isNotEmpty",
|
136
|
+
range: {
|
137
|
+
// from: "isNotZero", //Not required by IGB
|
138
|
+
to: "isNotZero",
|
139
|
+
currency: "isNotEmpty",
|
140
|
+
},
|
141
|
+
},
|
142
|
+
}
|
143
|
+
export const orderJourneyPostingDetailsStepBlurredFields = {
|
144
|
+
title: false,
|
145
|
+
description: false,
|
146
|
+
yearsOfExperience: false,
|
147
|
+
employmentType: false,
|
148
|
+
weeklyWorkingHours: {
|
149
|
+
from: false,
|
150
|
+
to: false,
|
151
|
+
},
|
152
|
+
salaryIndication: {
|
153
|
+
period: false,
|
154
|
+
range: {
|
155
|
+
from: false,
|
156
|
+
to: false,
|
157
|
+
currency: false,
|
158
|
+
},
|
159
|
+
},
|
160
|
+
campaignName: false,
|
161
|
+
}
|
162
|
+
export const orderJourneyPostingDetailsStepHideFields = {
|
163
|
+
title: false,
|
164
|
+
description: false,
|
165
|
+
yearsOfExperience: false,
|
166
|
+
employmentType: false,
|
167
|
+
"weeklyWorkingHours.from": false,
|
168
|
+
"weeklyWorkingHours.to": false,
|
169
|
+
"salaryIndication.period": false,
|
170
|
+
"salaryIndication.range.from": false,
|
171
|
+
"salaryIndication.range.to": false,
|
172
|
+
"salaryIndication.range.currency": false,
|
173
|
+
campaignName: false,
|
174
|
+
}
|
175
|
+
/* Organization Step (Create Campaign Form) */
|
176
|
+
export const orderJourneyOrganizationStepErrorMessages = {
|
177
|
+
name: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
178
|
+
companyLogo: ERROR_MESSAGE_SHOULD_BE_URL,
|
179
|
+
}
|
180
|
+
export const orderJourneyOrganizationStepValidators: NestedValidatorKeys = {
|
181
|
+
name: "isNotEmpty",
|
182
|
+
companyLogo: "isURL",
|
183
|
+
}
|
184
|
+
export const orderJourneyOrganizationStepBlurredFields = {
|
185
|
+
name: false,
|
186
|
+
companyLogo: false,
|
187
|
+
}
|
188
|
+
export const orderJourneyOrganizationStepHideFields = {
|
189
|
+
name: false,
|
190
|
+
companyLogo: false,
|
191
|
+
}
|
192
|
+
/* Contact Info Step (Create Campaign Form) */
|
193
|
+
export const orderJourneyContactInfoStepErrorMessages = {}
|
194
|
+
export const orderJourneyContactInfoStepValidators: NestedValidatorKeys = {}
|
195
|
+
export const orderJourneyContactInfoStepBlurredFields = {
|
196
|
+
name: false,
|
197
|
+
emailAddress: false,
|
198
|
+
phoneNumber: false,
|
199
|
+
}
|
200
|
+
export const orderJourneyContactInfoStepHideFields = {
|
201
|
+
name: false,
|
202
|
+
emailAddress: false,
|
203
|
+
phoneNumber: false,
|
204
|
+
}
|
205
|
+
/* Working Location Step (Create Campaign Form) */
|
206
|
+
export const orderJourneyWorkingLocationStepErrorMessages = {
|
207
|
+
addressLine1: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
208
|
+
// addressLine2: ERROR_MESSAGE_CANNOT_BE_EMPTY, //Not required by IGB
|
209
|
+
postcode: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
210
|
+
city: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
211
|
+
country: ERROR_MESSAGE_CANNOT_BE_EMPTY,
|
212
|
+
}
|
213
|
+
export const orderJourneyWorkingLocationStepValidators: NestedValidatorKeys = {
|
214
|
+
addressLine1: "isNotEmpty",
|
215
|
+
// addressLine2: "isNotEmpty", //Not required by IGB
|
216
|
+
postcode: "isNotEmpty",
|
217
|
+
city: "isNotEmpty",
|
218
|
+
country: "isNotEmpty",
|
219
|
+
}
|
220
|
+
export const orderJourneyWorkingLocationStepBlurredFields = {
|
221
|
+
addressLine1: false,
|
222
|
+
addressLine2: false,
|
223
|
+
postcode: false,
|
224
|
+
city: false,
|
225
|
+
country: false,
|
226
|
+
allowsRemoteWork: false,
|
227
|
+
}
|
228
|
+
export const orderJourneyWorkingLocationStepHideFields = {
|
229
|
+
addressLine1: false,
|
230
|
+
addressLine2: false,
|
231
|
+
postcode: false,
|
232
|
+
city: false,
|
233
|
+
country: false,
|
234
|
+
allowsRemoteWork: false,
|
235
|
+
}
|
236
|
+
/* URLs Step (Create Campaign Form) */
|
237
|
+
export const orderJourneyURLsStepErrorMessages = {
|
238
|
+
jobPageUrl: ERROR_MESSAGE_SHOULD_BE_URL,
|
239
|
+
applicationUrl: ERROR_MESSAGE_SHOULD_BE_URL,
|
240
|
+
}
|
241
|
+
export const orderJourneyURLsStepValidators: NestedValidatorKeys = {
|
242
|
+
jobPageUrl: "isURL",
|
243
|
+
applicationUrl: "isURL",
|
244
|
+
}
|
245
|
+
export const orderJourneyURLsStepBlurredFields = {
|
246
|
+
jobPageUrl: false,
|
247
|
+
applicationUrl: false,
|
248
|
+
}
|
249
|
+
export const orderJourneyURLsStepHideFields = {
|
250
|
+
jobPageUrl: false,
|
251
|
+
applicationUrl: false,
|
252
|
+
}
|
253
|
+
/* UTM Codes */
|
254
|
+
export const orderJourneyUTMCodesStepErrorMessages = {}
|
255
|
+
export const orderJourneyUTMCodesStepValidators: NestedValidatorKeys = {}
|
256
|
+
export const orderJourneyUTMCodesStepBlurredFields = {}
|
257
|
+
/* Order Review */
|
258
|
+
export const orderJourneyOrderReviewStepErrorMessages = {}
|
259
|
+
export const orderJourneyOrderReviewStepValidators: NestedValidatorKeys = {}
|
260
|
+
export const orderJourneyOrderReviewStepBlurredFields = {}
|
261
|
+
/* Payment Method */
|
262
|
+
export const orderJourneyPaymentMethodStepErrorMessages = {}
|
263
|
+
export const orderJourneyPaymentMethodStepValidators: NestedValidatorKeys = {}
|
264
|
+
export const orderJourneyPaymentMethodStepBlurredFields = {}
|
265
|
+
/* Order Confirmation */
|
266
|
+
export const orderJourneyOrderConfirmationStepErrorMessages = {}
|
267
|
+
export const orderJourneyOrderConfirmationStepValidators: NestedValidatorKeys =
|
268
|
+
{}
|
269
|
+
export const orderJourneyOrderConfirmationStepBlurredFields = {}
|
270
|
+
|
271
|
+
export const orderJourneyDefaultEnabledSteps = [
|
272
|
+
OrderJourneyStepKey.searchRecommendProducts,
|
273
|
+
OrderJourneyStepKey.selectProducts,
|
274
|
+
OrderJourneyStepKey.addContracts,
|
275
|
+
OrderJourneyStepKey.selectContracts,
|
276
|
+
OrderJourneyStepKey.basketSummary,
|
277
|
+
OrderJourneyStepKey.targetGroup,
|
278
|
+
OrderJourneyStepKey.recruiterInfo,
|
279
|
+
OrderJourneyStepKey.postingDetails,
|
280
|
+
OrderJourneyStepKey.postingOrganization,
|
281
|
+
OrderJourneyStepKey.postingContactInfo,
|
282
|
+
OrderJourneyStepKey.postingWorkingLocation,
|
283
|
+
OrderJourneyStepKey.postingURLs,
|
284
|
+
OrderJourneyStepKey.contractChannelPostingRequirements,
|
285
|
+
OrderJourneyStepKey.postingUTMCodes,
|
286
|
+
OrderJourneyStepKey.orderReview,
|
287
|
+
OrderJourneyStepKey.paymentMethod,
|
288
|
+
OrderJourneyStepKey.orderConfirmation,
|
289
|
+
]
|
@@ -0,0 +1,25 @@
|
|
1
|
+
export enum OrderJourneyStepKey {
|
2
|
+
searchRecommendProducts = "search-recommend-products",
|
3
|
+
selectProducts = "select-products",
|
4
|
+
addContracts = "add-contracts",
|
5
|
+
selectContracts = "select-contracts",
|
6
|
+
basketSummary = "basket-summary",
|
7
|
+
targetGroup = "target-group",
|
8
|
+
recruiterInfo = "recruiter-info",
|
9
|
+
postingDetails = "posting-details",
|
10
|
+
postingOrganization = "posting-organization",
|
11
|
+
postingContactInfo = "posting-contact-info",
|
12
|
+
postingWorkingLocation = "posting-working-location",
|
13
|
+
postingURLs = "posting-urls",
|
14
|
+
contractChannelPostingRequirements = "contract-channel-posting-requirements",
|
15
|
+
postingUTMCodes = "posting-utm-codes",
|
16
|
+
orderReview = "order-review",
|
17
|
+
paymentMethod = "payment-method",
|
18
|
+
orderConfirmation = "order-confirmation",
|
19
|
+
}
|
20
|
+
|
21
|
+
export enum OrderJourneyPaymentMethod {
|
22
|
+
atsManaged = "ats-managed",
|
23
|
+
wallet = "wallet",
|
24
|
+
purchaseOrder = "purchase-order",
|
25
|
+
}
|