@proteinjs/db-ui 1.8.4 → 1.9.0
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/CHANGELOG.md +22 -0
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/src/pages/HashGeneratorPage.d.ts.map +1 -1
- package/dist/src/pages/HashGeneratorPage.js +0 -1
- package/dist/src/pages/HashGeneratorPage.js.map +1 -1
- package/dist/src/pages/RecordFormPage.d.ts.map +1 -1
- package/dist/src/pages/RecordFormPage.js +13 -6
- package/dist/src/pages/RecordFormPage.js.map +1 -1
- package/dist/src/pages/RecordTablePage.d.ts.map +1 -1
- package/dist/src/pages/RecordTablePage.js +9 -6
- package/dist/src/pages/RecordTablePage.js.map +1 -1
- package/dist/src/pages/TablesPage.d.ts.map +1 -1
- package/dist/src/pages/TablesPage.js +0 -1
- package/dist/src/pages/TablesPage.js.map +1 -1
- package/dist/src/pages/UuidGeneratorPage.d.ts.map +1 -1
- package/dist/src/pages/UuidGeneratorPage.js +0 -1
- package/dist/src/pages/UuidGeneratorPage.js.map +1 -1
- package/dist/src/table/QueryCursorLoader.d.ts +10 -14
- package/dist/src/table/QueryCursorLoader.d.ts.map +1 -1
- package/dist/src/table/QueryCursorLoader.js +20 -41
- package/dist/src/table/QueryCursorLoader.js.map +1 -1
- package/dist/test/QueryCursorLoader.test.d.ts +1 -1
- package/dist/test/QueryCursorLoader.test.d.ts.map +1 -1
- package/dist/test/QueryCursorLoader.test.js +122 -95
- package/dist/test/QueryCursorLoader.test.js.map +1 -1
- package/dist/test/recordPageErrorStates.test.d.ts +2 -0
- package/dist/test/recordPageErrorStates.test.d.ts.map +1 -0
- package/dist/test/recordPageErrorStates.test.js +37 -0
- package/dist/test/recordPageErrorStates.test.js.map +1 -0
- package/generated/index.ts +1 -1
- package/jest.config.js +8 -0
- package/package.json +4 -3
- package/src/pages/HashGeneratorPage.tsx +0 -1
- package/src/pages/RecordFormPage.tsx +13 -7
- package/src/pages/RecordTablePage.tsx +14 -11
- package/src/pages/TablesPage.tsx +0 -1
- package/src/pages/UuidGeneratorPage.tsx +0 -1
- package/src/table/QueryCursorLoader.ts +23 -43
- package/test/QueryCursorLoader.test.ts +87 -94
- package/test/recordPageErrorStates.test.tsx +35 -0
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -51,30 +40,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
40
|
};
|
|
52
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
42
|
/**
|
|
54
|
-
* QueryCursorLoader (src/table/QueryCursorLoader.ts)
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* the
|
|
43
|
+
* QueryCursorLoader (src/table/QueryCursorLoader.ts) as the thin `CursorLoader` adapter over
|
|
44
|
+
* the db-owned `CursorWindowPager`: react-query key derivation, string-cursor encode/decode
|
|
45
|
+
* threading into the pager's lexicographic window queries (primary axis + `id` tiebreak), and
|
|
46
|
+
* exhaustion (short window, and the null-tail rule: NULL sort-value rows collect at the tail
|
|
47
|
+
* under the sort; a null can't anchor a continuation, so paging stops). The db round trip is
|
|
48
|
+
* injected through the pager's `options.db` seam via the house internals-cast pattern — no
|
|
49
|
+
* module mocking.
|
|
59
50
|
*/
|
|
60
51
|
var moment_1 = __importDefault(require("moment"));
|
|
61
|
-
var
|
|
62
|
-
var
|
|
52
|
+
var db_1 = require("@proteinjs/db");
|
|
53
|
+
var QueryCursorLoader_1 = require("../src/table/QueryCursorLoader");
|
|
54
|
+
// Load the reflection source graph so the house Serializer's custom serializers (moments)
|
|
55
|
+
// are registered — cursor encode/decode fidelity rides them.
|
|
56
|
+
require("../generated/index");
|
|
57
|
+
var table = { name: 'test_content' };
|
|
58
|
+
var sort = [{ field: 'lastActivityAt', desc: true }];
|
|
59
|
+
var createQuery = function () { return new db_1.QueryBuilder(table.name); };
|
|
60
|
+
var staged = { rows: [] };
|
|
61
|
+
var executed = [];
|
|
63
62
|
var stubDb = {
|
|
64
63
|
query: function (_table, qb) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
64
|
return __generator(this, function (_a) {
|
|
66
|
-
|
|
67
|
-
return [2 /*return*/,
|
|
65
|
+
executed.push(qb);
|
|
66
|
+
return [2 /*return*/, staged.rows];
|
|
68
67
|
});
|
|
69
68
|
}); },
|
|
70
69
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var internals = function (loader) { return loader; };
|
|
70
|
+
var loaderWithStubDb = function (sortCriteria, query) {
|
|
71
|
+
if (query === void 0) { query = createQuery; }
|
|
72
|
+
var loader = new QueryCursorLoader_1.QueryCursorLoader(table, query, sortCriteria);
|
|
73
|
+
loader.pager.options = { db: stubDb };
|
|
74
|
+
return loader;
|
|
75
|
+
};
|
|
78
76
|
var graphNodes = function (qb) { return qb.graph.nodes().map(function (id) { return qb.graph.node(id); }); };
|
|
79
77
|
var conditionNodes = function (qb) { return graphNodes(qb).filter(function (node) { return (node === null || node === void 0 ? void 0 : node.type) === 'CONDITION'; }); };
|
|
80
78
|
var paginationNode = function (qb) { return graphNodes(qb).find(function (node) { return (node === null || node === void 0 ? void 0 : node.type) === 'PAGINATION'; }); };
|
|
@@ -83,11 +81,11 @@ var dated = function (id, at) { return ({
|
|
|
83
81
|
id: id,
|
|
84
82
|
created: (0, moment_1.default)(),
|
|
85
83
|
updated: (0, moment_1.default)(),
|
|
86
|
-
lastActivityAt: at ? (0, moment_1.default)(at) :
|
|
84
|
+
lastActivityAt: at ? (0, moment_1.default)(at) : null,
|
|
87
85
|
}); };
|
|
88
86
|
beforeEach(function () {
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
staged.rows = [];
|
|
88
|
+
executed.length = 0;
|
|
91
89
|
});
|
|
92
90
|
describe('reactQueryKeys', function () {
|
|
93
91
|
it('names the data set after the table and the query after its serialized query + sort', function () {
|
|
@@ -103,90 +101,119 @@ describe('reactQueryKeys', function () {
|
|
|
103
101
|
expect(resorted.reactQueryKeys.dataQueryKey).not.toBe(loader.reactQueryKeys.dataQueryKey);
|
|
104
102
|
});
|
|
105
103
|
});
|
|
106
|
-
describe('
|
|
107
|
-
it('the first window carries no cursor
|
|
108
|
-
var loader
|
|
109
|
-
var qb = internals(loader).buildWindowQuery(null, 30);
|
|
110
|
-
expect(conditionNodes(qb)).toHaveLength(0);
|
|
111
|
-
expect(paginationNode(qb)).toMatchObject({ start: 0, end: 30 });
|
|
112
|
-
expect(sortNodes(qb)).toHaveLength(1);
|
|
113
|
-
expect(sortNodes(qb)[0].criteria).toMatchObject({ field: 'lastActivityAt', desc: true });
|
|
114
|
-
});
|
|
115
|
-
it('a cursor becomes `field < cursor` on the primary sort field for a descending sort', function () {
|
|
116
|
-
var loader = new QueryCursorLoader_1.QueryCursorLoader(table, createQuery, sort);
|
|
117
|
-
var cursor = (0, moment_1.default)('2026-08-10T12:00:00.000Z');
|
|
118
|
-
var qb = internals(loader).buildWindowQuery(cursor, 30);
|
|
119
|
-
var conditions = conditionNodes(qb);
|
|
120
|
-
expect(conditions).toHaveLength(1);
|
|
121
|
-
expect(conditions[0]).toMatchObject({ field: 'lastActivityAt', operator: '<' });
|
|
122
|
-
expect(conditions[0].value).toBe(cursor);
|
|
123
|
-
expect(paginationNode(qb)).toMatchObject({ start: 0, end: 30 });
|
|
124
|
-
});
|
|
125
|
-
it('an ascending primary sort flips the cursor operator to `>`', function () {
|
|
126
|
-
var loader = new QueryCursorLoader_1.QueryCursorLoader(table, createQuery, [{ field: 'lastActivityAt', desc: false }]);
|
|
127
|
-
var qb = internals(loader).buildWindowQuery(5, 10);
|
|
128
|
-
expect(conditionNodes(qb)[0]).toMatchObject({ field: 'lastActivityAt', operator: '>', value: 5 });
|
|
129
|
-
});
|
|
130
|
-
it('every window builds on a FRESH query — cursor conditions never accumulate across windows', function () {
|
|
131
|
-
var loader = new QueryCursorLoader_1.QueryCursorLoader(table, createQuery, sort);
|
|
132
|
-
internals(loader).buildWindowQuery((0, moment_1.default)('2026-08-10T12:00:00.000Z'), 30);
|
|
133
|
-
var second = internals(loader).buildWindowQuery((0, moment_1.default)('2026-08-01T12:00:00.000Z'), 30);
|
|
134
|
-
expect(conditionNodes(second)).toHaveLength(1);
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
describe('deriveNextCursor — exhaustion', function () {
|
|
138
|
-
var loader = new QueryCursorLoader_1.QueryCursorLoader(table, createQuery, sort);
|
|
139
|
-
it('a short window is exhausted', function () {
|
|
140
|
-
expect(internals(loader).deriveNextCursor([dated('a', '2026-08-10T12:00:00.000Z')], 3)).toBeNull();
|
|
141
|
-
expect(internals(loader).deriveNextCursor([], 3)).toBeNull();
|
|
142
|
-
});
|
|
143
|
-
it('a full window anchors the next cursor at its tail', function () {
|
|
144
|
-
var rows = [
|
|
145
|
-
dated('a', '2026-08-10T12:00:00.000Z'),
|
|
146
|
-
dated('b', '2026-08-09T12:00:00.000Z'),
|
|
147
|
-
dated('c', '2026-08-08T12:00:00.000Z'),
|
|
148
|
-
];
|
|
149
|
-
var next = internals(loader).deriveNextCursor(rows, 3);
|
|
150
|
-
expect(next).toBe(rows[2].lastActivityAt);
|
|
151
|
-
});
|
|
152
|
-
it('a full window with a NULL cursor-field tail is exhausted (null rows collect at the tail; no anchor)', function () {
|
|
153
|
-
var rows = [dated('a', '2026-08-10T12:00:00.000Z'), dated('b', '2026-08-09T12:00:00.000Z'), dated('c', null)];
|
|
154
|
-
expect(internals(loader).deriveNextCursor(rows, 3)).toBeNull();
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
describe('loadWindow', function () {
|
|
158
|
-
it('returns the queried rows with the derived next cursor', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
159
|
-
var loader, rows, window;
|
|
104
|
+
describe('loadWindow — cursor threading', function () {
|
|
105
|
+
it('the first window carries no cursor conditions — the sort (with id tiebreak) and the window pagination', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
106
|
+
var loader, qb;
|
|
160
107
|
return __generator(this, function (_a) {
|
|
161
108
|
switch (_a.label) {
|
|
162
109
|
case 0:
|
|
163
|
-
loader =
|
|
110
|
+
loader = loaderWithStubDb(sort);
|
|
111
|
+
staged.rows = [];
|
|
112
|
+
return [4 /*yield*/, loader.loadWindow(null, 30)];
|
|
113
|
+
case 1:
|
|
114
|
+
_a.sent();
|
|
115
|
+
expect(executed).toHaveLength(1);
|
|
116
|
+
qb = executed[0];
|
|
117
|
+
expect(conditionNodes(qb)).toHaveLength(0);
|
|
118
|
+
expect(paginationNode(qb)).toMatchObject({ start: 0, end: 30 });
|
|
119
|
+
expect(sortNodes(qb).map(function (node) { return node.criteria; })).toEqual([
|
|
120
|
+
{ field: 'lastActivityAt', desc: true },
|
|
121
|
+
{ field: 'id', desc: false },
|
|
122
|
+
]);
|
|
123
|
+
return [2 /*return*/];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}); });
|
|
127
|
+
it('a full window returns a string cursor; feeding it back threads the lexicographic continuation', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
128
|
+
var loader, rows, first, qb, conditions, past;
|
|
129
|
+
return __generator(this, function (_a) {
|
|
130
|
+
switch (_a.label) {
|
|
131
|
+
case 0:
|
|
132
|
+
loader = loaderWithStubDb(sort);
|
|
164
133
|
rows = [
|
|
165
134
|
dated('a', '2026-08-10T12:00:00.000Z'),
|
|
166
135
|
dated('b', '2026-08-09T12:00:00.000Z'),
|
|
167
136
|
dated('c', '2026-08-08T12:00:00.000Z'),
|
|
168
137
|
];
|
|
169
|
-
|
|
138
|
+
staged.rows = rows;
|
|
139
|
+
return [4 /*yield*/, loader.loadWindow(null, 3)];
|
|
140
|
+
case 1:
|
|
141
|
+
first = _a.sent();
|
|
142
|
+
expect(first.rows).toBe(rows);
|
|
143
|
+
expect(typeof first.nextCursor).toBe('string');
|
|
144
|
+
staged.rows = [];
|
|
145
|
+
return [4 /*yield*/, loader.loadWindow(first.nextCursor, 3)];
|
|
146
|
+
case 2:
|
|
147
|
+
_a.sent();
|
|
148
|
+
qb = executed[1];
|
|
149
|
+
conditions = conditionNodes(qb);
|
|
150
|
+
expect(conditions).toHaveLength(3);
|
|
151
|
+
past = conditions.find(function (node) { return node.operator === '<'; });
|
|
152
|
+
expect(past).toMatchObject({ field: 'lastActivityAt' });
|
|
153
|
+
expect(moment_1.default.isMoment(past.value)).toBe(true);
|
|
154
|
+
expect(past.value.toISOString()).toBe(rows[2].lastActivityAt.toISOString());
|
|
155
|
+
expect(conditions.find(function (node) { return node.operator === '='; })).toMatchObject({ field: 'lastActivityAt' });
|
|
156
|
+
expect(conditions.find(function (node) { return node.operator === '>'; })).toMatchObject({ field: 'id', value: 'c' });
|
|
157
|
+
return [2 /*return*/];
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}); });
|
|
161
|
+
it('every window builds on a FRESH query — cursor conditions never accumulate across windows', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
162
|
+
var loader, first, second;
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
loader = loaderWithStubDb(sort);
|
|
167
|
+
staged.rows = [
|
|
168
|
+
dated('a', '2026-08-10T12:00:00.000Z'),
|
|
169
|
+
dated('b', '2026-08-09T12:00:00.000Z'),
|
|
170
|
+
dated('c', '2026-08-08T12:00:00.000Z'),
|
|
171
|
+
];
|
|
172
|
+
return [4 /*yield*/, loader.loadWindow(null, 3)];
|
|
173
|
+
case 1:
|
|
174
|
+
first = _a.sent();
|
|
175
|
+
staged.rows = [
|
|
176
|
+
dated('d', '2026-08-07T12:00:00.000Z'),
|
|
177
|
+
dated('e', '2026-08-06T12:00:00.000Z'),
|
|
178
|
+
dated('f', '2026-08-05T12:00:00.000Z'),
|
|
179
|
+
];
|
|
180
|
+
return [4 /*yield*/, loader.loadWindow(first.nextCursor, 3)];
|
|
181
|
+
case 2:
|
|
182
|
+
second = _a.sent();
|
|
183
|
+
staged.rows = [];
|
|
184
|
+
return [4 /*yield*/, loader.loadWindow(second.nextCursor, 3)];
|
|
185
|
+
case 3:
|
|
186
|
+
_a.sent();
|
|
187
|
+
expect(conditionNodes(executed[2])).toHaveLength(3);
|
|
188
|
+
return [2 /*return*/];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}); });
|
|
192
|
+
});
|
|
193
|
+
describe('loadWindow — exhaustion', function () {
|
|
194
|
+
it('a short window is exhausted (null cursor)', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
195
|
+
var loader, window;
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
switch (_a.label) {
|
|
198
|
+
case 0:
|
|
199
|
+
loader = loaderWithStubDb(sort);
|
|
200
|
+
staged.rows = [dated('a', '2026-08-10T12:00:00.000Z')];
|
|
170
201
|
return [4 /*yield*/, loader.loadWindow(null, 3)];
|
|
171
202
|
case 1:
|
|
172
203
|
window = _a.sent();
|
|
173
|
-
expect(window.
|
|
174
|
-
expect(window.nextCursor).toBe(rows[2].lastActivityAt);
|
|
175
|
-
// The executed query is the built window query: pagination sized to the window.
|
|
176
|
-
expect(queries).toHaveLength(1);
|
|
177
|
-
expect(paginationNode(queries[0])).toMatchObject({ start: 0, end: 3 });
|
|
204
|
+
expect(window.nextCursor).toBeNull();
|
|
178
205
|
return [2 /*return*/];
|
|
179
206
|
}
|
|
180
207
|
});
|
|
181
208
|
}); });
|
|
182
|
-
it('
|
|
209
|
+
it('a full window with a NULL sort-value tail is exhausted (null rows collect at the tail; no anchor)', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
183
210
|
var loader, window;
|
|
184
211
|
return __generator(this, function (_a) {
|
|
185
212
|
switch (_a.label) {
|
|
186
213
|
case 0:
|
|
187
|
-
loader =
|
|
188
|
-
|
|
189
|
-
return [4 /*yield*/, loader.loadWindow(
|
|
214
|
+
loader = loaderWithStubDb(sort);
|
|
215
|
+
staged.rows = [dated('a', '2026-08-10T12:00:00.000Z'), dated('b', '2026-08-09T12:00:00.000Z'), dated('c', null)];
|
|
216
|
+
return [4 /*yield*/, loader.loadWindow(null, 3)];
|
|
190
217
|
case 1:
|
|
191
218
|
window = _a.sent();
|
|
192
219
|
expect(window.nextCursor).toBeNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryCursorLoader.test.js","sourceRoot":"","sources":["../../test/QueryCursorLoader.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QueryCursorLoader.test.js","sourceRoot":"","sources":["../../test/QueryCursorLoader.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;GAQG;AACH,kDAA4B;AAC5B,oCAAsE;AACtE,oEAAmE;AACnE,0FAA0F;AAC1F,6DAA6D;AAC7D,8BAA4B;AAU5B,IAAM,KAAK,GAAG,EAAE,IAAI,EAAE,cAAc,EAAgB,CAAC;AACrD,IAAM,IAAI,GAAwB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5E,IAAM,WAAW,GAAG,cAAM,OAAA,IAAI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M,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,EAAA;;oBAAzC,MAAM,GAAG,SAAgC;oBAC/C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;;;;SACtC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordPageErrorStates.test.d.ts","sourceRoot":"","sources":["../../test/recordPageErrorStates.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var server_1 = require("react-dom/server");
|
|
8
|
+
var RecordFormPage_1 = require("../src/pages/RecordFormPage");
|
|
9
|
+
var RecordTablePage_1 = require("../src/pages/RecordTablePage");
|
|
10
|
+
describe('record form page error states', function () {
|
|
11
|
+
it('renders the not-accessible message for an unknown table (regression: a shadowed catch binding swallowed the message and the page rendered blank)', function () {
|
|
12
|
+
var Form = RecordFormPage_1.recordFormPage.component;
|
|
13
|
+
var html = (0, server_1.renderToStaticMarkup)(react_1.default.createElement(Form, { urlParams: { table: 'NotARealTable' } }));
|
|
14
|
+
expect(html).toContain('Table not accessible in UI: NotARealTable');
|
|
15
|
+
});
|
|
16
|
+
it('renders the missing-param message when no table is provided', function () {
|
|
17
|
+
var Form = RecordFormPage_1.recordFormPage.component;
|
|
18
|
+
var html = (0, server_1.renderToStaticMarkup)(react_1.default.createElement(Form, { urlParams: {} }));
|
|
19
|
+
// (apostrophes render HTML-escaped in static markup, so assert around them)
|
|
20
|
+
expect(html).toContain('Table name not provided via the');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('record table page error states', function () {
|
|
24
|
+
it('renders the not-accessible message outside the table card (the stretched Paper clipped it)', function () {
|
|
25
|
+
var Table = RecordTablePage_1.recordTablePage.component;
|
|
26
|
+
var html = (0, server_1.renderToStaticMarkup)(react_1.default.createElement(Table, { urlParams: { name: 'NotARealTable' } }));
|
|
27
|
+
expect(html).toContain('Table not accessible in UI: NotARealTable');
|
|
28
|
+
expect(html).not.toContain('MuiPaper');
|
|
29
|
+
});
|
|
30
|
+
it('renders the missing-param message when no name is provided', function () {
|
|
31
|
+
var Table = RecordTablePage_1.recordTablePage.component;
|
|
32
|
+
var html = (0, server_1.renderToStaticMarkup)(react_1.default.createElement(Table, { urlParams: {} }));
|
|
33
|
+
// (apostrophes render HTML-escaped in static markup, so assert around them)
|
|
34
|
+
expect(html).toContain('Table not provided via the');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=recordPageErrorStates.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordPageErrorStates.test.js","sourceRoot":"","sources":["../../test/recordPageErrorStates.test.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,2CAAwD;AACxD,8DAA6D;AAC7D,gEAA+D;AAE/D,QAAQ,CAAC,+BAA+B,EAAE;IACxC,EAAE,CAAC,kJAAkJ,EAAE;QACrJ,IAAM,IAAI,GAAG,+BAAc,CAAC,SAAS,CAAC;QACtC,IAAM,IAAI,GAAG,IAAA,6BAAoB,EAAC,8BAAC,IAAI,IAAC,SAAS,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,GAAI,CAAC,CAAC;QACnF,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,2CAA2C,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE;QAChE,IAAM,IAAI,GAAG,+BAAc,CAAC,SAAS,CAAC;QACtC,IAAM,IAAI,GAAG,IAAA,6BAAoB,EAAC,8BAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAI,CAAC,CAAC;QAC3D,4EAA4E;QAC5E,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gCAAgC,EAAE;IACzC,EAAE,CAAC,4FAA4F,EAAE;QAC/F,IAAM,KAAK,GAAG,iCAAe,CAAC,SAAS,CAAC;QACxC,IAAM,IAAI,GAAG,IAAA,6BAAoB,EAAC,8BAAC,KAAK,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,GAAI,CAAC,CAAC;QACnF,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,2CAA2C,CAAC,CAAC;QACpE,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE;QAC/D,IAAM,KAAK,GAAG,iCAAe,CAAC,SAAS,CAAC;QACxC,IAAM,IAAI,GAAG,IAAA,6BAAoB,EAAC,8BAAC,KAAK,IAAC,SAAS,EAAE,EAAE,GAAI,CAAC,CAAC;QAC5D,4EAA4E;QAC5E,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/generated/index.ts
CHANGED
|
@@ -16,7 +16,7 @@ import 'uuid';
|
|
|
16
16
|
/** Generate Source Graph */
|
|
17
17
|
|
|
18
18
|
const sourceGraph =
|
|
19
|
-
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/db-ui/QueryCursorLoader","value":{"packageName":"@proteinjs/db-ui","name":"QueryCursorLoader","filePath":"/home/runner/work/db/db/packages/ui/src/table/QueryCursorLoader.ts","qualifiedName":"@proteinjs/db-ui/QueryCursorLoader","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"reactQueryKeys","type":{"packageName":"@proteinjs/ui","name":"ReactQueryKeys","filePath":null,"qualifiedName":"@proteinjs/ui/ReactQueryKeys","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"sort","type":{"packageName":"","name":"SortCriteria<T>[]","filePath":null,"qualifiedName":"/SortCriteria<T>[]","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"table","type":{"packageName":"","name":"Table<T>","filePath":null,"qualifiedName":"/Table<T>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"createQuery","type":{"packageName":"","name":"() => QueryBuilder<T>","filePath":null,"qualifiedName":"/() => QueryBuilder<T>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"queryOptions","type":{"packageName":"","name":"QueryOptions<T>","filePath":null,"qualifiedName":"/QueryOptions<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"}],"methods":[{"name":"loadWindow","returnType":{"packageName":"","name":"Promise<CursorWindow<T>>","filePath":null,"qualifiedName":"/Promise<CursorWindow<T>>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"cursor","type":{"packageName":"","name":"CursorValue | null","filePath":null,"qualifiedName":"/CursorValue | null","typeParameters":null,"directParents":null}},{"name":"windowSize","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}}]},{"name":"buildWindowQuery","returnType":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"cursor","type":{"packageName":"","name":"CursorValue | null","filePath":null,"qualifiedName":"/CursorValue | null","typeParameters":null,"directParents":null}},{"name":"windowSize","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}}]},{"name":"deriveNextCursor","returnType":{"packageName":"","name":"CursorValue | null","filePath":null,"qualifiedName":"/CursorValue | null","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"rows","type":{"packageName":"","name":"T[]","filePath":null,"qualifiedName":"/T[]","typeParameters":null,"directParents":null}},{"name":"windowSize","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}}]}],"typeParameters":["/T extends Record"],"directParentInterfaces":[{"packageName":"@proteinjs/ui","name":"CursorLoader","filePath":null,"qualifiedName":"@proteinjs/ui/CursorLoader","properties":[],"methods":[],"typeParameters":["/T"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/ui/CursorLoader"},{"v":"@proteinjs/db-ui/QueryTableLoader","value":{"packageName":"@proteinjs/db-ui","name":"QueryTableLoader","filePath":"/home/runner/work/db/db/packages/ui/src/table/QueryTableLoader.ts","qualifiedName":"@proteinjs/db-ui/QueryTableLoader","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"rowCountQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"paginationQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"reactQueryKeys","type":{"packageName":"","name":"TableLoader<T>[\'reactQueryKeys\']","filePath":null,"qualifiedName":"/TableLoader<T>[\'reactQueryKeys\']","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"table","type":{"packageName":"","name":"Table<T>","filePath":null,"qualifiedName":"/Table<T>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"query","type":{"packageName":"","name":"Query<T>","filePath":null,"qualifiedName":"/Query<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"sort","type":{"packageName":"","name":"SortCriteria<T>[]","filePath":null,"qualifiedName":"/SortCriteria<T>[]","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"queryOptions","type":{"packageName":"","name":"QueryOptions<T>","filePath":null,"qualifiedName":"/QueryOptions<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"}],"methods":[{"name":"load","returnType":{"packageName":"","name":"Promise<RowWindow<T>>","filePath":null,"qualifiedName":"/Promise<RowWindow<T>>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"startIndex","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}},{"name":"endIndex","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}},{"name":"skipRowCount","type":{"packageName":"","name":"boolean","filePath":null,"qualifiedName":"/boolean","typeParameters":null,"directParents":null}}]}],"typeParameters":["/T extends Record"],"directParentInterfaces":[{"packageName":"@proteinjs/ui","name":"TableLoader","filePath":null,"qualifiedName":"@proteinjs/ui/TableLoader","properties":[],"methods":[],"typeParameters":["/T"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/ui/TableLoader"},{"v":"@proteinjs/db-ui/RecordFormCustomization","value":{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":"/home/runner/work/db/db/packages/ui/src/form/RecordFormCustomization.tsx","qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":{"packageName":"","name":"Table<any>","filePath":null,"qualifiedName":"/Table<any>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFormButtons","returnType":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"record","type":{"packageName":"","name":"any","filePath":null,"qualifiedName":"/any","typeParameters":null,"directParents":null}},{"name":"defaultFormButtons","type":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null}}]},{"name":"getFieldLayout","returnType":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"record","type":{"packageName":"","name":"any","filePath":null,"qualifiedName":"/any","typeParameters":null,"directParents":null}},{"name":"defaultFieldLayout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/reflection/Loadable"},{"v":"@proteinjs/db-ui/hashGeneratorPage","value":{"packageName":"@proteinjs/db-ui","name":"hashGeneratorPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/HashGeneratorPage.tsx","qualifiedName":"@proteinjs/db-ui/hashGeneratorPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/ui/Page"},{"v":"@proteinjs/db-ui/recordFormPage","value":{"packageName":"@proteinjs/db-ui","name":"recordFormPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/RecordFormPage.tsx","qualifiedName":"@proteinjs/db-ui/recordFormPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/recordTablePage","value":{"packageName":"@proteinjs/db-ui","name":"recordTablePage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/RecordTablePage.tsx","qualifiedName":"@proteinjs/db-ui/recordTablePage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/tablesPage","value":{"packageName":"@proteinjs/db-ui","name":"tablesPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/TablesPage.tsx","qualifiedName":"@proteinjs/db-ui/tablesPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/uuidGeneratorPage","value":{"packageName":"@proteinjs/db-ui","name":"uuidGeneratorPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/UuidGeneratorPage.tsx","qualifiedName":"@proteinjs/db-ui/uuidGeneratorPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/SpecificTableProps"},{"v":"@proteinjs/db-ui/MigrationRecordFormCustomization","value":{"packageName":"@proteinjs/db-ui","name":"MigrationRecordFormCustomization","filePath":"/home/runner/work/db/db/packages/ui/src/form/customizations/MigrationRecordFormCustomization.tsx","qualifiedName":"@proteinjs/db-ui/MigrationRecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFormButtons","returnType":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"migration","type":{"packageName":"@proteinjs/db","name":"Migration","filePath":null,"qualifiedName":"@proteinjs/db/Migration","typeParameters":null,"directParents":null}},{"name":"defaultFormButtons","type":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":null,"qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}}],"edges":[{"v":"@proteinjs/db-ui/QueryCursorLoader","w":"@proteinjs/ui/CursorLoader","value":"implements interface"},{"v":"@proteinjs/db-ui/QueryTableLoader","w":"@proteinjs/ui/TableLoader","value":"implements interface"},{"v":"@proteinjs/db-ui/RecordFormCustomization","w":"@proteinjs/reflection/Loadable","value":"implements interface"},{"v":"@proteinjs/db-ui/hashGeneratorPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/recordFormPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/recordTablePage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/tablesPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/uuidGeneratorPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/MigrationRecordFormCustomization","w":"@proteinjs/db-ui/RecordFormCustomization","value":"extends class"}]}';
|
|
19
|
+
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/db-ui/QueryCursorLoader","value":{"packageName":"@proteinjs/db-ui","name":"QueryCursorLoader","filePath":"/home/runner/work/db/db/packages/ui/src/table/QueryCursorLoader.ts","qualifiedName":"@proteinjs/db-ui/QueryCursorLoader","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"reactQueryKeys","type":{"packageName":"@proteinjs/ui","name":"ReactQueryKeys","filePath":null,"qualifiedName":"@proteinjs/ui/ReactQueryKeys","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"pager","type":{"packageName":"","name":"CursorWindowPager<T>","filePath":null,"qualifiedName":"/CursorWindowPager<T>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"}],"methods":[{"name":"loadWindow","returnType":{"packageName":"","name":"Promise<CursorWindow<T>>","filePath":null,"qualifiedName":"/Promise<CursorWindow<T>>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"cursor","type":{"packageName":"","name":"CursorValue | null","filePath":null,"qualifiedName":"/CursorValue | null","typeParameters":null,"directParents":null}},{"name":"windowSize","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}}]}],"typeParameters":["/T extends Record"],"directParentInterfaces":[{"packageName":"@proteinjs/ui","name":"CursorLoader","filePath":null,"qualifiedName":"@proteinjs/ui/CursorLoader","properties":[],"methods":[],"typeParameters":["/T"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/ui/CursorLoader"},{"v":"@proteinjs/db-ui/QueryTableLoader","value":{"packageName":"@proteinjs/db-ui","name":"QueryTableLoader","filePath":"/home/runner/work/db/db/packages/ui/src/table/QueryTableLoader.ts","qualifiedName":"@proteinjs/db-ui/QueryTableLoader","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"rowCountQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"paginationQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"reactQueryKeys","type":{"packageName":"","name":"TableLoader<T>[\'reactQueryKeys\']","filePath":null,"qualifiedName":"/TableLoader<T>[\'reactQueryKeys\']","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"table","type":{"packageName":"","name":"Table<T>","filePath":null,"qualifiedName":"/Table<T>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"query","type":{"packageName":"","name":"Query<T>","filePath":null,"qualifiedName":"/Query<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"sort","type":{"packageName":"","name":"SortCriteria<T>[]","filePath":null,"qualifiedName":"/SortCriteria<T>[]","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"queryOptions","type":{"packageName":"","name":"QueryOptions<T>","filePath":null,"qualifiedName":"/QueryOptions<T>","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"private"}],"methods":[{"name":"load","returnType":{"packageName":"","name":"Promise<RowWindow<T>>","filePath":null,"qualifiedName":"/Promise<RowWindow<T>>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"startIndex","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}},{"name":"endIndex","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}},{"name":"skipRowCount","type":{"packageName":"","name":"boolean","filePath":null,"qualifiedName":"/boolean","typeParameters":null,"directParents":null}}]}],"typeParameters":["/T extends Record"],"directParentInterfaces":[{"packageName":"@proteinjs/ui","name":"TableLoader","filePath":null,"qualifiedName":"@proteinjs/ui/TableLoader","properties":[],"methods":[],"typeParameters":["/T"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/ui/TableLoader"},{"v":"@proteinjs/db-ui/RecordFormCustomization","value":{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":"/home/runner/work/db/db/packages/ui/src/form/RecordFormCustomization.tsx","qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":{"packageName":"","name":"Table<any>","filePath":null,"qualifiedName":"/Table<any>","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFormButtons","returnType":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"record","type":{"packageName":"","name":"any","filePath":null,"qualifiedName":"/any","typeParameters":null,"directParents":null}},{"name":"defaultFormButtons","type":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null}}]},{"name":"getFieldLayout","returnType":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"record","type":{"packageName":"","name":"any","filePath":null,"qualifiedName":"/any","typeParameters":null,"directParents":null}},{"name":"defaultFieldLayout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/reflection/Loadable"},{"v":"@proteinjs/db-ui/hashGeneratorPage","value":{"packageName":"@proteinjs/db-ui","name":"hashGeneratorPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/HashGeneratorPage.tsx","qualifiedName":"@proteinjs/db-ui/hashGeneratorPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/ui/Page"},{"v":"@proteinjs/db-ui/recordFormPage","value":{"packageName":"@proteinjs/db-ui","name":"recordFormPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/RecordFormPage.tsx","qualifiedName":"@proteinjs/db-ui/recordFormPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/recordTablePage","value":{"packageName":"@proteinjs/db-ui","name":"recordTablePage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/RecordTablePage.tsx","qualifiedName":"@proteinjs/db-ui/recordTablePage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/tablesPage","value":{"packageName":"@proteinjs/db-ui","name":"tablesPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/TablesPage.tsx","qualifiedName":"@proteinjs/db-ui/tablesPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/uuidGeneratorPage","value":{"packageName":"@proteinjs/db-ui","name":"uuidGeneratorPage","filePath":"/home/runner/work/db/db/packages/ui/src/pages/UuidGeneratorPage.tsx","qualifiedName":"@proteinjs/db-ui/uuidGeneratorPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/db-ui/SpecificTableProps"},{"v":"@proteinjs/db-ui/MigrationRecordFormCustomization","value":{"packageName":"@proteinjs/db-ui","name":"MigrationRecordFormCustomization","filePath":"/home/runner/work/db/db/packages/ui/src/form/customizations/MigrationRecordFormCustomization.tsx","qualifiedName":"@proteinjs/db-ui/MigrationRecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFormButtons","returnType":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"migration","type":{"packageName":"@proteinjs/db","name":"Migration","filePath":null,"qualifiedName":"@proteinjs/db/Migration","typeParameters":null,"directParents":null}},{"name":"defaultFormButtons","type":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":null,"qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}}],"edges":[{"v":"@proteinjs/db-ui/QueryCursorLoader","w":"@proteinjs/ui/CursorLoader","value":"implements interface"},{"v":"@proteinjs/db-ui/QueryTableLoader","w":"@proteinjs/ui/TableLoader","value":"implements interface"},{"v":"@proteinjs/db-ui/RecordFormCustomization","w":"@proteinjs/reflection/Loadable","value":"implements interface"},{"v":"@proteinjs/db-ui/hashGeneratorPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/recordFormPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/recordTablePage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/tablesPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/uuidGeneratorPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/db-ui/MigrationRecordFormCustomization","w":"@proteinjs/db-ui/RecordFormCustomization","value":"extends class"}]}';
|
|
20
20
|
|
|
21
21
|
/** Generate Source Links */
|
|
22
22
|
|
package/jest.config.js
CHANGED
|
@@ -6,4 +6,12 @@ module.exports = {
|
|
|
6
6
|
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
|
7
7
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
8
8
|
testEnvironment: 'node',
|
|
9
|
+
moduleNameMapper: {
|
|
10
|
+
// The symlinked @proteinjs/ui carries its own react tree. Pin the singletons to THIS
|
|
11
|
+
// package's copies so jest loads one React (hooks) — the util-ui precedent.
|
|
12
|
+
'^react$': '<rootDir>/node_modules/react',
|
|
13
|
+
'^react/(.*)$': '<rootDir>/node_modules/react/$1',
|
|
14
|
+
'^react-dom$': '<rootDir>/node_modules/react-dom',
|
|
15
|
+
'^react-dom/(.*)$': '<rootDir>/node_modules/react-dom/$1',
|
|
16
|
+
},
|
|
9
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/db-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Db ui components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@emotion/styled": "11.11.0",
|
|
27
27
|
"@mui/icons-material": "5.14.11",
|
|
28
28
|
"@mui/material": "5.14.11",
|
|
29
|
-
"@proteinjs/db": "^1.
|
|
29
|
+
"@proteinjs/db": "^1.31.0",
|
|
30
30
|
"@proteinjs/reflection": "^1.1.12",
|
|
31
31
|
"@proteinjs/ui": "^4.5.0",
|
|
32
32
|
"@proteinjs/util": "^1.6.1",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@types/jest": "29.5.5",
|
|
41
41
|
"@types/node": "14.0.27",
|
|
42
42
|
"@types/react": "18.2.23",
|
|
43
|
+
"@types/react-dom": "18.2.8",
|
|
43
44
|
"@types/string": "0.0.33",
|
|
44
45
|
"@types/uuid": "8.3.0",
|
|
45
46
|
"@typescript-eslint/eslint-plugin": "7.8.0",
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
},
|
|
54
55
|
"main": "./dist/generated/index.js",
|
|
55
56
|
"types": "./dist/generated/index.d.ts",
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d84e548336f96b2541c1fbbe6a9ad6074df610c7"
|
|
57
58
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { FormPage, Page, PageComponentProps } from '@proteinjs/ui';
|
|
3
3
|
import { getDbService, tableByName } from '@proteinjs/db';
|
|
4
4
|
import { RecordForm } from '../form/RecordForm';
|
|
5
|
-
import { Theme, SxProps } from '@mui/material';
|
|
5
|
+
import { Theme, SxProps, Typography } from '@mui/material';
|
|
6
6
|
|
|
7
7
|
export const recordFormPage: Page = {
|
|
8
8
|
name: 'Record Form',
|
|
@@ -10,9 +10,10 @@ export const recordFormPage: Page = {
|
|
|
10
10
|
auth: {
|
|
11
11
|
allUsers: true,
|
|
12
12
|
},
|
|
13
|
+
// No height override: the app's page container owns viewport height (dvh on mobile —
|
|
14
|
+
// a 100vh pin here clipped the bottom behind mobile browser chrome).
|
|
13
15
|
pageContainerSxProps: (theme: Theme): SxProps => {
|
|
14
16
|
return {
|
|
15
|
-
height: '100vh',
|
|
16
17
|
backgroundColor: theme.palette.background.default,
|
|
17
18
|
};
|
|
18
19
|
},
|
|
@@ -71,8 +72,9 @@ const DynamicRecordForm = ({ urlParams }: PageComponentProps) => {
|
|
|
71
72
|
if (tableName) {
|
|
72
73
|
try {
|
|
73
74
|
table = tableByName(tableName);
|
|
74
|
-
} catch
|
|
75
|
-
//
|
|
75
|
+
} catch {
|
|
76
|
+
// NOTE: this catch previously bound the exception as `error`, shadowing the outer
|
|
77
|
+
// variable — the message was never returned and the page rendered blank.
|
|
76
78
|
error = `Table not accessible in UI: ${tableName}`;
|
|
77
79
|
}
|
|
78
80
|
} else {
|
|
@@ -82,14 +84,18 @@ const DynamicRecordForm = ({ urlParams }: PageComponentProps) => {
|
|
|
82
84
|
return { table, error };
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
function Message({ children }: { children: React.ReactNode }) {
|
|
88
|
+
return <Typography sx={{ p: 3, color: 'text.secondary' }}>{children}</Typography>;
|
|
89
|
+
}
|
|
90
|
+
|
|
85
91
|
function Form() {
|
|
86
92
|
const { table, error } = getTable();
|
|
87
93
|
if (!table) {
|
|
88
|
-
return <
|
|
94
|
+
return <Message>{error}</Message>;
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
if (loadError) {
|
|
92
|
-
return <
|
|
98
|
+
return <Message>{loadError}</Message>;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
if (!recordLoaded) {
|
|
@@ -97,7 +103,7 @@ const DynamicRecordForm = ({ urlParams }: PageComponentProps) => {
|
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
if (recordId && !record) {
|
|
100
|
-
return <
|
|
106
|
+
return <Message>{`No ${table.name} record found: ${recordId}`}</Message>;
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
return <RecordForm table={table} record={record} />;
|