nucleus-core-ts 0.9.840 → 0.9.842
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/dist/fe/components/IntegrationsPage/components/ConnectionSwitcher.js +12 -4
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.js +14 -22
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.js +29 -1
- package/dist/fe/components/IntegrationsPage/components/MappingAccountFields.js +270 -280
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.js +98 -88
- package/dist/fe/components/IntegrationsPage/components/MappingScheduleFields.js +80 -90
- package/dist/fe/components/IntegrationsPage/components/Primitives.d.ts +17 -0
- package/dist/fe/components/IntegrationsPage/components/Primitives.js +37 -0
- package/dist/fe/components/IntegrationsPage/components/ReferenceCheckRows.js +14 -22
- package/dist/fe/components/IntegrationsPage/theme/index.d.ts +8 -0
- package/dist/fe/components/IntegrationsPage/theme/index.js +15 -0
- package/package.json +1 -1
|
@@ -18,8 +18,16 @@ import { integrationsPageTheme as theme } from '../theme';
|
|
|
18
18
|
*/ export function ConnectionSwitcher() {
|
|
19
19
|
const store = useIntegrationsStore();
|
|
20
20
|
const labels = useLabels();
|
|
21
|
+
/**
|
|
22
|
+
* The way back does not depend on finding anything.
|
|
23
|
+
*
|
|
24
|
+
* `store.sources` is the rail's CURRENT PAGE, and the rail is unmounted the
|
|
25
|
+
* moment a connection is chosen — so a selected connection that is not on
|
|
26
|
+
* that page rendered nothing at all here: no name, and no way back to the
|
|
27
|
+
* list short of reloading the page. The name is what needs looking up; the
|
|
28
|
+
* button is not.
|
|
29
|
+
*/ if (!store.selectedSourceId) return null;
|
|
21
30
|
const source = store.sources.find((candidate)=>candidate.id === store.selectedSourceId);
|
|
22
|
-
if (!source) return null;
|
|
23
31
|
return /*#__PURE__*/ _jsxs("div", {
|
|
24
32
|
className: cn('flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-slate-200/80 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900'),
|
|
25
33
|
children: [
|
|
@@ -32,12 +40,12 @@ import { integrationsPageTheme as theme } from '../theme';
|
|
|
32
40
|
}),
|
|
33
41
|
/*#__PURE__*/ _jsx("span", {
|
|
34
42
|
className: "truncate font-semibold text-base text-slate-900 dark:text-slate-100",
|
|
35
|
-
children: source.
|
|
43
|
+
children: source?.name ?? labels.connections.heading
|
|
36
44
|
}),
|
|
37
|
-
/*#__PURE__*/ _jsx("span", {
|
|
45
|
+
source?.baseUrl ? /*#__PURE__*/ _jsx("span", {
|
|
38
46
|
className: cn(theme.list.itemMeta, 'mt-0.5'),
|
|
39
47
|
children: source.baseUrl
|
|
40
|
-
})
|
|
48
|
+
}) : null
|
|
41
49
|
]
|
|
42
50
|
}),
|
|
43
51
|
/*#__PURE__*/ _jsx("button", {
|
|
@@ -6,7 +6,7 @@ import { useLabels } from '../text/context';
|
|
|
6
6
|
import { integrationsPageTheme } from '../theme';
|
|
7
7
|
import { FieldMappingRow } from './FieldMappingRow';
|
|
8
8
|
import { EMPTY_FIELD_MAPPING, FIELD_MAPPING_COLUMNS, FIELD_MAPPING_GRID, PARENT_PREFIX } from './fieldMappingOptions';
|
|
9
|
-
import { Notice } from './Primitives';
|
|
9
|
+
import { Notice, Section } from './Primitives';
|
|
10
10
|
/**
|
|
11
11
|
* The rows that say which incoming value becomes which column.
|
|
12
12
|
*
|
|
@@ -33,28 +33,20 @@ export function FieldMappingRows({ rows, sourceFields, targetFields, disabled, o
|
|
|
33
33
|
if (!moving || !displaced) return;
|
|
34
34
|
onChange(rows.with(index, displaced).with(target, moving));
|
|
35
35
|
};
|
|
36
|
-
return /*#__PURE__*/ _jsxs(
|
|
37
|
-
|
|
36
|
+
return /*#__PURE__*/ _jsxs(Section, {
|
|
37
|
+
action: /*#__PURE__*/ _jsx("button", {
|
|
38
|
+
className: theme.button.secondary,
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
onClick: ()=>onChange([
|
|
41
|
+
...rows,
|
|
42
|
+
EMPTY_FIELD_MAPPING
|
|
43
|
+
]),
|
|
44
|
+
type: "button",
|
|
45
|
+
children: "Add field"
|
|
46
|
+
}),
|
|
47
|
+
purpose: "Which incoming value becomes which column. The order is the order they are applied in.",
|
|
48
|
+
title: labels.mappings.fieldsHeading,
|
|
38
49
|
children: [
|
|
39
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
40
|
-
className: "flex flex-wrap items-center justify-between gap-2",
|
|
41
|
-
children: [
|
|
42
|
-
/*#__PURE__*/ _jsx("h3", {
|
|
43
|
-
className: theme.card.title,
|
|
44
|
-
children: labels.mappings.fieldsHeading
|
|
45
|
-
}),
|
|
46
|
-
/*#__PURE__*/ _jsx("button", {
|
|
47
|
-
className: theme.button.secondary,
|
|
48
|
-
disabled: disabled,
|
|
49
|
-
onClick: ()=>onChange([
|
|
50
|
-
...rows,
|
|
51
|
-
EMPTY_FIELD_MAPPING
|
|
52
|
-
]),
|
|
53
|
-
type: "button",
|
|
54
|
-
children: "Add field"
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
}),
|
|
58
50
|
sourceFields.length === 0 ? /*#__PURE__*/ _jsx(Notice, {
|
|
59
51
|
title: labels.mappings.sampleFirstTitle,
|
|
60
52
|
tone: "warning",
|
|
@@ -100,14 +100,42 @@ export function IntegrationsPage({ title = 'Integrations', subtitle = 'Connect a
|
|
|
100
100
|
focusTargetEntity,
|
|
101
101
|
focusStep
|
|
102
102
|
]);
|
|
103
|
+
/**
|
|
104
|
+
* Chosen for them ONCE, and never again.
|
|
105
|
+
*
|
|
106
|
+
* This used to re-choose whenever nothing was selected — so pressing "Change"
|
|
107
|
+
* cleared the connection and the same effect immediately put it back. There
|
|
108
|
+
* was no way to reach the list again short of reloading the page, and the
|
|
109
|
+
* button looked broken rather than overruled.
|
|
110
|
+
*/ const autoSelected = useRef(false);
|
|
103
111
|
const followFocus = useEffectEvent(()=>{
|
|
104
112
|
if (!store.focusTargetEntity) return;
|
|
105
113
|
if (!store.selectedSourceId) {
|
|
106
|
-
if (store.sources.length === 1 && store.sources[0])
|
|
114
|
+
if (!autoSelected.current && store.sources.length === 1 && store.sources[0]) {
|
|
115
|
+
autoSelected.current = true;
|
|
116
|
+
store.selectSource(store.sources[0].id);
|
|
117
|
+
}
|
|
107
118
|
return;
|
|
108
119
|
}
|
|
109
120
|
if (store.tab !== 'mappings') store.setTab('mappings');
|
|
110
121
|
});
|
|
122
|
+
/**
|
|
123
|
+
* Leaving a connection spends the arrival.
|
|
124
|
+
*
|
|
125
|
+
* Somebody who pressed "Change" is choosing a different connection; the table
|
|
126
|
+
* they arrived asking about is no longer what they are doing, and carrying it
|
|
127
|
+
* forward would jump them into a mapping of a connection they had not picked
|
|
128
|
+
* yet.
|
|
129
|
+
*/ const forgetFocusOnLeave = useEffectEvent(()=>{
|
|
130
|
+
if (autoSelected.current && !store.selectedSourceId && store.focusTargetEntity) {
|
|
131
|
+
store.setFocusTargetEntity(null);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
useEffect(()=>{
|
|
135
|
+
forgetFocusOnLeave();
|
|
136
|
+
}, [
|
|
137
|
+
store.selectedSourceId
|
|
138
|
+
]);
|
|
111
139
|
useEffect(()=>{
|
|
112
140
|
followFocus();
|
|
113
141
|
}, [
|