@multiplatform.one/backoffice 7.81.1 → 7.82.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/dist/cjs/chrome/UserMenu.cjs +1 -12
- package/dist/cjs/chrome/UserMenu.native.js +1 -12
- package/dist/cjs/chrome/UserMenu.native.js.map +1 -1
- package/dist/cjs/formBuilder/FormBuilderScreen.cjs +2 -2
- package/dist/cjs/formBuilder/FormBuilderScreen.native.js +2 -2
- package/dist/cjs/formBuilder/FormBuilderScreen.native.js.map +1 -1
- package/dist/cjs/i18n/en.cjs +3 -6
- package/dist/cjs/i18n/en.native.js +3 -6
- package/dist/cjs/i18n/en.native.js.map +1 -1
- package/dist/cjs/list/DoctypeListScreen.cjs +2 -18
- package/dist/cjs/list/DoctypeListScreen.native.js +3 -22
- package/dist/cjs/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/cjs/report/QueryReportScreen.cjs +35 -47
- package/dist/cjs/report/QueryReportScreen.native.js +37 -48
- package/dist/cjs/report/QueryReportScreen.native.js.map +1 -1
- package/dist/esm/chrome/UserMenu.mjs +2 -13
- package/dist/esm/chrome/UserMenu.mjs.map +1 -1
- package/dist/esm/chrome/UserMenu.native.js +2 -13
- package/dist/esm/chrome/UserMenu.native.js.map +1 -1
- package/dist/esm/formBuilder/FormBuilderScreen.mjs +2 -2
- package/dist/esm/formBuilder/FormBuilderScreen.mjs.map +1 -1
- package/dist/esm/formBuilder/FormBuilderScreen.native.js +2 -2
- package/dist/esm/formBuilder/FormBuilderScreen.native.js.map +1 -1
- package/dist/esm/i18n/en.mjs +3 -6
- package/dist/esm/i18n/en.mjs.map +1 -1
- package/dist/esm/i18n/en.native.js +3 -6
- package/dist/esm/i18n/en.native.js.map +1 -1
- package/dist/esm/list/DoctypeListScreen.mjs +3 -19
- package/dist/esm/list/DoctypeListScreen.mjs.map +1 -1
- package/dist/esm/list/DoctypeListScreen.native.js +4 -23
- package/dist/esm/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/esm/report/QueryReportScreen.mjs +26 -38
- package/dist/esm/report/QueryReportScreen.mjs.map +1 -1
- package/dist/esm/report/QueryReportScreen.native.js +28 -39
- package/dist/esm/report/QueryReportScreen.native.js.map +1 -1
- package/dist/jsx/chrome/UserMenu.mjs +2 -13
- package/dist/jsx/chrome/UserMenu.mjs.map +1 -1
- package/dist/jsx/chrome/UserMenu.native.js +1 -12
- package/dist/jsx/chrome/UserMenu.native.js.map +1 -1
- package/dist/jsx/formBuilder/FormBuilderScreen.mjs +2 -2
- package/dist/jsx/formBuilder/FormBuilderScreen.mjs.map +1 -1
- package/dist/jsx/formBuilder/FormBuilderScreen.native.js +2 -2
- package/dist/jsx/formBuilder/FormBuilderScreen.native.js.map +1 -1
- package/dist/jsx/i18n/en.mjs +3 -6
- package/dist/jsx/i18n/en.mjs.map +1 -1
- package/dist/jsx/i18n/en.native.js +3 -6
- package/dist/jsx/i18n/en.native.js.map +1 -1
- package/dist/jsx/list/DoctypeListScreen.mjs +3 -19
- package/dist/jsx/list/DoctypeListScreen.mjs.map +1 -1
- package/dist/jsx/list/DoctypeListScreen.native.js +3 -22
- package/dist/jsx/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/jsx/report/QueryReportScreen.mjs +26 -38
- package/dist/jsx/report/QueryReportScreen.mjs.map +1 -1
- package/dist/jsx/report/QueryReportScreen.native.js +37 -48
- package/dist/jsx/report/QueryReportScreen.native.js.map +1 -1
- package/package.json +12 -12
- package/src/chrome/UserMenu.tsx +0 -15
- package/src/form/FormToolbar.screen.spec.tsx +31 -0
- package/src/formBuilder/FormBuilderScreen.tsx +2 -2
- package/src/i18n/en.ts +3 -6
- package/src/list/DoctypeListScreen.compactHead.screen.spec.tsx +2 -2
- package/src/list/DoctypeListScreen.tsx +8 -28
- package/src/report/QueryReportScreen.tsx +33 -46
- package/types/chrome/UserMenu.d.ts.map +1 -1
- package/types/i18n/en.d.ts +3 -6
- package/types/i18n/en.d.ts.map +1 -1
- package/types/list/DoctypeListScreen.d.ts.map +1 -1
- package/types/report/QueryReportScreen.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Desk /app/query-report/<name> parity surface: report title header
|
|
2
|
-
//
|
|
1
|
+
// Desk /app/query-report/<name> parity surface: report title header with
|
|
2
|
+
// an icon export, a sticky declared-filter band (queryReportFilterBar — Metabase /
|
|
3
3
|
// Looker / Desk page-form / Linear insights), and the query_report.run
|
|
4
4
|
// result in the catalog DataTable (client-side sort/search/pagination —
|
|
5
5
|
// desk also loads query-report rows in one shot).
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
ActionButton,
|
|
14
14
|
Button,
|
|
15
15
|
EmptyState,
|
|
16
|
-
IconButton,
|
|
17
16
|
PageHeader,
|
|
18
17
|
ScrollView,
|
|
19
18
|
Spinner,
|
|
@@ -23,9 +22,8 @@ import {
|
|
|
23
22
|
isWeb,
|
|
24
23
|
} from "@multiplatform.one/components";
|
|
25
24
|
import { DataTable, DataTablePagination } from "@multiplatform.one/table";
|
|
26
|
-
import { downloadBlob } from "@multiplatform.one/platform";
|
|
25
|
+
import { downloadBlob, onVisibilityChange } from "@multiplatform.one/platform";
|
|
27
26
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
28
|
-
import { ArrowClockwiseIcon } from "@phosphor-icons/react";
|
|
29
27
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
30
28
|
import { useTranslation } from "react-i18next";
|
|
31
29
|
import {
|
|
@@ -66,6 +64,10 @@ export interface QueryReportScreenProps {
|
|
|
66
64
|
|
|
67
65
|
const PAGE_SIZES = [20, 100, 500];
|
|
68
66
|
|
|
67
|
+
// LC-216: a report has no Refresh control. It re-runs when its filters
|
|
68
|
+
// change and when the page comes back after this long away.
|
|
69
|
+
const STALE_AFTER_MS = 60_000;
|
|
70
|
+
|
|
69
71
|
export function QueryReportScreen({
|
|
70
72
|
reportName,
|
|
71
73
|
fixture,
|
|
@@ -179,27 +181,26 @@ export function QueryReportScreen({
|
|
|
179
181
|
}, [report.columns, report.rows, title]);
|
|
180
182
|
|
|
181
183
|
const subtitle = useMemo(() => {
|
|
182
|
-
if (report.loading) return undefined;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
t("queryReport.rowCount", {
|
|
188
|
-
defaultValue: "{{count}} row(s)",
|
|
189
|
-
count: report.rows.length,
|
|
190
|
-
}),
|
|
191
|
-
);
|
|
192
|
-
if (typeof report.executionTime === "number")
|
|
193
|
-
bits.push(
|
|
194
|
-
t("queryReport.executionTime", {
|
|
195
|
-
defaultValue: "ran in {{seconds}}s",
|
|
196
|
-
seconds: report.executionTime.toFixed(2),
|
|
197
|
-
}),
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
return bits.length > 0 ? bits.join(" · ") : undefined;
|
|
184
|
+
if (report.loading || report.error || report.missingRequired.length > 0) return undefined;
|
|
185
|
+
return t("queryReport.rowCount", {
|
|
186
|
+
defaultValue: "{{count}} rows",
|
|
187
|
+
count: report.rows.length,
|
|
188
|
+
});
|
|
201
189
|
}, [report, t]);
|
|
202
190
|
|
|
191
|
+
const { reload } = report;
|
|
192
|
+
const ranAt = useRef(Date.now());
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (!report.loading) ranAt.current = Date.now();
|
|
195
|
+
}, [report.loading]);
|
|
196
|
+
useEffect(
|
|
197
|
+
() =>
|
|
198
|
+
onVisibilityChange((visible) => {
|
|
199
|
+
if (visible && Date.now() - ranAt.current > STALE_AFTER_MS) reload();
|
|
200
|
+
}),
|
|
201
|
+
[reload],
|
|
202
|
+
);
|
|
203
|
+
|
|
203
204
|
let body: React.ReactNode;
|
|
204
205
|
if (report.loading) {
|
|
205
206
|
body = (
|
|
@@ -286,13 +287,7 @@ export function QueryReportScreen({
|
|
|
286
287
|
<Button chromeless onPress={clearVisibleFilters}>
|
|
287
288
|
{t("queryReport.clearAllFilters", "Clear all filters")}
|
|
288
289
|
</Button>
|
|
289
|
-
) :
|
|
290
|
-
<IconButton
|
|
291
|
-
icon={ArrowClockwiseIcon}
|
|
292
|
-
aria-label={t("queryReport.refresh", "Refresh")}
|
|
293
|
-
onPress={report.reload}
|
|
294
|
-
/>
|
|
295
|
-
)
|
|
290
|
+
) : undefined
|
|
296
291
|
}
|
|
297
292
|
/>
|
|
298
293
|
);
|
|
@@ -323,20 +318,12 @@ export function QueryReportScreen({
|
|
|
323
318
|
<XStack gap="$2" alignItems="center">
|
|
324
319
|
{report.running && !report.loading ? <Spinner size="small" /> : null}
|
|
325
320
|
{report.refused ? null : (
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
/>
|
|
333
|
-
<ActionButton
|
|
334
|
-
kind="export"
|
|
335
|
-
label={t("queryReport.exportCsv", "Export CSV")}
|
|
336
|
-
onPress={handleExport}
|
|
337
|
-
disabled={report.loading || report.rows.length === 0}
|
|
338
|
-
/>
|
|
339
|
-
</>
|
|
321
|
+
<ActionButton
|
|
322
|
+
kind="export"
|
|
323
|
+
label={t("queryReport.exportCsv", "Export CSV")}
|
|
324
|
+
onPress={handleExport}
|
|
325
|
+
disabled={report.loading || report.rows.length === 0}
|
|
326
|
+
/>
|
|
340
327
|
)}
|
|
341
328
|
</XStack>
|
|
342
329
|
}
|
|
@@ -346,7 +333,7 @@ export function QueryReportScreen({
|
|
|
346
333
|
{stripHtml(report.serverMessage)}
|
|
347
334
|
</Text>
|
|
348
335
|
) : null}
|
|
349
|
-
<YStack flex={1} minWidth={0}
|
|
336
|
+
<YStack flex={1} minWidth={0} {...knobProps.gap}>
|
|
350
337
|
{report.filterMeta.length > 0 ? (
|
|
351
338
|
<QueryReportFilterBar
|
|
352
339
|
filterMeta={report.filterMeta}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/chrome/UserMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/chrome/UserMenu.tsx"],"names":[],"mappings":"AAsCA,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAE,aAAkB,2CAqM3D"}
|
package/types/i18n/en.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare const en: {
|
|
|
81
81
|
readonly customizeMode: "Saves through Customize Form";
|
|
82
82
|
readonly doctypeMode: "Saves to DocType";
|
|
83
83
|
readonly goToList: "Go to {{doctype}} list";
|
|
84
|
-
readonly
|
|
84
|
+
readonly revert: "Revert to Saved";
|
|
85
85
|
readonly properties: "Field properties";
|
|
86
86
|
readonly behaviour: "Behaviour";
|
|
87
87
|
readonly discardTitle: "Discard unsaved changes?";
|
|
@@ -345,7 +345,6 @@ export declare const en: {
|
|
|
345
345
|
readonly authFailed: "Unable to complete sign-in or sign-out. Try again.";
|
|
346
346
|
readonly myProfile: "My Profile";
|
|
347
347
|
readonly mySettings: "My Settings";
|
|
348
|
-
readonly reload: "Reload";
|
|
349
348
|
readonly toggleTheme: "Toggle Theme";
|
|
350
349
|
readonly themeUnavailable: "Theme switching is unavailable on this platform";
|
|
351
350
|
readonly viewWebsite: "View Website";
|
|
@@ -502,7 +501,6 @@ export declare const en: {
|
|
|
502
501
|
readonly range: "{{start}}–{{end}} of {{total}}";
|
|
503
502
|
readonly noTags: "No Tags";
|
|
504
503
|
readonly notPermitted: "You can't open the {{doctype}} list";
|
|
505
|
-
readonly refresh: "Refresh";
|
|
506
504
|
readonly resultCount_one: "{{count}} result";
|
|
507
505
|
readonly resultCount_other: "{{count}} results";
|
|
508
506
|
readonly select: "Select";
|
|
@@ -564,13 +562,12 @@ export declare const en: {
|
|
|
564
562
|
readonly disabledTitle: "\"{{report}}\" is disabled";
|
|
565
563
|
readonly emptyDescription: "The report ran but returned no rows";
|
|
566
564
|
readonly emptyTitle: "No results";
|
|
567
|
-
readonly executionTime: "ran in {{seconds}}s";
|
|
568
565
|
readonly filtersRequiredDescription: "Set the required filter(s) to run this report: {{filters}}";
|
|
569
566
|
readonly filtersRequiredTitle: "Filters required";
|
|
570
567
|
readonly notPermitted: "You can't run \"{{report}}\"";
|
|
571
|
-
readonly refresh: "Refresh";
|
|
572
568
|
readonly retry: "Retry";
|
|
573
|
-
readonly
|
|
569
|
+
readonly rowCount_one: "{{count}} row";
|
|
570
|
+
readonly rowCount_other: "{{count}} rows";
|
|
574
571
|
readonly runError: "Could not run \"{{report}}\"";
|
|
575
572
|
readonly scriptFiltersGap: "Some of this report's filters are defined in code and aren't supported here yet";
|
|
576
573
|
readonly scriptFiltersHint: "Some of this report's filters are declared in desk-side scripts and could not be derived here";
|
package/types/i18n/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAotBL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoctypeListScreen.d.ts","sourceRoot":"","sources":["../../src/list/DoctypeListScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DoctypeListScreen.d.ts","sourceRoot":"","sources":["../../src/list/DoctypeListScreen.tsx"],"names":[],"mappings":"AA8CA,OAAO,EAUL,KAAK,OAAO,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAEV,eAAe,EAIhB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAS1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAoC5D,MAAM,WAAW,sBAAsB;IACrC,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,KAAK,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;IACtF,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,cAAc,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC9C;AAyBD,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,KAAK,EAAE,cAAc,EACrB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,GACf,EAAE,sBAAsB,2CAypCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryReportScreen.d.ts","sourceRoot":"","sources":["../../src/report/QueryReportScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QueryReportScreen.d.ts","sourceRoot":"","sources":["../../src/report/QueryReportScreen.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAC;AAQtC,MAAM,WAAW,sBAAsB;IACrC,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,mFAAmF;IACnF,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,wCAAwC;IACxC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;AAQD,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,SAAS,GACV,EAAE,sBAAsB,2CA6RxB"}
|