nucleus-core-ts 0.9.831 → 0.9.833

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.
@@ -51,62 +51,30 @@ const FAMILY_NAME = /^(surname|last|lastname|family|soyad)$/i;
51
51
  }
52
52
  export function RunPlanSuggestions({ plan, mapping, onEditMapping }) {
53
53
  const missing = missingRequiredCounts(plan);
54
- if (missing.length === 0) return null;
54
+ const withoutAccount = plan.issues.filter((issue)=>issue.kind === 'account_unmatched').length;
55
+ if (missing.length === 0 && withoutAccount === 0) return null;
55
56
  const template = suggestEmailTemplate(mapping);
56
- return /*#__PURE__*/ _jsx("section", {
57
+ return /*#__PURE__*/ _jsxs("section", {
57
58
  className: "flex flex-col gap-3",
58
- children: missing.map((entry)=>{
59
- const isEmail = EMAIL_LIKE.test(entry.field);
60
- return /*#__PURE__*/ _jsxs(Notice, {
61
- title: `${entry.records} record(s) have no ${entry.field}, so they are left out`,
59
+ children: [
60
+ withoutAccount > 0 ? /*#__PURE__*/ _jsxs(Notice, {
61
+ title: `${withoutAccount} record(s) will be imported without a login`,
62
62
  tone: "warning",
63
63
  children: [
64
- isEmail && template ? /*#__PURE__*/ _jsxs(_Fragment, {
64
+ /*#__PURE__*/ _jsx("p", {
65
+ children: "They have nothing to create an account under — the column the account is identified by is empty on them. They are still imported, so they appear in the directory; they simply cannot sign in."
66
+ }),
67
+ template ? /*#__PURE__*/ _jsxs("p", {
68
+ className: "mt-1",
65
69
  children: [
66
- /*#__PURE__*/ _jsxs("p", {
67
- children: [
68
- "An address can be built from the fields the source DOES send. On the mapping, set",
69
- ' ',
70
- /*#__PURE__*/ _jsx("strong", {
71
- children: "Fallback"
72
- }),
73
- " on the ",
74
- /*#__PURE__*/ _jsx("strong", {
75
- children: entry.field
76
- }),
77
- " row to something like:"
78
- ]
79
- }),
80
- /*#__PURE__*/ _jsx("p", {
81
- className: "mt-1",
82
- children: /*#__PURE__*/ _jsx("code", {
83
- className: theme.code,
84
- children: template
85
- })
70
+ 'Giving that column a Fallback fixes it for all of them at once — ',
71
+ /*#__PURE__*/ _jsx("code", {
72
+ className: theme.code,
73
+ children: template
86
74
  }),
87
- /*#__PURE__*/ _jsxs("p", {
88
- className: "mt-1",
89
- children: [
90
- "Pair it with the ",
91
- /*#__PURE__*/ _jsx("strong", {
92
- children: "E-mail safe"
93
- }),
94
- " transform and ",
95
- /*#__PURE__*/ _jsx("em", {
96
- children: "Ayşe Yılmaz"
97
- }),
98
- ' ',
99
- "becomes ",
100
- /*#__PURE__*/ _jsx("em", {
101
- children: "ayse.yilmaz@example.com"
102
- }),
103
- ". Records that already carry an address keep the one they have — the fallback is only used when the source is empty."
104
- ]
105
- })
75
+ ' and everybody gets an account.'
106
76
  ]
107
- }) : /*#__PURE__*/ _jsx("p", {
108
- children: `Nothing in this import fills ${entry.field}, and the table will not accept a row without it. Either map a source field to it, or give that row a Fallback — a fixed value, or one built from other fields with {braces}.`
109
- }),
77
+ }) : null,
110
78
  onEditMapping ? /*#__PURE__*/ _jsx("button", {
111
79
  className: `${theme.button.secondary} mt-3`,
112
80
  onClick: onEditMapping,
@@ -114,7 +82,68 @@ export function RunPlanSuggestions({ plan, mapping, onEditMapping }) {
114
82
  children: "Open the mapping"
115
83
  }) : null
116
84
  ]
117
- }, entry.field);
118
- })
85
+ }) : null,
86
+ missing.map((entry)=>{
87
+ const isEmail = EMAIL_LIKE.test(entry.field);
88
+ return /*#__PURE__*/ _jsxs(Notice, {
89
+ title: `${entry.records} record(s) have no ${entry.field}, so they are left out`,
90
+ tone: "warning",
91
+ children: [
92
+ isEmail && template ? /*#__PURE__*/ _jsxs(_Fragment, {
93
+ children: [
94
+ /*#__PURE__*/ _jsxs("p", {
95
+ children: [
96
+ "An address can be built from the fields the source DOES send. On the mapping, set",
97
+ ' ',
98
+ /*#__PURE__*/ _jsx("strong", {
99
+ children: "Fallback"
100
+ }),
101
+ " on the ",
102
+ /*#__PURE__*/ _jsx("strong", {
103
+ children: entry.field
104
+ }),
105
+ " row to something like:"
106
+ ]
107
+ }),
108
+ /*#__PURE__*/ _jsx("p", {
109
+ className: "mt-1",
110
+ children: /*#__PURE__*/ _jsx("code", {
111
+ className: theme.code,
112
+ children: template
113
+ })
114
+ }),
115
+ /*#__PURE__*/ _jsxs("p", {
116
+ className: "mt-1",
117
+ children: [
118
+ "Pair it with the ",
119
+ /*#__PURE__*/ _jsx("strong", {
120
+ children: "E-mail safe"
121
+ }),
122
+ " transform and ",
123
+ /*#__PURE__*/ _jsx("em", {
124
+ children: "Ayşe Yılmaz"
125
+ }),
126
+ ' ',
127
+ "becomes ",
128
+ /*#__PURE__*/ _jsx("em", {
129
+ children: "ayse.yilmaz@example.com"
130
+ }),
131
+ ". Records that already carry an address keep the one they have — the fallback is only used when the source is empty."
132
+ ]
133
+ })
134
+ ]
135
+ }) : /*#__PURE__*/ _jsx("p", {
136
+ children: `Nothing in this import fills ${entry.field}, and the table will not accept a row without it. Either map a source field to it, or give that row a Fallback — a fixed value, or one built from other fields with {braces}.`
137
+ }),
138
+ onEditMapping ? /*#__PURE__*/ _jsx("button", {
139
+ className: `${theme.button.secondary} mt-3`,
140
+ onClick: onEditMapping,
141
+ type: "button",
142
+ children: "Open the mapping"
143
+ }) : null
144
+ ]
145
+ }, entry.field);
146
+ })
147
+ ]
119
148
  });
120
149
  }