nucleus-core-ts 0.9.857 → 0.9.859

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.
@@ -40,7 +40,13 @@ export function MappingAccountFields({ value, targetFields, targets, disabled, o
40
40
  onChange({
41
41
  entity: '',
42
42
  idColumn,
43
- matchColumn: 'email',
43
+ // Nothing is chosen until the accounts table is, because until then there
44
+ // is no list to choose from. It used to default to the literal 'email' —
45
+ // a column this product cannot promise exists, so an installation whose
46
+ // accounts are identified by a staff number or a username started with a
47
+ // rule pointing at a column that was not there, and the run failed at the
48
+ // first account.
49
+ matchColumn: '',
44
50
  matchFrom: emailish,
45
51
  passwordColumn: ''
46
52
  });
@@ -70,7 +76,9 @@ export function MappingAccountFields({ value, targetFields, targets, disabled, o
70
76
  onChange: (event)=>patch({
71
77
  entity: event.target.value,
72
78
  passwordColumn: '',
73
- matchColumn: 'email'
79
+ // Cleared, not guessed: the columns of the table just
80
+ // chosen are what the next field offers.
81
+ matchColumn: ''
74
82
  }),
75
83
  value: value.entity,
76
84
  children: [
@@ -26,6 +26,7 @@ export const TRANSFORMS = [
26
26
  'toBoolean',
27
27
  'dateOnly',
28
28
  'emailSafe',
29
+ 'slug',
29
30
  'pathLeaf',
30
31
  'toList'
31
32
  ];
@@ -39,6 +40,7 @@ export const TRANSFORM_LABEL = {
39
40
  toBoolean: 'To boolean',
40
41
  dateOnly: 'Date only',
41
42
  emailSafe: 'E-mail safe (ascii, lowercase)',
43
+ slug: 'URL slug (ascii, lowercase, hyphens)',
42
44
  pathLeaf: 'Last part of a path (A/B/C → C)',
43
45
  toList: 'To a list (for a column that holds many)'
44
46
  };
@@ -136,6 +136,16 @@ export const { useStore: useIntegrationsStore } = createStore(initial, {
136
136
  store.mappingsLoading = loading;
137
137
  },
138
138
  selectMapping: (store)=>(id)=>batch(()=>{
139
+ /*
140
+ * Choosing the mapping you are already on changes nothing.
141
+ *
142
+ * Everything below discards what belongs to the PREVIOUS mapping — its
143
+ * plan, its running import, its progress. Selecting the same one again
144
+ * therefore threw away the tracking of an import that was still going:
145
+ * clicking its row in the list while it ran, or arriving at the step from
146
+ * a link that re-selected it, left the progress bar gone and the run
147
+ * apparently finished. It was still writing.
148
+ */ if (store.selectedMappingId === id) return;
139
149
  store.selectedMappingId = id;
140
150
  // A plan belongs to the mapping it was computed for. Showing it against a
141
151
  // different one would have an operator approve counts from another import.
@@ -88,7 +88,7 @@ export type IntegrationEndpoint = {
88
88
  } | null;
89
89
  enabled?: boolean;
90
90
  };
91
- export type MappingTransformValue = 'none' | 'trim' | 'upper' | 'lower' | 'toString' | 'toNumber' | 'toBoolean' | 'dateOnly' | 'emailSafe' | 'pathLeaf' | 'toList';
91
+ export type MappingTransformValue = 'none' | 'trim' | 'upper' | 'lower' | 'toString' | 'toNumber' | 'toBoolean' | 'dateOnly' | 'emailSafe' | 'slug' | 'pathLeaf' | 'toList';
92
92
  export type FieldMappingValue = {
93
93
  source: string;
94
94
  target: string;