@feedmepos/mf-report 5.32.3 → 5.33.0-beta.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/App-ZE1kA1jU.js +358 -0
- package/dist/{DateRangeSelect-6ojNsYQf.js → DateRangeSelect-B10B3ZaN.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-DinIx-4F.js → Default.vue_vue_type_script_setup_true_lang-dtu8Gum_.js} +1 -1
- package/dist/{DigestListView-Rv4nvsme.js → DigestListView-CqyxDNR_.js} +3 -3
- package/dist/{DigestReaderView-Cy5rWEDn.js → DigestReaderView-ILhtZ6ke.js} +4 -4
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CrRev99v.js → DynamicWidget.vue_vue_type_script_setup_true_lang-Dk6NA-nL.js} +7 -7
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CaFtkGgu.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Do8UrF5k.js} +753 -753
- package/dist/{InsightView-SOS32a9h.js → InsightView-cZx4gAxG.js} +5 -5
- package/dist/{Integration-CWo6GL7F.js → Integration-CgEy3mhX.js} +3 -3
- package/dist/{Integrations-T1M6Fbke.js → Integrations-BTy2r5Au.js} +2 -2
- package/dist/{Layout-CNhJDEmI.js → Layout-B3MnHb6_.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-DgFWhBfv.js → LocationSelect.vue_vue_type_script_setup_true_lang-DqPi50ty.js} +1752 -1743
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BltVG4Ta.js → MenuTab.vue_vue_type_script_setup_true_lang-DGMEWWMl.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-B70bamMw.js → NavigationTab.vue_vue_type_script_setup_true_lang-CS-gvEAf.js} +3187 -3187
- package/dist/{OverviewView-DM_qaGcz.js → OverviewView-CnsSS3dA.js} +5 -5
- package/dist/Report-aCXfcgbD.js +722 -0
- package/dist/{ReportCanvasView-0680UK2i.js → ReportCanvasView-DJiD7cHf.js} +5 -5
- package/dist/{ReportEditor-9gIhhaWp.js → ReportEditor-D6VOw4xg.js} +7 -7
- package/dist/{ReportView-B1a3q6Ea.js → ReportView-DHxQQHdv.js} +64 -62
- package/dist/{ReportViewRoute-DW-K8Abr.js → ReportViewRoute-R7QAQx-y.js} +2 -2
- package/dist/{Setting-BikzZySl.js → Setting-C3q0gsVs.js} +3 -3
- package/dist/Template-DulgV4HH.js +557 -0
- package/dist/{TileEditor-B21SIE0n.js → TileEditor-B04Vkqd4.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-BH2WdtF-.js → TilePageStack.vue_vue_type_script_setup_true_lang-Cn6yji3z.js} +2 -2
- package/dist/{TransitionFade-DNtxHJq8.js → TransitionFade-B0IFIQeH.js} +6 -6
- package/dist/{app-DSxKqUxD.js → app-60Wbr-Yr.js} +2517 -2449
- package/dist/app.js +2 -2
- package/dist/assets/{formatChartData.worker-McooHFG-.js → formatChartData.worker-o6kHvamD.js} +4 -4
- package/dist/assets/{processTableData.worker-B6m0dNAb.js → processTableData.worker-B7UZDrcg.js} +4 -4
- package/dist/{currency-BJiFhFc7.js → currency-JlsW9tkr.js} +1 -1
- package/dist/{index-BdZ-RSDt.js → index-BcttP7wp.js} +15 -15
- package/dist/{report-DcuMyUEc.js → report-CN9S4Zga.js} +132 -132
- package/dist/style.css +1 -1
- package/dist/{useDigestFont-DYDD96g_.js → useDigestFont-CyF_Sl2L.js} +1 -1
- package/dist/{useReportCanvasPanel-6D4KNid_.js → useReportCanvasPanel-DHUVpFYD.js} +3 -3
- package/dist/{useRestaurantPermission-5C-J7LtV.js → useRestaurantPermission-BjxYCII1.js} +1 -1
- package/package.json +2 -2
- package/dist/App-Ct4zKRmu.js +0 -339
- package/dist/Report-BpCqn_xs.js +0 -712
- package/dist/Template-DKUNK3A7.js +0 -522
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { u as p, F as m, v,
|
|
1
|
+
import { u as p, F as m, w as v, B as ye, a as Pe, b as we, E as Se, j as be } from "./app-60Wbr-Yr.js";
|
|
2
2
|
import { storeToRefs as l, defineStore as j } from "pinia";
|
|
3
3
|
import { ref as i, computed as $, watch as Ae } from "vue";
|
|
4
4
|
import { useSnackbar as W } from "@feedmepos/ui-library";
|
|
5
5
|
import { c as Q } from "./index-CtZE4sab.js";
|
|
6
6
|
import "./global-loader-BuxFfehu.js";
|
|
7
7
|
import { useCoreStore as $e } from "@feedmepos/mf-common";
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var Ie = /* @__PURE__ */ ((e) => (e.DateTime = "DATE_TIME", e.Hour = "HOUR", e.Day = "DAY", e.Week = "WEEK", e.Month = "MONTH", e.TimeOfDay = "TIME_OF_DAY", e.HourOfDay = "HOUR_OF_DAY", e.DayOfWeek = "DAY_OF_WEEK", e.DayOfMonth = "DAY_OF_MONTH", e.MonthOfYear = "MONTH_OF_YEAR", e.Year = "YEAR", e.YearMonthDay = "YEAR_MONTH_DAY", e))(Ie || {}), Ce = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(Ce || {}), Z = /* @__PURE__ */ ((e) => (e.Equal = "EQUAL", e.NotEqual = "NOT_EQUAL", e.GreaterThan = "GREATER_THAN", e.LessThan = "LESS_THAN", e.GreaterThanOrEqual = "GREATER_THAN_OR_EQUAL", e.LessThanOrEqual = "LESS_THAN_OR_EQUAL", e.Between = "BETWEEN", e.Like = "LIKE", e.NotLike = "NOT_LIKE", e.And = "AND", e.Or = "OR", e))(Z || {}), De = /* @__PURE__ */ ((e) => (e.String = "STRING", e.Timestamp = "TIMESTAMP", e.Bool = "BOOL", e.Numeric = "NUMERIC", e))(De || {}), _e = /* @__PURE__ */ ((e) => (e.MTD = "MTD", e))(_e || {}), Ne = /* @__PURE__ */ ((e) => (e.Material = "material", e.Custom = "custom", e))(Ne || {}), Le = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e.ExtraLarge = "xl", e))(Le || {}), Fe = /* @__PURE__ */ ((e) => (e.Scorecard = "SCORECARD", e.Spacer = "SPACER", e.Table = "TABLE", e.BarChart = "BARCHART", e.StackBarChart = "STACKBARCHART", e.ClusteredStackBarChart = "CLUSTEREDSTACKBARCHART", e.LineChart = "LINECHART", e.StackLineChart = "STACKLINECHART", e.Circular = "CIRCULAR", e))(Fe || {}), C = /* @__PURE__ */ ((e) => (e.Tab = "TAB", e.Page = "PAGE", e))(C || {}), Ue = /* @__PURE__ */ ((e) => (e.EXCEL = "excel", e.PDF = "pdf", e.PDFFULLSIZE = "pdfFullSize", e.PDFRECEIPT = "pdfReceipt", e))(Ue || {}), Ge = /* @__PURE__ */ ((e) => (e.PORTRAIT = "portrait", e.LANDSCAPE = "landscape", e))(Ge || {});
|
|
9
|
+
function gt(e) {
|
|
10
10
|
switch (e) {
|
|
11
11
|
case "excel":
|
|
12
12
|
return "Excel";
|
|
@@ -32,8 +32,8 @@ function Tt(e) {
|
|
|
32
32
|
}
|
|
33
33
|
var Me = /* @__PURE__ */ ((e) => (e.BigQuery = "BIGQUERY", e.Postgres = "POSTGRES", e))(Me || {});
|
|
34
34
|
const T = "/report-settings", Oe = async () => {
|
|
35
|
-
const {
|
|
36
|
-
if (e) {
|
|
35
|
+
const { scopePath: e } = l(p());
|
|
36
|
+
if (e.value) {
|
|
37
37
|
const t = {
|
|
38
38
|
fetchType: m.Get,
|
|
39
39
|
url: `${T}/${e.value}/reports`
|
|
@@ -42,8 +42,8 @@ const T = "/report-settings", Oe = async () => {
|
|
|
42
42
|
} else
|
|
43
43
|
return Promise.reject(new Error("Business Id is not defined"));
|
|
44
44
|
}, Be = async () => {
|
|
45
|
-
const {
|
|
46
|
-
if (e) {
|
|
45
|
+
const { scopePath: e } = l(p());
|
|
46
|
+
if (e.value) {
|
|
47
47
|
const t = {
|
|
48
48
|
fetchType: m.Get,
|
|
49
49
|
url: `${T}/${e.value}/report-templates`
|
|
@@ -52,8 +52,8 @@ const T = "/report-settings", Oe = async () => {
|
|
|
52
52
|
} else
|
|
53
53
|
return Promise.reject(new Error("Business Id is not defined"));
|
|
54
54
|
}, ke = (e) => {
|
|
55
|
-
const {
|
|
56
|
-
if (t) {
|
|
55
|
+
const { scopePath: t } = l(p());
|
|
56
|
+
if (t.value) {
|
|
57
57
|
const r = {
|
|
58
58
|
fetchType: m.Post,
|
|
59
59
|
url: `${T}/${t.value}/report-template`,
|
|
@@ -65,7 +65,7 @@ const T = "/report-settings", Oe = async () => {
|
|
|
65
65
|
} else
|
|
66
66
|
return Promise.reject(new Error("Business Id is not defined"));
|
|
67
67
|
}, xe = (e) => {
|
|
68
|
-
const {
|
|
68
|
+
const { scopePath: t } = l(p()), r = {
|
|
69
69
|
fetchType: m.Put,
|
|
70
70
|
url: `${T}/${t.value}/report-template`,
|
|
71
71
|
data: {
|
|
@@ -74,48 +74,48 @@ const T = "/report-settings", Oe = async () => {
|
|
|
74
74
|
};
|
|
75
75
|
return v.fetch(r);
|
|
76
76
|
}, He = (e) => {
|
|
77
|
-
const {
|
|
77
|
+
const { scopePath: t } = l(p()), r = {
|
|
78
78
|
fetchType: m.Delete,
|
|
79
79
|
url: `${T}/${t.value}/report-template/${e.id}`
|
|
80
80
|
};
|
|
81
81
|
return v.fetch(r);
|
|
82
82
|
}, V = (e) => {
|
|
83
|
-
const {
|
|
83
|
+
const { scopePath: t } = l(p()), r = {
|
|
84
84
|
fetchType: m.Put,
|
|
85
85
|
url: `${T}/${t.value}/reports/${e.id}`,
|
|
86
86
|
data: e
|
|
87
87
|
};
|
|
88
88
|
return v.fetch(r);
|
|
89
89
|
}, je = (e) => {
|
|
90
|
-
const {
|
|
90
|
+
const { scopePath: t } = l(p()), r = {
|
|
91
91
|
fetchType: m.Post,
|
|
92
92
|
url: `${T}/${t.value}/reports`,
|
|
93
93
|
data: e
|
|
94
94
|
};
|
|
95
95
|
return v.fetch(r);
|
|
96
96
|
}, Ye = (e) => {
|
|
97
|
-
const {
|
|
97
|
+
const { scopePath: t } = l(p()), r = {
|
|
98
98
|
fetchType: m.Delete,
|
|
99
99
|
url: `${T}/${t.value}/reports/${e.id}`
|
|
100
100
|
};
|
|
101
101
|
return v.fetch(r);
|
|
102
102
|
}, Je = (e) => {
|
|
103
|
-
const {
|
|
103
|
+
const { scopePath: t } = l(p()), r = {
|
|
104
104
|
fetchType: m.Put,
|
|
105
105
|
url: `${T}/${t.value}/reports/default`,
|
|
106
106
|
data: { defaultReport: e }
|
|
107
107
|
};
|
|
108
108
|
return v.fetch(r);
|
|
109
109
|
}, Rt = (e, t) => {
|
|
110
|
-
const {
|
|
110
|
+
const { scopePath: r } = l(p()), a = {
|
|
111
111
|
fetchType: m.Put,
|
|
112
112
|
url: `${T}/${r.value}/reports/${e}/pos-support`,
|
|
113
113
|
data: { isSupportPos: t }
|
|
114
114
|
};
|
|
115
|
-
return v.fetch(
|
|
115
|
+
return v.fetch(a);
|
|
116
116
|
}, Ke = async () => {
|
|
117
|
-
const {
|
|
118
|
-
if (e) {
|
|
117
|
+
const { scopePath: e } = l(p());
|
|
118
|
+
if (e.value) {
|
|
119
119
|
const t = {
|
|
120
120
|
fetchType: m.Get,
|
|
121
121
|
url: `${T}/${e.value}/overview-report`
|
|
@@ -124,8 +124,8 @@ const T = "/report-settings", Oe = async () => {
|
|
|
124
124
|
} else
|
|
125
125
|
return Promise.reject(new Error("Business Id is not defined"));
|
|
126
126
|
}, Qe = async () => {
|
|
127
|
-
const {
|
|
128
|
-
if (e) {
|
|
127
|
+
const { scopePath: e } = l(p());
|
|
128
|
+
if (e.value) {
|
|
129
129
|
const t = {
|
|
130
130
|
fetchType: m.Get,
|
|
131
131
|
url: `${T}/${e.value}/config`
|
|
@@ -134,8 +134,8 @@ const T = "/report-settings", Oe = async () => {
|
|
|
134
134
|
} else
|
|
135
135
|
return Promise.reject(new Error("Business Id is not defined"));
|
|
136
136
|
}, Ve = "/report-settings", q = async () => {
|
|
137
|
-
const {
|
|
138
|
-
if (e) {
|
|
137
|
+
const { scopePath: e } = l(p());
|
|
138
|
+
if (e.value) {
|
|
139
139
|
const t = {
|
|
140
140
|
fetchType: m.Get,
|
|
141
141
|
url: `${Ve}/${e.value}/categories`
|
|
@@ -164,14 +164,14 @@ function D(e, t, r) {
|
|
|
164
164
|
if (z.randomUUID && !t && !e)
|
|
165
165
|
return z.randomUUID();
|
|
166
166
|
e = e || {};
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
167
|
+
const a = e.random || (e.rng || ze)();
|
|
168
|
+
if (a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, t) {
|
|
169
169
|
r = r || 0;
|
|
170
|
-
for (let
|
|
171
|
-
t[r +
|
|
170
|
+
for (let u = 0; u < 16; ++u)
|
|
171
|
+
t[r + u] = a[u];
|
|
172
172
|
return t;
|
|
173
173
|
}
|
|
174
|
-
return Xe(
|
|
174
|
+
return Xe(a);
|
|
175
175
|
}
|
|
176
176
|
const Ze = 3;
|
|
177
177
|
function et(e) {
|
|
@@ -198,8 +198,8 @@ function Et(e = []) {
|
|
|
198
198
|
function re(e = [], t) {
|
|
199
199
|
for (const r of e) {
|
|
200
200
|
if (r.id === t) return r;
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
201
|
+
const a = re(r.tiles, t);
|
|
202
|
+
if (a) return a;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
function yt(e, t) {
|
|
@@ -212,16 +212,16 @@ function J(e) {
|
|
|
212
212
|
const t = Y(e) ? e.tiles.flatMap((r) => r.tiles ?? []) : e.tiles;
|
|
213
213
|
return t.length === 0 ? 2 : 1 + Math.max(...t.map(J));
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Pt(e = []) {
|
|
216
216
|
return e.length === 0 ? 0 : Math.max(...e.map(J));
|
|
217
217
|
}
|
|
218
218
|
function wt(e, t) {
|
|
219
219
|
return Y(e) && t !== 1 ? !1 : t + J(e) - 1 <= Ze;
|
|
220
220
|
}
|
|
221
221
|
function St(e) {
|
|
222
|
-
const t = JSON.parse(JSON.stringify(e)), r = (
|
|
223
|
-
var
|
|
224
|
-
|
|
222
|
+
const t = JSON.parse(JSON.stringify(e)), r = (a) => {
|
|
223
|
+
var u;
|
|
224
|
+
a.id = D(), (u = a.tiles) == null || u.forEach(r);
|
|
225
225
|
};
|
|
226
226
|
return r(t), t;
|
|
227
227
|
}
|
|
@@ -243,7 +243,7 @@ function rt(e) {
|
|
|
243
243
|
tiles: []
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function bt() {
|
|
247
247
|
return {
|
|
248
248
|
id: D(),
|
|
249
249
|
size: { width: 12, height: 4 },
|
|
@@ -257,7 +257,7 @@ function At(e) {
|
|
|
257
257
|
function $t(e) {
|
|
258
258
|
delete e.mode, delete e.tiles, delete e.tabTitle;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function It() {
|
|
261
261
|
return {
|
|
262
262
|
id: D(),
|
|
263
263
|
size: { width: 6, height: 4 },
|
|
@@ -269,10 +269,10 @@ function Ct(e, {
|
|
|
269
269
|
unknownLabel: t,
|
|
270
270
|
getAvailable: r
|
|
271
271
|
}) {
|
|
272
|
-
return e.map((
|
|
273
|
-
label: String(
|
|
274
|
-
value:
|
|
275
|
-
available: r == null ? void 0 : r(
|
|
272
|
+
return e.map((a) => ({
|
|
273
|
+
label: String(a).trim() === "" ? t : String(a),
|
|
274
|
+
value: a,
|
|
275
|
+
available: r == null ? void 0 : r(a)
|
|
276
276
|
}));
|
|
277
277
|
}
|
|
278
278
|
function X(e, t) {
|
|
@@ -297,8 +297,8 @@ function Dt(e, t = "") {
|
|
|
297
297
|
filters: e.filters ?? []
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
|
-
const
|
|
301
|
-
const e = i([]), t = i({}), r = i(!1),
|
|
300
|
+
const at = j(nt, () => {
|
|
301
|
+
const e = i([]), t = i({}), r = i(!1), a = i({}), u = i([]), R = i(null), w = () => ({
|
|
302
302
|
id: "",
|
|
303
303
|
globalFilter: {
|
|
304
304
|
label: "",
|
|
@@ -315,36 +315,36 @@ const st = j(nt, () => {
|
|
|
315
315
|
showAdvanced: !1,
|
|
316
316
|
visibleCount: 50
|
|
317
317
|
});
|
|
318
|
-
function
|
|
319
|
-
const f = X(o,
|
|
318
|
+
function b(o, h) {
|
|
319
|
+
const f = X(o, h);
|
|
320
320
|
return t.value[f] || (t.value[f] = w()), t.value[f];
|
|
321
321
|
}
|
|
322
322
|
const _ = (o) => R.value === o;
|
|
323
|
-
function L(o,
|
|
324
|
-
Object.assign(
|
|
323
|
+
function L(o, h, f) {
|
|
324
|
+
Object.assign(b(o, h), f);
|
|
325
325
|
}
|
|
326
|
-
function A(o,
|
|
327
|
-
|
|
326
|
+
function A(o, h, f = 50) {
|
|
327
|
+
b(o, h).visibleCount += f;
|
|
328
328
|
}
|
|
329
329
|
function F(o) {
|
|
330
330
|
var f;
|
|
331
331
|
if (!o) return;
|
|
332
|
-
const
|
|
333
|
-
Object.keys(t.value).forEach((
|
|
334
|
-
|
|
335
|
-
}), (f = R.value) != null && f.startsWith(
|
|
332
|
+
const h = `${o}|`;
|
|
333
|
+
Object.keys(t.value).forEach((P) => {
|
|
334
|
+
P.startsWith(h) && delete t.value[P];
|
|
335
|
+
}), (f = R.value) != null && f.startsWith(h) && S();
|
|
336
336
|
}
|
|
337
337
|
function U(o) {
|
|
338
338
|
r.value = o;
|
|
339
339
|
}
|
|
340
340
|
function E(o = []) {
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
341
|
+
const h = Array.from(new Set(o.filter(Boolean)));
|
|
342
|
+
u.value = h, h.forEach((f) => {
|
|
343
|
+
a.value[f] = (a.value[f] ?? 0) + 1;
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
function G(o) {
|
|
347
|
-
return
|
|
347
|
+
return a.value[o] ?? 0;
|
|
348
348
|
}
|
|
349
349
|
function y(o) {
|
|
350
350
|
R.value = o;
|
|
@@ -358,10 +358,10 @@ const st = j(nt, () => {
|
|
|
358
358
|
return {
|
|
359
359
|
globalFilters: e,
|
|
360
360
|
includeUnavailable: r,
|
|
361
|
-
appliedTilesFiltersVersion:
|
|
362
|
-
lastAppliedTileFilterIds:
|
|
361
|
+
appliedTilesFiltersVersion: a,
|
|
362
|
+
lastAppliedTileFilterIds: u,
|
|
363
363
|
openMenuKey: R,
|
|
364
|
-
getGlobalFilter:
|
|
364
|
+
getGlobalFilter: b,
|
|
365
365
|
isMenuOpen: _,
|
|
366
366
|
setGlobalFilter: L,
|
|
367
367
|
showMore: A,
|
|
@@ -379,7 +379,7 @@ function x(e, t = {}) {
|
|
|
379
379
|
const r = localStorage.getItem(e);
|
|
380
380
|
return r === null && (t == null ? void 0 : t.fallback) !== void 0 ? t.fallback : r === null ? null : t.format ? t.format(r) : r;
|
|
381
381
|
}
|
|
382
|
-
const
|
|
382
|
+
const I = {
|
|
383
383
|
get: x,
|
|
384
384
|
getJson: (e) => x(e, {
|
|
385
385
|
fallback: {},
|
|
@@ -393,7 +393,7 @@ const P = {
|
|
|
393
393
|
setJson: (e, t) => {
|
|
394
394
|
localStorage.setItem(e, JSON.stringify(t));
|
|
395
395
|
}
|
|
396
|
-
},
|
|
396
|
+
}, st = () => {
|
|
397
397
|
const e = {
|
|
398
398
|
fetchType: m.Get,
|
|
399
399
|
url: "/schemas"
|
|
@@ -403,9 +403,9 @@ const P = {
|
|
|
403
403
|
const e = i([]), t = W();
|
|
404
404
|
async function r() {
|
|
405
405
|
try {
|
|
406
|
-
e.value = await
|
|
407
|
-
} catch (
|
|
408
|
-
console.log(
|
|
406
|
+
e.value = await st();
|
|
407
|
+
} catch (a) {
|
|
408
|
+
console.log(a), t.open({
|
|
409
409
|
title: "Get Schema Error",
|
|
410
410
|
message: "Internal Server Error",
|
|
411
411
|
type: "error"
|
|
@@ -417,42 +417,42 @@ const P = {
|
|
|
417
417
|
getSchema: r
|
|
418
418
|
};
|
|
419
419
|
});
|
|
420
|
-
async function
|
|
420
|
+
async function ct(e, t) {
|
|
421
421
|
const { businessId: r } = l(p());
|
|
422
422
|
if (!r.value)
|
|
423
423
|
return Promise.reject(new Error("Failed to grant permission. Business Id is not defined"));
|
|
424
424
|
if (!e || !t)
|
|
425
425
|
return Promise.reject(new Error("Failed to grant permission. Permission key or report label is not defined"));
|
|
426
|
-
const
|
|
426
|
+
const a = {
|
|
427
427
|
fetchType: m.Post,
|
|
428
428
|
url: `/businesses/${r.value}/my-permissions/report-manage`,
|
|
429
429
|
data: { permissionKey: e, label: t }
|
|
430
430
|
};
|
|
431
|
-
await ye.fetch(
|
|
431
|
+
await ye.fetch(a);
|
|
432
432
|
}
|
|
433
|
-
const
|
|
434
|
-
const { business: e } = l(
|
|
435
|
-
const n =
|
|
436
|
-
(
|
|
433
|
+
const ut = "mf-reportreport-store", _t = j(ut, () => {
|
|
434
|
+
const { business: e } = l(Pe()), { globalFilters: t } = l(at()), { schemas: r } = l(it()), { flags: a } = l(we()), u = i([]), R = i([]), w = i([]), b = i(0), _ = W(), L = $e(), A = $(() => u.value.filter((n) => n.editable)), F = $(() => u.value.filter((n) => !n.editable)), U = i(!1), E = i(""), G = i(), y = i(), S = $(() => {
|
|
435
|
+
const n = a.value.find(
|
|
436
|
+
(s) => s.key === Se.report_portal_integration_custom_report
|
|
437
437
|
);
|
|
438
438
|
return typeof (n == null ? void 0 : n.value) == "number" ? n.value : null;
|
|
439
|
-
}), { isReportPermissionEnabled: M } =
|
|
440
|
-
async function
|
|
439
|
+
}), { isReportPermissionEnabled: M } = be(), o = $(() => S.value === null ? !0 : S.value - A.value.length > 0);
|
|
440
|
+
async function h() {
|
|
441
441
|
return y.value = await Ke(), y.value && H(y.value.tiles), y.value;
|
|
442
442
|
}
|
|
443
443
|
async function f() {
|
|
444
444
|
var n;
|
|
445
445
|
try {
|
|
446
|
-
|
|
447
|
-
} catch (
|
|
448
|
-
console.log(
|
|
446
|
+
u.value = await Oe(), u.value.forEach((c) => H(c.tiles)), w.value = await q(), u.value.find((c) => c.id === E.value) || (E.value = ((n = u.value.find((c) => c.isDefault)) == null ? void 0 : n.id) || u.value[0].id);
|
|
447
|
+
} catch (s) {
|
|
448
|
+
console.log(s), _.open({
|
|
449
449
|
title: "Report Fetch Error",
|
|
450
450
|
message: "Internal Server Error",
|
|
451
451
|
type: "error"
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
async function
|
|
455
|
+
async function P() {
|
|
456
456
|
try {
|
|
457
457
|
R.value = await Be(), w.value.length === 0 && (w.value = await q());
|
|
458
458
|
} catch (n) {
|
|
@@ -464,12 +464,12 @@ const ct = "mf-reportreport-store", _t = j(ct, () => {
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
const K = $(
|
|
467
|
-
() =>
|
|
467
|
+
() => u.value.find((n) => n.id === E.value)
|
|
468
468
|
);
|
|
469
469
|
function ne(n) {
|
|
470
|
-
var
|
|
471
|
-
const
|
|
472
|
-
return
|
|
470
|
+
var c;
|
|
471
|
+
const s = (c = r.value.find((g) => g.name === n.schemaName)) == null ? void 0 : c.fields.find((g) => g.name === n.name);
|
|
472
|
+
return s == null ? void 0 : s.type;
|
|
473
473
|
}
|
|
474
474
|
Ae(
|
|
475
475
|
() => {
|
|
@@ -477,55 +477,55 @@ const ct = "mf-reportreport-store", _t = j(ct, () => {
|
|
|
477
477
|
return (n = K.value) == null ? void 0 : n.globalFilters;
|
|
478
478
|
},
|
|
479
479
|
(n) => {
|
|
480
|
-
t.value = (n ?? []).map((
|
|
481
|
-
...
|
|
482
|
-
values: Array.isArray(
|
|
483
|
-
type: ne(
|
|
480
|
+
t.value = (n ?? []).map((s) => ({
|
|
481
|
+
...s,
|
|
482
|
+
values: Array.isArray(s.values) ? [...s.values] : [],
|
|
483
|
+
type: ne(s)
|
|
484
484
|
}));
|
|
485
485
|
},
|
|
486
486
|
{ deep: !0 }
|
|
487
487
|
);
|
|
488
|
-
const
|
|
488
|
+
const ae = i(), se = i(0), oe = i(), ie = i(null), ce = i(null), ue = i(!1), le = i(!1), fe = i(!1);
|
|
489
489
|
async function de(n) {
|
|
490
490
|
if (!n.editable && n.id) {
|
|
491
|
-
const
|
|
492
|
-
return O(
|
|
491
|
+
const g = await V(n);
|
|
492
|
+
return O(g.id), await f(), g;
|
|
493
493
|
}
|
|
494
|
-
const
|
|
495
|
-
let
|
|
496
|
-
if (
|
|
497
|
-
|
|
494
|
+
const s = A.value.findIndex((g) => g.id === n.id);
|
|
495
|
+
let c;
|
|
496
|
+
if (s >= 0)
|
|
497
|
+
c = await V(n);
|
|
498
498
|
else {
|
|
499
|
-
|
|
499
|
+
c = await je(n);
|
|
500
500
|
try {
|
|
501
501
|
if (M.value) {
|
|
502
|
-
await
|
|
503
|
-
const { businessId:
|
|
504
|
-
await L.fetchUserPermissions(void 0,
|
|
502
|
+
await ct(c.id, c.name);
|
|
503
|
+
const { businessId: g } = l(p());
|
|
504
|
+
await L.fetchUserPermissions(void 0, g.value);
|
|
505
505
|
}
|
|
506
|
-
} catch (
|
|
506
|
+
} catch (g) {
|
|
507
507
|
console.warn("Failed to grant report manage permission", {
|
|
508
|
-
reportId:
|
|
509
|
-
err:
|
|
508
|
+
reportId: c.id,
|
|
509
|
+
err: g
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
return O(
|
|
513
|
+
return O(c.id), await f(), c;
|
|
514
514
|
}
|
|
515
515
|
async function pe(n) {
|
|
516
516
|
await Ye(n), await f();
|
|
517
517
|
}
|
|
518
518
|
async function me(n) {
|
|
519
|
-
await Je(n), await
|
|
519
|
+
await Je(n), await h();
|
|
520
520
|
}
|
|
521
|
-
async function
|
|
522
|
-
await ke(n), await
|
|
521
|
+
async function he(n) {
|
|
522
|
+
await ke(n), await P();
|
|
523
523
|
}
|
|
524
524
|
async function ve(n) {
|
|
525
|
-
await xe(n), await
|
|
525
|
+
await xe(n), await P();
|
|
526
526
|
}
|
|
527
|
-
async function
|
|
528
|
-
await He(n), await
|
|
527
|
+
async function ge(n) {
|
|
528
|
+
await He(n), await P();
|
|
529
529
|
}
|
|
530
530
|
function O(n) {
|
|
531
531
|
E.value = n;
|
|
@@ -534,65 +534,65 @@ const ct = "mf-reportreport-store", _t = j(ct, () => {
|
|
|
534
534
|
function k() {
|
|
535
535
|
var n;
|
|
536
536
|
if ((n = e.value) != null && n._id) {
|
|
537
|
-
const
|
|
538
|
-
if ((
|
|
539
|
-
B.value =
|
|
537
|
+
const s = I.getJson("pinReport")[e.value._id];
|
|
538
|
+
if ((s == null ? void 0 : s.length) > 0) {
|
|
539
|
+
B.value = s;
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
B.value = null;
|
|
544
544
|
}
|
|
545
545
|
function Te(n) {
|
|
546
|
-
var
|
|
546
|
+
var s;
|
|
547
547
|
if (e.value && n) {
|
|
548
|
-
const
|
|
549
|
-
|
|
548
|
+
const c = I.getJson("pinReport");
|
|
549
|
+
c[(s = e.value) == null ? void 0 : s._id] ? c[e.value._id].push(n.id) : c[e.value._id] = [n.id], I.setJson("pinReport", c), k();
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
function Re(n) {
|
|
553
553
|
if (e.value) {
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
(
|
|
557
|
-
),
|
|
554
|
+
const s = I.getJson("pinReport");
|
|
555
|
+
s[e.value._id].length === 1 ? s[e.value._id] = [] : s[e.value._id] = s[e.value._id].filter(
|
|
556
|
+
(c) => c !== n
|
|
557
|
+
), I.setJson("pinReport", s), k();
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
async function Ee() {
|
|
561
561
|
return await Qe();
|
|
562
562
|
}
|
|
563
563
|
return {
|
|
564
|
-
isOpenDownloadDialog:
|
|
564
|
+
isOpenDownloadDialog: ue,
|
|
565
565
|
isOpenFeedbackDialog: le,
|
|
566
566
|
isOpenEmailDialog: fe,
|
|
567
567
|
currentSelectWidgetType: G,
|
|
568
|
-
reports:
|
|
568
|
+
reports: u,
|
|
569
569
|
reportTemplates: R,
|
|
570
570
|
categories: w,
|
|
571
571
|
currentReport: K,
|
|
572
|
-
editingReport:
|
|
573
|
-
editingTileIndex:
|
|
572
|
+
editingReport: ae,
|
|
573
|
+
editingTileIndex: se,
|
|
574
574
|
editingTile: oe,
|
|
575
575
|
editingGlobalFilterIndex: ie,
|
|
576
|
-
editingGlobalFilter:
|
|
576
|
+
editingGlobalFilter: ce,
|
|
577
577
|
currentReportId: E,
|
|
578
578
|
editableReports: A,
|
|
579
579
|
nonEditableReports: F,
|
|
580
580
|
isOpenAddReportDialog: U,
|
|
581
581
|
overviewReport: y,
|
|
582
582
|
pinReport: B,
|
|
583
|
-
scrollPositionY:
|
|
583
|
+
scrollPositionY: b,
|
|
584
584
|
customReportQuota: S,
|
|
585
585
|
canCreateCustomReport: o,
|
|
586
586
|
createOrUpdateReport: de,
|
|
587
587
|
removeReport: pe,
|
|
588
588
|
updateCurrentReportId: O,
|
|
589
589
|
getReports: f,
|
|
590
|
-
getReportTemplates:
|
|
590
|
+
getReportTemplates: P,
|
|
591
591
|
updateDefaultReport: me,
|
|
592
|
-
createReportTemplate:
|
|
592
|
+
createReportTemplate: he,
|
|
593
593
|
updateReportTemplate: ve,
|
|
594
|
-
removeReportTemplates:
|
|
595
|
-
getOverviewReport:
|
|
594
|
+
removeReportTemplates: ge,
|
|
595
|
+
getOverviewReport: h,
|
|
596
596
|
refreshPinReport: k,
|
|
597
597
|
cachePinReport: Te,
|
|
598
598
|
clearPinReport: Re,
|
|
@@ -611,29 +611,29 @@ export {
|
|
|
611
611
|
Ce as S,
|
|
612
612
|
Fe as W,
|
|
613
613
|
it as a,
|
|
614
|
-
|
|
614
|
+
Ie as b,
|
|
615
615
|
Ne as c,
|
|
616
616
|
ee as d,
|
|
617
617
|
tt as e,
|
|
618
618
|
At as f,
|
|
619
619
|
$t as g,
|
|
620
|
-
|
|
620
|
+
It as h,
|
|
621
621
|
Y as i,
|
|
622
|
-
|
|
622
|
+
bt as j,
|
|
623
623
|
yt as k,
|
|
624
624
|
Et as l,
|
|
625
625
|
wt as m,
|
|
626
626
|
rt as n,
|
|
627
|
-
|
|
627
|
+
at as o,
|
|
628
628
|
te as p,
|
|
629
629
|
H as q,
|
|
630
630
|
St as r,
|
|
631
631
|
Rt as s,
|
|
632
|
-
|
|
632
|
+
Pt as t,
|
|
633
633
|
_t as u,
|
|
634
634
|
D as v,
|
|
635
635
|
Ge as w,
|
|
636
636
|
Dt as x,
|
|
637
|
-
|
|
637
|
+
gt as y,
|
|
638
638
|
Tt as z
|
|
639
639
|
};
|