@teselagen/ui 0.3.68 → 0.3.70
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/index.cjs.js +201 -187
- package/index.es.js +201 -187
- package/package.json +1 -1
- package/src/FormComponents/Uploader.js +4 -1
- package/src/FormComponents/tryToMatchSchemas.js +15 -12
- package/src/MatchHeaders.js +6 -0
- package/src/UploadCsvWizard.js +6 -0
- package/src/style.css +4 -0
- package/style.css +4 -0
package/package.json
CHANGED
|
@@ -729,7 +729,8 @@ function UploaderInner({
|
|
|
729
729
|
csvValidationIssue: _csvValidationIssue,
|
|
730
730
|
matchedHeaders,
|
|
731
731
|
userSchema,
|
|
732
|
-
searchResults
|
|
732
|
+
searchResults,
|
|
733
|
+
ignoredHeadersMsg
|
|
733
734
|
} = await tryToMatchSchemas({
|
|
734
735
|
incomingData: parsedF.data,
|
|
735
736
|
validateAgainstSchema
|
|
@@ -790,6 +791,7 @@ function UploaderInner({
|
|
|
790
791
|
filesWIssues.push({
|
|
791
792
|
file,
|
|
792
793
|
csvValidationIssue,
|
|
794
|
+
ignoredHeadersMsg,
|
|
793
795
|
matchedHeaders,
|
|
794
796
|
userSchema,
|
|
795
797
|
searchResults
|
|
@@ -798,6 +800,7 @@ function UploaderInner({
|
|
|
798
800
|
filesWOIssues.push({
|
|
799
801
|
file,
|
|
800
802
|
csvValidationIssue,
|
|
803
|
+
ignoredHeadersMsg,
|
|
801
804
|
matchedHeaders,
|
|
802
805
|
userSchema,
|
|
803
806
|
searchResults
|
|
@@ -28,10 +28,11 @@ export default async function tryToMatchSchemas({
|
|
|
28
28
|
await resolveValidateAgainstSchema(validateAgainstSchema);
|
|
29
29
|
const userSchema = getSchema(incomingData);
|
|
30
30
|
|
|
31
|
-
const { searchResults, csvValidationIssue } =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const { searchResults, csvValidationIssue, ignoredHeadersMsg } =
|
|
32
|
+
await matchSchemas({
|
|
33
|
+
userSchema,
|
|
34
|
+
officialSchema: validateAgainstSchema
|
|
35
|
+
});
|
|
35
36
|
|
|
36
37
|
const incomingHeadersToScores = {};
|
|
37
38
|
|
|
@@ -67,6 +68,7 @@ export default async function tryToMatchSchemas({
|
|
|
67
68
|
});
|
|
68
69
|
|
|
69
70
|
return {
|
|
71
|
+
ignoredHeadersMsg,
|
|
70
72
|
csvValidationIssue,
|
|
71
73
|
matchedHeaders,
|
|
72
74
|
userSchema,
|
|
@@ -150,7 +152,10 @@ async function matchSchemas({ userSchema, officialSchema }) {
|
|
|
150
152
|
matchedAltPaths.includes(uh.path)
|
|
151
153
|
)
|
|
152
154
|
) {
|
|
153
|
-
|
|
155
|
+
// check that the column does contain data (if it doesn't, it's probably a blank column)
|
|
156
|
+
if (userSchema.userData.some(e => e[uh.path])) {
|
|
157
|
+
ignoredUserSchemaFields.push(uh);
|
|
158
|
+
}
|
|
154
159
|
}
|
|
155
160
|
});
|
|
156
161
|
|
|
@@ -224,18 +229,16 @@ async function matchSchemas({ userSchema, officialSchema }) {
|
|
|
224
229
|
}
|
|
225
230
|
// csvValidationIssue = `Some of the data doesn't look quite right. Do these header mappings look correct?`;
|
|
226
231
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
// }
|
|
231
|
-
if (!csvValidationIssue && ignoredUserSchemaFields.length) {
|
|
232
|
-
csvValidationIssue = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields
|
|
232
|
+
let ignoredHeadersMsg;
|
|
233
|
+
if (ignoredUserSchemaFields.length) {
|
|
234
|
+
ignoredHeadersMsg = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields
|
|
233
235
|
.map(f => f.displayName || f.path)
|
|
234
236
|
.join(", ")}`;
|
|
235
237
|
}
|
|
236
238
|
return {
|
|
237
239
|
searchResults: officialSchema.fields,
|
|
238
|
-
csvValidationIssue
|
|
240
|
+
csvValidationIssue,
|
|
241
|
+
ignoredHeadersMsg
|
|
239
242
|
};
|
|
240
243
|
}
|
|
241
244
|
|
package/src/MatchHeaders.js
CHANGED
|
@@ -13,6 +13,7 @@ export function MatchHeaders({
|
|
|
13
13
|
onMultiFileUploadSubmit,
|
|
14
14
|
doAllFilesHaveSameHeaders,
|
|
15
15
|
csvValidationIssue,
|
|
16
|
+
ignoredHeadersMsg,
|
|
16
17
|
searchResults,
|
|
17
18
|
matchedHeaders,
|
|
18
19
|
userSchema,
|
|
@@ -37,6 +38,11 @@ export function MatchHeaders({
|
|
|
37
38
|
{csvValidationIssue}
|
|
38
39
|
</Callout>
|
|
39
40
|
)}
|
|
41
|
+
{!onMultiFileUploadSubmit && ignoredHeadersMsg && (
|
|
42
|
+
<Callout style={{ width: "fit-content" }} intent="warning">
|
|
43
|
+
{ignoredHeadersMsg}
|
|
44
|
+
</Callout>
|
|
45
|
+
)}
|
|
40
46
|
<br></br>
|
|
41
47
|
<tr
|
|
42
48
|
style={{
|
package/src/UploadCsvWizard.js
CHANGED
|
@@ -76,6 +76,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
76
76
|
doAllFilesHaveSameHeaders,
|
|
77
77
|
destroyForms,
|
|
78
78
|
csvValidationIssue,
|
|
79
|
+
ignoredHeadersMsg,
|
|
79
80
|
searchResults,
|
|
80
81
|
matchedHeaders,
|
|
81
82
|
userSchema,
|
|
@@ -222,6 +223,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
222
223
|
destroyForms,
|
|
223
224
|
setFilesWIssues,
|
|
224
225
|
csvValidationIssue,
|
|
226
|
+
ignoredHeadersMsg,
|
|
225
227
|
searchResults,
|
|
226
228
|
matchedHeaders,
|
|
227
229
|
userSchema,
|
|
@@ -266,6 +268,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
266
268
|
reduxFormEntitiesArray,
|
|
267
269
|
// onMultiFileUploadSubmit,
|
|
268
270
|
csvValidationIssue,
|
|
271
|
+
ignoredHeadersMsg,
|
|
269
272
|
searchResults,
|
|
270
273
|
matchedHeaders,
|
|
271
274
|
userSchema,
|
|
@@ -312,6 +315,7 @@ const UploadCsvWizardDialog = compose(
|
|
|
312
315
|
searchResults,
|
|
313
316
|
onUploadWizardFinish,
|
|
314
317
|
csvValidationIssue,
|
|
318
|
+
ignoredHeadersMsg,
|
|
315
319
|
matchedHeaders,
|
|
316
320
|
//fromRedux:
|
|
317
321
|
changeForm,
|
|
@@ -344,6 +348,7 @@ const UploadCsvWizardDialogInner = compose(
|
|
|
344
348
|
searchResults,
|
|
345
349
|
onUploadWizardFinish,
|
|
346
350
|
csvValidationIssue,
|
|
351
|
+
ignoredHeadersMsg,
|
|
347
352
|
matchedHeaders,
|
|
348
353
|
//fromRedux:
|
|
349
354
|
handleSubmit,
|
|
@@ -383,6 +388,7 @@ const UploadCsvWizardDialogInner = compose(
|
|
|
383
388
|
{...{
|
|
384
389
|
onMultiFileUploadSubmit,
|
|
385
390
|
csvValidationIssue,
|
|
391
|
+
ignoredHeadersMsg,
|
|
386
392
|
searchResults,
|
|
387
393
|
matchedHeaders,
|
|
388
394
|
userSchema,
|
package/src/style.css
CHANGED
|
@@ -242,3 +242,7 @@ button:not(:disabled):active {
|
|
|
242
242
|
text-align: unset !important;
|
|
243
243
|
cursor: pointer !important;
|
|
244
244
|
} */
|
|
245
|
+
|
|
246
|
+
.bp3-dialog-header .bp3-heading {
|
|
247
|
+
width: 10px; /* tnw: this is a hack to prevent the dialog title from causing the dialog width to expand larger than the dialog content*/
|
|
248
|
+
}
|
package/style.css
CHANGED
|
@@ -9060,6 +9060,10 @@ button:not(:disabled):active {
|
|
|
9060
9060
|
text-align: unset !important;
|
|
9061
9061
|
cursor: pointer !important;
|
|
9062
9062
|
} */
|
|
9063
|
+
|
|
9064
|
+
.bp3-dialog-header .bp3-heading {
|
|
9065
|
+
width: 10px; /* tnw: this is a hack to prevent the dialog title from causing the dialog width to expand larger than the dialog content*/
|
|
9066
|
+
}
|
|
9063
9067
|
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}.rg-celleditor-input,
|
|
9064
9068
|
.rg-celleditor input {
|
|
9065
9069
|
border: none;
|