@orchestrator-ui/orchestrator-ui-components 0.11.1 → 0.12.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/.turbo/turbo-build.log +4 -4
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +9 -9
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +34 -17
- package/dist/index.js +84 -77
- package/package.json +1 -1
- package/src/api/index.ts +12 -18
- package/src/components/WfoForms/CreateForm.tsx +1 -1
- package/src/components/WfoForms/index.ts +1 -1
- package/src/hooks/useQueryWithFetch.ts +7 -2
- package/src/pages/startPage/WfoStartPage.tsx +1 -1
- package/src/types/index.ts +1 -0
- package/src/utils/string.spec.ts +37 -1
- package/src/utils/strings.ts +9 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @orchestrator-ui/orchestrator-ui-components@0.
|
|
2
|
+
> @orchestrator-ui/orchestrator-ui-components@0.12.0 build
|
|
3
3
|
> tsup src/index.ts --format esm --dts --tsconfig tsconfig.build.json
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.js [22m[32m2.15 MB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
14
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m120.
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 767ms
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 11712ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m120.96 KB[39m
|
package/.turbo/turbo-lint.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
|
|
2
|
-
> @orchestrator-ui/orchestrator-ui-components@0.
|
|
2
|
+
> @orchestrator-ui/orchestrator-ui-components@0.12.0 test
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
5
|
PASS Orchestrator UI Components Tests src/pages/processes/timelineUtils.spec.ts
|
|
6
6
|
PASS Orchestrator UI Components Tests src/utils/date.spec.ts
|
|
7
7
|
PASS Orchestrator UI Components Tests src/components/WfoForms/formFields/utils.spec.ts
|
|
8
8
|
PASS Orchestrator UI Components Tests src/components/WfoSubscription/utils/utils.spec.ts
|
|
9
|
+
PASS Orchestrator UI Components Tests src/utils/string.spec.ts
|
|
9
10
|
PASS Orchestrator UI Components Tests src/utils/getProductNamesFromProcess.spec.ts
|
|
11
|
+
PASS Orchestrator UI Components Tests src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts
|
|
10
12
|
PASS Orchestrator UI Components Tests src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts
|
|
11
13
|
PASS Orchestrator UI Components Tests src/components/WfoTree/treeUtils.spec.ts
|
|
12
|
-
PASS Orchestrator UI Components Tests src/components/WfoTable/utils/tableConfigPersistence.spec.ts
|
|
13
|
-
PASS Orchestrator UI Components Tests src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts
|
|
14
|
-
PASS Orchestrator UI Components Tests src/utils/string.spec.ts
|
|
15
14
|
PASS Orchestrator UI Components Tests src/components/WfoTable/utils/tableUtils.spec.ts
|
|
16
15
|
PASS Orchestrator UI Components Tests src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts
|
|
16
|
+
PASS Orchestrator UI Components Tests src/components/WfoTable/utils/tableConfigPersistence.spec.ts
|
|
17
17
|
PASS Orchestrator UI Components Tests src/messages/getTranslationMessages.spec.ts
|
|
18
|
-
PASS Orchestrator UI Components Tests src/utils/getToastMessage.spec.ts
|
|
19
18
|
PASS Orchestrator UI Components Tests src/components/WfoTable/utils/columns.spec.ts
|
|
20
|
-
PASS Orchestrator UI Components Tests src/
|
|
19
|
+
PASS Orchestrator UI Components Tests src/utils/getToastMessage.spec.ts
|
|
21
20
|
PASS Orchestrator UI Components Tests src/utils/sortObjectKeys.spec.ts
|
|
22
21
|
PASS Orchestrator UI Components Tests src/utils/getTokenName.spec.ts
|
|
22
|
+
PASS Orchestrator UI Components Tests src/components/WfoWorkflowSteps/stepListUtils.spec.ts
|
|
23
23
|
PASS Orchestrator UI Components Tests src/utils/environmentVariables.spec.ts
|
|
24
24
|
PASS Orchestrator UI Components Tests src/utils/uuid.spec.ts
|
|
25
25
|
PASS Orchestrator UI Components Tests src/utils/getTypedFieldFromObject.spec.ts
|
|
26
|
-
PASS Orchestrator UI Components Tests src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts
|
|
27
26
|
PASS Orchestrator UI Components Tests src/utils/getQueryVariablesForExport.spec.ts
|
|
27
|
+
PASS Orchestrator UI Components Tests src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts
|
|
28
28
|
|
|
29
29
|
Test Suites: 23 passed, 23 total
|
|
30
|
-
Tests:
|
|
30
|
+
Tests: 141 passed, 141 total
|
|
31
31
|
Snapshots: 0 total
|
|
32
|
-
Time: 4.
|
|
32
|
+
Time: 4.392 s
|
|
33
33
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @orchestrator-ui/orchestrator-ui-components
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5efb8b0: #821 Reverted FORMS_ENPOINT string, removed cimStartForm, added new string utils
|
|
8
|
+
#833 Small change to useQueryWithFetch for the default sending level
|
|
9
|
+
|
|
3
10
|
## 0.11.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,25 @@ import { Reducer, Slice, PayloadAction, EnhancedStore, Dispatch, UnknownAction }
|
|
|
36
36
|
import { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
|
|
37
37
|
export { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
|
|
38
38
|
|
|
39
|
+
interface ValidationError {
|
|
40
|
+
input_type: string;
|
|
41
|
+
loc: (string | number)[];
|
|
42
|
+
msg: string;
|
|
43
|
+
type: string;
|
|
44
|
+
ctx?: ValidationErrorContext;
|
|
45
|
+
}
|
|
46
|
+
interface ValidationErrorContext {
|
|
47
|
+
[index: string]: string;
|
|
48
|
+
}
|
|
49
|
+
interface Form {
|
|
50
|
+
stepUserInput?: JSONSchema6;
|
|
51
|
+
hasNext?: boolean;
|
|
52
|
+
}
|
|
39
53
|
declare type InputForm = JSONSchema6;
|
|
54
|
+
interface FormNotCompleteResponse {
|
|
55
|
+
form: InputForm;
|
|
56
|
+
hasNext?: boolean;
|
|
57
|
+
}
|
|
40
58
|
declare type FieldProps$1<Value, Extra = object, InputElementType = HTMLInputElement, ElementType = HTMLDivElement> = HTMLFieldProps<Value, ElementType, {
|
|
41
59
|
inputRef?: Ref<InputElementType>;
|
|
42
60
|
description?: string;
|
|
@@ -477,17 +495,14 @@ declare class BaseApiClient {
|
|
|
477
495
|
fetchJsonWithCustomErrorHandling: <R = object>(path: string) => Promise<R>;
|
|
478
496
|
postPutJson: <R = object>(path: string, processInput: object, method: string, showErrorDialog?: boolean, result?: boolean) => Promise<R>;
|
|
479
497
|
}
|
|
480
|
-
declare
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
498
|
+
declare class ApiClient extends BaseApiClient {
|
|
499
|
+
startForm: (formKey: string, userInputs: object[]) => Promise<{
|
|
500
|
+
id: string;
|
|
501
|
+
}>;
|
|
484
502
|
startProcess: (workflowName: string, processInput: object) => Promise<unknown>;
|
|
485
503
|
resumeProcess: (processId: string, userInput: object[]) => Promise<object>;
|
|
486
504
|
products: () => Promise<ProductDefinition[]>;
|
|
487
505
|
productById: (productId: string) => Promise<ProductDefinition>;
|
|
488
|
-
cimStartForm: (formKey: string, userInputs: object[]) => Promise<{
|
|
489
|
-
id: string;
|
|
490
|
-
}>;
|
|
491
506
|
prefix_filters: () => Promise<IpPrefix[]>;
|
|
492
507
|
ip_blocks: (parentPrefix: number) => Promise<IpBlock[]>;
|
|
493
508
|
free_subnets: (subnet: string, netmask: number, prefixlen: number) => Promise<string[]>;
|
|
@@ -1000,7 +1015,7 @@ declare const useWfoSession: <R extends boolean>(options?: UseSessionOptions<R>
|
|
|
1000
1015
|
session: WfoSession | null;
|
|
1001
1016
|
};
|
|
1002
1017
|
|
|
1003
|
-
declare const useQueryWithFetch: <T, V extends Variables$1>(url: string, queryVars: V, queryKey: string) => react_query.UseQueryResult<T, unknown>;
|
|
1018
|
+
declare const useQueryWithFetch: <T, V extends Variables$1>(url: string, queryVars: V, queryKey: string, options?: UseQueryOptions<T, unknown, T, [string, ...unknown[]]> | undefined) => react_query.UseQueryResult<T, unknown>;
|
|
1004
1019
|
|
|
1005
1020
|
declare enum SubscriptionDetailTab {
|
|
1006
1021
|
GENERAL_TAB = "general",
|
|
@@ -1358,14 +1373,6 @@ declare const WfoLoading: () => _emotion_react_jsx_runtime.JSX.Element;
|
|
|
1358
1373
|
|
|
1359
1374
|
declare const WfoToastsList: () => _emotion_react_jsx_runtime.JSX.Element;
|
|
1360
1375
|
|
|
1361
|
-
interface IProps {
|
|
1362
|
-
preselectedInput?: unknown;
|
|
1363
|
-
formKey: string;
|
|
1364
|
-
handleSubmit: (userInputs: any) => void;
|
|
1365
|
-
handleCancel?: () => void;
|
|
1366
|
-
}
|
|
1367
|
-
declare function CreateForm(props: IProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1368
|
-
|
|
1369
1376
|
declare type AutoFieldsProps = {
|
|
1370
1377
|
autoField?: ComponentType<{
|
|
1371
1378
|
className: string;
|
|
@@ -1723,6 +1730,14 @@ declare const CustomerField: uniforms.ConnectedField<CustomerFieldProps, string
|
|
|
1723
1730
|
|
|
1724
1731
|
declare const ConnectedSelectField: uniforms.ConnectedField<SelectFieldProps, string | string[] | undefined>;
|
|
1725
1732
|
|
|
1733
|
+
interface IProps {
|
|
1734
|
+
preselectedInput?: unknown;
|
|
1735
|
+
formKey: string;
|
|
1736
|
+
handleSubmit: (userInputs: any) => void;
|
|
1737
|
+
handleCancel?: () => void;
|
|
1738
|
+
}
|
|
1739
|
+
declare function CreateForm(props: IProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1740
|
+
|
|
1726
1741
|
declare const WfoStartTaskButtonComboBox: () => _emotion_react_jsx_runtime.JSX.Element;
|
|
1727
1742
|
|
|
1728
1743
|
declare type WfoDateTimeProps = {
|
|
@@ -3056,6 +3071,8 @@ declare const isUuid4: (value: string) => boolean;
|
|
|
3056
3071
|
declare const upperCaseFirstChar: (value: string) => string;
|
|
3057
3072
|
declare const removeSuffix: (value: string, splitChar?: string) => string;
|
|
3058
3073
|
declare const camelToHuman: (value: string) => string;
|
|
3074
|
+
declare const snakeToHuman: (value: string) => string;
|
|
3075
|
+
declare const snakeToKebab: (value: string) => string;
|
|
3059
3076
|
|
|
3060
3077
|
declare const getProductNamesFromProcess: (process: ProcessDetail | undefined | Omit<ProcessDetail, 'status'>) => string;
|
|
3061
3078
|
|
|
@@ -3067,4 +3084,4 @@ declare const getQueryVariablesForExport: <T extends object>(queryVariables: Gra
|
|
|
3067
3084
|
query?: string | undefined;
|
|
3068
3085
|
};
|
|
3069
3086
|
|
|
3070
|
-
export { ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, AcceptField, type AcceptFieldProps, ApiClient, ApiClientContext, ApiClientContextProvider, type ApiClientContextProviderProps, type ApiContext, type AppDispatch, type AutoFieldsProps, BadgeType, BaseApiClient, type BaseGraphQlResult, BaseQueryTypes, BoolField, type BoolFieldProps, COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, type CacheNames, type CacheOption, CacheTags, ColorModes, type ColumnConfig, type ConfirmDialogActions, ConfirmationDialogContext, ConfirmationDialogContextWrapper, ConfirmationDialogProvider, ConnectedSelectField, ContactPersonNameField, type ContactPersonNameFieldProps, CreateForm, type Customer, CustomerField, type CustomerFieldProps, type CustomersResult, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZES, type DataDisplayParams, type DataDisplayReturnValues, DateField, type DateFieldProps, DividerField, type DividerFieldProps, type EmailAddress, type EmailState, EngineStatus, Environment, ErrorField, type ErrorFieldProps, ErrorsField, type ErrorsFieldProps, type ExternalService, type Field, type FieldValue, type FilterQuery, type FixedInputDefinition, GET_PROCESS_DETAIL_GRAPHQL_QUERY, GET_PROCESS_LIST_GRAPHQL_QUERY, GET_PROCESS_LIST_SUMMARY_GRAPHQL_QUERY, GET_PROCESS_STEPS_GRAPHQL_QUERY, GET_PRODUCTS_BLOCKS_GRAPHQL_QUERY, GET_PRODUCTS_GRAPHQL_QUERY, GET_PRODUCTS_SUMMARY_GRAPHQL_QUERY, GET_RESOURCE_TYPES_GRAPHQL_QUERY, GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY, GET_SUBSCRIPTIONS_LIST_SUMMARY_GRAPHQL_QUERY, GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY, GET_SUBSCRIPTION_DROPDOWN_OPTIONS_GRAPHQL_QUERY, type GraphQLPageInfo, type GraphQLSort, type GraphqlFilter, type GraphqlQueryVariables, type GroupedStep, HIDDEN_KEYS, type HeaderBadgeProps, type IPvAnyNetworkFieldProps, ImsNodeIdField, type ImsNodeIdFieldProps, type ImsPortFieldProps, ImsPortIdField, type InUseByRelation, IpNetworkField, type KeyValue, LabelField, type LabelFieldProps, ListAddField, type ListAddFieldProps, ListDelField, type ListDelFieldProps, ListField, type ListFieldProps, ListSelectField, type ListSelectFieldProps, Locale, LocationCodeField, type LocationCodeFieldProps, LongTextField, type LongTextFieldProps, MAXIMUM_ITEMS_FOR_BULK_FETCHING, METADATA_PRODUCT_BLOCKS_TABLE_LOCAL_STORAGE_KEY, METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY, METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY, METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY, NestField, type NestFieldProps, type Nullable, NumField, type NumFieldProps, OptGroupField, type OptGroupFieldProps, type OrchestratorConfig, OrchestratorConfigContext, OrchestratorConfigProvider, type OrchestratorConfigProviderProps, PATH_METADATA, PATH_METADATA_PRODUCTS, PATH_METADATA_PRODUCT_BLOCKS, PATH_METADATA_RESOURCE_TYPES, PATH_METADATA_WORKFLOWS, PATH_SETTINGS, PATH_START, PATH_START_NEW_TASK, PATH_START_NEW_WORKFLOW, PATH_SUBSCRIPTIONS, PATH_TASKS, PATH_WORKFLOWS, type Pagination, type Policy, PolicyContext, PolicyContextProvider, type PolicyProviderProps, PolicyResource, type Process, type ProcessDetail, type ProcessDetailResultRaw, ProcessDoneStatuses, type ProcessListItem, type ProcessListResponse, type ProcessListResult, ProcessStatus, type ProcessStatusCounts, type ProcessStepsResult, type ProcessesDetailResult, type ProductBlockDefinition, type ProductBlockDefinitionsResult, type ProductBlockInstance, type ProductDefinition, type ProductDefinitionsResult, ProductField, type ProductFieldProps, ProductLifecycleStatus, RENDER_ALL, RESOURCE_TYPE_FIELD_DESCRIPTION, RESOURCE_TYPE_FIELD_ID, RESOURCE_TYPE_FIELD_PRODUCT_BLOCKS, RESOURCE_TYPE_FIELD_TYPE, RadioField, type RadioFieldProps, type RelatedSubscription, type RelatedSubscriptionsResult, RenderDirection, type ResourceTypeDefinition, type ResourceTypeDefinitionsResult, type RootState, STEP_STATE_HIDDEN_KEYS, SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY, type SelectFieldProps, type ShowConfirmDialog, type ShowConfirmDialogType, SortOrder, type StartProcessStep, type Step, type StepListItem, type StepState, StepStatus, StoreProvider, type StoreProviderProps, type StoredTableConfig, SubmitField, type SubmitFieldProps, type Subscription, type SubscriptionAction, type SubscriptionDetail, type SubscriptionDetailProcess, type SubscriptionDetailResult, SubscriptionDetailTab, type SubscriptionDropdownOption, type SubscriptionDropdownOptionsResult, SubscriptionField, type SubscriptionFieldProps, SubscriptionKeyValueBlock, SubscriptionStatus, SubscriptionSummaryField, type SubscriptionSummaryFieldProps, type SubscriptionsResult, SummaryField, type SummaryFieldProps, type TableColumnKeys, type TableConfig, TableSettingsModal, type TableSettingsModalProps, TextField, type TextFieldProps, type TimelineItem, TimelinePosition, TimestampField, type TimestampFieldProps, type ToastState, ToastTypes, type TranslationMessagesMap, type TreeBlock, TreeContext, type TreeContextType, TreeProvider, type TreeProviderProps, UnconnectedSelectField, type UserInputForm, UserInputFormWizard, VlanField, type VlanFieldProps, WFO_STATUS_COLOR_FIELD, WfoArrowNarrowDown, WfoArrowNarrowUp, WfoArrowsExpand, WfoAuth, WfoBadge, type WfoBadgeProps, WfoBasicTable, type WfoBasicTableColumns, type WfoBasicTableColumnsWithControlColumns, type WfoBasicTableProps, WfoBell, WfoBreadcrumbs, WfoCheckmarkCircleFill, WfoChevronDown, WfoChevronUp, WfoCode, WfoCogFill, WfoContactEnvelopeFill, type WfoControlColumn, WfoCubeSolid, WfoDataGridTable, type WfoDataGridTableColumns, type WfoDataGridTableProps, type WfoDataSearch, type WfoDataSorting, WfoDateTime, type WfoDateTimeProps, WfoDropdownButton, WfoEngineStatusBadge, WfoEngineStatusButton, WfoEnvironmentBadge, WfoError, WfoErrorBoundary, type WfoEuiBasicTableColumn, WfoEyeFill, WfoFailedTasksBadge, type WfoFilterTab, WfoFilterTabs, type WfoFilterTabsProps, WfoFirstPartUUID, type WfoFirstUUIDPartProps, WfoFlushSettings, WfoHeaderBadge, type WfoIconProps, WfoInformationModal, type WfoInformationModalProps, WfoInsyncIcon, WfoIsAllowedToRender, type WfoIsAllowedToRenderProps, WfoJsonCodeBlock, type WfoJsonCodeBlockProps, WfoKeyCell, type WfoKeyCellProps, WfoKeyValueTable, type WfoKeyValueTableDataType, type WfoKeyValueTableProps, WfoLoading, WfoLogoutIcon, WfoMinusCircleFill, WfoMinusCircleOutline, WfoModifySettings, WfoPageHeader, type WfoPageHeaderProps, WfoPageTemplate, type WfoPageTemplateProps, WfoPageUnauthorized, WfoPencil, WfoPencilAlt, WfoPlayCircle, WfoPlayFill, WfoPlusCircleFill, type WfoPolicyRenderFallbackProps, WfoPolicyRenderPageFallback, WfoProcessDetailPage, WfoProcessListSubscriptionsCell, WfoProcessRawData, WfoProcessStatusBadge, type WfoProcessStatusBadgeProps, WfoProcessSubscriptionDelta, WfoProcessesList, type WfoProcessesListProps, type WfoProcessesListSubscriptionsCellProps, WfoProcessesTimeline, WfoProductBlockBadge, type WfoProductBlockBadgeProps, WfoProductBlocksPage, WfoProductStatusBadge, type WfoProductStatusBadgeProps, WfoProductsPage, WfoRefresh, WfoResourceTypesPage, WfoSearchField, type WfoSearchFieldProps, WfoSearchStrikethrough, type WfoSession, WfoSettingsModal, type WfoSettingsModalProps, WfoSettingsPage, WfoShare, WfoSideMenu, WfoSidebar, type WfoSidebarProps, WfoSortAsc, WfoSortButton, type WfoSortButtonProps, WfoSortButtons, type WfoSortButtonsProps, WfoSortDesc, WfoSortDirectionIcon, type WfoSortDirectionIconProps, WfoStartPage, WfoStartProcessPage, WfoStartTaskButtonComboBox, WfoStatistic, WfoStatus, WfoStatusColorField, type WfoStatusColorFieldProps, WfoStatusDotIcon, WfoStep, WfoStepList, WfoStepListHeader, type WfoStepListHeaderProps, type WfoStepListProps, type WfoStepListRef, type WfoStepProps, WfoStepStatusIcon, type WfoStepStatusIconProps, WfoSubmitModal, type WfoSubmitModalProps, WfoSubscription, WfoSubscriptionActions, type WfoSubscriptionActionsProps, WfoSubscriptionDetailPage, WfoSubscriptionDetailTree, WfoSubscriptionGeneral, WfoSubscriptionProductBlock, WfoSubscriptionStatusBadge, type WfoSubscriptionStatusBadgeProps, WfoSubscriptionsListPage, type WfoTableColumns, type WfoTableColumnsWithExtraNonDataFields, type WfoTableControlColumnConfig, type WfoTableDataColumnConfig, WfoTableHeaderCell, type WfoTableHeaderCellProps, WfoTableWithFilter, type WfoTableWithFilterProps, WfoTasksListPage, WfoTasksListTabType, WfoTextAnchor, WfoTimeline, type WfoTimelineProps, WfoToastsList, type WfoTreeNodeMap, type WfoUserProfile, WfoValueCell, type WfoValueCellProps, WfoViewList, WfoWarningTriangle, WfoWorkflowStepList, type WfoWorkflowStepListProps, WfoWorkflowTargetBadge, type WfoWorkflowTargetBadgeProps, WfoWorkflowsListPage, WfoWorkflowsPage, WfoXCircleFill, type WorkflowDefinition, type WorkflowDefinitionsResult, type WorkflowListItem, WorkflowTarget, addToastMessage, calculateTimeDifference, camelToHuman, clearTableConfigFromLocalStorage, defaultOrchestratorTheme, defaultTasksListTabs, determineNewSortOrder, determinePageIndex, flattenArrayProps, formatDate, formatDateCetWithUtc, getApiClient, getCurrentBrowserLocale, getDataSortHandler, getDate, getFieldFromProductBlockInstanceValues, getFirstUuidPart, getInitialColumnOrder, getNumberValueFromEnvironmentVariable, getOrchestratorConfigSlice, getOrchestratorStore, getPageChangeHandler, getProcessListGraphQlQuery, getProcessListSummaryGraphQlQuery, getProductBlockTitle, getProductNamesFromProcess, getProductsQuery, getProductsSummaryQuery, getQueryStringHandler, getQueryVariablesForExport, getSortDirectionFromString, getStatusBadgeColor, getStepContent, getSubscriptionDropdownOptionsGraphQlQuery, getSubscriptionsListGraphQlQuery, getSubscriptionsListSummaryGraphQlQuery, getTableConfigFromLocalStorage, getTasksListTabTypeFromString, getTypedFieldFromObject, getWfoBasicTableStyles, getWorkflowTargetColor, getWorkflowTargetIconContent, isToday, isUuid4, isValidLocalStorageTableConfig, localMomentToUtcTimestamp, mapColumnSortToEuiDataGridSorting, mapSortableAndFilterableValuesToTableColumnConfig, orchestratorApi, parseDate, parseDateOrTimeRelativeToToday, parseDateRelativeToToday, parseDateToLocaleDateString, parseDateToLocaleDateTimeString, parseDateToLocaleTimeString, parseIsoString, processListQuery, removeSuffix, removeToastMessage, renderEmptyElementWhenNotAllowedByPolicy, setTableConfigToLocalStorage, stop, toastMessagesReducer, toastMessagesSlice, upperCaseFirstChar, urlPolicyMap, useCacheNames, useCheckEngineStatus, useClearCacheMutation, useDataDisplayParams, useFilterQueryWithRest, useGetCustomersQuery, useGetEngineStatusQuery, useGetProcessListQuery, useGetTranslationMessages, useMutateProcess, useOrchestratorConfig, useOrchestratorTheme, usePolicy, useProcessStatusCountsQuery, useQueryWithFetch, useQueryWithGraphql, useQueryWithGraphqlLazy, useRawProcessDetails, useSetEngineStatusMutation, useShowToastMessage, useStoredTableConfig, useStreamMessagesQuery, useSubscriptionActions, useWfoSession, useWithOrchestratorTheme, utcTimestampToLocalMoment };
|
|
3087
|
+
export { ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, AcceptField, type AcceptFieldProps, ApiClient, ApiClientContext, ApiClientContextProvider, type ApiClientContextProviderProps, type ApiContext, type AppDispatch, type AutoFieldsProps, BadgeType, BaseApiClient, type BaseGraphQlResult, BaseQueryTypes, BoolField, type BoolFieldProps, COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY, COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY, type CacheNames, type CacheOption, CacheTags, ColorModes, type ColumnConfig, type ConfirmDialogActions, ConfirmationDialogContext, ConfirmationDialogContextWrapper, ConfirmationDialogProvider, ConnectedSelectField, ContactPersonNameField, type ContactPersonNameFieldProps, CreateForm, type Customer, CustomerField, type CustomerFieldProps, type CustomersResult, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZES, type DataDisplayParams, type DataDisplayReturnValues, DateField, type DateFieldProps, DividerField, type DividerFieldProps, type EmailAddress, type EmailState, EngineStatus, Environment, ErrorField, type ErrorFieldProps, ErrorsField, type ErrorsFieldProps, type ExternalService, type Field, type FieldProps$1 as FieldProps, type FieldValue, type FilterQuery, type FixedInputDefinition, type Form, type FormNotCompleteResponse, GET_PROCESS_DETAIL_GRAPHQL_QUERY, GET_PROCESS_LIST_GRAPHQL_QUERY, GET_PROCESS_LIST_SUMMARY_GRAPHQL_QUERY, GET_PROCESS_STEPS_GRAPHQL_QUERY, GET_PRODUCTS_BLOCKS_GRAPHQL_QUERY, GET_PRODUCTS_GRAPHQL_QUERY, GET_PRODUCTS_SUMMARY_GRAPHQL_QUERY, GET_RESOURCE_TYPES_GRAPHQL_QUERY, GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY, GET_SUBSCRIPTIONS_LIST_SUMMARY_GRAPHQL_QUERY, GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY, GET_SUBSCRIPTION_DROPDOWN_OPTIONS_GRAPHQL_QUERY, type GraphQLPageInfo, type GraphQLSort, type GraphqlFilter, type GraphqlQueryVariables, type GroupedStep, HIDDEN_KEYS, type HeaderBadgeProps, type IPvAnyNetworkFieldProps, ImsNodeIdField, type ImsNodeIdFieldProps, type ImsPortFieldProps, ImsPortIdField, type InUseByRelation, type InputForm, IpNetworkField, type KeyValue, LabelField, type LabelFieldProps, ListAddField, type ListAddFieldProps, ListDelField, type ListDelFieldProps, ListField, type ListFieldProps, ListSelectField, type ListSelectFieldProps, Locale, LocationCodeField, type LocationCodeFieldProps, LongTextField, type LongTextFieldProps, MAXIMUM_ITEMS_FOR_BULK_FETCHING, METADATA_PRODUCT_BLOCKS_TABLE_LOCAL_STORAGE_KEY, METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY, METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY, METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY, NestField, type NestFieldProps, type Nullable, NumField, type NumFieldProps, OptGroupField, type OptGroupFieldProps, type OrchestratorConfig, OrchestratorConfigContext, OrchestratorConfigProvider, type OrchestratorConfigProviderProps, PATH_METADATA, PATH_METADATA_PRODUCTS, PATH_METADATA_PRODUCT_BLOCKS, PATH_METADATA_RESOURCE_TYPES, PATH_METADATA_WORKFLOWS, PATH_SETTINGS, PATH_START, PATH_START_NEW_TASK, PATH_START_NEW_WORKFLOW, PATH_SUBSCRIPTIONS, PATH_TASKS, PATH_WORKFLOWS, type Pagination, type Policy, PolicyContext, PolicyContextProvider, type PolicyProviderProps, PolicyResource, type Process, type ProcessDetail, type ProcessDetailResultRaw, ProcessDoneStatuses, type ProcessListItem, type ProcessListResponse, type ProcessListResult, ProcessStatus, type ProcessStatusCounts, type ProcessStepsResult, type ProcessesDetailResult, type ProductBlockDefinition, type ProductBlockDefinitionsResult, type ProductBlockInstance, type ProductDefinition, type ProductDefinitionsResult, ProductField, type ProductFieldProps, ProductLifecycleStatus, RENDER_ALL, RESOURCE_TYPE_FIELD_DESCRIPTION, RESOURCE_TYPE_FIELD_ID, RESOURCE_TYPE_FIELD_PRODUCT_BLOCKS, RESOURCE_TYPE_FIELD_TYPE, RadioField, type RadioFieldProps, type RelatedSubscription, type RelatedSubscriptionsResult, RenderDirection, type ResourceTypeDefinition, type ResourceTypeDefinitionsResult, type RootState, STEP_STATE_HIDDEN_KEYS, SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY, type SelectFieldProps, type ShowConfirmDialog, type ShowConfirmDialogType, SortOrder, type StartProcessStep, type Step, type StepListItem, type StepState, StepStatus, StoreProvider, type StoreProviderProps, type StoredTableConfig, SubmitField, type SubmitFieldProps, type Subscription, type SubscriptionAction, type SubscriptionDetail, type SubscriptionDetailProcess, type SubscriptionDetailResult, SubscriptionDetailTab, type SubscriptionDropdownOption, type SubscriptionDropdownOptionsResult, SubscriptionField, type SubscriptionFieldProps, SubscriptionKeyValueBlock, SubscriptionStatus, SubscriptionSummaryField, type SubscriptionSummaryFieldProps, type SubscriptionsResult, SummaryField, type SummaryFieldProps, type TableColumnKeys, type TableConfig, TableSettingsModal, type TableSettingsModalProps, TextField, type TextFieldProps, type TimelineItem, TimelinePosition, TimestampField, type TimestampFieldProps, type ToastState, ToastTypes, type TranslationMessagesMap, type TreeBlock, TreeContext, type TreeContextType, TreeProvider, type TreeProviderProps, UnconnectedSelectField, type UserInputForm, UserInputFormWizard, type ValidationError, type ValidationErrorContext, VlanField, type VlanFieldProps, WFO_STATUS_COLOR_FIELD, WfoArrowNarrowDown, WfoArrowNarrowUp, WfoArrowsExpand, WfoAuth, WfoBadge, type WfoBadgeProps, WfoBasicTable, type WfoBasicTableColumns, type WfoBasicTableColumnsWithControlColumns, type WfoBasicTableProps, WfoBell, WfoBreadcrumbs, WfoCheckmarkCircleFill, WfoChevronDown, WfoChevronUp, WfoCode, WfoCogFill, WfoContactEnvelopeFill, type WfoControlColumn, WfoCubeSolid, WfoDataGridTable, type WfoDataGridTableColumns, type WfoDataGridTableProps, type WfoDataSearch, type WfoDataSorting, WfoDateTime, type WfoDateTimeProps, WfoDropdownButton, WfoEngineStatusBadge, WfoEngineStatusButton, WfoEnvironmentBadge, WfoError, WfoErrorBoundary, type WfoEuiBasicTableColumn, WfoEyeFill, WfoFailedTasksBadge, type WfoFilterTab, WfoFilterTabs, type WfoFilterTabsProps, WfoFirstPartUUID, type WfoFirstUUIDPartProps, WfoFlushSettings, WfoHeaderBadge, type WfoIconProps, WfoInformationModal, type WfoInformationModalProps, WfoInsyncIcon, WfoIsAllowedToRender, type WfoIsAllowedToRenderProps, WfoJsonCodeBlock, type WfoJsonCodeBlockProps, WfoKeyCell, type WfoKeyCellProps, WfoKeyValueTable, type WfoKeyValueTableDataType, type WfoKeyValueTableProps, WfoLoading, WfoLogoutIcon, WfoMinusCircleFill, WfoMinusCircleOutline, WfoModifySettings, WfoPageHeader, type WfoPageHeaderProps, WfoPageTemplate, type WfoPageTemplateProps, WfoPageUnauthorized, WfoPencil, WfoPencilAlt, WfoPlayCircle, WfoPlayFill, WfoPlusCircleFill, type WfoPolicyRenderFallbackProps, WfoPolicyRenderPageFallback, WfoProcessDetailPage, WfoProcessListSubscriptionsCell, WfoProcessRawData, WfoProcessStatusBadge, type WfoProcessStatusBadgeProps, WfoProcessSubscriptionDelta, WfoProcessesList, type WfoProcessesListProps, type WfoProcessesListSubscriptionsCellProps, WfoProcessesTimeline, WfoProductBlockBadge, type WfoProductBlockBadgeProps, WfoProductBlocksPage, WfoProductStatusBadge, type WfoProductStatusBadgeProps, WfoProductsPage, WfoRefresh, WfoResourceTypesPage, WfoSearchField, type WfoSearchFieldProps, WfoSearchStrikethrough, type WfoSession, WfoSettingsModal, type WfoSettingsModalProps, WfoSettingsPage, WfoShare, WfoSideMenu, WfoSidebar, type WfoSidebarProps, WfoSortAsc, WfoSortButton, type WfoSortButtonProps, WfoSortButtons, type WfoSortButtonsProps, WfoSortDesc, WfoSortDirectionIcon, type WfoSortDirectionIconProps, WfoStartPage, WfoStartProcessPage, WfoStartTaskButtonComboBox, WfoStatistic, WfoStatus, WfoStatusColorField, type WfoStatusColorFieldProps, WfoStatusDotIcon, WfoStep, WfoStepList, WfoStepListHeader, type WfoStepListHeaderProps, type WfoStepListProps, type WfoStepListRef, type WfoStepProps, WfoStepStatusIcon, type WfoStepStatusIconProps, WfoSubmitModal, type WfoSubmitModalProps, WfoSubscription, WfoSubscriptionActions, type WfoSubscriptionActionsProps, WfoSubscriptionDetailPage, WfoSubscriptionDetailTree, WfoSubscriptionGeneral, WfoSubscriptionProductBlock, WfoSubscriptionStatusBadge, type WfoSubscriptionStatusBadgeProps, WfoSubscriptionsListPage, type WfoTableColumns, type WfoTableColumnsWithExtraNonDataFields, type WfoTableControlColumnConfig, type WfoTableDataColumnConfig, WfoTableHeaderCell, type WfoTableHeaderCellProps, WfoTableWithFilter, type WfoTableWithFilterProps, WfoTasksListPage, WfoTasksListTabType, WfoTextAnchor, WfoTimeline, type WfoTimelineProps, WfoToastsList, type WfoTreeNodeMap, type WfoUserProfile, WfoValueCell, type WfoValueCellProps, WfoViewList, WfoWarningTriangle, WfoWorkflowStepList, type WfoWorkflowStepListProps, WfoWorkflowTargetBadge, type WfoWorkflowTargetBadgeProps, WfoWorkflowsListPage, WfoWorkflowsPage, WfoXCircleFill, type WorkflowDefinition, type WorkflowDefinitionsResult, type WorkflowListItem, WorkflowTarget, addToastMessage, calculateTimeDifference, camelToHuman, clearTableConfigFromLocalStorage, defaultOrchestratorTheme, defaultTasksListTabs, determineNewSortOrder, determinePageIndex, flattenArrayProps, formatDate, formatDateCetWithUtc, getApiClient, getCurrentBrowserLocale, getDataSortHandler, getDate, getFieldFromProductBlockInstanceValues, getFirstUuidPart, getInitialColumnOrder, getNumberValueFromEnvironmentVariable, getOrchestratorConfigSlice, getOrchestratorStore, getPageChangeHandler, getProcessListGraphQlQuery, getProcessListSummaryGraphQlQuery, getProductBlockTitle, getProductNamesFromProcess, getProductsQuery, getProductsSummaryQuery, getQueryStringHandler, getQueryVariablesForExport, getSortDirectionFromString, getStatusBadgeColor, getStepContent, getSubscriptionDropdownOptionsGraphQlQuery, getSubscriptionsListGraphQlQuery, getSubscriptionsListSummaryGraphQlQuery, getTableConfigFromLocalStorage, getTasksListTabTypeFromString, getTypedFieldFromObject, getWfoBasicTableStyles, getWorkflowTargetColor, getWorkflowTargetIconContent, isToday, isUuid4, isValidLocalStorageTableConfig, localMomentToUtcTimestamp, mapColumnSortToEuiDataGridSorting, mapSortableAndFilterableValuesToTableColumnConfig, orchestratorApi, parseDate, parseDateOrTimeRelativeToToday, parseDateRelativeToToday, parseDateToLocaleDateString, parseDateToLocaleDateTimeString, parseDateToLocaleTimeString, parseIsoString, processListQuery, removeSuffix, removeToastMessage, renderEmptyElementWhenNotAllowedByPolicy, setTableConfigToLocalStorage, snakeToHuman, snakeToKebab, stop, toastMessagesReducer, toastMessagesSlice, upperCaseFirstChar, urlPolicyMap, useCacheNames, useCheckEngineStatus, useClearCacheMutation, useDataDisplayParams, useFilterQueryWithRest, useGetCustomersQuery, useGetEngineStatusQuery, useGetProcessListQuery, useGetTranslationMessages, useMutateProcess, useOrchestratorConfig, useOrchestratorTheme, usePolicy, useProcessStatusCountsQuery, useQueryWithFetch, useQueryWithGraphql, useQueryWithGraphqlLazy, useRawProcessDetails, useSetEngineStatusMutation, useShowToastMessage, useStoredTableConfig, useStreamMessagesQuery, useSubscriptionActions, useWfoSession, useWithOrchestratorTheme, utcTimestampToLocalMoment };
|
package/dist/index.js
CHANGED
|
@@ -34572,9 +34572,9 @@ var getAxiosInstance = (apiPath, accessToken) => {
|
|
|
34572
34572
|
};
|
|
34573
34573
|
|
|
34574
34574
|
// src/api/index.ts
|
|
34575
|
-
var CIM_FORMS_ENDPOINT = "surf/cim/forms/";
|
|
34576
34575
|
var PROCESS_ENDPOINT = "processes/";
|
|
34577
34576
|
var PRODUCTS_ENDPOINT = "products/";
|
|
34577
|
+
var FORMS_ENDPOINT = "surf/forms/";
|
|
34578
34578
|
var BaseApiClient = class {
|
|
34579
34579
|
constructor(apiPath, accessToken) {
|
|
34580
34580
|
this.axiosFetch = (path, options = {}, headers = {}, showErrorDialog = true, result = true) => {
|
|
@@ -34614,11 +34614,18 @@ var BaseApiClient = class {
|
|
|
34614
34614
|
this._axiosInstance = getAxiosInstance(apiPath, accessToken);
|
|
34615
34615
|
}
|
|
34616
34616
|
};
|
|
34617
|
-
var
|
|
34618
|
-
};
|
|
34619
|
-
var ApiClient = class extends ApiClientInterface {
|
|
34617
|
+
var ApiClient = class extends BaseApiClient {
|
|
34620
34618
|
constructor() {
|
|
34621
34619
|
super(...arguments);
|
|
34620
|
+
this.startForm = (formKey, userInputs) => {
|
|
34621
|
+
return this.postPutJson(
|
|
34622
|
+
`${FORMS_ENDPOINT}${formKey}`,
|
|
34623
|
+
userInputs,
|
|
34624
|
+
"post",
|
|
34625
|
+
false,
|
|
34626
|
+
true
|
|
34627
|
+
);
|
|
34628
|
+
};
|
|
34622
34629
|
this.startProcess = (workflowName, processInput) => {
|
|
34623
34630
|
return this.postPutJson(
|
|
34624
34631
|
`${PROCESS_ENDPOINT}${workflowName}`,
|
|
@@ -34643,15 +34650,6 @@ var ApiClient = class extends ApiClientInterface {
|
|
|
34643
34650
|
this.productById = (productId) => {
|
|
34644
34651
|
return this.fetchJson(`${PRODUCTS_ENDPOINT}${productId}`);
|
|
34645
34652
|
};
|
|
34646
|
-
this.cimStartForm = (formKey, userInputs) => {
|
|
34647
|
-
return this.postPutJson(
|
|
34648
|
-
`${CIM_FORMS_ENDPOINT}${formKey}`,
|
|
34649
|
-
userInputs,
|
|
34650
|
-
"post",
|
|
34651
|
-
false,
|
|
34652
|
-
true
|
|
34653
|
-
);
|
|
34654
|
-
};
|
|
34655
34653
|
this.prefix_filters = () => {
|
|
34656
34654
|
return this.fetchJson("surf/ipam/prefix_filters");
|
|
34657
34655
|
};
|
|
@@ -41313,7 +41311,7 @@ import { useContext as useContext6 } from "react";
|
|
|
41313
41311
|
// src/hooks/useQueryWithFetch.ts
|
|
41314
41312
|
import { useQuery as useQuery2 } from "react-query";
|
|
41315
41313
|
import { signOut as signOut2 } from "next-auth/react";
|
|
41316
|
-
var useQueryWithFetch = (url, queryVars, queryKey) => {
|
|
41314
|
+
var useQueryWithFetch = (url, queryVars, queryKey, options) => {
|
|
41317
41315
|
const { session } = useWfoSession();
|
|
41318
41316
|
const requestHeaders = {
|
|
41319
41317
|
authorization: session ? `Bearer ${session.accessToken}` : ""
|
|
@@ -41331,7 +41329,11 @@ var useQueryWithFetch = (url, queryVars, queryKey) => {
|
|
|
41331
41329
|
}
|
|
41332
41330
|
return yield response.json();
|
|
41333
41331
|
});
|
|
41334
|
-
return useQuery2(
|
|
41332
|
+
return useQuery2(
|
|
41333
|
+
[queryKey, ...Object.values(queryVars)],
|
|
41334
|
+
fetchData,
|
|
41335
|
+
options
|
|
41336
|
+
);
|
|
41335
41337
|
};
|
|
41336
41338
|
|
|
41337
41339
|
// src/hooks/useProcessStatusCountsQuery.ts
|
|
@@ -43290,6 +43292,13 @@ var camelToHuman = (value) => {
|
|
|
43290
43292
|
const result = value.replace(/([A-Z])/g, " $1").trimStart();
|
|
43291
43293
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
43292
43294
|
};
|
|
43295
|
+
var snakeToHuman = (value) => {
|
|
43296
|
+
const result = value.replace(/_/g, " ");
|
|
43297
|
+
return result.charAt(0) + result.slice(1);
|
|
43298
|
+
};
|
|
43299
|
+
var snakeToKebab = (value) => {
|
|
43300
|
+
return value.replace(/_/g, "-");
|
|
43301
|
+
};
|
|
43293
43302
|
|
|
43294
43303
|
// src/utils/getProductNamesFromProcess.ts
|
|
43295
43304
|
var getProductNamesFromProcess = (process2) => {
|
|
@@ -49858,13 +49867,35 @@ var WfoToastsList = () => {
|
|
|
49858
49867
|
);
|
|
49859
49868
|
};
|
|
49860
49869
|
|
|
49861
|
-
// src/components/WfoForms/
|
|
49862
|
-
import {
|
|
49863
|
-
|
|
49864
|
-
|
|
49865
|
-
|
|
49866
|
-
|
|
49867
|
-
|
|
49870
|
+
// src/components/WfoForms/AutoFields.tsx
|
|
49871
|
+
import { createElement } from "react";
|
|
49872
|
+
import { useForm } from "uniforms";
|
|
49873
|
+
import { AutoField } from "uniforms-unstyled";
|
|
49874
|
+
function AutoFields(_a) {
|
|
49875
|
+
var _b = _a, {
|
|
49876
|
+
autoField = AutoField,
|
|
49877
|
+
element = "section",
|
|
49878
|
+
fields,
|
|
49879
|
+
omitFields = []
|
|
49880
|
+
} = _b, props = __objRest(_b, [
|
|
49881
|
+
"autoField",
|
|
49882
|
+
"element",
|
|
49883
|
+
"fields",
|
|
49884
|
+
"omitFields"
|
|
49885
|
+
]);
|
|
49886
|
+
const { schema } = useForm();
|
|
49887
|
+
return createElement(
|
|
49888
|
+
element,
|
|
49889
|
+
__spreadValues({}, props),
|
|
49890
|
+
(fields != null ? fields : schema.getSubfields()).filter((field) => !omitFields.includes(field)).map(
|
|
49891
|
+
(field) => createElement(autoField, {
|
|
49892
|
+
key: field,
|
|
49893
|
+
name: field,
|
|
49894
|
+
className: "form-input"
|
|
49895
|
+
})
|
|
49896
|
+
)
|
|
49897
|
+
);
|
|
49898
|
+
}
|
|
49868
49899
|
|
|
49869
49900
|
// src/components/WfoForms/UserInputForm.tsx
|
|
49870
49901
|
var import_cloneDeep2 = __toESM(require_cloneDeep(), 1);
|
|
@@ -49883,7 +49914,7 @@ import {
|
|
|
49883
49914
|
} from "@elastic/eui";
|
|
49884
49915
|
|
|
49885
49916
|
// src/components/WfoForms/AutoFieldLoader.tsx
|
|
49886
|
-
import { AutoField as
|
|
49917
|
+
import { AutoField as AutoField5 } from "uniforms-unstyled";
|
|
49887
49918
|
|
|
49888
49919
|
// src/components/WfoForms/formFields/AcceptField.tsx
|
|
49889
49920
|
import { useReducer } from "react";
|
|
@@ -50231,10 +50262,10 @@ var ErrorField = connectField4(Error2, {
|
|
|
50231
50262
|
});
|
|
50232
50263
|
|
|
50233
50264
|
// src/components/WfoForms/formFields/ErrorsField.tsx
|
|
50234
|
-
import { filterDOMProps as filterDOMProps4, useForm } from "uniforms";
|
|
50265
|
+
import { filterDOMProps as filterDOMProps4, useForm as useForm2 } from "uniforms";
|
|
50235
50266
|
import { jsx as jsx102, jsxs as jsxs65 } from "@emotion/react/jsx-runtime";
|
|
50236
50267
|
var ErrorsField = (props) => {
|
|
50237
|
-
const { error, schema } =
|
|
50268
|
+
const { error, schema } = useForm2();
|
|
50238
50269
|
return !error && !props.children ? null : /* @__PURE__ */ jsxs65("div", __spreadProps(__spreadValues({}, filterDOMProps4(props)), { children: [
|
|
50239
50270
|
props.children,
|
|
50240
50271
|
/* @__PURE__ */ jsx102("ul", { children: schema.getErrorMessages(error).map((message, index) => /* @__PURE__ */ jsx102("li", { children: message }, index)) })
|
|
@@ -50393,10 +50424,10 @@ import { EuiFlexItem as EuiFlexItem14, EuiFormRow as EuiFormRow4, EuiText as Eui
|
|
|
50393
50424
|
|
|
50394
50425
|
// src/components/WfoForms/formFields/ListItemField.tsx
|
|
50395
50426
|
import { connectField as connectField8 } from "uniforms";
|
|
50396
|
-
import { AutoField } from "uniforms-unstyled";
|
|
50427
|
+
import { AutoField as AutoField2 } from "uniforms-unstyled";
|
|
50397
50428
|
import { jsx as jsx106, jsxs as jsxs68 } from "@emotion/react/jsx-runtime";
|
|
50398
50429
|
function ListItem({
|
|
50399
|
-
children = /* @__PURE__ */ jsx106(
|
|
50430
|
+
children = /* @__PURE__ */ jsx106(AutoField2, { label: null, name: "" }),
|
|
50400
50431
|
outerList = false
|
|
50401
50432
|
}) {
|
|
50402
50433
|
return /* @__PURE__ */ jsxs68("li", { children: [
|
|
@@ -50583,13 +50614,13 @@ var ListField = connectField9(List);
|
|
|
50583
50614
|
|
|
50584
50615
|
// src/components/WfoForms/formFields/ListSelectField.tsx
|
|
50585
50616
|
var import_lodash3 = __toESM(require_lodash(), 1);
|
|
50586
|
-
import { joinName as joinName5, useField as useField5, useForm as
|
|
50617
|
+
import { joinName as joinName5, useField as useField5, useForm as useForm4 } from "uniforms";
|
|
50587
50618
|
|
|
50588
50619
|
// src/components/WfoForms/formFields/SelectField.tsx
|
|
50589
50620
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
50590
50621
|
import ReactSelect from "react-select";
|
|
50591
50622
|
import { useTranslations as useTranslations26 } from "next-intl";
|
|
50592
|
-
import { joinName as joinName4, useField as useField4, useForm as
|
|
50623
|
+
import { joinName as joinName4, useField as useField4, useForm as useForm3 } from "uniforms";
|
|
50593
50624
|
import { EuiFormRow as EuiFormRow5, EuiText as EuiText14 } from "@elastic/eui";
|
|
50594
50625
|
|
|
50595
50626
|
// src/components/WfoForms/formFields/reactSelectStyles.ts
|
|
@@ -50670,7 +50701,7 @@ function UnconnectedSelectField(_a) {
|
|
|
50670
50701
|
parentName = name;
|
|
50671
50702
|
}
|
|
50672
50703
|
const parent = useField4(parentName, {}, { absoluteName: true })[0];
|
|
50673
|
-
const { model } =
|
|
50704
|
+
const { model } = useForm3();
|
|
50674
50705
|
if (parentName !== name) {
|
|
50675
50706
|
if (parent.fieldType === Array && parent.uniqueItems) {
|
|
50676
50707
|
const allValues = (0, import_lodash2.get)(model, parentName, []);
|
|
@@ -50772,7 +50803,7 @@ function ListSelectField(_a) {
|
|
|
50772
50803
|
parentName = name;
|
|
50773
50804
|
}
|
|
50774
50805
|
const parent = useField5(parentName, {}, { absoluteName: true })[0];
|
|
50775
|
-
const { model } =
|
|
50806
|
+
const { model } = useForm4();
|
|
50776
50807
|
if (parentName !== name) {
|
|
50777
50808
|
if (parent.fieldType === Array && parent.uniqueItems) {
|
|
50778
50809
|
const allValues = (0, import_lodash3.get)(model, parentName, []);
|
|
@@ -51047,7 +51078,7 @@ function Radio(_a) {
|
|
|
51047
51078
|
var RadioField = connectField13(Radio, { kind: "leaf" });
|
|
51048
51079
|
|
|
51049
51080
|
// src/components/WfoForms/formFields/SubmitField.tsx
|
|
51050
|
-
import { filterDOMProps as filterDOMProps13, useForm as
|
|
51081
|
+
import { filterDOMProps as filterDOMProps13, useForm as useForm5 } from "uniforms";
|
|
51051
51082
|
import { jsx as jsx114 } from "@emotion/react/jsx-runtime";
|
|
51052
51083
|
var SubmitField = (_a) => {
|
|
51053
51084
|
var _b = _a, {
|
|
@@ -51061,7 +51092,7 @@ var SubmitField = (_a) => {
|
|
|
51061
51092
|
"readOnly",
|
|
51062
51093
|
"value"
|
|
51063
51094
|
]);
|
|
51064
|
-
const { error, state } =
|
|
51095
|
+
const { error, state } = useForm5();
|
|
51065
51096
|
return /* @__PURE__ */ jsx114(
|
|
51066
51097
|
"input",
|
|
51067
51098
|
__spreadValues(__spreadValues({
|
|
@@ -51335,7 +51366,7 @@ import {
|
|
|
51335
51366
|
filterDOMProps as filterDOMProps18,
|
|
51336
51367
|
joinName as joinName6,
|
|
51337
51368
|
useField as useField6,
|
|
51338
|
-
useForm as
|
|
51369
|
+
useForm as useForm6
|
|
51339
51370
|
} from "uniforms";
|
|
51340
51371
|
import { EuiFieldText as EuiFieldText2, EuiFormRow as EuiFormRow12, EuiText as EuiText21 } from "@elastic/eui";
|
|
51341
51372
|
|
|
@@ -51525,7 +51556,7 @@ function ContactPersonName(_a) {
|
|
|
51525
51556
|
]);
|
|
51526
51557
|
const axiosApiClient = useAxiosApiClient();
|
|
51527
51558
|
const t = useTranslations28("pydanticForms");
|
|
51528
|
-
const { model, onChange: formOnChange, schema } =
|
|
51559
|
+
const { model, onChange: formOnChange, schema } = useForm6();
|
|
51529
51560
|
const contactsPersonFieldNameArray = joinName6(null, name).slice(0, -1);
|
|
51530
51561
|
const emailFieldName = joinName6(contactsPersonFieldNameArray, "email");
|
|
51531
51562
|
const contactsFieldName = joinName6(
|
|
@@ -51950,7 +51981,7 @@ var LocationCodeField = connectField21(LocationCode, { kind: "leaf" });
|
|
|
51950
51981
|
var import_get3 = __toESM(require_get(), 1);
|
|
51951
51982
|
import { useEffect as useEffect13, useState as useState22 } from "react";
|
|
51952
51983
|
import { useTranslations as useTranslations32 } from "next-intl";
|
|
51953
|
-
import { connectField as connectField22, filterDOMProps as filterDOMProps22, joinName as joinName7, useForm as
|
|
51984
|
+
import { connectField as connectField22, filterDOMProps as filterDOMProps22, joinName as joinName7, useForm as useForm7 } from "uniforms";
|
|
51954
51985
|
import { EuiFieldText as EuiFieldText3, EuiFormRow as EuiFormRow14, EuiText as EuiText23 } from "@elastic/eui";
|
|
51955
51986
|
|
|
51956
51987
|
// src/hooks/surf/useIsTaggedPort.ts
|
|
@@ -52053,7 +52084,7 @@ function Vlan(_a) {
|
|
|
52053
52084
|
]);
|
|
52054
52085
|
const t = useTranslations32("pydanticForms");
|
|
52055
52086
|
const axiosApiClient = useAxiosApiClient();
|
|
52056
|
-
const { model, schema } =
|
|
52087
|
+
const { model, schema } = useForm7();
|
|
52057
52088
|
const initialValue = schema.getInitialValue(name, {});
|
|
52058
52089
|
const nameArray = joinName7(null, name);
|
|
52059
52090
|
const selfName = nameArray.slice(-1);
|
|
@@ -52165,7 +52196,7 @@ var VlanField = connectField22(Vlan, { kind: "leaf" });
|
|
|
52165
52196
|
|
|
52166
52197
|
// src/components/WfoForms/formFields/NestField.tsx
|
|
52167
52198
|
import { connectField as connectField23, filterDOMProps as filterDOMProps23, joinName as joinName8 } from "uniforms";
|
|
52168
|
-
import { AutoField as
|
|
52199
|
+
import { AutoField as AutoField3 } from "uniforms-unstyled";
|
|
52169
52200
|
import {
|
|
52170
52201
|
EuiDescribedFormGroup,
|
|
52171
52202
|
EuiFlexGroup as EuiFlexGroup13,
|
|
@@ -52207,7 +52238,7 @@ function Nest(_a) {
|
|
|
52207
52238
|
/* @__PURE__ */ jsx125(EuiText24, { size: "m", children: description })
|
|
52208
52239
|
] }),
|
|
52209
52240
|
children || (fields == null ? void 0 : fields.map((field) => /* @__PURE__ */ jsx125(EuiFlexItem17, { children: /* @__PURE__ */ jsx125(
|
|
52210
|
-
|
|
52241
|
+
AutoField3,
|
|
52211
52242
|
__spreadProps(__spreadValues({
|
|
52212
52243
|
name: field
|
|
52213
52244
|
}, itemProps), {
|
|
@@ -52225,7 +52256,7 @@ function Nest(_a) {
|
|
|
52225
52256
|
description,
|
|
52226
52257
|
className: `${className} nest-field`,
|
|
52227
52258
|
children: children || (fields == null ? void 0 : fields.map((field) => /* @__PURE__ */ jsx125(
|
|
52228
|
-
|
|
52259
|
+
AutoField3,
|
|
52229
52260
|
__spreadProps(__spreadValues({
|
|
52230
52261
|
name: field
|
|
52231
52262
|
}, itemProps), {
|
|
@@ -52242,7 +52273,7 @@ var NestField = connectField23(Nest);
|
|
|
52242
52273
|
// src/components/WfoForms/formFields/OptGroupField.tsx
|
|
52243
52274
|
import { useTranslations as useTranslations33 } from "next-intl";
|
|
52244
52275
|
import { connectField as connectField24, filterDOMProps as filterDOMProps24, useField as useField7 } from "uniforms";
|
|
52245
|
-
import { AutoField as
|
|
52276
|
+
import { AutoField as AutoField4 } from "uniforms-unstyled";
|
|
52246
52277
|
import { EuiDescribedFormGroup as EuiDescribedFormGroup2, EuiFlexItem as EuiFlexItem18, EuiFormRow as EuiFormRow15 } from "@elastic/eui";
|
|
52247
52278
|
import { Fragment as Fragment23, jsx as jsx126, jsxs as jsxs75 } from "@emotion/react/jsx-runtime";
|
|
52248
52279
|
filterDOMProps24.register("properties");
|
|
@@ -52278,7 +52309,7 @@ function OptGroup(_a) {
|
|
|
52278
52309
|
children: /* @__PURE__ */ jsx126(BoolField, { name: "enabled", readOnly })
|
|
52279
52310
|
}
|
|
52280
52311
|
) }),
|
|
52281
|
-
enabled && (fields == null ? void 0 : fields.filter((field) => field !== "enabled").map((field) => /* @__PURE__ */ jsx126(EuiFlexItem18, { children: /* @__PURE__ */ jsx126(
|
|
52312
|
+
enabled && (fields == null ? void 0 : fields.filter((field) => field !== "enabled").map((field) => /* @__PURE__ */ jsx126(EuiFlexItem18, { children: /* @__PURE__ */ jsx126(AutoField4, __spreadValues({ name: field }, itemProps)) }, field)))
|
|
52282
52313
|
] })
|
|
52283
52314
|
})
|
|
52284
52315
|
);
|
|
@@ -52294,7 +52325,7 @@ import {
|
|
|
52294
52325
|
filterDOMProps as filterDOMProps25,
|
|
52295
52326
|
joinName as joinName9,
|
|
52296
52327
|
useField as useField8,
|
|
52297
|
-
useForm as
|
|
52328
|
+
useForm as useForm8
|
|
52298
52329
|
} from "uniforms";
|
|
52299
52330
|
import {
|
|
52300
52331
|
EuiButtonIcon as EuiButtonIcon2,
|
|
@@ -52442,7 +52473,7 @@ function SubscriptionFieldDefinition(_a) {
|
|
|
52442
52473
|
parentName = name;
|
|
52443
52474
|
}
|
|
52444
52475
|
const parent = useField8(parentName, {}, { absoluteName: true })[0];
|
|
52445
|
-
const { model, schema } =
|
|
52476
|
+
const { model, schema } = useForm8();
|
|
52446
52477
|
const bandWithFromField = bandwidthKey ? (0, import_get4.default)(model, bandwidthKey) || schema.getInitialValue(bandwidthKey, {}) : void 0;
|
|
52447
52478
|
const usedBandwidth = bandwidth || bandWithFromField;
|
|
52448
52479
|
const usedCustomerId = customerKey ? (0, import_get4.default)(model, customerKey, "nonExistingOrgToFilterEverything") : customerId;
|
|
@@ -53537,37 +53568,7 @@ function autoFieldFunction(props, uniforms) {
|
|
|
53537
53568
|
return DateField;
|
|
53538
53569
|
}
|
|
53539
53570
|
}
|
|
53540
|
-
return
|
|
53541
|
-
}
|
|
53542
|
-
|
|
53543
|
-
// src/components/WfoForms/AutoFields.tsx
|
|
53544
|
-
import { createElement } from "react";
|
|
53545
|
-
import { useForm as useForm8 } from "uniforms";
|
|
53546
|
-
import { AutoField as AutoField5 } from "uniforms-unstyled";
|
|
53547
|
-
function AutoFields(_a) {
|
|
53548
|
-
var _b = _a, {
|
|
53549
|
-
autoField = AutoField5,
|
|
53550
|
-
element = "section",
|
|
53551
|
-
fields,
|
|
53552
|
-
omitFields = []
|
|
53553
|
-
} = _b, props = __objRest(_b, [
|
|
53554
|
-
"autoField",
|
|
53555
|
-
"element",
|
|
53556
|
-
"fields",
|
|
53557
|
-
"omitFields"
|
|
53558
|
-
]);
|
|
53559
|
-
const { schema } = useForm8();
|
|
53560
|
-
return createElement(
|
|
53561
|
-
element,
|
|
53562
|
-
__spreadValues({}, props),
|
|
53563
|
-
(fields != null ? fields : schema.getSubfields()).filter((field) => !omitFields.includes(field)).map(
|
|
53564
|
-
(field) => createElement(autoField, {
|
|
53565
|
-
key: field,
|
|
53566
|
-
name: field,
|
|
53567
|
-
className: "form-input"
|
|
53568
|
-
})
|
|
53569
|
-
)
|
|
53570
|
-
);
|
|
53571
|
+
return AutoField5.defaultComponentDetector(props, uniforms);
|
|
53571
53572
|
}
|
|
53572
53573
|
|
|
53573
53574
|
// src/components/WfoForms/UserInputFormStyling.ts
|
|
@@ -54073,6 +54074,9 @@ function UserInputForm({
|
|
|
54073
54074
|
var UserInputForm_default = UserInputForm;
|
|
54074
54075
|
|
|
54075
54076
|
// src/components/WfoForms/UserInputFormWizard.tsx
|
|
54077
|
+
import { useEffect as useEffect14, useState as useState25 } from "react";
|
|
54078
|
+
import { useRouter as useRouter7 } from "next/router";
|
|
54079
|
+
import hash from "object-hash";
|
|
54076
54080
|
import { jsx as jsx135 } from "@emotion/react/jsx-runtime";
|
|
54077
54081
|
function stop2(e) {
|
|
54078
54082
|
if (e !== void 0 && e !== null) {
|
|
@@ -54147,6 +54151,7 @@ function UserInputFormWizard({
|
|
|
54147
54151
|
var UserInputFormWizard_default = UserInputFormWizard;
|
|
54148
54152
|
|
|
54149
54153
|
// src/components/WfoForms/CreateForm.tsx
|
|
54154
|
+
import { useCallback as useCallback4, useEffect as useEffect15, useState as useState26 } from "react";
|
|
54150
54155
|
import { jsx as jsx136 } from "@emotion/react/jsx-runtime";
|
|
54151
54156
|
function CreateForm(props) {
|
|
54152
54157
|
const { preselectedInput, formKey, handleSubmit, handleCancel } = props;
|
|
@@ -54155,7 +54160,7 @@ function CreateForm(props) {
|
|
|
54155
54160
|
const apiClient = useAxiosApiClient();
|
|
54156
54161
|
const submit = useCallback4(
|
|
54157
54162
|
(userInputs) => {
|
|
54158
|
-
return apiClient.
|
|
54163
|
+
return apiClient.startForm(formKey, userInputs).then((form2) => {
|
|
54159
54164
|
handleSubmit(form2);
|
|
54160
54165
|
});
|
|
54161
54166
|
},
|
|
@@ -57068,7 +57073,7 @@ var WfoStartPage = () => {
|
|
|
57068
57073
|
)) != null ? _d : [],
|
|
57069
57074
|
button: {
|
|
57070
57075
|
name: t("outOfSyncSubscriptions.buttonText"),
|
|
57071
|
-
url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%
|
|
57076
|
+
url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%28provisioning%7Cactive%29+insync%3Afalse`
|
|
57072
57077
|
},
|
|
57073
57078
|
isLoading: outOfSyncsubscriptionsSummaryIsFetching
|
|
57074
57079
|
};
|
|
@@ -59530,6 +59535,8 @@ export {
|
|
|
59530
59535
|
removeToastMessage,
|
|
59531
59536
|
renderEmptyElementWhenNotAllowedByPolicy,
|
|
59532
59537
|
setTableConfigToLocalStorage,
|
|
59538
|
+
snakeToHuman,
|
|
59539
|
+
snakeToKebab,
|
|
59533
59540
|
stop,
|
|
59534
59541
|
toastMessagesReducer,
|
|
59535
59542
|
toastMessagesSlice,
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -24,9 +24,9 @@ import { ProductDefinition } from '@/types';
|
|
|
24
24
|
|
|
25
25
|
import { getAxiosInstance } from './axios';
|
|
26
26
|
|
|
27
|
-
const CIM_FORMS_ENDPOINT = 'surf/cim/forms/';
|
|
28
27
|
const PROCESS_ENDPOINT = 'processes/';
|
|
29
28
|
const PRODUCTS_ENDPOINT = 'products/';
|
|
29
|
+
const FORMS_ENDPOINT = 'surf/forms/';
|
|
30
30
|
|
|
31
31
|
export class BaseApiClient {
|
|
32
32
|
private _axiosInstance: AxiosInstance;
|
|
@@ -105,14 +105,20 @@ export class BaseApiClient {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
export class ApiClient extends BaseApiClient {
|
|
109
|
+
startForm = (
|
|
110
110
|
formKey: string,
|
|
111
111
|
userInputs: object[],
|
|
112
|
-
) =>
|
|
113
|
-
|
|
112
|
+
): Promise<{ id: string }> => {
|
|
113
|
+
return this.postPutJson(
|
|
114
|
+
`${FORMS_ENDPOINT}${formKey}`,
|
|
115
|
+
userInputs,
|
|
116
|
+
'post',
|
|
117
|
+
false,
|
|
118
|
+
true,
|
|
119
|
+
);
|
|
120
|
+
};
|
|
114
121
|
|
|
115
|
-
export class ApiClient extends ApiClientInterface {
|
|
116
122
|
startProcess = (
|
|
117
123
|
workflowName: string,
|
|
118
124
|
processInput: object,
|
|
@@ -142,18 +148,6 @@ export class ApiClient extends ApiClientInterface {
|
|
|
142
148
|
productById = (productId: string): Promise<ProductDefinition> => {
|
|
143
149
|
return this.fetchJson(`${PRODUCTS_ENDPOINT}${productId}`);
|
|
144
150
|
};
|
|
145
|
-
cimStartForm = (
|
|
146
|
-
formKey: string,
|
|
147
|
-
userInputs: object[],
|
|
148
|
-
): Promise<{ id: string }> => {
|
|
149
|
-
return this.postPutJson(
|
|
150
|
-
`${CIM_FORMS_ENDPOINT}${formKey}`,
|
|
151
|
-
userInputs,
|
|
152
|
-
'post',
|
|
153
|
-
false,
|
|
154
|
-
true,
|
|
155
|
-
);
|
|
156
|
-
};
|
|
157
151
|
prefix_filters = (): Promise<IpPrefix[]> => {
|
|
158
152
|
return this.fetchJson('surf/ipam/prefix_filters');
|
|
159
153
|
};
|
|
@@ -35,7 +35,7 @@ export function CreateForm(props: IProps) {
|
|
|
35
35
|
|
|
36
36
|
const submit = useCallback(
|
|
37
37
|
(userInputs: object[]) => {
|
|
38
|
-
return apiClient.
|
|
38
|
+
return apiClient.startForm(formKey, userInputs).then((form) => {
|
|
39
39
|
handleSubmit(form);
|
|
40
40
|
});
|
|
41
41
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useQuery } from 'react-query';
|
|
1
|
+
import { UseQueryOptions, useQuery } from 'react-query';
|
|
2
2
|
|
|
3
3
|
import { Variables } from 'graphql-request/build/cjs/types';
|
|
4
4
|
import { signOut } from 'next-auth/react';
|
|
@@ -9,6 +9,7 @@ export const useQueryWithFetch = <T, V extends Variables>(
|
|
|
9
9
|
url: string,
|
|
10
10
|
queryVars: V,
|
|
11
11
|
queryKey: string,
|
|
12
|
+
options?: UseQueryOptions<T, unknown, T, [string, ...unknown[]]>,
|
|
12
13
|
) => {
|
|
13
14
|
const { session } = useWfoSession();
|
|
14
15
|
const requestHeaders = {
|
|
@@ -29,5 +30,9 @@ export const useQueryWithFetch = <T, V extends Variables>(
|
|
|
29
30
|
}
|
|
30
31
|
return (await response.json()) as T;
|
|
31
32
|
};
|
|
32
|
-
return useQuery(
|
|
33
|
+
return useQuery(
|
|
34
|
+
[queryKey, ...Object.values(queryVars)],
|
|
35
|
+
fetchData,
|
|
36
|
+
options,
|
|
37
|
+
);
|
|
33
38
|
};
|
|
@@ -107,7 +107,7 @@ export const WfoStartPage = () => {
|
|
|
107
107
|
) ?? [],
|
|
108
108
|
button: {
|
|
109
109
|
name: t('outOfSyncSubscriptions.buttonText'),
|
|
110
|
-
url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%
|
|
110
|
+
url: `${PATH_SUBSCRIPTIONS}?activeTab=ALL&sortBy=field-startDate_order-ASC&queryString=status%3A%28provisioning%7Cactive%29+insync%3Afalse`,
|
|
111
111
|
},
|
|
112
112
|
isLoading: outOfSyncsubscriptionsSummaryIsFetching,
|
|
113
113
|
};
|
package/src/types/index.ts
CHANGED
package/src/utils/string.spec.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
camelToHuman,
|
|
3
|
+
removeSuffix,
|
|
4
|
+
snakeToHuman,
|
|
5
|
+
snakeToKebab,
|
|
6
|
+
upperCaseFirstChar,
|
|
7
|
+
} from './strings';
|
|
2
8
|
|
|
3
9
|
describe('upperCaseFirstChar()', () => {
|
|
4
10
|
it("Doesn't crash on an empty string but returns empty string", () => {
|
|
@@ -68,3 +74,33 @@ describe('camelToHuman()', () => {
|
|
|
68
74
|
expect(result).toEqual('A Quick Brown Fox');
|
|
69
75
|
});
|
|
70
76
|
});
|
|
77
|
+
|
|
78
|
+
describe('snakeToHuman()', () => {
|
|
79
|
+
it('Returns an empty string when input is an empty string', () => {
|
|
80
|
+
const result = snakeToHuman('');
|
|
81
|
+
expect(result).toEqual('');
|
|
82
|
+
});
|
|
83
|
+
it('Returns two words from a single underscore snake case word', () => {
|
|
84
|
+
const result = snakeToHuman('hello_world');
|
|
85
|
+
expect(result).toEqual('hello world');
|
|
86
|
+
});
|
|
87
|
+
it('Returns multiple words from a multiple underscore snake case word', () => {
|
|
88
|
+
const result = snakeToHuman('quick_brown_fox');
|
|
89
|
+
expect(result).toEqual('quick brown fox');
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('snakeToKebab()', () => {
|
|
94
|
+
it('Returns an empty string when input is an empty string', () => {
|
|
95
|
+
const result = snakeToKebab('');
|
|
96
|
+
expect(result).toEqual('');
|
|
97
|
+
});
|
|
98
|
+
it('Returns kebab case word from a single underscore snake case word', () => {
|
|
99
|
+
const result = snakeToKebab('hello_world');
|
|
100
|
+
expect(result).toEqual('hello-world');
|
|
101
|
+
});
|
|
102
|
+
it('Returns kebab case word from a multiple underscore snake case word', () => {
|
|
103
|
+
const result = snakeToKebab('quick_brown_fox');
|
|
104
|
+
expect(result).toEqual('quick-brown-fox');
|
|
105
|
+
});
|
|
106
|
+
});
|
package/src/utils/strings.ts
CHANGED
|
@@ -13,3 +13,12 @@ export const camelToHuman = (value: string): string => {
|
|
|
13
13
|
const result = value.replace(/([A-Z])/g, ' $1').trimStart();
|
|
14
14
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
15
15
|
};
|
|
16
|
+
|
|
17
|
+
export const snakeToHuman = (value: string): string => {
|
|
18
|
+
const result = value.replace(/_/g, ' ');
|
|
19
|
+
return result.charAt(0) + result.slice(1);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const snakeToKebab = (value: string): string => {
|
|
23
|
+
return value.replace(/_/g, '-');
|
|
24
|
+
};
|