@datarecce/ui 0.1.31 → 0.1.32
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/{state-lPCQsWy5.js → RecceCheckContext-BOGmP80K.js} +4367 -5089
- package/dist/RecceCheckContext-BOGmP80K.js.map +1 -0
- package/dist/{state-B9yzhuKs.mjs → RecceCheckContext-CwUCo6AW.mjs} +4273 -4541
- package/dist/RecceCheckContext-CwUCo6AW.mjs.map +1 -0
- package/dist/{state-DOUPNifc.css → RecceCheckContext-DPnWB_aU.css} +57 -57
- package/dist/RecceCheckContext-DPnWB_aU.css.map +1 -0
- package/dist/{state-IA7HWYOs.css → RecceCheckContext-DyxOeUsX.css} +57 -57
- package/dist/RecceCheckContext-DyxOeUsX.css.map +1 -0
- package/dist/api.d.mts +1 -1
- package/dist/api.js +65 -26
- package/dist/api.js.map +1 -0
- package/dist/api.mjs +44 -5
- package/dist/api.mjs.map +1 -0
- package/dist/{components-DCOI1YlQ.mjs → components-DQUwJlNQ.mjs} +20 -21
- package/dist/{components-DCOI1YlQ.mjs.map → components-DQUwJlNQ.mjs.map} +1 -1
- package/dist/{components-B-YxuuPz.js → components-uVp0e4cH.js} +231 -241
- package/dist/{components-B-YxuuPz.js.map → components-uVp0e4cH.js.map} +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.js +38 -38
- package/dist/components.mjs +5 -5
- package/dist/{urls-B1Ymdoz-.mjs → const-CaIm1Z8g.mjs} +2 -6
- package/dist/const-CaIm1Z8g.mjs.map +1 -0
- package/dist/{urls-C4eAc82S.js → const-CvdZO0FN.js} +1 -11
- package/dist/const-CvdZO0FN.js.map +1 -0
- package/dist/global-styles.css +84 -0
- package/dist/global-styles.css.map +1 -0
- package/dist/global-styles.js +1 -0
- package/dist/global-styles.mjs +1 -0
- package/dist/{hooks-DjBNmTdh.mjs → hooks-C6Kma5ld.mjs} +2 -3
- package/dist/{hooks-DjBNmTdh.mjs.map → hooks-C6Kma5ld.mjs.map} +1 -1
- package/dist/hooks-CfZ4UBBF.js +40 -0
- package/dist/{hooks-B9hsc1oD.js.map → hooks-CfZ4UBBF.js.map} +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.js +26 -26
- package/dist/hooks.mjs +4 -4
- package/dist/{html2canvas-pro.esm-WJxOmKlq.js → html2canvas-pro.esm-CsuSOHXp.js} +1 -1
- package/dist/{html2canvas-pro.esm-WJxOmKlq.js.map → html2canvas-pro.esm-CsuSOHXp.js.map} +1 -1
- package/dist/{html2canvas-pro.esm-BInzOtWO.mjs → html2canvas-pro.esm-E7kpobrC.mjs} +1 -1
- package/dist/{html2canvas-pro.esm-BInzOtWO.mjs.map → html2canvas-pro.esm-E7kpobrC.mjs.map} +1 -1
- package/dist/{index-IIXVIoOL.d.mts → index-DsCU2oGL.d.mts} +7 -7
- package/dist/{index-IIXVIoOL.d.mts.map → index-DsCU2oGL.d.mts.map} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.js +85 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{mui-theme-B2wm_cvZ.js → mui-theme-iBHkjXJq.js} +2 -2
- package/dist/{mui-theme-B2wm_cvZ.js.map → mui-theme-iBHkjXJq.js.map} +1 -1
- package/dist/state-CTITyT0R.js +795 -0
- package/dist/state-CTITyT0R.js.map +1 -0
- package/dist/state-Sc2b4jri.mjs +382 -0
- package/dist/state-Sc2b4jri.mjs.map +1 -0
- package/dist/styles.css +4 -3
- package/dist/theme.d.mts +1 -1
- package/dist/theme.js +1 -1
- package/dist/{tooltipMessage-DosF13kZ.js → tooltipMessage-BC5W7H3X.js} +1 -1
- package/dist/{tooltipMessage-DosF13kZ.js.map → tooltipMessage-BC5W7H3X.js.map} +1 -1
- package/dist/{tooltipMessage-B--I3p1V.mjs → tooltipMessage-B_xMIKWL.mjs} +1 -1
- package/dist/{tooltipMessage-B--I3p1V.mjs.map → tooltipMessage-B_xMIKWL.mjs.map} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.js +5 -4
- package/dist/types.mjs +3 -2
- package/dist/urls-BQW5wjg-.js +13 -0
- package/dist/urls-BQW5wjg-.js.map +1 -0
- package/dist/urls-DT7FVEcS.mjs +7 -0
- package/dist/urls-DT7FVEcS.mjs.map +1 -0
- package/dist/version-B9s8yne-.js +300 -0
- package/dist/version-B9s8yne-.js.map +1 -0
- package/dist/version-DP1kU_7v.mjs +162 -0
- package/dist/version-DP1kU_7v.mjs.map +1 -0
- package/package.json +2 -2
- package/src/global-styles.css +81 -0
- package/src/theme/index.ts +1 -1
- package/dist/RecceCheckContext-DPpu9nG5.js +0 -303
- package/dist/RecceCheckContext-DPpu9nG5.js.map +0 -1
- package/dist/RecceCheckContext-bXdfQLGG.mjs +0 -229
- package/dist/RecceCheckContext-bXdfQLGG.mjs.map +0 -1
- package/dist/hooks-B9hsc1oD.js +0 -40
- package/dist/state-B9yzhuKs.mjs.map +0 -1
- package/dist/state-DOUPNifc.css.map +0 -1
- package/dist/state-IA7HWYOs.css.map +0 -1
- package/dist/state-lPCQsWy5.js.map +0 -1
- package/dist/urls-B1Ymdoz-.mjs.map +0 -1
- package/dist/urls-C4eAc82S.js.map +0 -1
- package/dist/version-Dh8sZhvs.js +0 -147
- package/dist/version-Dh8sZhvs.js.map +0 -1
- package/dist/version-OnOKzBeQ.mjs +0 -93
- package/dist/version-OnOKzBeQ.mjs.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
|
|
2
|
+
@theme {
|
|
3
|
+
--color-brand: rgb(253, 104, 62);
|
|
4
|
+
--font-sans:
|
|
5
|
+
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
|
6
|
+
"Segoe UI Symbol", "Noto Color Emoji";
|
|
7
|
+
--font-mono:
|
|
8
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
9
|
+
"Courier New", monospace;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Theme-aware CSS custom properties
|
|
14
|
+
* These variables change based on the theme class set by next-themes
|
|
15
|
+
*/
|
|
16
|
+
:root,
|
|
17
|
+
.light {
|
|
18
|
+
/* Neutral colors - light mode */
|
|
19
|
+
--recce-neutral-50: #fafafa;
|
|
20
|
+
--recce-neutral-100: #f5f5f5;
|
|
21
|
+
--recce-neutral-200: #e5e5e5;
|
|
22
|
+
--recce-neutral-300: #d4d4d4;
|
|
23
|
+
--recce-neutral-700: #404040;
|
|
24
|
+
--recce-neutral-800: #262626;
|
|
25
|
+
|
|
26
|
+
/* Semantic colors - light mode */
|
|
27
|
+
--recce-bg-default: #ffffff;
|
|
28
|
+
--recce-bg-paper: #ffffff;
|
|
29
|
+
--recce-bg-subtle: #fafafa;
|
|
30
|
+
--recce-bg-muted: #f1f5f9;
|
|
31
|
+
--recce-border-default: #d4d4d4;
|
|
32
|
+
--recce-border-light: #e5e5e5;
|
|
33
|
+
--recce-text-primary: #171717;
|
|
34
|
+
--recce-text-secondary: #525252;
|
|
35
|
+
|
|
36
|
+
/* Gutter/split pane colors */
|
|
37
|
+
--recce-gutter-bg: #eeeeee;
|
|
38
|
+
--recce-gutter-hover: #ff6e42;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dark {
|
|
42
|
+
/* Neutral colors - dark mode */
|
|
43
|
+
--recce-neutral-50: #fafafa;
|
|
44
|
+
--recce-neutral-100: #f5f5f5;
|
|
45
|
+
--recce-neutral-200: #e5e5e5;
|
|
46
|
+
--recce-neutral-300: #d4d4d4;
|
|
47
|
+
--recce-neutral-700: #404040;
|
|
48
|
+
--recce-neutral-800: #262626;
|
|
49
|
+
|
|
50
|
+
/* Semantic colors - dark mode */
|
|
51
|
+
--recce-bg-default: #171717;
|
|
52
|
+
--recce-bg-paper: #262626;
|
|
53
|
+
--recce-bg-subtle: #262626;
|
|
54
|
+
--recce-bg-muted: #1e293b;
|
|
55
|
+
--recce-border-default: #525252;
|
|
56
|
+
--recce-border-light: #404040;
|
|
57
|
+
--recce-text-primary: #fafafa;
|
|
58
|
+
--recce-text-secondary: #a3a3a3;
|
|
59
|
+
|
|
60
|
+
/* Gutter/split pane colors */
|
|
61
|
+
--recce-gutter-bg: #404040;
|
|
62
|
+
--recce-gutter-hover: #ff6e42;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/*
|
|
66
|
+
The default border color has changed to `currentcolor` in Tailwind CSS v4,
|
|
67
|
+
so we've added these compatibility styles to make sure everything still
|
|
68
|
+
looks the same as it did with Tailwind CSS v3.
|
|
69
|
+
|
|
70
|
+
If we ever want to remove these styles, we need to add an explicit border
|
|
71
|
+
color utility to any element that depends on these defaults.
|
|
72
|
+
*/
|
|
73
|
+
@layer base {
|
|
74
|
+
*,
|
|
75
|
+
::after,
|
|
76
|
+
::before,
|
|
77
|
+
::backdrop,
|
|
78
|
+
::file-selector-button {
|
|
79
|
+
border-color: var(--color-gray-200, currentcolor);
|
|
80
|
+
}
|
|
81
|
+
}
|
package/src/theme/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
// Export the light and dark themes from the mui-theme file
|
|
10
|
-
export { lightTheme, darkTheme, muiTheme } from "
|
|
10
|
+
export { lightTheme, darkTheme, muiTheme } from "@/components/ui/mui-theme";
|
|
11
11
|
|
|
12
12
|
// Export theme-related types and utilities
|
|
13
13
|
export type { Theme } from "@mui/material/styles";
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
const require_state = require('./state-lPCQsWy5.js');
|
|
3
|
-
let react = require("react");
|
|
4
|
-
react = require_state.__toESM(react);
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let _mui_material_Stack = require("@mui/material/Stack");
|
|
7
|
-
_mui_material_Stack = require_state.__toESM(_mui_material_Stack);
|
|
8
|
-
let _mui_material_Box = require("@mui/material/Box");
|
|
9
|
-
_mui_material_Box = require_state.__toESM(_mui_material_Box);
|
|
10
|
-
let _mui_material_Button = require("@mui/material/Button");
|
|
11
|
-
_mui_material_Button = require_state.__toESM(_mui_material_Button);
|
|
12
|
-
let _mui_material_Dialog = require("@mui/material/Dialog");
|
|
13
|
-
_mui_material_Dialog = require_state.__toESM(_mui_material_Dialog);
|
|
14
|
-
let _mui_material_DialogActions = require("@mui/material/DialogActions");
|
|
15
|
-
_mui_material_DialogActions = require_state.__toESM(_mui_material_DialogActions);
|
|
16
|
-
let _mui_material_DialogContent = require("@mui/material/DialogContent");
|
|
17
|
-
_mui_material_DialogContent = require_state.__toESM(_mui_material_DialogContent);
|
|
18
|
-
let _mui_material_DialogTitle = require("@mui/material/DialogTitle");
|
|
19
|
-
_mui_material_DialogTitle = require_state.__toESM(_mui_material_DialogTitle);
|
|
20
|
-
let _mui_material_IconButton = require("@mui/material/IconButton");
|
|
21
|
-
_mui_material_IconButton = require_state.__toESM(_mui_material_IconButton);
|
|
22
|
-
let react_icons_io5 = require("react-icons/io5");
|
|
23
|
-
|
|
24
|
-
//#region recce-source/js/src/lib/hooks/RecceQueryContext.tsx
|
|
25
|
-
const defaultSqlQuery = "select * from {{ ref(\"mymodel\") }}";
|
|
26
|
-
const RecceQueryContext = (0, react.createContext)({
|
|
27
|
-
sqlQuery: defaultSqlQuery,
|
|
28
|
-
setSqlQuery: () => {},
|
|
29
|
-
primaryKeys: void 0,
|
|
30
|
-
setPrimaryKeys: () => {},
|
|
31
|
-
isCustomQueries: false,
|
|
32
|
-
setCustomQueries: () => {},
|
|
33
|
-
baseSqlQuery: defaultSqlQuery,
|
|
34
|
-
setBaseSqlQuery: () => {}
|
|
35
|
-
});
|
|
36
|
-
function RecceQueryContextProvider({ children }) {
|
|
37
|
-
const [sqlQuery, setSqlQuery] = react.default.useState(defaultSqlQuery);
|
|
38
|
-
const [baseSqlQuery, setBaseSqlQuery] = react.default.useState(defaultSqlQuery);
|
|
39
|
-
const [isCustomQueries, setCustomQueries] = react.default.useState(false);
|
|
40
|
-
const [primaryKeys, setPrimaryKeys] = react.default.useState();
|
|
41
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecceQueryContext.Provider, {
|
|
42
|
-
value: {
|
|
43
|
-
setSqlQuery,
|
|
44
|
-
sqlQuery,
|
|
45
|
-
setPrimaryKeys,
|
|
46
|
-
primaryKeys,
|
|
47
|
-
isCustomQueries,
|
|
48
|
-
setCustomQueries,
|
|
49
|
-
baseSqlQuery,
|
|
50
|
-
setBaseSqlQuery
|
|
51
|
-
},
|
|
52
|
-
children
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
const useRecceQueryContext = () => (0, react.useContext)(RecceQueryContext);
|
|
56
|
-
const RowCountStateContext = (0, react.createContext)({
|
|
57
|
-
isNodesFetching: [],
|
|
58
|
-
setIsNodesFetching: () => {}
|
|
59
|
-
});
|
|
60
|
-
function RowCountStateContextProvider({ children }) {
|
|
61
|
-
const [isNodesFetching, setIsNodesFetching] = react.default.useState([]);
|
|
62
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowCountStateContext.Provider, {
|
|
63
|
-
value: {
|
|
64
|
-
isNodesFetching,
|
|
65
|
-
setIsNodesFetching
|
|
66
|
-
},
|
|
67
|
-
children
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const useRowCountStateContext = () => (0, react.useContext)(RowCountStateContext);
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region recce-source/js/src/lib/hooks/RecceShareStateContext.tsx
|
|
74
|
-
const ShareState = (0, react.createContext)(void 0);
|
|
75
|
-
function RecceShareStateContextProvider({ children }) {
|
|
76
|
-
const [shareUrl, setShareUrl] = (0, react.useState)();
|
|
77
|
-
const [isLoading, setIsLoading] = (0, react.useState)(false);
|
|
78
|
-
const [error, setError] = (0, react.useState)();
|
|
79
|
-
const { apiClient } = require_state.useApiConfig();
|
|
80
|
-
const handleShareClick = async () => {
|
|
81
|
-
setIsLoading(true);
|
|
82
|
-
setError(void 0);
|
|
83
|
-
setShareUrl(void 0);
|
|
84
|
-
try {
|
|
85
|
-
const response = await require_state.shareState(apiClient);
|
|
86
|
-
if (response.status !== "success") {
|
|
87
|
-
setError(response.message);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
setShareUrl(response.share_url);
|
|
91
|
-
} catch (err) {
|
|
92
|
-
setError(err.message);
|
|
93
|
-
} finally {
|
|
94
|
-
setIsLoading(false);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareState.Provider, {
|
|
98
|
-
value: {
|
|
99
|
-
shareUrl,
|
|
100
|
-
isLoading,
|
|
101
|
-
error,
|
|
102
|
-
handleShareClick
|
|
103
|
-
},
|
|
104
|
-
children
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
const useRecceShareStateContext = () => {
|
|
108
|
-
const context = (0, react.useContext)(ShareState);
|
|
109
|
-
if (!context) throw new Error("useRecceShareStateContext must be used within a RecceShareStateContextProvider");
|
|
110
|
-
return context;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region recce-source/js/src/components/lineage/useValueDiffAlertDialog.tsx
|
|
115
|
-
function useValueDiffAlertDialog() {
|
|
116
|
-
const [open, setOpen] = (0, react.useState)(false);
|
|
117
|
-
const [nodeCount, setNodeCount] = (0, react.useState)(0);
|
|
118
|
-
const [resolvePromise, setResolvePromise] = (0, react.useState)();
|
|
119
|
-
const cancelRef = (0, react.useRef)(null);
|
|
120
|
-
const confirm = (0, react.useCallback)((nodeCount$1) => {
|
|
121
|
-
setNodeCount(nodeCount$1);
|
|
122
|
-
return new Promise((resolve) => {
|
|
123
|
-
setResolvePromise(() => resolve);
|
|
124
|
-
setOpen(true);
|
|
125
|
-
});
|
|
126
|
-
}, []);
|
|
127
|
-
const handleConfirm = () => {
|
|
128
|
-
require_state.trackExploreActionForm({
|
|
129
|
-
action: require_state.EXPLORE_ACTION.VALUE_DIFF,
|
|
130
|
-
event: require_state.EXPLORE_FORM_EVENT.EXECUTE
|
|
131
|
-
});
|
|
132
|
-
resolvePromise?.(true);
|
|
133
|
-
setOpen(false);
|
|
134
|
-
};
|
|
135
|
-
const handleCancel = () => {
|
|
136
|
-
require_state.trackExploreActionForm({
|
|
137
|
-
action: require_state.EXPLORE_ACTION.VALUE_DIFF,
|
|
138
|
-
event: require_state.EXPLORE_FORM_EVENT.CANCEL
|
|
139
|
-
});
|
|
140
|
-
resolvePromise?.(false);
|
|
141
|
-
setOpen(false);
|
|
142
|
-
};
|
|
143
|
-
return {
|
|
144
|
-
confirm,
|
|
145
|
-
AlertDialog: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Dialog.default, {
|
|
146
|
-
open,
|
|
147
|
-
onClose: handleCancel,
|
|
148
|
-
maxWidth: "md",
|
|
149
|
-
fullWidth: true,
|
|
150
|
-
"aria-labelledby": "value-diff-alert-dialog-title",
|
|
151
|
-
children: [
|
|
152
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_DialogTitle.default, {
|
|
153
|
-
id: "value-diff-alert-dialog-title",
|
|
154
|
-
sx: {
|
|
155
|
-
fontSize: "1.125rem",
|
|
156
|
-
fontWeight: "bold"
|
|
157
|
-
},
|
|
158
|
-
children: [
|
|
159
|
-
"Value Diff on ",
|
|
160
|
-
nodeCount,
|
|
161
|
-
" nodes"
|
|
162
|
-
]
|
|
163
|
-
}),
|
|
164
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_IconButton.default, {
|
|
165
|
-
"aria-label": "close",
|
|
166
|
-
onClick: handleCancel,
|
|
167
|
-
sx: {
|
|
168
|
-
position: "absolute",
|
|
169
|
-
right: 8,
|
|
170
|
-
top: 8,
|
|
171
|
-
color: "grey.500"
|
|
172
|
-
},
|
|
173
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_io5.IoClose, {})
|
|
174
|
-
}),
|
|
175
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_DialogContent.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Stack.default, {
|
|
176
|
-
spacing: "20px",
|
|
177
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Box.default, { children: [
|
|
178
|
-
"Value diff will be executed on ",
|
|
179
|
-
nodeCount,
|
|
180
|
-
" nodes in the Lineage, which can add extra costs to your bill."
|
|
181
|
-
] })
|
|
182
|
-
}) }),
|
|
183
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_DialogActions.default, {
|
|
184
|
-
sx: { gap: .5 },
|
|
185
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Button.default, {
|
|
186
|
-
ref: cancelRef,
|
|
187
|
-
onClick: handleCancel,
|
|
188
|
-
variant: "outlined",
|
|
189
|
-
color: "neutral",
|
|
190
|
-
children: "Cancel"
|
|
191
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Button.default, {
|
|
192
|
-
color: "iochmara",
|
|
193
|
-
variant: "contained",
|
|
194
|
-
onClick: handleConfirm,
|
|
195
|
-
sx: { ml: 1.5 },
|
|
196
|
-
children: "Execute"
|
|
197
|
-
})]
|
|
198
|
-
})
|
|
199
|
-
]
|
|
200
|
-
})
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
var useValueDiffAlertDialog_default = useValueDiffAlertDialog;
|
|
204
|
-
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region recce-source/js/src/lib/hooks/useCheckToast.tsx
|
|
207
|
-
function useCheckToast() {
|
|
208
|
-
function markedAsApprovedToast() {
|
|
209
|
-
require_state.toaster.create({
|
|
210
|
-
title: "Marked as approved",
|
|
211
|
-
type: "success",
|
|
212
|
-
duration: 2e3
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
return { markedAsApprovedToast };
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region recce-source/js/src/lib/hooks/RecceCheckContext.tsx
|
|
220
|
-
const RecceCheckContext = (0, react.createContext)({
|
|
221
|
-
latestSelectedCheckId: "",
|
|
222
|
-
setLatestSelectedCheckId: () => {}
|
|
223
|
-
});
|
|
224
|
-
function RecceCheckContextProvider({ children }) {
|
|
225
|
-
const [selectCheckId, setSelectCheckId] = react.default.useState("");
|
|
226
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecceCheckContext.Provider, {
|
|
227
|
-
value: {
|
|
228
|
-
setLatestSelectedCheckId: setSelectCheckId,
|
|
229
|
-
latestSelectedCheckId: selectCheckId
|
|
230
|
-
},
|
|
231
|
-
children
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
const useRecceCheckContext = () => (0, react.useContext)(RecceCheckContext);
|
|
235
|
-
|
|
236
|
-
//#endregion
|
|
237
|
-
Object.defineProperty(exports, 'RecceCheckContextProvider', {
|
|
238
|
-
enumerable: true,
|
|
239
|
-
get: function () {
|
|
240
|
-
return RecceCheckContextProvider;
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
Object.defineProperty(exports, 'RecceQueryContextProvider', {
|
|
244
|
-
enumerable: true,
|
|
245
|
-
get: function () {
|
|
246
|
-
return RecceQueryContextProvider;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
Object.defineProperty(exports, 'RecceShareStateContextProvider', {
|
|
250
|
-
enumerable: true,
|
|
251
|
-
get: function () {
|
|
252
|
-
return RecceShareStateContextProvider;
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
Object.defineProperty(exports, 'RowCountStateContextProvider', {
|
|
256
|
-
enumerable: true,
|
|
257
|
-
get: function () {
|
|
258
|
-
return RowCountStateContextProvider;
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
Object.defineProperty(exports, 'defaultSqlQuery', {
|
|
262
|
-
enumerable: true,
|
|
263
|
-
get: function () {
|
|
264
|
-
return defaultSqlQuery;
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
Object.defineProperty(exports, 'useCheckToast', {
|
|
268
|
-
enumerable: true,
|
|
269
|
-
get: function () {
|
|
270
|
-
return useCheckToast;
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
Object.defineProperty(exports, 'useRecceCheckContext', {
|
|
274
|
-
enumerable: true,
|
|
275
|
-
get: function () {
|
|
276
|
-
return useRecceCheckContext;
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
Object.defineProperty(exports, 'useRecceQueryContext', {
|
|
280
|
-
enumerable: true,
|
|
281
|
-
get: function () {
|
|
282
|
-
return useRecceQueryContext;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
Object.defineProperty(exports, 'useRecceShareStateContext', {
|
|
286
|
-
enumerable: true,
|
|
287
|
-
get: function () {
|
|
288
|
-
return useRecceShareStateContext;
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
Object.defineProperty(exports, 'useRowCountStateContext', {
|
|
292
|
-
enumerable: true,
|
|
293
|
-
get: function () {
|
|
294
|
-
return useRowCountStateContext;
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
Object.defineProperty(exports, 'useValueDiffAlertDialog_default', {
|
|
298
|
-
enumerable: true,
|
|
299
|
-
get: function () {
|
|
300
|
-
return useValueDiffAlertDialog_default;
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
//# sourceMappingURL=RecceCheckContext-DPpu9nG5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RecceCheckContext-DPpu9nG5.js","names":["React","useApiConfig","shareState","nodeCount","EXPLORE_ACTION","EXPLORE_FORM_EVENT","MuiDialog","DialogTitle","IconButton","IoClose","DialogContent","Stack","Box","DialogActions","Button","React"],"sources":["../recce-source/js/src/lib/hooks/RecceQueryContext.tsx","../recce-source/js/src/lib/hooks/RecceShareStateContext.tsx","../recce-source/js/src/components/lineage/useValueDiffAlertDialog.tsx","../recce-source/js/src/lib/hooks/useCheckToast.tsx","../recce-source/js/src/lib/hooks/RecceCheckContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\n\nexport interface QueryContext {\n sqlQuery: string;\n setSqlQuery: (sqlQuery: string) => void;\n primaryKeys: string[] | undefined;\n setPrimaryKeys: (primaryKeys: string[] | undefined) => void;\n isCustomQueries: boolean;\n setCustomQueries: (isCustomQueries: boolean) => void;\n baseSqlQuery?: string;\n setBaseSqlQuery?: (baseSqlQuery: string) => void;\n}\n\nexport const defaultSqlQuery = 'select * from {{ ref(\"mymodel\") }}';\n\nconst defaultQueryContext: QueryContext = {\n sqlQuery: defaultSqlQuery,\n setSqlQuery: () => {\n return void 0;\n },\n primaryKeys: undefined,\n setPrimaryKeys: () => {\n return void 0;\n },\n isCustomQueries: false,\n setCustomQueries: () => {\n return void 0;\n },\n baseSqlQuery: defaultSqlQuery,\n setBaseSqlQuery: () => {\n return void 0;\n },\n};\n\nconst RecceQueryContext = createContext(defaultQueryContext);\n\ninterface QueryContextProps {\n children: React.ReactNode;\n}\n\nexport function RecceQueryContextProvider({ children }: QueryContextProps) {\n const [sqlQuery, setSqlQuery] = React.useState<string>(defaultSqlQuery);\n const [baseSqlQuery, setBaseSqlQuery] =\n React.useState<string>(defaultSqlQuery);\n const [isCustomQueries, setCustomQueries] = React.useState<boolean>(false);\n const [primaryKeys, setPrimaryKeys] = React.useState<string[] | undefined>();\n return (\n <RecceQueryContext.Provider\n value={{\n setSqlQuery,\n sqlQuery,\n setPrimaryKeys,\n primaryKeys,\n isCustomQueries,\n setCustomQueries,\n baseSqlQuery,\n setBaseSqlQuery,\n }}\n >\n {children}\n </RecceQueryContext.Provider>\n );\n}\n\nexport const useRecceQueryContext = () => useContext(RecceQueryContext);\n\nexport interface RowCountStateContext {\n isNodesFetching: string[];\n setIsNodesFetching: (nodes: string[]) => void;\n}\n\nconst defaultRowCountStateContext: RowCountStateContext = {\n isNodesFetching: [],\n setIsNodesFetching: () => {\n return void 0;\n },\n};\n\nconst RowCountStateContext = createContext(defaultRowCountStateContext);\n\ninterface RowCountStateContextProps {\n children: React.ReactNode;\n}\n\nexport function RowCountStateContextProvider({\n children,\n}: RowCountStateContextProps) {\n const [isNodesFetching, setIsNodesFetching] = React.useState<string[]>([]);\n return (\n <RowCountStateContext.Provider\n value={{ isNodesFetching, setIsNodesFetching }}\n >\n {children}\n </RowCountStateContext.Provider>\n );\n}\n\nexport const useRowCountStateContext = () => useContext(RowCountStateContext);\n","import React, { createContext, useContext, useState } from \"react\";\nimport { shareState } from \"@/lib/api/state\";\nimport { useApiConfig } from \"./ApiConfigContext\";\n\ninterface ShareStateProps {\n shareUrl?: string;\n isLoading: boolean;\n error?: string;\n handleShareClick: () => Promise<void>;\n}\n\nconst ShareState = createContext<ShareStateProps | undefined>(undefined);\n\nexport function RecceShareStateContextProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n const [shareUrl, setShareUrl] = useState<string>();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string>();\n const { apiClient } = useApiConfig();\n\n const handleShareClick = async () => {\n setIsLoading(true);\n setError(undefined);\n setShareUrl(undefined);\n try {\n const response = await shareState(apiClient);\n if (response.status !== \"success\") {\n setError(response.message);\n return;\n }\n setShareUrl(response.share_url);\n } catch (err) {\n setError((err as Error).message);\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <ShareState.Provider\n value={{ shareUrl, isLoading, error, handleShareClick }}\n >\n {children}\n </ShareState.Provider>\n );\n}\n\nexport const useRecceShareStateContext = () => {\n const context = useContext(ShareState);\n if (!context) {\n throw new Error(\n \"useRecceShareStateContext must be used within a RecceShareStateContextProvider\",\n );\n }\n return context;\n};\n","import Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport MuiDialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Stack from \"@mui/material/Stack\";\nimport React, { useCallback, useRef, useState } from \"react\";\nimport { IoClose } from \"react-icons/io5\";\nimport {\n EXPLORE_ACTION,\n EXPLORE_FORM_EVENT,\n trackExploreActionForm,\n} from \"@/lib/api/track\";\n\nfunction useValueDiffAlertDialog() {\n const [open, setOpen] = useState(false);\n const [nodeCount, setNodeCount] = useState(0);\n const [resolvePromise, setResolvePromise] =\n useState<(value: boolean) => void>();\n const cancelRef = useRef<HTMLButtonElement>(null);\n\n const confirm = useCallback((nodeCount: number) => {\n setNodeCount(nodeCount);\n return new Promise<boolean>((resolve) => {\n setResolvePromise(() => resolve);\n setOpen(true);\n });\n }, []);\n\n const handleConfirm = () => {\n trackExploreActionForm({\n action: EXPLORE_ACTION.VALUE_DIFF,\n event: EXPLORE_FORM_EVENT.EXECUTE,\n });\n resolvePromise?.(true);\n setOpen(false);\n };\n\n const handleCancel = () => {\n trackExploreActionForm({\n action: EXPLORE_ACTION.VALUE_DIFF,\n event: EXPLORE_FORM_EVENT.CANCEL,\n });\n resolvePromise?.(false);\n setOpen(false);\n };\n\n const ValueDiffAlertDialog = (\n <MuiDialog\n open={open}\n onClose={handleCancel}\n maxWidth=\"md\"\n fullWidth\n aria-labelledby=\"value-diff-alert-dialog-title\"\n >\n <DialogTitle\n id=\"value-diff-alert-dialog-title\"\n sx={{ fontSize: \"1.125rem\", fontWeight: \"bold\" }}\n >\n Value Diff on {nodeCount} nodes\n </DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={handleCancel}\n sx={{\n position: \"absolute\",\n right: 8,\n top: 8,\n color: \"grey.500\",\n }}\n >\n <IoClose />\n </IconButton>\n <DialogContent>\n <Stack spacing=\"20px\">\n <Box>\n Value diff will be executed on {nodeCount} nodes in the Lineage,\n which can add extra costs to your bill.\n </Box>\n </Stack>\n </DialogContent>\n <DialogActions sx={{ gap: 0.5 }}>\n <Button\n ref={cancelRef}\n onClick={handleCancel}\n variant=\"outlined\"\n color=\"neutral\"\n >\n Cancel\n </Button>\n <Button\n color=\"iochmara\"\n variant=\"contained\"\n onClick={handleConfirm}\n sx={{ ml: 1.5 }}\n >\n Execute\n </Button>\n </DialogActions>\n </MuiDialog>\n );\n\n return { confirm, AlertDialog: ValueDiffAlertDialog };\n}\n\nexport default useValueDiffAlertDialog;\n","import { toaster } from \"@/components/ui/toaster\";\n\nexport function useCheckToast() {\n function markedAsApprovedToast() {\n toaster.create({\n title: \"Marked as approved\",\n type: \"success\",\n duration: 2000,\n });\n }\n return {\n markedAsApprovedToast,\n };\n}\n","import React, { createContext, useContext } from \"react\";\n\nexport interface CheckContext {\n latestSelectedCheckId: string;\n setLatestSelectedCheckId: (selectCheckId: string) => void;\n}\n\ninterface CheckContextProps {\n children: React.ReactNode;\n}\n\nconst RecceCheckContext = createContext<CheckContext>({\n latestSelectedCheckId: \"\",\n setLatestSelectedCheckId: () => {\n return void 0;\n },\n});\n\nexport function RecceCheckContextProvider({ children }: CheckContextProps) {\n const [selectCheckId, setSelectCheckId] = React.useState<string>(\"\");\n return (\n <RecceCheckContext.Provider\n value={{\n setLatestSelectedCheckId: setSelectCheckId,\n latestSelectedCheckId: selectCheckId,\n }}\n >\n {children}\n </RecceCheckContext.Provider>\n );\n}\n\nexport const useRecceCheckContext = () => useContext(RecceCheckContext);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAa,kBAAkB;AAqB/B,MAAM,6CAnBoC;CACxC,UAAU;CACV,mBAAmB;CAGnB,aAAa;CACb,sBAAsB;CAGtB,iBAAiB;CACjB,wBAAwB;CAGxB,cAAc;CACd,uBAAuB;CAGxB,CAE2D;AAM5D,SAAgB,0BAA0B,EAAE,YAA+B;CACzE,MAAM,CAAC,UAAU,eAAeA,cAAM,SAAiB,gBAAgB;CACvE,MAAM,CAAC,cAAc,mBACnBA,cAAM,SAAiB,gB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ACP,MAAM;GACN,UAAU;GACX,CAAC;;AAEJ,QAAO,EACL,uBACD;;;;;ACDH,MAAM,6CAAgD;CACpD,uBAAuB;CACvB,gCAAgC;CAGjC,CAAC;AAEF,SAAgB,0BAA0B,EAAE,YAA+B;CACzE,MAAM,CAAC,eAAe,oBAAoBC,cAAM,SAAiB,GAAG;AACpE,QACE,2CAAC,kBAAkB;EACjB,OAAO;GACL,0BAA0B;GAC1B,uBAAuB;GACxB;EAEA;GAC0B;;AAIjC,MAAa,mDAAwC,kBAAkB"}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
import { Wn as toaster, Xt as EXPLORE_FORM_EVENT, Yt as EXPLORE_ACTION, kt as useApiConfig, o as shareState, rn as trackExploreActionForm } from "./state-B9yzhuKs.mjs";
|
|
3
|
-
import React, { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import Stack from "@mui/material/Stack";
|
|
6
|
-
import Box from "@mui/material/Box";
|
|
7
|
-
import Button from "@mui/material/Button";
|
|
8
|
-
import MuiDialog from "@mui/material/Dialog";
|
|
9
|
-
import DialogActions from "@mui/material/DialogActions";
|
|
10
|
-
import DialogContent from "@mui/material/DialogContent";
|
|
11
|
-
import DialogTitle from "@mui/material/DialogTitle";
|
|
12
|
-
import IconButton from "@mui/material/IconButton";
|
|
13
|
-
import { IoClose } from "react-icons/io5";
|
|
14
|
-
|
|
15
|
-
//#region recce-source/js/src/lib/hooks/RecceQueryContext.tsx
|
|
16
|
-
const defaultSqlQuery = "select * from {{ ref(\"mymodel\") }}";
|
|
17
|
-
const RecceQueryContext = createContext({
|
|
18
|
-
sqlQuery: defaultSqlQuery,
|
|
19
|
-
setSqlQuery: () => {},
|
|
20
|
-
primaryKeys: void 0,
|
|
21
|
-
setPrimaryKeys: () => {},
|
|
22
|
-
isCustomQueries: false,
|
|
23
|
-
setCustomQueries: () => {},
|
|
24
|
-
baseSqlQuery: defaultSqlQuery,
|
|
25
|
-
setBaseSqlQuery: () => {}
|
|
26
|
-
});
|
|
27
|
-
function RecceQueryContextProvider({ children }) {
|
|
28
|
-
const [sqlQuery, setSqlQuery] = React.useState(defaultSqlQuery);
|
|
29
|
-
const [baseSqlQuery, setBaseSqlQuery] = React.useState(defaultSqlQuery);
|
|
30
|
-
const [isCustomQueries, setCustomQueries] = React.useState(false);
|
|
31
|
-
const [primaryKeys, setPrimaryKeys] = React.useState();
|
|
32
|
-
return /* @__PURE__ */ jsx(RecceQueryContext.Provider, {
|
|
33
|
-
value: {
|
|
34
|
-
setSqlQuery,
|
|
35
|
-
sqlQuery,
|
|
36
|
-
setPrimaryKeys,
|
|
37
|
-
primaryKeys,
|
|
38
|
-
isCustomQueries,
|
|
39
|
-
setCustomQueries,
|
|
40
|
-
baseSqlQuery,
|
|
41
|
-
setBaseSqlQuery
|
|
42
|
-
},
|
|
43
|
-
children
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const useRecceQueryContext = () => useContext(RecceQueryContext);
|
|
47
|
-
const RowCountStateContext = createContext({
|
|
48
|
-
isNodesFetching: [],
|
|
49
|
-
setIsNodesFetching: () => {}
|
|
50
|
-
});
|
|
51
|
-
function RowCountStateContextProvider({ children }) {
|
|
52
|
-
const [isNodesFetching, setIsNodesFetching] = React.useState([]);
|
|
53
|
-
return /* @__PURE__ */ jsx(RowCountStateContext.Provider, {
|
|
54
|
-
value: {
|
|
55
|
-
isNodesFetching,
|
|
56
|
-
setIsNodesFetching
|
|
57
|
-
},
|
|
58
|
-
children
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const useRowCountStateContext = () => useContext(RowCountStateContext);
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region recce-source/js/src/lib/hooks/RecceShareStateContext.tsx
|
|
65
|
-
const ShareState = createContext(void 0);
|
|
66
|
-
function RecceShareStateContextProvider({ children }) {
|
|
67
|
-
const [shareUrl, setShareUrl] = useState();
|
|
68
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
69
|
-
const [error, setError] = useState();
|
|
70
|
-
const { apiClient } = useApiConfig();
|
|
71
|
-
const handleShareClick = async () => {
|
|
72
|
-
setIsLoading(true);
|
|
73
|
-
setError(void 0);
|
|
74
|
-
setShareUrl(void 0);
|
|
75
|
-
try {
|
|
76
|
-
const response = await shareState(apiClient);
|
|
77
|
-
if (response.status !== "success") {
|
|
78
|
-
setError(response.message);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
setShareUrl(response.share_url);
|
|
82
|
-
} catch (err) {
|
|
83
|
-
setError(err.message);
|
|
84
|
-
} finally {
|
|
85
|
-
setIsLoading(false);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
return /* @__PURE__ */ jsx(ShareState.Provider, {
|
|
89
|
-
value: {
|
|
90
|
-
shareUrl,
|
|
91
|
-
isLoading,
|
|
92
|
-
error,
|
|
93
|
-
handleShareClick
|
|
94
|
-
},
|
|
95
|
-
children
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const useRecceShareStateContext = () => {
|
|
99
|
-
const context = useContext(ShareState);
|
|
100
|
-
if (!context) throw new Error("useRecceShareStateContext must be used within a RecceShareStateContextProvider");
|
|
101
|
-
return context;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region recce-source/js/src/components/lineage/useValueDiffAlertDialog.tsx
|
|
106
|
-
function useValueDiffAlertDialog() {
|
|
107
|
-
const [open, setOpen] = useState(false);
|
|
108
|
-
const [nodeCount, setNodeCount] = useState(0);
|
|
109
|
-
const [resolvePromise, setResolvePromise] = useState();
|
|
110
|
-
const cancelRef = useRef(null);
|
|
111
|
-
const confirm = useCallback((nodeCount$1) => {
|
|
112
|
-
setNodeCount(nodeCount$1);
|
|
113
|
-
return new Promise((resolve) => {
|
|
114
|
-
setResolvePromise(() => resolve);
|
|
115
|
-
setOpen(true);
|
|
116
|
-
});
|
|
117
|
-
}, []);
|
|
118
|
-
const handleConfirm = () => {
|
|
119
|
-
trackExploreActionForm({
|
|
120
|
-
action: EXPLORE_ACTION.VALUE_DIFF,
|
|
121
|
-
event: EXPLORE_FORM_EVENT.EXECUTE
|
|
122
|
-
});
|
|
123
|
-
resolvePromise?.(true);
|
|
124
|
-
setOpen(false);
|
|
125
|
-
};
|
|
126
|
-
const handleCancel = () => {
|
|
127
|
-
trackExploreActionForm({
|
|
128
|
-
action: EXPLORE_ACTION.VALUE_DIFF,
|
|
129
|
-
event: EXPLORE_FORM_EVENT.CANCEL
|
|
130
|
-
});
|
|
131
|
-
resolvePromise?.(false);
|
|
132
|
-
setOpen(false);
|
|
133
|
-
};
|
|
134
|
-
return {
|
|
135
|
-
confirm,
|
|
136
|
-
AlertDialog: /* @__PURE__ */ jsxs(MuiDialog, {
|
|
137
|
-
open,
|
|
138
|
-
onClose: handleCancel,
|
|
139
|
-
maxWidth: "md",
|
|
140
|
-
fullWidth: true,
|
|
141
|
-
"aria-labelledby": "value-diff-alert-dialog-title",
|
|
142
|
-
children: [
|
|
143
|
-
/* @__PURE__ */ jsxs(DialogTitle, {
|
|
144
|
-
id: "value-diff-alert-dialog-title",
|
|
145
|
-
sx: {
|
|
146
|
-
fontSize: "1.125rem",
|
|
147
|
-
fontWeight: "bold"
|
|
148
|
-
},
|
|
149
|
-
children: [
|
|
150
|
-
"Value Diff on ",
|
|
151
|
-
nodeCount,
|
|
152
|
-
" nodes"
|
|
153
|
-
]
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ jsx(IconButton, {
|
|
156
|
-
"aria-label": "close",
|
|
157
|
-
onClick: handleCancel,
|
|
158
|
-
sx: {
|
|
159
|
-
position: "absolute",
|
|
160
|
-
right: 8,
|
|
161
|
-
top: 8,
|
|
162
|
-
color: "grey.500"
|
|
163
|
-
},
|
|
164
|
-
children: /* @__PURE__ */ jsx(IoClose, {})
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(Stack, {
|
|
167
|
-
spacing: "20px",
|
|
168
|
-
children: /* @__PURE__ */ jsxs(Box, { children: [
|
|
169
|
-
"Value diff will be executed on ",
|
|
170
|
-
nodeCount,
|
|
171
|
-
" nodes in the Lineage, which can add extra costs to your bill."
|
|
172
|
-
] })
|
|
173
|
-
}) }),
|
|
174
|
-
/* @__PURE__ */ jsxs(DialogActions, {
|
|
175
|
-
sx: { gap: .5 },
|
|
176
|
-
children: [/* @__PURE__ */ jsx(Button, {
|
|
177
|
-
ref: cancelRef,
|
|
178
|
-
onClick: handleCancel,
|
|
179
|
-
variant: "outlined",
|
|
180
|
-
color: "neutral",
|
|
181
|
-
children: "Cancel"
|
|
182
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
183
|
-
color: "iochmara",
|
|
184
|
-
variant: "contained",
|
|
185
|
-
onClick: handleConfirm,
|
|
186
|
-
sx: { ml: 1.5 },
|
|
187
|
-
children: "Execute"
|
|
188
|
-
})]
|
|
189
|
-
})
|
|
190
|
-
]
|
|
191
|
-
})
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
var useValueDiffAlertDialog_default = useValueDiffAlertDialog;
|
|
195
|
-
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region recce-source/js/src/lib/hooks/useCheckToast.tsx
|
|
198
|
-
function useCheckToast() {
|
|
199
|
-
function markedAsApprovedToast() {
|
|
200
|
-
toaster.create({
|
|
201
|
-
title: "Marked as approved",
|
|
202
|
-
type: "success",
|
|
203
|
-
duration: 2e3
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
return { markedAsApprovedToast };
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region recce-source/js/src/lib/hooks/RecceCheckContext.tsx
|
|
211
|
-
const RecceCheckContext = createContext({
|
|
212
|
-
latestSelectedCheckId: "",
|
|
213
|
-
setLatestSelectedCheckId: () => {}
|
|
214
|
-
});
|
|
215
|
-
function RecceCheckContextProvider({ children }) {
|
|
216
|
-
const [selectCheckId, setSelectCheckId] = React.useState("");
|
|
217
|
-
return /* @__PURE__ */ jsx(RecceCheckContext.Provider, {
|
|
218
|
-
value: {
|
|
219
|
-
setLatestSelectedCheckId: setSelectCheckId,
|
|
220
|
-
latestSelectedCheckId: selectCheckId
|
|
221
|
-
},
|
|
222
|
-
children
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
const useRecceCheckContext = () => useContext(RecceCheckContext);
|
|
226
|
-
|
|
227
|
-
//#endregion
|
|
228
|
-
export { RecceShareStateContextProvider as a, RowCountStateContextProvider as c, useRowCountStateContext as d, useValueDiffAlertDialog_default as i, defaultSqlQuery as l, useRecceCheckContext as n, useRecceShareStateContext as o, useCheckToast as r, RecceQueryContextProvider as s, RecceCheckContextProvider as t, useRecceQueryContext as u };
|
|
229
|
-
//# sourceMappingURL=RecceCheckContext-bXdfQLGG.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RecceCheckContext-bXdfQLGG.mjs","names":["nodeCount"],"sources":["../recce-source/js/src/lib/hooks/RecceQueryContext.tsx","../recce-source/js/src/lib/hooks/RecceShareStateContext.tsx","../recce-source/js/src/components/lineage/useValueDiffAlertDialog.tsx","../recce-source/js/src/lib/hooks/useCheckToast.tsx","../recce-source/js/src/lib/hooks/RecceCheckContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\n\nexport interface QueryContext {\n sqlQuery: string;\n setSqlQuery: (sqlQuery: string) => void;\n primaryKeys: string[] | undefined;\n setPrimaryKeys: (primaryKeys: string[] | undefined) => void;\n isCustomQueries: boolean;\n setCustomQueries: (isCustomQueries: boolean) => void;\n baseSqlQuery?: string;\n setBaseSqlQuery?: (baseSqlQuery: string) => void;\n}\n\nexport const defaultSqlQuery = 'select * from {{ ref(\"mymodel\") }}';\n\nconst defaultQueryContext: QueryContext = {\n sqlQuery: defaultSqlQuery,\n setSqlQuery: () => {\n return void 0;\n },\n primaryKeys: undefined,\n setPrimaryKeys: () => {\n return void 0;\n },\n isCustomQueries: false,\n setCustomQueries: () => {\n return void 0;\n },\n baseSqlQuery: defaultSqlQuery,\n setBaseSqlQuery: () => {\n return void 0;\n },\n};\n\nconst RecceQueryContext = createContext(defaultQueryContext);\n\ninterface QueryContextProps {\n children: React.ReactNode;\n}\n\nexport function RecceQueryContextProvider({ children }: QueryContextProps) {\n const [sqlQuery, setSqlQuery] = React.useState<string>(defaultSqlQuery);\n const [baseSqlQuery, setBaseSqlQuery] =\n React.useState<string>(defaultSqlQuery);\n const [isCustomQueries, setCustomQueries] = React.useState<boolean>(false);\n const [primaryKeys, setPrimaryKeys] = React.useState<string[] | undefined>();\n return (\n <RecceQueryContext.Provider\n value={{\n setSqlQuery,\n sqlQuery,\n setPrimaryKeys,\n primaryKeys,\n isCustomQueries,\n setCustomQueries,\n baseSqlQuery,\n setBaseSqlQuery,\n }}\n >\n {children}\n </RecceQueryContext.Provider>\n );\n}\n\nexport const useRecceQueryContext = () => useContext(RecceQueryContext);\n\nexport interface RowCountStateContext {\n isNodesFetching: string[];\n setIsNodesFetching: (nodes: string[]) => void;\n}\n\nconst defaultRowCountStateContext: RowCountStateContext = {\n isNodesFetching: [],\n setIsNodesFetching: () => {\n return void 0;\n },\n};\n\nconst RowCountStateContext = createContext(defaultRowCountStateContext);\n\ninterface RowCountStateContextProps {\n children: React.ReactNode;\n}\n\nexport function RowCountStateContextProvider({\n children,\n}: RowCountStateContextProps) {\n const [isNodesFetching, setIsNodesFetching] = React.useState<string[]>([]);\n return (\n <RowCountStateContext.Provider\n value={{ isNodesFetching, setIsNodesFetching }}\n >\n {children}\n </RowCountStateContext.Provider>\n );\n}\n\nexport const useRowCountStateContext = () => useContext(RowCountStateContext);\n","import React, { createContext, useContext, useState } from \"react\";\nimport { shareState } from \"@/lib/api/state\";\nimport { useApiConfig } from \"./ApiConfigContext\";\n\ninterface ShareStateProps {\n shareUrl?: string;\n isLoading: boolean;\n error?: string;\n handleShareClick: () => Promise<void>;\n}\n\nconst ShareState = createContext<ShareStateProps | undefined>(undefined);\n\nexport function RecceShareStateContextProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n const [shareUrl, setShareUrl] = useState<string>();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string>();\n const { apiClient } = useApiConfig();\n\n const handleShareClick = async () => {\n setIsLoading(true);\n setError(undefined);\n setShareUrl(undefined);\n try {\n const response = await shareState(apiClient);\n if (response.status !== \"success\") {\n setError(response.message);\n return;\n }\n setShareUrl(response.share_url);\n } catch (err) {\n setError((err as Error).message);\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <ShareState.Provider\n value={{ shareUrl, isLoading, error, handleShareClick }}\n >\n {children}\n </ShareState.Provider>\n );\n}\n\nexport const useRecceShareStateContext = () => {\n const context = useContext(ShareState);\n if (!context) {\n throw new Error(\n \"useRecceShareStateContext must be used within a RecceShareStateContextProvider\",\n );\n }\n return context;\n};\n","import Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport MuiDialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Stack from \"@mui/material/Stack\";\nimport React, { useCallback, useRef, useState } from \"react\";\nimport { IoClose } from \"react-icons/io5\";\nimport {\n EXPLORE_ACTION,\n EXPLORE_FORM_EVENT,\n trackExploreActionForm,\n} from \"@/lib/api/track\";\n\nfunction useValueDiffAlertDialog() {\n const [open, setOpen] = useState(false);\n const [nodeCount, setNodeCount] = useState(0);\n const [resolvePromise, setResolvePromise] =\n useState<(value: boolean) => void>();\n const cancelRef = useRef<HTMLButtonElement>(null);\n\n const confirm = useCallback((nodeCount: number) => {\n setNodeCount(nodeCount);\n return new Promise<boolean>((resolve) => {\n setResolvePromise(() => resolve);\n setOpen(true);\n });\n }, []);\n\n const handleConfirm = () => {\n trackExploreActionForm({\n action: EXPLORE_ACTION.VALUE_DIFF,\n event: EXPLORE_FORM_EVENT.EXECUTE,\n });\n resolvePromise?.(true);\n setOpen(false);\n };\n\n const handleCancel = () => {\n trackExploreActionForm({\n action: EXPLORE_ACTION.VALUE_DIFF,\n event: EXPLORE_FORM_EVENT.CANCEL,\n });\n resolvePromise?.(false);\n setOpen(false);\n };\n\n const ValueDiffAlertDialog = (\n <MuiDialog\n open={open}\n onClose={handleCancel}\n maxWidth=\"md\"\n fullWidth\n aria-labelledby=\"value-diff-alert-dialog-title\"\n >\n <DialogTitle\n id=\"value-diff-alert-dialog-title\"\n sx={{ fontSize: \"1.125rem\", fontWeight: \"bold\" }}\n >\n Value Diff on {nodeCount} nodes\n </DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={handleCancel}\n sx={{\n position: \"absolute\",\n right: 8,\n top: 8,\n color: \"grey.500\",\n }}\n >\n <IoClose />\n </IconButton>\n <DialogContent>\n <Stack spacing=\"20px\">\n <Box>\n Value diff will be executed on {nodeCount} nodes in the Lineage,\n which can add extra costs to your bill.\n </Box>\n </Stack>\n </DialogContent>\n <DialogActions sx={{ gap: 0.5 }}>\n <Button\n ref={cancelRef}\n onClick={handleCancel}\n variant=\"outlined\"\n color=\"neutral\"\n >\n Cancel\n </Button>\n <Button\n color=\"iochmara\"\n variant=\"contained\"\n onClick={handleConfirm}\n sx={{ ml: 1.5 }}\n >\n Execute\n </Button>\n </DialogActions>\n </MuiDialog>\n );\n\n return { confirm, AlertDialog: ValueDiffAlertDialog };\n}\n\nexport default useValueDiffAlertDialog;\n","import { toaster } from \"@/components/ui/toaster\";\n\nexport function useCheckToast() {\n function markedAsApprovedToast() {\n toaster.create({\n title: \"Marked as approved\",\n type: \"success\",\n duration: 2000,\n });\n }\n return {\n markedAsApprovedToast,\n };\n}\n","import React, { createContext, useContext } from \"react\";\n\nexport interface CheckContext {\n latestSelectedCheckId: string;\n setLatestSelectedCheckId: (selectCheckId: string) => void;\n}\n\ninterface CheckContextProps {\n children: React.ReactNode;\n}\n\nconst RecceCheckContext = createContext<CheckContext>({\n latestSelectedCheckId: \"\",\n setLatestSelectedCheckId: () => {\n return void 0;\n },\n});\n\nexport function RecceCheckContextProvider({ children }: CheckContextProps) {\n const [selectCheckId, setSelectCheckId] = React.useState<string>(\"\");\n return (\n <RecceCheckContext.Provider\n value={{\n setLatestSelectedCheckId: setSelectCheckId,\n latestSelectedCheckId: selectCheckId,\n }}\n >\n {children}\n </RecceCheckContext.Provider>\n );\n}\n\nexport const useRecceCheckContext = () => useContext(RecceCheckContext);\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAa,kBAAkB;AAqB/B,MAAM,oBAAoB,cAnBgB;CACxC,UAAU;CACV,mBAAmB;CAGnB,aAAa;CACb,sBAAsB;CAGtB,iBAAiB;CACjB,wBAAwB;CAGxB,cAAc;CACd,uBAAuB;CAGxB,CAE2D;AAM5D,SAAgB,0BAA0B,EAAE,YAA+B;CACzE,MAAM,CAAC,UAAU,eAAe,MAAM,SAAiB,gBAAgB;CACvE,MAAM,CAAC,cAAc,mBACnB,MAAM,SAAiB,gBAAgB;CACzC,MAAM,CAAC,iBAAiB,oBAAoB,MAAM,SAAkB,MAAM;CAC1E,MAAM,CAAC,aAAa,kBAAkB,MAAM,UAAgC;AAC5E,QACE,oBAAC,kBAAkB;EACjB,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EAEA;GAC0B;;AAIjC,MAAa,6BAA6B,WAAW,kBAAkB;AAcvE,MAAM,uBAAuB,cAP6B;CACxD,iBAAiB,EAAE;CACnB,0BAA0B;CAG3B,CAEsE;AAMvE,SAAgB,6BAA6B,EAC3C,YAC4B;CAC5B,MAAM,CAAC,iBAAiB,sBAAsB,MAAM,SAAmB,EAAE,CAAC;AAC1E,QACE,oBAAC,qBAAqB;EACpB,OAAO;GAAE;GAAiB;GAAoB;EAE7C;GAC6B;;AAIpC,MAAa,gCAAgC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