@budibase/server 2.6.10 → 2.6.12
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/builder/assets/{index.15b5f48f.js → index.a40dcadd.js} +111 -111
- package/builder/index.html +1 -1
- package/dist/api/controllers/table/internal.js +3 -0
- package/dist/api/controllers/table/utils.js +7 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/rowProcessor/index.js +1 -3
- package/dist/utilities/rowProcessor/map.js +18 -17
- package/package.json +8 -8
- package/src/api/controllers/table/index.ts +1 -0
- package/src/api/controllers/table/internal.ts +5 -0
- package/src/api/controllers/table/utils.ts +7 -7
- package/src/api/routes/tests/misc.spec.js +84 -5
- package/src/api/routes/tests/row.spec.js +57 -8
- package/src/api/routes/tests/table.spec.js +4 -1
- package/src/utilities/rowProcessor/index.ts +2 -3
- package/src/utilities/rowProcessor/map.ts +18 -16
package/builder/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
10
10
|
rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/builder/assets/index.
|
|
11
|
+
<script type="module" crossorigin src="/builder/assets/index.a40dcadd.js"></script>
|
|
12
12
|
<link rel="stylesheet" href="/builder/assets/index.86c992bf.css">
|
|
13
13
|
</head>
|
|
14
14
|
|
|
@@ -185,9 +185,12 @@ function destroy(ctx) {
|
|
|
185
185
|
exports.destroy = destroy;
|
|
186
186
|
function bulkImport(ctx) {
|
|
187
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
const db = backend_core_1.context.getAppDB();
|
|
188
189
|
const table = yield sdk_1.default.tables.getTable(ctx.params.tableId);
|
|
189
190
|
const { rows } = ctx.request.body;
|
|
190
191
|
yield (0, utils_2.handleDataImport)(ctx.user, table, rows);
|
|
192
|
+
// Ensure auto id and other table updates are persisted
|
|
193
|
+
yield db.put(table);
|
|
191
194
|
return table;
|
|
192
195
|
});
|
|
193
196
|
}
|
|
@@ -114,15 +114,15 @@ function importToRows(data, table, user = null) {
|
|
|
114
114
|
// the real schema of the table passed in, not the clone used for
|
|
115
115
|
// incrementing auto IDs
|
|
116
116
|
for (const [fieldName, schema] of Object.entries(originalTable.schema)) {
|
|
117
|
+
const rowVal = Array.isArray(row[fieldName])
|
|
118
|
+
? row[fieldName]
|
|
119
|
+
: [row[fieldName]];
|
|
117
120
|
if ((schema.type === constants_1.FieldTypes.OPTIONS ||
|
|
118
121
|
schema.type === constants_1.FieldTypes.ARRAY) &&
|
|
119
|
-
row[fieldName]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
schema.constraints.inclusion =
|
|
123
|
-
...schema.constraints.inclusion,
|
|
124
|
-
row[fieldName],
|
|
125
|
-
];
|
|
122
|
+
row[fieldName]) {
|
|
123
|
+
let merged = [...schema.constraints.inclusion, ...rowVal];
|
|
124
|
+
let superSet = new Set(merged);
|
|
125
|
+
schema.constraints.inclusion = Array.from(superSet);
|
|
126
126
|
schema.constraints.inclusion.sort();
|
|
127
127
|
}
|
|
128
128
|
}
|