@fieldia/core 0.24.0 → 0.26.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/README.md +133 -1
- package/package.json +1 -1
- package/schema/page.schema.json +983 -329
- package/src/index.d.mts +6 -2
- package/src/index.d.ts +6 -2
- package/src/index.js +16 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +7 -2
- package/src/index.mjs.map +1 -1
- package/src/lib/format/actions.d.mts +31 -1
- package/src/lib/format/actions.d.ts +31 -1
- package/src/lib/format/actions.js +1 -0
- package/src/lib/format/actions.js.map +1 -1
- package/src/lib/format/actions.mjs +1 -0
- package/src/lib/format/actions.mjs.map +1 -1
- package/src/lib/format/duplicate-kinds.d.mts +10 -0
- package/src/lib/format/duplicate-kinds.d.ts +10 -0
- package/src/lib/format/duplicate-kinds.js +14 -0
- package/src/lib/format/duplicate-kinds.js.map +1 -0
- package/src/lib/format/duplicate-kinds.mjs +10 -0
- package/src/lib/format/duplicate-kinds.mjs.map +1 -0
- package/src/lib/format/duplicates.d.mts +22 -0
- package/src/lib/format/duplicates.d.ts +22 -0
- package/src/lib/format/duplicates.js +24 -0
- package/src/lib/format/duplicates.js.map +1 -0
- package/src/lib/format/duplicates.mjs +21 -0
- package/src/lib/format/duplicates.mjs.map +1 -0
- package/src/lib/format/field.d.mts +236 -0
- package/src/lib/format/field.d.ts +236 -0
- package/src/lib/format/field.js +4 -3
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +2 -1
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/head-checks.d.mts +3 -1
- package/src/lib/format/head-checks.d.ts +3 -1
- package/src/lib/format/head-checks.js +25 -4
- package/src/lib/format/head-checks.js.map +1 -1
- package/src/lib/format/head-checks.mjs +24 -4
- package/src/lib/format/head-checks.mjs.map +1 -1
- package/src/lib/format/import-fields.d.mts +18 -0
- package/src/lib/format/import-fields.d.ts +18 -0
- package/src/lib/format/import-fields.js +26 -0
- package/src/lib/format/import-fields.js.map +1 -0
- package/src/lib/format/import-fields.mjs +21 -0
- package/src/lib/format/import-fields.mjs.map +1 -0
- package/src/lib/format/layout.d.mts +7391 -3264
- package/src/lib/format/layout.d.ts +7391 -3264
- package/src/lib/format/layout.js +100 -37
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +99 -36
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/layout.types.d.mts +5 -2
- package/src/lib/format/layout.types.d.ts +5 -2
- package/src/lib/format/page.d.mts +1018 -118
- package/src/lib/format/page.d.ts +1018 -118
- package/src/lib/format/page.js +17 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +17 -0
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/records.d.mts +23 -0
- package/src/lib/format/records.d.ts +23 -0
- package/src/lib/format/records.js +28 -0
- package/src/lib/format/records.js.map +1 -0
- package/src/lib/format/records.mjs +25 -0
- package/src/lib/format/records.mjs.map +1 -0
- package/src/lib/format/references.d.mts +31 -0
- package/src/lib/format/references.d.ts +31 -0
- package/src/lib/format/references.js +185 -24
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +185 -24
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/translate.js +12 -6
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +12 -6
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/upgrade.d.mts +8 -3
- package/src/lib/format/upgrade.d.ts +8 -3
- package/src/lib/format/upgrade.js +8 -3
- package/src/lib/format/upgrade.js.map +1 -1
- package/src/lib/format/upgrade.mjs +8 -3
- package/src/lib/format/upgrade.mjs.map +1 -1
- package/src/lib/format/version.d.mts +2 -2
- package/src/lib/format/version.d.ts +2 -2
- package/src/lib/format/version.js +2 -2
- package/src/lib/format/version.js.map +1 -1
- package/src/lib/format/version.mjs +2 -2
- package/src/lib/format/version.mjs.map +1 -1
- package/src/lib/record/check.js +2 -2
- package/src/lib/record/check.js.map +1 -1
- package/src/lib/record/check.mjs +3 -3
- package/src/lib/record/check.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +121 -0
- package/src/lib/record/data-source.d.ts +121 -0
- package/src/lib/record/data-source.js +16 -0
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs +15 -0
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/form.d.mts +51 -3
- package/src/lib/record/form.d.ts +51 -3
- package/src/lib/record/form.js +78 -17
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +79 -18
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/inputs.js +8 -8
- package/src/lib/record/inputs.js.map +1 -1
- package/src/lib/record/inputs.mjs +9 -9
- package/src/lib/record/inputs.mjs.map +1 -1
- package/src/lib/record/limits.js +1 -1
- package/src/lib/record/limits.js.map +1 -1
- package/src/lib/record/limits.mjs +2 -2
- package/src/lib/record/limits.mjs.map +1 -1
- package/src/lib/record/locales/de.js +2 -0
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +2 -0
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/memory-data-source.d.mts +12 -5
- package/src/lib/record/memory-data-source.d.ts +12 -5
- package/src/lib/record/memory-data-source.js +85 -1
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +86 -2
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/memory-duplicates.d.mts +19 -0
- package/src/lib/record/memory-duplicates.d.ts +19 -0
- package/src/lib/record/memory-duplicates.js +78 -0
- package/src/lib/record/memory-duplicates.js.map +1 -0
- package/src/lib/record/memory-duplicates.mjs +74 -0
- package/src/lib/record/memory-duplicates.mjs.map +1 -0
- package/src/lib/record/messages.d.mts +24 -0
- package/src/lib/record/messages.d.ts +24 -0
- package/src/lib/record/messages.js +25 -0
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +24 -0
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/record-words.d.mts +19 -0
- package/src/lib/record/record-words.d.ts +19 -0
- package/src/lib/record/record-words.js +60 -0
- package/src/lib/record/record-words.js.map +1 -0
- package/src/lib/record/record-words.mjs +56 -0
- package/src/lib/record/record-words.mjs.map +1 -0
- package/src/lib/record/rules.js +1 -1
- package/src/lib/record/rules.js.map +1 -1
- package/src/lib/record/rules.mjs +2 -2
- package/src/lib/record/rules.mjs.map +1 -1
- package/src/lib/record/run.d.mts +39 -1
- package/src/lib/record/run.d.ts +39 -1
- package/src/lib/record/run.js +15 -1
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +15 -1
- package/src/lib/record/run.mjs.map +1 -1
- package/src/lib/record/search.js +2 -1
- package/src/lib/record/search.js.map +1 -1
- package/src/lib/record/search.mjs +2 -1
- package/src/lib/record/search.mjs.map +1 -1
- package/src/lib/record/structures.js +3 -3
- package/src/lib/record/structures.js.map +1 -1
- package/src/lib/record/structures.mjs +4 -4
- package/src/lib/record/structures.mjs.map +1 -1
- package/src/lib/record/waits.d.mts +32 -0
- package/src/lib/record/waits.d.ts +32 -0
- package/src/lib/record/waits.js +89 -0
- package/src/lib/record/waits.js.map +1 -0
- package/src/lib/record/waits.mjs +85 -0
- package/src/lib/record/waits.mjs.map +1 -0
- package/src/runtime.d.mts +13 -7
- package/src/runtime.d.ts +13 -7
- package/src/runtime.js +13 -3
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +4 -1
- package/src/runtime.mjs.map +1 -1
package/src/lib/format/page.js
CHANGED
|
@@ -7,6 +7,8 @@ const field_1 = require("./field");
|
|
|
7
7
|
const layout_1 = require("./layout");
|
|
8
8
|
const part_look_1 = require("./part-look");
|
|
9
9
|
const phone_1 = require("./phone");
|
|
10
|
+
const duplicates_1 = require("./duplicates");
|
|
11
|
+
const records_1 = require("./records");
|
|
10
12
|
const themes_1 = require("./themes");
|
|
11
13
|
var themes_2 = require("./themes");
|
|
12
14
|
Object.defineProperty(exports, "THEMES", { enumerable: true, get: function () { return themes_2.THEMES; } });
|
|
@@ -75,6 +77,21 @@ exports.PageSchema = z
|
|
|
75
77
|
.optional(),
|
|
76
78
|
phone: phone_1.PagePhoneSchema.optional(),
|
|
77
79
|
timeZone: field_1.TimeZoneSchema.optional(),
|
|
80
|
+
print: z
|
|
81
|
+
.strictObject({
|
|
82
|
+
header: z.string().min(1).max(500).optional(),
|
|
83
|
+
footer: z.string().min(1).max(1000).optional(),
|
|
84
|
+
// An address an image is drawn from: the web's, the app's own (a path), or the picture itself — never a script's.
|
|
85
|
+
logo: z
|
|
86
|
+
.string()
|
|
87
|
+
.regex(/^(https?:\/\/|data:image\/|\/|\.{0,2}\/?[^:\s]+$)/i, { error: 'a logo is an image’s address: https://…, a path, or data:image/…' })
|
|
88
|
+
.optional(),
|
|
89
|
+
})
|
|
90
|
+
.meta({ id: 'PagePrint' })
|
|
91
|
+
.optional(),
|
|
92
|
+
duplicates: duplicates_1.PageDuplicatesSchema.optional(),
|
|
93
|
+
records: records_1.PageRecordsSchema.optional(),
|
|
94
|
+
lowerLabels: z.boolean().optional(),
|
|
78
95
|
})
|
|
79
96
|
.meta({
|
|
80
97
|
title: 'Fieldia page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,uCAA8D;AAC9D,mCAAoE;AACpE,qCAA8F;AAC9F,2CAAwE;AACxE,mCAA0D;AAC1D,qCAA8C;AAC9C,mCAA8C;AAArC,gGAAA,MAAM,OAAA;AACf,qCAA4C;AAE5C,uCAA+E;AAE/E,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACz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;IAC3C,OAAO,EAAE,2BAAiB,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
package/src/lib/format/page.mjs
CHANGED
|
@@ -4,6 +4,8 @@ import { FieldsSchema, TimeZoneSchema } from './field.mjs';
|
|
|
4
4
|
import { HelpShownSchema, RootLayoutSchema } from './layout.mjs';
|
|
5
5
|
import { PART_LOOKS } from './part-look.mjs';
|
|
6
6
|
import { PagePhoneSchema } from './phone.mjs';
|
|
7
|
+
import { PageDuplicatesSchema } from './duplicates.mjs';
|
|
8
|
+
import { PageRecordsSchema } from './records.mjs';
|
|
7
9
|
import { THEMES } from './themes.mjs';
|
|
8
10
|
export { THEMES } from './themes.mjs';
|
|
9
11
|
import { SKINS } from './themes.mjs';
|
|
@@ -70,6 +72,21 @@ export const PageSchema = z
|
|
|
70
72
|
.optional(),
|
|
71
73
|
phone: PagePhoneSchema.optional(),
|
|
72
74
|
timeZone: TimeZoneSchema.optional(),
|
|
75
|
+
print: z
|
|
76
|
+
.strictObject({
|
|
77
|
+
header: z.string().min(1).max(500).optional(),
|
|
78
|
+
footer: z.string().min(1).max(1000).optional(),
|
|
79
|
+
// An address an image is drawn from: the web's, the app's own (a path), or the picture itself — never a script's.
|
|
80
|
+
logo: z
|
|
81
|
+
.string()
|
|
82
|
+
.regex(/^(https?:\/\/|data:image\/|\/|\.{0,2}\/?[^:\s]+$)/i, { error: 'a logo is an image’s address: https://…, a path, or data:image/…' })
|
|
83
|
+
.optional(),
|
|
84
|
+
})
|
|
85
|
+
.meta({ id: 'PagePrint' })
|
|
86
|
+
.optional(),
|
|
87
|
+
duplicates: PageDuplicatesSchema.optional(),
|
|
88
|
+
records: PageRecordsSchema.optional(),
|
|
89
|
+
lowerLabels: z.boolean().optional(),
|
|
73
90
|
})
|
|
74
91
|
.meta({
|
|
75
92
|
title: 'Fieldia page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAmB,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAe,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAiC,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAa,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAsB,MAAM,WAAW,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"page.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAmB,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAe,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAiC,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAuB,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAoB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zB,QAAQ,EAAE;IACb,UAAU,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a page's records are called (`records` on a page), so Fieldia's own sentences name them as the business does:
|
|
4
|
+
* "A customer with this phone already exists", "17 customers imported", "Are you sure you want to delete this
|
|
5
|
+
* customer?", "New customer", "Select all 1,284 customers that match". Without it Fieldia says "record", or no noun at
|
|
6
|
+
* all ("New"), as before.
|
|
7
|
+
*
|
|
8
|
+
* "records": { "one": "customer", "other": "customers", "a": "a customer" }
|
|
9
|
+
* "records": { "one": "invoice", "other": "invoices", "a": "an invoice" }
|
|
10
|
+
*
|
|
11
|
+
* `one` and `other` are the word for one record and for more, written as they stand inside a sentence (lower case in
|
|
12
|
+
* English): a sentence that counts picks one of them as its language does for the number. `a` is the word for one
|
|
13
|
+
* with its article, where the language puts one before it — "a customer", "an invoice", "un client", "une facture":
|
|
14
|
+
* Fieldia never guesses an article, so a sentence that needs one says "A record …" until it is given. Other languages
|
|
15
|
+
* come through the page's `translations`, as its other words do ("customer" → "عميل"). How a field's label is written
|
|
16
|
+
* inside those sentences is the page's own `lowerLabels`, beside it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PageRecordsSchema: z.ZodObject<{
|
|
19
|
+
one: z.ZodString;
|
|
20
|
+
other: z.ZodString;
|
|
21
|
+
a: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export type PageRecords = z.infer<typeof PageRecordsSchema>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a page's records are called (`records` on a page), so Fieldia's own sentences name them as the business does:
|
|
4
|
+
* "A customer with this phone already exists", "17 customers imported", "Are you sure you want to delete this
|
|
5
|
+
* customer?", "New customer", "Select all 1,284 customers that match". Without it Fieldia says "record", or no noun at
|
|
6
|
+
* all ("New"), as before.
|
|
7
|
+
*
|
|
8
|
+
* "records": { "one": "customer", "other": "customers", "a": "a customer" }
|
|
9
|
+
* "records": { "one": "invoice", "other": "invoices", "a": "an invoice" }
|
|
10
|
+
*
|
|
11
|
+
* `one` and `other` are the word for one record and for more, written as they stand inside a sentence (lower case in
|
|
12
|
+
* English): a sentence that counts picks one of them as its language does for the number. `a` is the word for one
|
|
13
|
+
* with its article, where the language puts one before it — "a customer", "an invoice", "un client", "une facture":
|
|
14
|
+
* Fieldia never guesses an article, so a sentence that needs one says "A record …" until it is given. Other languages
|
|
15
|
+
* come through the page's `translations`, as its other words do ("customer" → "عميل"). How a field's label is written
|
|
16
|
+
* inside those sentences is the page's own `lowerLabels`, beside it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PageRecordsSchema: z.ZodObject<{
|
|
19
|
+
one: z.ZodString;
|
|
20
|
+
other: z.ZodString;
|
|
21
|
+
a: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.z.core.$strict>;
|
|
23
|
+
export type PageRecords = z.infer<typeof PageRecordsSchema>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageRecordsSchema = void 0;
|
|
4
|
+
const z = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* What a page's records are called (`records` on a page), so Fieldia's own sentences name them as the business does:
|
|
7
|
+
* "A customer with this phone already exists", "17 customers imported", "Are you sure you want to delete this
|
|
8
|
+
* customer?", "New customer", "Select all 1,284 customers that match". Without it Fieldia says "record", or no noun at
|
|
9
|
+
* all ("New"), as before.
|
|
10
|
+
*
|
|
11
|
+
* "records": { "one": "customer", "other": "customers", "a": "a customer" }
|
|
12
|
+
* "records": { "one": "invoice", "other": "invoices", "a": "an invoice" }
|
|
13
|
+
*
|
|
14
|
+
* `one` and `other` are the word for one record and for more, written as they stand inside a sentence (lower case in
|
|
15
|
+
* English): a sentence that counts picks one of them as its language does for the number. `a` is the word for one
|
|
16
|
+
* with its article, where the language puts one before it — "a customer", "an invoice", "un client", "une facture":
|
|
17
|
+
* Fieldia never guesses an article, so a sentence that needs one says "A record …" until it is given. Other languages
|
|
18
|
+
* come through the page's `translations`, as its other words do ("customer" → "عميل"). How a field's label is written
|
|
19
|
+
* inside those sentences is the page's own `lowerLabels`, beside it.
|
|
20
|
+
*/
|
|
21
|
+
exports.PageRecordsSchema = z
|
|
22
|
+
.strictObject({
|
|
23
|
+
one: z.string().regex(/\S/, 'one is the word for one record: "customer"').max(60),
|
|
24
|
+
other: z.string().regex(/\S/, 'other is the word for more than one record: "customers"').max(60),
|
|
25
|
+
a: z.string().regex(/\S/, 'a is the word for one record with its article: "a customer", "an invoice"').max(80).optional(),
|
|
26
|
+
})
|
|
27
|
+
.meta({ id: 'PageRecords' });
|
|
28
|
+
//# sourceMappingURL=records.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/records.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAEzB;;;;;;;;;;;;;;;GAeG;AACU,QAAA,iBAAiB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACZ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,4CAA4C,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,yDAAyD,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,2EAA2E,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1H,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a page's records are called (`records` on a page), so Fieldia's own sentences name them as the business does:
|
|
4
|
+
* "A customer with this phone already exists", "17 customers imported", "Are you sure you want to delete this
|
|
5
|
+
* customer?", "New customer", "Select all 1,284 customers that match". Without it Fieldia says "record", or no noun at
|
|
6
|
+
* all ("New"), as before.
|
|
7
|
+
*
|
|
8
|
+
* "records": { "one": "customer", "other": "customers", "a": "a customer" }
|
|
9
|
+
* "records": { "one": "invoice", "other": "invoices", "a": "an invoice" }
|
|
10
|
+
*
|
|
11
|
+
* `one` and `other` are the word for one record and for more, written as they stand inside a sentence (lower case in
|
|
12
|
+
* English): a sentence that counts picks one of them as its language does for the number. `a` is the word for one
|
|
13
|
+
* with its article, where the language puts one before it — "a customer", "an invoice", "un client", "une facture":
|
|
14
|
+
* Fieldia never guesses an article, so a sentence that needs one says "A record …" until it is given. Other languages
|
|
15
|
+
* come through the page's `translations`, as its other words do ("customer" → "عميل"). How a field's label is written
|
|
16
|
+
* inside those sentences is the page's own `lowerLabels`, beside it.
|
|
17
|
+
*/
|
|
18
|
+
export const PageRecordsSchema = z
|
|
19
|
+
.strictObject({
|
|
20
|
+
one: z.string().regex(/\S/, 'one is the word for one record: "customer"').max(60),
|
|
21
|
+
other: z.string().regex(/\S/, 'other is the word for more than one record: "customers"').max(60),
|
|
22
|
+
a: z.string().regex(/\S/, 'a is the word for one record with its article: "a customer", "an invoice"').max(80).optional(),
|
|
23
|
+
})
|
|
24
|
+
.meta({ id: 'PageRecords' });
|
|
25
|
+
//# sourceMappingURL=records.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACZ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,4CAA4C,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,yDAAyD,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,2EAA2E,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1H,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -40,6 +40,10 @@ export declare class ReferenceCheck {
|
|
|
40
40
|
run(): PageIssue[];
|
|
41
41
|
/** A bot check: on a page of responses, its captcha drawn in a slot the page places. */
|
|
42
42
|
private checkBotCheck;
|
|
43
|
+
/** Possible duplicates: asked of a record's own page, by fields records can be compared by, each named once. */
|
|
44
|
+
private checkDuplicates;
|
|
45
|
+
/** What the page's records are called: words for one and for more, and for one with its article where given. */
|
|
46
|
+
private checkRecords;
|
|
43
47
|
/** A time zone the browser knows, by its IANA name: a page's dates and times are never drawn on a clock it cannot read. */
|
|
44
48
|
private checkZone;
|
|
45
49
|
/** Each step's goTo and show names a tab or a wizard step of this page. */
|
|
@@ -97,6 +101,19 @@ export declare class ReferenceCheck {
|
|
|
97
101
|
private walkFooter;
|
|
98
102
|
private walkRoot;
|
|
99
103
|
private walkList;
|
|
104
|
+
/**
|
|
105
|
+
* A list's cards, gallery, columns people choose and rows' own rules: a
|
|
106
|
+
* card's fields the page's, its picture one that can hold a picture; the
|
|
107
|
+
* optional columns among the columns; a row's tones, bold and buttons
|
|
108
|
+
* reading the list's record (its fields, `id`, `user`); and the list
|
|
109
|
+
* opening on one thing.
|
|
110
|
+
*/
|
|
111
|
+
private checkListRows;
|
|
112
|
+
/**
|
|
113
|
+
* What a list's card shows — a list page's, or a related list's of its own records' fields: its title, subtitle,
|
|
114
|
+
* status and lines each a field, its picture one that can hold a picture.
|
|
115
|
+
*/
|
|
116
|
+
private checkListCard;
|
|
100
117
|
/**
|
|
101
118
|
* A list's calendar: when each record starts (a date, or a date and time)
|
|
102
119
|
* and ends (the same kind), its words, its colour and its columns, each
|
|
@@ -111,8 +128,16 @@ export declare class ReferenceCheck {
|
|
|
111
128
|
* the rows chosen need a box to choose one.
|
|
112
129
|
*/
|
|
113
130
|
private checkListCells;
|
|
131
|
+
/**
|
|
132
|
+
* What a list shows of its records — a list page's, or a related list's of its own records' fields: its columns, its
|
|
133
|
+
* order and the fields its search looks in, each a field; each column's cells for a column of it, a sum, an average,
|
|
134
|
+
* the lowest and the highest of a number column (any column's count), a lead's icon by a field's values.
|
|
135
|
+
*/
|
|
136
|
+
private checkListed;
|
|
114
137
|
/** A list's Edit: each field it names one value can set in many records, and rows to choose to set it on. */
|
|
115
138
|
private checkBulkEdit;
|
|
139
|
+
/** A list's Import: each field it names one a file's cell can fill, and at least one such field on the page. */
|
|
140
|
+
private checkImport;
|
|
116
141
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
117
142
|
private walkListMap;
|
|
118
143
|
/**
|
|
@@ -130,6 +155,12 @@ export declare class ReferenceCheck {
|
|
|
130
155
|
private walkNode;
|
|
131
156
|
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
132
157
|
private checkFormNode;
|
|
158
|
+
/**
|
|
159
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
160
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
161
|
+
* `valueFrom` this record's.
|
|
162
|
+
*/
|
|
163
|
+
private checkRelated;
|
|
133
164
|
private walkTabs;
|
|
134
165
|
private walkSheet;
|
|
135
166
|
/** An address with suggestions: a char field, its place kept as a place field keeps one, its parts in a json field. */
|
|
@@ -40,6 +40,10 @@ export declare class ReferenceCheck {
|
|
|
40
40
|
run(): PageIssue[];
|
|
41
41
|
/** A bot check: on a page of responses, its captcha drawn in a slot the page places. */
|
|
42
42
|
private checkBotCheck;
|
|
43
|
+
/** Possible duplicates: asked of a record's own page, by fields records can be compared by, each named once. */
|
|
44
|
+
private checkDuplicates;
|
|
45
|
+
/** What the page's records are called: words for one and for more, and for one with its article where given. */
|
|
46
|
+
private checkRecords;
|
|
43
47
|
/** A time zone the browser knows, by its IANA name: a page's dates and times are never drawn on a clock it cannot read. */
|
|
44
48
|
private checkZone;
|
|
45
49
|
/** Each step's goTo and show names a tab or a wizard step of this page. */
|
|
@@ -97,6 +101,19 @@ export declare class ReferenceCheck {
|
|
|
97
101
|
private walkFooter;
|
|
98
102
|
private walkRoot;
|
|
99
103
|
private walkList;
|
|
104
|
+
/**
|
|
105
|
+
* A list's cards, gallery, columns people choose and rows' own rules: a
|
|
106
|
+
* card's fields the page's, its picture one that can hold a picture; the
|
|
107
|
+
* optional columns among the columns; a row's tones, bold and buttons
|
|
108
|
+
* reading the list's record (its fields, `id`, `user`); and the list
|
|
109
|
+
* opening on one thing.
|
|
110
|
+
*/
|
|
111
|
+
private checkListRows;
|
|
112
|
+
/**
|
|
113
|
+
* What a list's card shows — a list page's, or a related list's of its own records' fields: its title, subtitle,
|
|
114
|
+
* status and lines each a field, its picture one that can hold a picture.
|
|
115
|
+
*/
|
|
116
|
+
private checkListCard;
|
|
100
117
|
/**
|
|
101
118
|
* A list's calendar: when each record starts (a date, or a date and time)
|
|
102
119
|
* and ends (the same kind), its words, its colour and its columns, each
|
|
@@ -111,8 +128,16 @@ export declare class ReferenceCheck {
|
|
|
111
128
|
* the rows chosen need a box to choose one.
|
|
112
129
|
*/
|
|
113
130
|
private checkListCells;
|
|
131
|
+
/**
|
|
132
|
+
* What a list shows of its records — a list page's, or a related list's of its own records' fields: its columns, its
|
|
133
|
+
* order and the fields its search looks in, each a field; each column's cells for a column of it, a sum, an average,
|
|
134
|
+
* the lowest and the highest of a number column (any column's count), a lead's icon by a field's values.
|
|
135
|
+
*/
|
|
136
|
+
private checkListed;
|
|
114
137
|
/** A list's Edit: each field it names one value can set in many records, and rows to choose to set it on. */
|
|
115
138
|
private checkBulkEdit;
|
|
139
|
+
/** A list's Import: each field it names one a file's cell can fill, and at least one such field on the page. */
|
|
140
|
+
private checkImport;
|
|
116
141
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
117
142
|
private walkListMap;
|
|
118
143
|
/**
|
|
@@ -130,6 +155,12 @@ export declare class ReferenceCheck {
|
|
|
130
155
|
private walkNode;
|
|
131
156
|
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
132
157
|
private checkFormNode;
|
|
158
|
+
/**
|
|
159
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
160
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
161
|
+
* `valueFrom` this record's.
|
|
162
|
+
*/
|
|
163
|
+
private checkRelated;
|
|
133
164
|
private walkTabs;
|
|
134
165
|
private walkSheet;
|
|
135
166
|
/** An address with suggestions: a char field, its place kept as a place field keeps one, its parts in a json field. */
|
|
@@ -11,6 +11,8 @@ const head_checks_1 = require("./head-checks");
|
|
|
11
11
|
const section_checks_1 = require("./section-checks");
|
|
12
12
|
const pattern_1 = require("./pattern");
|
|
13
13
|
const bulk_edit_1 = require("./bulk-edit");
|
|
14
|
+
const duplicate_kinds_1 = require("./duplicate-kinds");
|
|
15
|
+
const import_fields_1 = require("./import-fields");
|
|
14
16
|
const zones_1 = require("../record/zones");
|
|
15
17
|
const messages_1 = require("../record/messages");
|
|
16
18
|
const autofill_group_1 = require("./autofill-group");
|
|
@@ -20,6 +22,8 @@ const EXPRESSIBLE = new Set(['char', 'text', 'html', 'integer', 'float', 'moneta
|
|
|
20
22
|
const EXPRESSIBLE_WORDS = 'text, numbers, yes or no, dates, choices and json can';
|
|
21
23
|
/** The kinds of field a list's filter bar can list the values of. */
|
|
22
24
|
const LISTS_ITS_VALUES = new Set(['selection', 'many2one', 'many2many', 'boolean', 'char', 'integer']);
|
|
25
|
+
/** Kinds of field a list's card shows as its picture: a picture held, or text holding a picture's address. */
|
|
26
|
+
const PICTURES = new Set(['image', 'binary', 'char']);
|
|
23
27
|
/** What a calendar's start and end can be: a day, or a day and a time. */
|
|
24
28
|
const CALENDAR_TIMES = new Set(['date', 'datetime']);
|
|
25
29
|
/** What a record's words on a calendar can be. */
|
|
@@ -70,6 +74,10 @@ class ReferenceCheck {
|
|
|
70
74
|
this.checkEvents(this.page.on, 'on');
|
|
71
75
|
if (this.page.botCheck !== undefined && !this.line)
|
|
72
76
|
this.checkBotCheck(this.page);
|
|
77
|
+
if (this.page.duplicates !== undefined && !this.line)
|
|
78
|
+
this.checkDuplicates(this.page);
|
|
79
|
+
if (this.page.records !== undefined && !this.line)
|
|
80
|
+
this.checkRecords(this.page.records);
|
|
73
81
|
this.checkGoingTo();
|
|
74
82
|
return this.issues;
|
|
75
83
|
}
|
|
@@ -82,6 +90,36 @@ class ReferenceCheck {
|
|
|
82
90
|
if (typeof captcha === 'string' && !this.slots.has(captcha))
|
|
83
91
|
this.report('botCheck.captcha', `no slot "${captcha}" on this page to draw the captcha in: place { "type": "slot", "id": "${captcha}", "name": "${captcha}" } where it goes`);
|
|
84
92
|
}
|
|
93
|
+
/** Possible duplicates: asked of a record's own page, by fields records can be compared by, each named once. */
|
|
94
|
+
checkDuplicates(page) {
|
|
95
|
+
const given = page.duplicates?.fields;
|
|
96
|
+
const named = Array.isArray(given) ? given : [];
|
|
97
|
+
if (!named.length)
|
|
98
|
+
this.report('duplicates.fields', 'name the fields records are compared by: ["phone", "email"]');
|
|
99
|
+
if (page.data.kind !== 'record')
|
|
100
|
+
this.report('duplicates', 'duplicates are asked of records like the one typed: a page of responses keeps none to compare it with');
|
|
101
|
+
else if (page.layout.type === 'list')
|
|
102
|
+
this.report('duplicates', 'duplicates are asked as a record is typed, on its own page, not on a list of records');
|
|
103
|
+
named.forEach((name, i) => {
|
|
104
|
+
const at = `duplicates.fields[${i}]`;
|
|
105
|
+
if (named.indexOf(name) !== i)
|
|
106
|
+
return this.report(at, `"${name}" is named twice`);
|
|
107
|
+
const def = this.need(name, at);
|
|
108
|
+
if (def && !duplicate_kinds_1.DUPLICATE_KINDS.has(def.type))
|
|
109
|
+
this.report(at, `"${name}" is a ${def.type}; records are compared by words, a number, a date, a choice or a link`);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/** What the page's records are called: words for one and for more, and for one with its article where given. */
|
|
113
|
+
checkRecords(records) {
|
|
114
|
+
const words = (records ?? {});
|
|
115
|
+
const said = (value) => typeof value === 'string' && /\S/.test(value);
|
|
116
|
+
if (!said(words['one']))
|
|
117
|
+
this.report('records.one', 'the word for one record, as a sentence says it: "customer"');
|
|
118
|
+
if (!said(words['other']))
|
|
119
|
+
this.report('records.other', 'the word for more than one record: "customers"');
|
|
120
|
+
if (words['a'] !== undefined && !said(words['a']))
|
|
121
|
+
this.report('records.a', 'the word for one record with its article: "a customer", "an invoice"');
|
|
122
|
+
}
|
|
85
123
|
/** A time zone the browser knows, by its IANA name: a page's dates and times are never drawn on a clock it cannot read. */
|
|
86
124
|
checkZone(zone, path) {
|
|
87
125
|
if (!(0, zones_1.isTimeZone)(zone))
|
|
@@ -524,9 +562,7 @@ class ReferenceCheck {
|
|
|
524
562
|
walkList(list, path) {
|
|
525
563
|
if (this.page.data.kind !== 'record')
|
|
526
564
|
this.report('data', 'a list shows records: its data needs kind "record" and a model');
|
|
527
|
-
|
|
528
|
-
list.sort?.forEach((order, i) => this.need(order.field, `${path}.sort[${i}].field`));
|
|
529
|
-
list.searchFields?.forEach((name, i) => this.need(name, `${path}.searchFields[${i}]`));
|
|
565
|
+
this.checkListed(list, this.page.fields, path);
|
|
530
566
|
list.groupBy?.forEach((name, i) => this.need(name, `${path}.groupBy[${i}]`));
|
|
531
567
|
// A list's filters are about its own records: their fields are the page's, and there is no record to take a value from.
|
|
532
568
|
const walk = (item, at) => {
|
|
@@ -561,6 +597,54 @@ class ReferenceCheck {
|
|
|
561
597
|
if (list.calendar)
|
|
562
598
|
this.walkListCalendar(list, `${path}.calendar`);
|
|
563
599
|
this.checkListCells(list, path);
|
|
600
|
+
this.checkListRows(list, path);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* A list's cards, gallery, columns people choose and rows' own rules: a
|
|
604
|
+
* card's fields the page's, its picture one that can hold a picture; the
|
|
605
|
+
* optional columns among the columns; a row's tones, bold and buttons
|
|
606
|
+
* reading the list's record (its fields, `id`, `user`); and the list
|
|
607
|
+
* opening on one thing.
|
|
608
|
+
*/
|
|
609
|
+
checkListRows(list, path) {
|
|
610
|
+
if (list.card)
|
|
611
|
+
this.checkListCard(list.card, `${path}.card`, this.page.fields);
|
|
612
|
+
for (const column of Object.keys(list.optionalColumns ?? {})) {
|
|
613
|
+
if (!list.columns.includes(column))
|
|
614
|
+
this.report(`${path}.optionalColumns.${column}`, `"${column}" is no column of this list: a person shows or hides its columns`);
|
|
615
|
+
}
|
|
616
|
+
// A column a person may hide, every one hidden at first: the list would open with no column but its own.
|
|
617
|
+
if (list.optionalColumns && list.columns.every((column) => list.optionalColumns?.[column] === 'hide'))
|
|
618
|
+
this.report(`${path}.optionalColumns`, 'every column starts hidden: show one at least, as the list opens');
|
|
619
|
+
if (list.gallery?.opens === 'gallery') {
|
|
620
|
+
if (list.map?.view && list.map.view !== 'list')
|
|
621
|
+
this.report(`${path}.gallery.opens`, 'the list opens on its map (map.view) and on its gallery: say one');
|
|
622
|
+
if (list.calendar?.opens === 'calendar')
|
|
623
|
+
this.report(`${path}.gallery.opens`, 'the list opens on its calendar and on its gallery: say one');
|
|
624
|
+
}
|
|
625
|
+
list.rowTones?.forEach((tone, i) => this.checkModifiers(tone, `${path}.rowTones[${i}]`, ['when']));
|
|
626
|
+
this.checkModifiers(list, path, ['rowBold']);
|
|
627
|
+
list.rowButtons?.forEach((button, i) => {
|
|
628
|
+
this.claim(button.id, `${path}.rowButtons[${i}]`);
|
|
629
|
+
this.checkPress(button, `${path}.rowButtons[${i}]`);
|
|
630
|
+
// Shown by a condition on each row's record.
|
|
631
|
+
this.checkModifiers(button, `${path}.rowButtons[${i}]`, ['invisible']);
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* What a list's card shows — a list page's, or a related list's of its own records' fields: its title, subtitle,
|
|
636
|
+
* status and lines each a field, its picture one that can hold a picture.
|
|
637
|
+
*/
|
|
638
|
+
checkListCard(card, at, fields) {
|
|
639
|
+
for (const key of ['title', 'subtitle', 'status'])
|
|
640
|
+
if (card[key] !== undefined)
|
|
641
|
+
this.need(card[key], `${at}.${key}`, fields);
|
|
642
|
+
if (card.image !== undefined) {
|
|
643
|
+
const def = this.need(card.image, `${at}.image`, fields);
|
|
644
|
+
if (def && !PICTURES.has(def.type))
|
|
645
|
+
this.report(`${at}.image`, `"${card.image}" is a ${def.type}; a card's picture is an image or binary field, or text holding a picture's address`);
|
|
646
|
+
}
|
|
647
|
+
card.fields?.forEach((line, i) => (Array.isArray(line) ? line : [line]).forEach((part, j) => this.need(typeof part === 'string' ? part : part.field, `${at}.fields[${i}]${Array.isArray(line) ? `[${j}]` : ''}${typeof part === 'string' ? '' : '.field'}`, fields)));
|
|
564
648
|
}
|
|
565
649
|
/**
|
|
566
650
|
* A list's calendar: when each record starts (a date, or a date and time)
|
|
@@ -605,27 +689,6 @@ class ReferenceCheck {
|
|
|
605
689
|
* the rows chosen need a box to choose one.
|
|
606
690
|
*/
|
|
607
691
|
checkListCells(list, path) {
|
|
608
|
-
for (const [column, cell] of Object.entries(list.cells ?? {})) {
|
|
609
|
-
const at = `${path}.cells.${column}`;
|
|
610
|
-
if (!list.columns.includes(column)) {
|
|
611
|
-
this.report(at, `"${column}" is no column of this list: its cells are for its columns`);
|
|
612
|
-
continue;
|
|
613
|
-
}
|
|
614
|
-
// A sum, an average, the lowest and the highest are a number column's; any column has a count.
|
|
615
|
-
const kind = this.page.fields[column]?.type;
|
|
616
|
-
if (cell.total && cell.total !== 'count' && kind && kind !== 'integer' && kind !== 'float' && kind !== 'monetary') {
|
|
617
|
-
this.report(`${at}.total`, `"${column}" is a ${kind}; its total "${cell.total}" is of numbers — an integer, a float or an amount — and any column's is "count"`);
|
|
618
|
-
}
|
|
619
|
-
if (!cell.lead)
|
|
620
|
-
continue;
|
|
621
|
-
const def = this.need(cell.lead.field, `${at}.lead.field`);
|
|
622
|
-
if (def?.type !== 'selection')
|
|
623
|
-
continue;
|
|
624
|
-
const values = new Set(def.options.map((option) => String(option.value)));
|
|
625
|
-
for (const value of Object.keys(cell.lead.looks))
|
|
626
|
-
if (!values.has(value))
|
|
627
|
-
this.report(`${at}.lead.looks.${value}`, `"${value}" is no value of "${cell.lead.field}"`);
|
|
628
|
-
}
|
|
629
692
|
if (list.filterFields && list.search !== 'fields')
|
|
630
693
|
this.report(`${path}.filterFields`, 'the filter fields are for the "fields" search: add "search": "fields"');
|
|
631
694
|
list.filterFields?.forEach((name, i) => {
|
|
@@ -648,6 +711,37 @@ class ReferenceCheck {
|
|
|
648
711
|
if (list.choose === false && list.actions?.length)
|
|
649
712
|
this.report(`${path}.actions`, 'a list’s buttons act on the rows chosen: with "choose": false there is no way to choose one');
|
|
650
713
|
this.checkBulkEdit(list, path);
|
|
714
|
+
this.checkImport(list, path);
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* What a list shows of its records — a list page's, or a related list's of its own records' fields: its columns, its
|
|
718
|
+
* order and the fields its search looks in, each a field; each column's cells for a column of it, a sum, an average,
|
|
719
|
+
* the lowest and the highest of a number column (any column's count), a lead's icon by a field's values.
|
|
720
|
+
*/
|
|
721
|
+
checkListed(list, fields, path) {
|
|
722
|
+
list.columns.forEach((name, i) => this.need(name, `${path}.columns[${i}]`, fields));
|
|
723
|
+
list.sort?.forEach((order, i) => this.need(order.field, `${path}.sort[${i}].field`, fields));
|
|
724
|
+
list.searchFields?.forEach((name, i) => this.need(name, `${path}.searchFields[${i}]`, fields));
|
|
725
|
+
for (const [column, cell] of Object.entries(list.cells ?? {})) {
|
|
726
|
+
const at = `${path}.cells.${column}`;
|
|
727
|
+
if (!list.columns.includes(column)) {
|
|
728
|
+
this.report(at, `"${column}" is no column of this list: its cells are for its columns`);
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
const kind = has(fields, column) ? fields[column].type : undefined;
|
|
732
|
+
if (cell.total && cell.total !== 'count' && kind && kind !== 'integer' && kind !== 'float' && kind !== 'monetary') {
|
|
733
|
+
this.report(`${at}.total`, `"${column}" is a ${kind}; its total "${cell.total}" is of numbers — an integer, a float or an amount — and any column's is "count"`);
|
|
734
|
+
}
|
|
735
|
+
if (!cell.lead)
|
|
736
|
+
continue;
|
|
737
|
+
const def = this.need(cell.lead.field, `${at}.lead.field`, fields);
|
|
738
|
+
if (def?.type !== 'selection')
|
|
739
|
+
continue;
|
|
740
|
+
const values = new Set(def.options.map((option) => String(option.value)));
|
|
741
|
+
for (const value of Object.keys(cell.lead.looks))
|
|
742
|
+
if (!values.has(value))
|
|
743
|
+
this.report(`${at}.lead.looks.${value}`, `"${value}" is no value of "${cell.lead.field}"`);
|
|
744
|
+
}
|
|
651
745
|
}
|
|
652
746
|
/** A list's Edit: each field it names one value can set in many records, and rows to choose to set it on. */
|
|
653
747
|
checkBulkEdit(list, path) {
|
|
@@ -674,6 +768,29 @@ class ReferenceCheck {
|
|
|
674
768
|
this.report(at, `"${name}" is ${def.compute ? 'worked out from other fields' : 'read-only'}; Edit sets a field people can change`);
|
|
675
769
|
});
|
|
676
770
|
}
|
|
771
|
+
/** A list's Import: each field it names one a file's cell can fill, and at least one such field on the page. */
|
|
772
|
+
checkImport(list, path) {
|
|
773
|
+
if (!list.import)
|
|
774
|
+
return;
|
|
775
|
+
if (list.import === true) {
|
|
776
|
+
if (!Object.values(this.page.fields).some((def) => (0, import_fields_1.importable)(def)))
|
|
777
|
+
this.report(`${path}.import`, 'Import fills the fields a file’s cell can, and this page has none: words, a number, money, yes or no, a date, a choice or a link people can change');
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
const named = list.import;
|
|
781
|
+
named.forEach((name, i) => {
|
|
782
|
+
const at = `${path}.import[${i}]`;
|
|
783
|
+
if (named.indexOf(name) !== i)
|
|
784
|
+
this.report(at, `"${name}" is offered twice`);
|
|
785
|
+
const def = this.need(name, at);
|
|
786
|
+
if (!def)
|
|
787
|
+
return;
|
|
788
|
+
if (!import_fields_1.IMPORT_KINDS.has(def.type))
|
|
789
|
+
this.report(at, `"${name}" is a ${def.type}; a file's cell fills words, a number, money, a yes or no, a date, a choice, or a link or links by name`);
|
|
790
|
+
else if (def.readonly === true || def.compute)
|
|
791
|
+
this.report(at, `"${name}" is ${def.compute ? 'worked out from other fields' : 'read-only'}; Import fills a field people can change`);
|
|
792
|
+
});
|
|
793
|
+
}
|
|
677
794
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
678
795
|
walkListMap(map, path) {
|
|
679
796
|
const pair = map.latitude !== undefined || map.longitude !== undefined;
|
|
@@ -868,6 +985,8 @@ class ReferenceCheck {
|
|
|
868
985
|
return this.checkValuesIn(node.text, `${path}.text`);
|
|
869
986
|
case 'map':
|
|
870
987
|
return this.walkMap(node, path);
|
|
988
|
+
case 'related':
|
|
989
|
+
return this.checkRelated(node, path);
|
|
871
990
|
case 'slot':
|
|
872
991
|
this.slots.add(node.name);
|
|
873
992
|
return;
|
|
@@ -892,6 +1011,48 @@ class ReferenceCheck {
|
|
|
892
1011
|
else
|
|
893
1012
|
this.formNames.set(node.name, path);
|
|
894
1013
|
}
|
|
1014
|
+
/**
|
|
1015
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
1016
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
1017
|
+
* `valueFrom` this record's.
|
|
1018
|
+
*/
|
|
1019
|
+
checkRelated(node, path) {
|
|
1020
|
+
// The quick check reads no shapes: a part with nothing to go by is said here.
|
|
1021
|
+
if (typeof node.model !== 'string' || typeof node.field !== 'string' || !Array.isArray(node.columns) || !node.fields || typeof node.fields !== 'object') {
|
|
1022
|
+
return this.report(path, 'a related list needs the model of its records, their link to this record (field), their fields and its columns');
|
|
1023
|
+
}
|
|
1024
|
+
const model = this.page.data.kind === 'record' ? this.page.data.model : null;
|
|
1025
|
+
if (!model || this.line)
|
|
1026
|
+
this.report(path, 'a related list shows the records that point at a record: it belongs on a record’s page');
|
|
1027
|
+
const fields = node.fields;
|
|
1028
|
+
this.checkListed(node, fields, path);
|
|
1029
|
+
// On a phone its rows are cards, as a list's: of its own records' fields.
|
|
1030
|
+
if (node.card)
|
|
1031
|
+
this.checkListCard(node.card, `${path}.card`, fields);
|
|
1032
|
+
// Its rows' own rules, as a list's, each read on the row's record: its own fields, its id, the person, the context.
|
|
1033
|
+
const row = { fields };
|
|
1034
|
+
node.rowTones?.forEach((tone, i) => this.checkModifiers(tone, `${path}.rowTones[${i}]`, ['when'], row));
|
|
1035
|
+
this.checkModifiers(node, path, ['rowBold'], row);
|
|
1036
|
+
node.rowButtons?.forEach((button, i) => {
|
|
1037
|
+
this.claim(button.id, `${path}.rowButtons[${i}]`);
|
|
1038
|
+
this.checkPress(button, `${path}.rowButtons[${i}]`);
|
|
1039
|
+
this.checkModifiers(button, `${path}.rowButtons[${i}]`, ['invisible'], row);
|
|
1040
|
+
});
|
|
1041
|
+
const link = has(fields, node.field) ? fields[node.field] : undefined;
|
|
1042
|
+
if (link && model && (link.type !== 'many2one' || link.relation !== model)) {
|
|
1043
|
+
this.report(`${path}.field`, `"${node.field}" ${link.type === 'many2one' ? `links to ${link.relation}` : `is a ${link.type}`}; the records listed point at this one by a many2one to ${model}`);
|
|
1044
|
+
}
|
|
1045
|
+
for (const [name, def] of Object.entries(fields)) {
|
|
1046
|
+
if (def.type === 'monetary' && def.currencyField !== undefined)
|
|
1047
|
+
this.checkCurrency(def.currencyField, `${path}.fields.${name}.currencyField`, fields, undefined, fields);
|
|
1048
|
+
if (def.type === 'datetime' && def.timeZone !== undefined)
|
|
1049
|
+
this.checkZone(def.timeZone, `${path}.fields.${name}.timeZone`);
|
|
1050
|
+
}
|
|
1051
|
+
// Its filter is about its records, by their fields; what it compares with may be read from this record.
|
|
1052
|
+
node.filter?.forEach((item, i) => this.checkFilterItem(item, `${path}.filter[${i}]`, this.here()));
|
|
1053
|
+
if (node.viewAll && node.viewAll.page === this.page.id)
|
|
1054
|
+
this.report(`${path}.viewAll.page`, 'View all opens a list of the records related: this page is the record they point at');
|
|
1055
|
+
}
|
|
895
1056
|
walkTabs(node, path) {
|
|
896
1057
|
node.children.forEach((tab, i) => {
|
|
897
1058
|
const tabPath = `${path}.children[${i}]`;
|