@fieldia/core 0.24.0 → 0.25.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 +77 -1
- package/package.json +1 -1
- package/schema/page.schema.json +951 -380
- package/src/index.d.mts +5 -2
- package/src/index.d.ts +5 -2
- package/src/index.js +14 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +6 -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/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 +5453 -1522
- package/src/lib/format/layout.d.ts +5453 -1522
- package/src/lib/format/layout.js +90 -32
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +89 -31
- 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 +961 -127
- package/src/lib/format/page.d.ts +961 -127
- package/src/lib/format/page.js +14 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +14 -0
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/references.d.mts +29 -0
- package/src/lib/format/references.d.ts +29 -0
- package/src/lib/format/references.js +172 -24
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +172 -24
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/translate.js +8 -4
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +8 -4
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/upgrade.d.mts +5 -3
- package/src/lib/format/upgrade.d.ts +5 -3
- package/src/lib/format/upgrade.js +5 -3
- package/src/lib/format/upgrade.js.map +1 -1
- package/src/lib/format/upgrade.mjs +5 -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/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 +45 -1
- package/src/lib/record/form.d.ts +45 -1
- package/src/lib/record/form.js +53 -0
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +53 -0
- package/src/lib/record/form.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 +61 -0
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +62 -1
- 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/run.d.mts +31 -1
- package/src/lib/record/run.d.ts +31 -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/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 +10 -7
- package/src/runtime.d.ts +10 -7
- package/src/runtime.js +8 -3
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +2 -1
- package/src/runtime.mjs.map +1 -1
package/src/lib/format/page.js
CHANGED
|
@@ -7,6 +7,7 @@ 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");
|
|
10
11
|
const themes_1 = require("./themes");
|
|
11
12
|
var themes_2 = require("./themes");
|
|
12
13
|
Object.defineProperty(exports, "THEMES", { enumerable: true, get: function () { return themes_2.THEMES; } });
|
|
@@ -75,6 +76,19 @@ exports.PageSchema = z
|
|
|
75
76
|
.optional(),
|
|
76
77
|
phone: phone_1.PagePhoneSchema.optional(),
|
|
77
78
|
timeZone: field_1.TimeZoneSchema.optional(),
|
|
79
|
+
print: z
|
|
80
|
+
.strictObject({
|
|
81
|
+
header: z.string().min(1).max(500).optional(),
|
|
82
|
+
footer: z.string().min(1).max(1000).optional(),
|
|
83
|
+
// An address an image is drawn from: the web's, the app's own (a path), or the picture itself — never a script's.
|
|
84
|
+
logo: z
|
|
85
|
+
.string()
|
|
86
|
+
.regex(/^(https?:\/\/|data:image\/|\/|\.{0,2}\/?[^:\s]+$)/i, { error: 'a logo is an image’s address: https://…, a path, or data:image/…' })
|
|
87
|
+
.optional(),
|
|
88
|
+
})
|
|
89
|
+
.meta({ id: 'PagePrint' })
|
|
90
|
+
.optional(),
|
|
91
|
+
duplicates: duplicates_1.PageDuplicatesSchema.optional(),
|
|
78
92
|
})
|
|
79
93
|
.meta({
|
|
80
94
|
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;AACzB,uCAA8D;AAC9D,mCAAoE;AACpE,qCAA8F;AAC9F,2CAAwE;AACxE,mCAA0D;AAC1D,6CAAyE;AACzE,qCAA8C;AAC9C,mCAA8C;AAArC,gGAAA,MAAM,OAAA;AACf,qCAA4C;AAE5C,uCAA+E;AAE/E,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AAiKV,QAAA,cAAc,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EA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AChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KACtC,CAAC;SACD,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC;SACxB,QAAQ,EAAE;IACb,KAAK,EAAE,uBAAe,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,sBAAc,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC;SACL,YAAY,CAAC;QACZ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;QAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QAC9C,kHAAkH;QAClH,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,KAAK,CAAC,oDAAoD,EAAE,EAAE,KAAK,EAAE,kEAAkE,EAAE,CAAC;aAC1I,QAAQ,EAAE;KACd,CAAC;SACD,IAAI,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;SACzB,QAAQ,EAAE;IACb,UAAU,EAAE,iCAAoB,CAAC,QAAQ,EAAE;CAC5C,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,7 @@ 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';
|
|
7
8
|
import { THEMES } from './themes.mjs';
|
|
8
9
|
export { THEMES } from './themes.mjs';
|
|
9
10
|
import { SKINS } from './themes.mjs';
|
|
@@ -70,6 +71,19 @@ export const PageSchema = z
|
|
|
70
71
|
.optional(),
|
|
71
72
|
phone: PagePhoneSchema.optional(),
|
|
72
73
|
timeZone: TimeZoneSchema.optional(),
|
|
74
|
+
print: z
|
|
75
|
+
.strictObject({
|
|
76
|
+
header: z.string().min(1).max(500).optional(),
|
|
77
|
+
footer: z.string().min(1).max(1000).optional(),
|
|
78
|
+
// An address an image is drawn from: the web's, the app's own (a path), or the picture itself — never a script's.
|
|
79
|
+
logo: z
|
|
80
|
+
.string()
|
|
81
|
+
.regex(/^(https?:\/\/|data:image\/|\/|\.{0,2}\/?[^:\s]+$)/i, { error: 'a logo is an image’s address: https://…, a path, or data:image/…' })
|
|
82
|
+
.optional(),
|
|
83
|
+
})
|
|
84
|
+
.meta({ id: 'PagePrint' })
|
|
85
|
+
.optional(),
|
|
86
|
+
duplicates: PageDuplicatesSchema.optional(),
|
|
73
87
|
})
|
|
74
88
|
.meta({
|
|
75
89
|
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,M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AAQ,EAAE;KACtC,CAAC;SACD,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC;SACxB,QAAQ,EAAE;IACb,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC;SACL,YAAY,CAAC;QACZ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;QAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QAC9C,kHAAkH;QAClH,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,KAAK,CAAC,oDAAoD,EAAE,EAAE,KAAK,EAAE,kEAAkE,EAAE,CAAC;aAC1I,QAAQ,EAAE;KACd,CAAC;SACD,IAAI,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;SACzB,QAAQ,EAAE;IACb,UAAU,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,IAAI,CAAC;IACJ,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,8HAA8H;CACjI,CAAC,CAAC"}
|
|
@@ -40,6 +40,8 @@ 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;
|
|
43
45
|
/** 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
46
|
private checkZone;
|
|
45
47
|
/** Each step's goTo and show names a tab or a wizard step of this page. */
|
|
@@ -97,6 +99,19 @@ export declare class ReferenceCheck {
|
|
|
97
99
|
private walkFooter;
|
|
98
100
|
private walkRoot;
|
|
99
101
|
private walkList;
|
|
102
|
+
/**
|
|
103
|
+
* A list's cards, gallery, columns people choose and rows' own rules: a
|
|
104
|
+
* card's fields the page's, its picture one that can hold a picture; the
|
|
105
|
+
* optional columns among the columns; a row's tones, bold and buttons
|
|
106
|
+
* reading the list's record (its fields, `id`, `user`); and the list
|
|
107
|
+
* opening on one thing.
|
|
108
|
+
*/
|
|
109
|
+
private checkListRows;
|
|
110
|
+
/**
|
|
111
|
+
* What a list's card shows — a list page's, or a related list's of its own records' fields: its title, subtitle,
|
|
112
|
+
* status and lines each a field, its picture one that can hold a picture.
|
|
113
|
+
*/
|
|
114
|
+
private checkListCard;
|
|
100
115
|
/**
|
|
101
116
|
* A list's calendar: when each record starts (a date, or a date and time)
|
|
102
117
|
* and ends (the same kind), its words, its colour and its columns, each
|
|
@@ -111,8 +126,16 @@ export declare class ReferenceCheck {
|
|
|
111
126
|
* the rows chosen need a box to choose one.
|
|
112
127
|
*/
|
|
113
128
|
private checkListCells;
|
|
129
|
+
/**
|
|
130
|
+
* What a list shows of its records — a list page's, or a related list's of its own records' fields: its columns, its
|
|
131
|
+
* order and the fields its search looks in, each a field; each column's cells for a column of it, a sum, an average,
|
|
132
|
+
* the lowest and the highest of a number column (any column's count), a lead's icon by a field's values.
|
|
133
|
+
*/
|
|
134
|
+
private checkListed;
|
|
114
135
|
/** A list's Edit: each field it names one value can set in many records, and rows to choose to set it on. */
|
|
115
136
|
private checkBulkEdit;
|
|
137
|
+
/** A list's Import: each field it names one a file's cell can fill, and at least one such field on the page. */
|
|
138
|
+
private checkImport;
|
|
116
139
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
117
140
|
private walkListMap;
|
|
118
141
|
/**
|
|
@@ -130,6 +153,12 @@ export declare class ReferenceCheck {
|
|
|
130
153
|
private walkNode;
|
|
131
154
|
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
132
155
|
private checkFormNode;
|
|
156
|
+
/**
|
|
157
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
158
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
159
|
+
* `valueFrom` this record's.
|
|
160
|
+
*/
|
|
161
|
+
private checkRelated;
|
|
133
162
|
private walkTabs;
|
|
134
163
|
private walkSheet;
|
|
135
164
|
/** 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,8 @@ 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;
|
|
43
45
|
/** 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
46
|
private checkZone;
|
|
45
47
|
/** Each step's goTo and show names a tab or a wizard step of this page. */
|
|
@@ -97,6 +99,19 @@ export declare class ReferenceCheck {
|
|
|
97
99
|
private walkFooter;
|
|
98
100
|
private walkRoot;
|
|
99
101
|
private walkList;
|
|
102
|
+
/**
|
|
103
|
+
* A list's cards, gallery, columns people choose and rows' own rules: a
|
|
104
|
+
* card's fields the page's, its picture one that can hold a picture; the
|
|
105
|
+
* optional columns among the columns; a row's tones, bold and buttons
|
|
106
|
+
* reading the list's record (its fields, `id`, `user`); and the list
|
|
107
|
+
* opening on one thing.
|
|
108
|
+
*/
|
|
109
|
+
private checkListRows;
|
|
110
|
+
/**
|
|
111
|
+
* What a list's card shows — a list page's, or a related list's of its own records' fields: its title, subtitle,
|
|
112
|
+
* status and lines each a field, its picture one that can hold a picture.
|
|
113
|
+
*/
|
|
114
|
+
private checkListCard;
|
|
100
115
|
/**
|
|
101
116
|
* A list's calendar: when each record starts (a date, or a date and time)
|
|
102
117
|
* and ends (the same kind), its words, its colour and its columns, each
|
|
@@ -111,8 +126,16 @@ export declare class ReferenceCheck {
|
|
|
111
126
|
* the rows chosen need a box to choose one.
|
|
112
127
|
*/
|
|
113
128
|
private checkListCells;
|
|
129
|
+
/**
|
|
130
|
+
* What a list shows of its records — a list page's, or a related list's of its own records' fields: its columns, its
|
|
131
|
+
* order and the fields its search looks in, each a field; each column's cells for a column of it, a sum, an average,
|
|
132
|
+
* the lowest and the highest of a number column (any column's count), a lead's icon by a field's values.
|
|
133
|
+
*/
|
|
134
|
+
private checkListed;
|
|
114
135
|
/** A list's Edit: each field it names one value can set in many records, and rows to choose to set it on. */
|
|
115
136
|
private checkBulkEdit;
|
|
137
|
+
/** A list's Import: each field it names one a file's cell can fill, and at least one such field on the page. */
|
|
138
|
+
private checkImport;
|
|
116
139
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
117
140
|
private walkListMap;
|
|
118
141
|
/**
|
|
@@ -130,6 +153,12 @@ export declare class ReferenceCheck {
|
|
|
130
153
|
private walkNode;
|
|
131
154
|
/** A saved form placed here: never this page itself, and its answers under a name no field and no other copy has. */
|
|
132
155
|
private checkFormNode;
|
|
156
|
+
/**
|
|
157
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
158
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
159
|
+
* `valueFrom` this record's.
|
|
160
|
+
*/
|
|
161
|
+
private checkRelated;
|
|
133
162
|
private walkTabs;
|
|
134
163
|
private walkSheet;
|
|
135
164
|
/** 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,8 @@ 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);
|
|
73
79
|
this.checkGoingTo();
|
|
74
80
|
return this.issues;
|
|
75
81
|
}
|
|
@@ -82,6 +88,25 @@ class ReferenceCheck {
|
|
|
82
88
|
if (typeof captcha === 'string' && !this.slots.has(captcha))
|
|
83
89
|
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
90
|
}
|
|
91
|
+
/** Possible duplicates: asked of a record's own page, by fields records can be compared by, each named once. */
|
|
92
|
+
checkDuplicates(page) {
|
|
93
|
+
const given = page.duplicates?.fields;
|
|
94
|
+
const named = Array.isArray(given) ? given : [];
|
|
95
|
+
if (!named.length)
|
|
96
|
+
this.report('duplicates.fields', 'name the fields records are compared by: ["phone", "email"]');
|
|
97
|
+
if (page.data.kind !== 'record')
|
|
98
|
+
this.report('duplicates', 'duplicates are asked of records like the one typed: a page of responses keeps none to compare it with');
|
|
99
|
+
else if (page.layout.type === 'list')
|
|
100
|
+
this.report('duplicates', 'duplicates are asked as a record is typed, on its own page, not on a list of records');
|
|
101
|
+
named.forEach((name, i) => {
|
|
102
|
+
const at = `duplicates.fields[${i}]`;
|
|
103
|
+
if (named.indexOf(name) !== i)
|
|
104
|
+
return this.report(at, `"${name}" is named twice`);
|
|
105
|
+
const def = this.need(name, at);
|
|
106
|
+
if (def && !duplicate_kinds_1.DUPLICATE_KINDS.has(def.type))
|
|
107
|
+
this.report(at, `"${name}" is a ${def.type}; records are compared by words, a number, a date, a choice or a link`);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
85
110
|
/** 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
111
|
checkZone(zone, path) {
|
|
87
112
|
if (!(0, zones_1.isTimeZone)(zone))
|
|
@@ -524,9 +549,7 @@ class ReferenceCheck {
|
|
|
524
549
|
walkList(list, path) {
|
|
525
550
|
if (this.page.data.kind !== 'record')
|
|
526
551
|
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}]`));
|
|
552
|
+
this.checkListed(list, this.page.fields, path);
|
|
530
553
|
list.groupBy?.forEach((name, i) => this.need(name, `${path}.groupBy[${i}]`));
|
|
531
554
|
// 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
555
|
const walk = (item, at) => {
|
|
@@ -561,6 +584,54 @@ class ReferenceCheck {
|
|
|
561
584
|
if (list.calendar)
|
|
562
585
|
this.walkListCalendar(list, `${path}.calendar`);
|
|
563
586
|
this.checkListCells(list, path);
|
|
587
|
+
this.checkListRows(list, path);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* A list's cards, gallery, columns people choose and rows' own rules: a
|
|
591
|
+
* card's fields the page's, its picture one that can hold a picture; the
|
|
592
|
+
* optional columns among the columns; a row's tones, bold and buttons
|
|
593
|
+
* reading the list's record (its fields, `id`, `user`); and the list
|
|
594
|
+
* opening on one thing.
|
|
595
|
+
*/
|
|
596
|
+
checkListRows(list, path) {
|
|
597
|
+
if (list.card)
|
|
598
|
+
this.checkListCard(list.card, `${path}.card`, this.page.fields);
|
|
599
|
+
for (const column of Object.keys(list.optionalColumns ?? {})) {
|
|
600
|
+
if (!list.columns.includes(column))
|
|
601
|
+
this.report(`${path}.optionalColumns.${column}`, `"${column}" is no column of this list: a person shows or hides its columns`);
|
|
602
|
+
}
|
|
603
|
+
// A column a person may hide, every one hidden at first: the list would open with no column but its own.
|
|
604
|
+
if (list.optionalColumns && list.columns.every((column) => list.optionalColumns?.[column] === 'hide'))
|
|
605
|
+
this.report(`${path}.optionalColumns`, 'every column starts hidden: show one at least, as the list opens');
|
|
606
|
+
if (list.gallery?.opens === 'gallery') {
|
|
607
|
+
if (list.map?.view && list.map.view !== 'list')
|
|
608
|
+
this.report(`${path}.gallery.opens`, 'the list opens on its map (map.view) and on its gallery: say one');
|
|
609
|
+
if (list.calendar?.opens === 'calendar')
|
|
610
|
+
this.report(`${path}.gallery.opens`, 'the list opens on its calendar and on its gallery: say one');
|
|
611
|
+
}
|
|
612
|
+
list.rowTones?.forEach((tone, i) => this.checkModifiers(tone, `${path}.rowTones[${i}]`, ['when']));
|
|
613
|
+
this.checkModifiers(list, path, ['rowBold']);
|
|
614
|
+
list.rowButtons?.forEach((button, i) => {
|
|
615
|
+
this.claim(button.id, `${path}.rowButtons[${i}]`);
|
|
616
|
+
this.checkPress(button, `${path}.rowButtons[${i}]`);
|
|
617
|
+
// Shown by a condition on each row's record.
|
|
618
|
+
this.checkModifiers(button, `${path}.rowButtons[${i}]`, ['invisible']);
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* What a list's card shows — a list page's, or a related list's of its own records' fields: its title, subtitle,
|
|
623
|
+
* status and lines each a field, its picture one that can hold a picture.
|
|
624
|
+
*/
|
|
625
|
+
checkListCard(card, at, fields) {
|
|
626
|
+
for (const key of ['title', 'subtitle', 'status'])
|
|
627
|
+
if (card[key] !== undefined)
|
|
628
|
+
this.need(card[key], `${at}.${key}`, fields);
|
|
629
|
+
if (card.image !== undefined) {
|
|
630
|
+
const def = this.need(card.image, `${at}.image`, fields);
|
|
631
|
+
if (def && !PICTURES.has(def.type))
|
|
632
|
+
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`);
|
|
633
|
+
}
|
|
634
|
+
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
635
|
}
|
|
565
636
|
/**
|
|
566
637
|
* A list's calendar: when each record starts (a date, or a date and time)
|
|
@@ -605,27 +676,6 @@ class ReferenceCheck {
|
|
|
605
676
|
* the rows chosen need a box to choose one.
|
|
606
677
|
*/
|
|
607
678
|
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
679
|
if (list.filterFields && list.search !== 'fields')
|
|
630
680
|
this.report(`${path}.filterFields`, 'the filter fields are for the "fields" search: add "search": "fields"');
|
|
631
681
|
list.filterFields?.forEach((name, i) => {
|
|
@@ -648,6 +698,37 @@ class ReferenceCheck {
|
|
|
648
698
|
if (list.choose === false && list.actions?.length)
|
|
649
699
|
this.report(`${path}.actions`, 'a list’s buttons act on the rows chosen: with "choose": false there is no way to choose one');
|
|
650
700
|
this.checkBulkEdit(list, path);
|
|
701
|
+
this.checkImport(list, path);
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* What a list shows of its records — a list page's, or a related list's of its own records' fields: its columns, its
|
|
705
|
+
* order and the fields its search looks in, each a field; each column's cells for a column of it, a sum, an average,
|
|
706
|
+
* the lowest and the highest of a number column (any column's count), a lead's icon by a field's values.
|
|
707
|
+
*/
|
|
708
|
+
checkListed(list, fields, path) {
|
|
709
|
+
list.columns.forEach((name, i) => this.need(name, `${path}.columns[${i}]`, fields));
|
|
710
|
+
list.sort?.forEach((order, i) => this.need(order.field, `${path}.sort[${i}].field`, fields));
|
|
711
|
+
list.searchFields?.forEach((name, i) => this.need(name, `${path}.searchFields[${i}]`, fields));
|
|
712
|
+
for (const [column, cell] of Object.entries(list.cells ?? {})) {
|
|
713
|
+
const at = `${path}.cells.${column}`;
|
|
714
|
+
if (!list.columns.includes(column)) {
|
|
715
|
+
this.report(at, `"${column}" is no column of this list: its cells are for its columns`);
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
const kind = has(fields, column) ? fields[column].type : undefined;
|
|
719
|
+
if (cell.total && cell.total !== 'count' && kind && kind !== 'integer' && kind !== 'float' && kind !== 'monetary') {
|
|
720
|
+
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"`);
|
|
721
|
+
}
|
|
722
|
+
if (!cell.lead)
|
|
723
|
+
continue;
|
|
724
|
+
const def = this.need(cell.lead.field, `${at}.lead.field`, fields);
|
|
725
|
+
if (def?.type !== 'selection')
|
|
726
|
+
continue;
|
|
727
|
+
const values = new Set(def.options.map((option) => String(option.value)));
|
|
728
|
+
for (const value of Object.keys(cell.lead.looks))
|
|
729
|
+
if (!values.has(value))
|
|
730
|
+
this.report(`${at}.lead.looks.${value}`, `"${value}" is no value of "${cell.lead.field}"`);
|
|
731
|
+
}
|
|
651
732
|
}
|
|
652
733
|
/** A list's Edit: each field it names one value can set in many records, and rows to choose to set it on. */
|
|
653
734
|
checkBulkEdit(list, path) {
|
|
@@ -674,6 +755,29 @@ class ReferenceCheck {
|
|
|
674
755
|
this.report(at, `"${name}" is ${def.compute ? 'worked out from other fields' : 'read-only'}; Edit sets a field people can change`);
|
|
675
756
|
});
|
|
676
757
|
}
|
|
758
|
+
/** A list's Import: each field it names one a file's cell can fill, and at least one such field on the page. */
|
|
759
|
+
checkImport(list, path) {
|
|
760
|
+
if (!list.import)
|
|
761
|
+
return;
|
|
762
|
+
if (list.import === true) {
|
|
763
|
+
if (!Object.values(this.page.fields).some((def) => (0, import_fields_1.importable)(def)))
|
|
764
|
+
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');
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
const named = list.import;
|
|
768
|
+
named.forEach((name, i) => {
|
|
769
|
+
const at = `${path}.import[${i}]`;
|
|
770
|
+
if (named.indexOf(name) !== i)
|
|
771
|
+
this.report(at, `"${name}" is offered twice`);
|
|
772
|
+
const def = this.need(name, at);
|
|
773
|
+
if (!def)
|
|
774
|
+
return;
|
|
775
|
+
if (!import_fields_1.IMPORT_KINDS.has(def.type))
|
|
776
|
+
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`);
|
|
777
|
+
else if (def.readonly === true || def.compute)
|
|
778
|
+
this.report(at, `"${name}" is ${def.compute ? 'worked out from other fields' : 'read-only'}; Import fills a field people can change`);
|
|
779
|
+
});
|
|
780
|
+
}
|
|
677
781
|
/** A list's map: where each record is, and the fields its pin and its card show, each of a type that can. */
|
|
678
782
|
walkListMap(map, path) {
|
|
679
783
|
const pair = map.latitude !== undefined || map.longitude !== undefined;
|
|
@@ -868,6 +972,8 @@ class ReferenceCheck {
|
|
|
868
972
|
return this.checkValuesIn(node.text, `${path}.text`);
|
|
869
973
|
case 'map':
|
|
870
974
|
return this.walkMap(node, path);
|
|
975
|
+
case 'related':
|
|
976
|
+
return this.checkRelated(node, path);
|
|
871
977
|
case 'slot':
|
|
872
978
|
this.slots.add(node.name);
|
|
873
979
|
return;
|
|
@@ -892,6 +998,48 @@ class ReferenceCheck {
|
|
|
892
998
|
else
|
|
893
999
|
this.formNames.set(node.name, path);
|
|
894
1000
|
}
|
|
1001
|
+
/**
|
|
1002
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
1003
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
1004
|
+
* `valueFrom` this record's.
|
|
1005
|
+
*/
|
|
1006
|
+
checkRelated(node, path) {
|
|
1007
|
+
// The quick check reads no shapes: a part with nothing to go by is said here.
|
|
1008
|
+
if (typeof node.model !== 'string' || typeof node.field !== 'string' || !Array.isArray(node.columns) || !node.fields || typeof node.fields !== 'object') {
|
|
1009
|
+
return this.report(path, 'a related list needs the model of its records, their link to this record (field), their fields and its columns');
|
|
1010
|
+
}
|
|
1011
|
+
const model = this.page.data.kind === 'record' ? this.page.data.model : null;
|
|
1012
|
+
if (!model || this.line)
|
|
1013
|
+
this.report(path, 'a related list shows the records that point at a record: it belongs on a record’s page');
|
|
1014
|
+
const fields = node.fields;
|
|
1015
|
+
this.checkListed(node, fields, path);
|
|
1016
|
+
// On a phone its rows are cards, as a list's: of its own records' fields.
|
|
1017
|
+
if (node.card)
|
|
1018
|
+
this.checkListCard(node.card, `${path}.card`, fields);
|
|
1019
|
+
// Its rows' own rules, as a list's, each read on the row's record: its own fields, its id, the person, the context.
|
|
1020
|
+
const row = { fields };
|
|
1021
|
+
node.rowTones?.forEach((tone, i) => this.checkModifiers(tone, `${path}.rowTones[${i}]`, ['when'], row));
|
|
1022
|
+
this.checkModifiers(node, path, ['rowBold'], row);
|
|
1023
|
+
node.rowButtons?.forEach((button, i) => {
|
|
1024
|
+
this.claim(button.id, `${path}.rowButtons[${i}]`);
|
|
1025
|
+
this.checkPress(button, `${path}.rowButtons[${i}]`);
|
|
1026
|
+
this.checkModifiers(button, `${path}.rowButtons[${i}]`, ['invisible'], row);
|
|
1027
|
+
});
|
|
1028
|
+
const link = has(fields, node.field) ? fields[node.field] : undefined;
|
|
1029
|
+
if (link && model && (link.type !== 'many2one' || link.relation !== model)) {
|
|
1030
|
+
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}`);
|
|
1031
|
+
}
|
|
1032
|
+
for (const [name, def] of Object.entries(fields)) {
|
|
1033
|
+
if (def.type === 'monetary' && def.currencyField !== undefined)
|
|
1034
|
+
this.checkCurrency(def.currencyField, `${path}.fields.${name}.currencyField`, fields, undefined, fields);
|
|
1035
|
+
if (def.type === 'datetime' && def.timeZone !== undefined)
|
|
1036
|
+
this.checkZone(def.timeZone, `${path}.fields.${name}.timeZone`);
|
|
1037
|
+
}
|
|
1038
|
+
// Its filter is about its records, by their fields; what it compares with may be read from this record.
|
|
1039
|
+
node.filter?.forEach((item, i) => this.checkFilterItem(item, `${path}.filter[${i}]`, this.here()));
|
|
1040
|
+
if (node.viewAll && node.viewAll.page === this.page.id)
|
|
1041
|
+
this.report(`${path}.viewAll.page`, 'View all opens a list of the records related: this page is the record they point at');
|
|
1042
|
+
}
|
|
895
1043
|
walkTabs(node, path) {
|
|
896
1044
|
node.children.forEach((tab, i) => {
|
|
897
1045
|
const tabPath = `${path}.children[${i}]`;
|