@malloy-publisher/sdk 0.3.1 → 0.4.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 +14 -9
- package/dist/{DocumentStorageProvider-tGvodI8f.es.js → DocumentStorageProvider-CyOJ0hqf.es.js} +7114 -6939
- package/dist/DocumentStorageProvider-DGPQEd_l.cjs.js +134 -0
- package/dist/{RenderedResult-mDE-4u8S.es.js → RenderedResult-BnPzJ9Jf.es.js} +64 -57
- package/dist/{RenderedResult-CPi6uQWq.cjs.js → RenderedResult-Dp22kZsQ.cjs.js} +2 -2
- package/dist/{ServerProvider-X2Ma0HRs.es.js → ServerProvider-BWOEKg0O.es.js} +1217 -1244
- package/dist/ServerProvider-Cc489A3f.cjs.js +1 -0
- package/dist/builder/index.cjs.js +41 -41
- package/dist/builder/index.es.js +2752 -2831
- package/dist/client/api.d.ts +100 -42
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/AppDialog.d.ts +30 -0
- package/dist/components/BackLink.d.ts +32 -0
- package/dist/components/Dashboard/DashboardBar.d.ts +21 -0
- package/dist/components/Dashboard/telemetry.d.ts +10 -5
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +12 -10
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +8 -2
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +8 -10
- package/dist/components/DashboardBuilder/newDashboard.d.ts +17 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +10 -1
- package/dist/components/ItemRow.d.ts +38 -0
- package/dist/components/Materializations/MaterializationDetailDialog.d.ts +1 -2
- package/dist/components/Materializations/MaterializationRunsList.d.ts +1 -5
- package/dist/components/Materializations/Materializations.d.ts +7 -3
- package/dist/components/Materializations/ScopeButton.d.ts +18 -0
- package/dist/components/Materializations/SectionLabel.d.ts +7 -4
- package/dist/components/Materializations/TriggerLabel.d.ts +14 -0
- package/dist/components/Materializations/index.d.ts +0 -1
- package/dist/components/Package/ContentTypeIcon.d.ts +3 -5
- package/dist/components/Package/NewDashboardDialog.d.ts +18 -0
- package/dist/components/Package/index.d.ts +0 -1
- package/dist/components/PackageSection.d.ts +23 -0
- package/dist/components/buttons.d.ts +53 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/styles.d.ts +49 -40
- package/dist/hooks/useCrudMutation.d.ts +42 -0
- package/dist/index.cjs.js +22 -26
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +17425 -20672
- package/dist/telemetry/consoleEvents.d.ts +60 -0
- package/dist/utils/sha256.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/AppDialog.tsx +115 -0
- package/src/components/BackLink.tsx +83 -0
- package/src/components/Connections/AddConnectionDialog.tsx +50 -70
- package/src/components/Connections/DeleteConnectionDialog.tsx +23 -50
- package/src/components/Connections/EditConnectionDialog.tsx +54 -73
- package/src/components/Dashboard/DashboardBar.tsx +88 -0
- package/src/components/Dashboard/telemetry.ts +10 -3
- package/src/components/DashboardBuilder/AddTileDialog.tsx +141 -143
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +110 -218
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +5 -11
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +184 -171
- package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +163 -0
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +2 -25
- package/src/components/DashboardBuilder/DashboardEditor.tsx +135 -61
- package/src/components/DashboardBuilder/DiffDialog.tsx +75 -82
- package/src/components/DashboardBuilder/DrillDialog.tsx +144 -156
- package/src/components/DashboardBuilder/FilterDialog.tsx +276 -295
- package/src/components/DashboardBuilder/FilterStrip.tsx +11 -10
- package/src/components/DashboardBuilder/newDashboard.spec.ts +40 -0
- package/src/components/DashboardBuilder/newDashboard.ts +48 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +53 -0
- package/src/components/DashboardBuilder/spliceDocument.ts +45 -8
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +56 -0
- package/src/components/DashboardBuilder/useDashboardEditor.ts +12 -4
- package/src/components/Environment/About.tsx +14 -28
- package/src/components/Environment/AddPackageDialog.tsx +85 -154
- package/src/components/Environment/Connections.tsx +125 -205
- package/src/components/Environment/DeletePackageDialog.tsx +32 -77
- package/src/components/Environment/EditPackageDialog.tsx +46 -58
- package/src/components/Environment/Environment.tsx +34 -36
- package/src/components/Environment/Packages.tsx +63 -128
- package/src/components/Home/AddEnvironmentDialog.tsx +47 -70
- package/src/components/Home/DeleteEnvironmentDialog.tsx +32 -77
- package/src/components/Home/EditEnvironmentDialog.tsx +47 -61
- package/src/components/Home/Home.tsx +101 -214
- package/src/components/ItemRow.tsx +165 -0
- package/src/components/Materializations/CreateMaterializationDialog.tsx +34 -51
- package/src/components/Materializations/DeleteMaterializationDialog.tsx +31 -53
- package/src/components/Materializations/MaterializationDetailDialog.tsx +60 -69
- package/src/components/Materializations/MaterializationRunsList.tsx +29 -42
- package/src/components/Materializations/Materializations.tsx +137 -140
- package/src/components/Materializations/ScopeButton.tsx +85 -0
- package/src/components/Materializations/SectionLabel.tsx +7 -4
- package/src/components/Materializations/SetScheduleDialog.tsx +48 -89
- package/src/components/Materializations/TriggerLabel.tsx +36 -0
- package/src/components/Materializations/cron.spec.ts +113 -0
- package/src/components/Materializations/index.ts +0 -1
- package/src/components/Materializations/utils.spec.ts +182 -0
- package/src/components/Package/ContentTypeIcon.spec.ts +22 -37
- package/src/components/Package/ContentTypeIcon.tsx +10 -12
- package/src/components/Package/NewDashboardDialog.spec.tsx +129 -0
- package/src/components/Package/NewDashboardDialog.tsx +265 -0
- package/src/components/Package/Package.tsx +179 -238
- package/src/components/Package/index.ts +0 -1
- package/src/components/PackageSection.tsx +85 -0
- package/src/components/RenderedResult/RenderedResult.lifecycle.spec.tsx +198 -0
- package/src/components/RenderedResult/RenderedResult.tsx +22 -8
- package/src/components/ResultsDialog.tsx +8 -32
- package/src/components/buttons.tsx +114 -0
- package/src/components/designSystem.spec.tsx +316 -0
- package/src/components/given/paramCodec.spec.ts +1 -1
- package/src/components/index.ts +10 -0
- package/src/components/styles.ts +49 -85
- package/src/hooks/useCrudMutation.spec.tsx +119 -0
- package/src/hooks/useCrudMutation.tsx +85 -0
- package/src/index.ts +9 -0
- package/src/telemetry/consoleEvents.spec.ts +130 -0
- package/src/telemetry/consoleEvents.ts +124 -0
- package/src/theme/defaults.ts +34 -23
- package/src/theme/resolveTheme.spec.ts +9 -4
- package/src/theme/resolveTheme.ts +12 -8
- package/src/utils/sha256.ts +13 -0
- package/test/README.md +1 -1
- package/test/serverProvider.tsx +5 -2
- package/dist/DocumentStorageProvider-BeBD0uWc.cjs.js +0 -134
- package/dist/ServerProvider-CH71GsoL.cjs.js +0 -1
- package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +0 -14
- package/dist/components/Materializations/EnvironmentMaterializations.d.ts +0 -7
- package/dist/components/Materializations/ScheduleCard.d.ts +0 -20
- package/dist/components/Materializations/TriggerChip.d.ts +0 -10
- package/dist/components/Package/Models.d.ts +0 -6
- package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +0 -179
- package/src/components/Materializations/EnvironmentMaterializations.tsx +0 -267
- package/src/components/Materializations/ScheduleCard.tsx +0 -231
- package/src/components/Materializations/TriggerChip.tsx +0 -44
- package/src/components/Package/Models.tsx +0 -71
|
@@ -3,36 +3,28 @@
|
|
|
3
3
|
|
|
4
4
|
import AddIcon from "@mui/icons-material/Add";
|
|
5
5
|
import CheckIcon from "@mui/icons-material/Check";
|
|
6
|
-
import GridViewIcon from "@mui/icons-material/GridView";
|
|
7
6
|
import TuneIcon from "@mui/icons-material/Tune";
|
|
8
7
|
import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
|
|
9
8
|
import RedoIcon from "@mui/icons-material/Redo";
|
|
10
9
|
import UndoIcon from "@mui/icons-material/Undo";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
Chip,
|
|
14
|
-
Divider,
|
|
15
|
-
IconButton,
|
|
16
|
-
ListItemIcon,
|
|
17
|
-
ListItemText,
|
|
18
|
-
Menu,
|
|
19
|
-
MenuItem,
|
|
20
|
-
Stack,
|
|
21
|
-
Tooltip,
|
|
22
|
-
Typography,
|
|
23
|
-
} from "@mui/material";
|
|
24
|
-
import { useState, type ReactNode } from "react";
|
|
10
|
+
import { Button, Chip, Divider, IconButton, Tooltip } from "@mui/material";
|
|
11
|
+
import type { ReactNode } from "react";
|
|
25
12
|
import { usePublisherTheme } from "../../theme/ThemeContext";
|
|
13
|
+
import { DashboardBar } from "../Dashboard/DashboardBar";
|
|
26
14
|
import { MOD } from "./useBuilderShortcuts";
|
|
27
15
|
|
|
28
16
|
/**
|
|
29
|
-
* The edit bar across the top of the builder
|
|
30
|
-
*
|
|
31
|
-
* the
|
|
17
|
+
* The edit bar across the top of the builder: that you are editing on the
|
|
18
|
+
* left, what you can do about it on the right, in the same {@link DashboardBar}
|
|
19
|
+
* the reader's view uses, so switching modes swaps the contents of one bar
|
|
20
|
+
* rather than replacing one bar with a different one.
|
|
32
21
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
22
|
+
* The right-hand controls are grouped by what they do, separated rather than
|
|
23
|
+
* run together: change the page (a tile, its settings), take a change back or
|
|
24
|
+
* put it down (undo, redo, save), and leave (Done, where the reader's view has
|
|
25
|
+
* Edit). Sticky, so undo and save stay in reach on a long dashboard; the
|
|
26
|
+
* reader's own header (title and description) stays in the page below it
|
|
27
|
+
* rather than being repeated here.
|
|
36
28
|
*/
|
|
37
29
|
export interface BuilderToolbarProps {
|
|
38
30
|
canUndo: boolean;
|
|
@@ -43,14 +35,12 @@ export interface BuilderToolbarProps {
|
|
|
43
35
|
saving: boolean;
|
|
44
36
|
/** Absent when the builder has nowhere to save: no Save, no unsaved marker. */
|
|
45
37
|
onSave?: () => void;
|
|
46
|
-
/** The host's
|
|
38
|
+
/** The host's way out of editing: Done, at the right edge. */
|
|
47
39
|
actions?: ReactNode;
|
|
48
40
|
/** Open the add-tile picker. Absent when the host passed no catalog to pick from. */
|
|
49
41
|
onAddTile?: () => void;
|
|
50
42
|
/** Open the page's settings, anchored to the button that asked. */
|
|
51
43
|
onSettings: (anchor: HTMLElement) => void;
|
|
52
|
-
/** Quick layout: every tile this file owns to one width. */
|
|
53
|
-
onQuickLayout: (share: 1 | 2 | 3 | 4) => void;
|
|
54
44
|
}
|
|
55
45
|
|
|
56
46
|
export function BuilderToolbar({
|
|
@@ -64,207 +54,109 @@ export function BuilderToolbar({
|
|
|
64
54
|
actions,
|
|
65
55
|
onAddTile,
|
|
66
56
|
onSettings,
|
|
67
|
-
onQuickLayout,
|
|
68
57
|
}: BuilderToolbarProps) {
|
|
69
58
|
const { theme } = usePublisherTheme();
|
|
70
|
-
const [layoutMenu, setLayoutMenu] = useState<HTMLElement | null>(null);
|
|
71
59
|
return (
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
60
|
+
<DashboardBar
|
|
61
|
+
left={
|
|
62
|
+
<Chip
|
|
63
|
+
// The app's theme makes every chip small; this one stands in a
|
|
64
|
+
// row of buttons, so it says otherwise and takes their height
|
|
65
|
+
// and type size. One size across the bar, or the state reads as
|
|
66
|
+
// a label that shrank away from the controls.
|
|
67
|
+
size="medium"
|
|
68
|
+
variant="outlined"
|
|
69
|
+
icon={<EditOutlinedIcon sx={{ fontSize: 20 }} />}
|
|
70
|
+
label="Editing"
|
|
71
|
+
sx={{
|
|
72
|
+
height: 37,
|
|
73
|
+
fontSize: "0.875rem",
|
|
74
|
+
fontWeight: 500,
|
|
75
|
+
// The app's own chip: the page's edge and its secondary
|
|
76
|
+
// text, not a filled blue badge borrowed from the drill
|
|
77
|
+
// link, which read as a notification rather than a state.
|
|
78
|
+
border: theme.border,
|
|
79
|
+
color: theme.tileTitle,
|
|
80
|
+
"& .MuiChip-icon": { color: "inherit" },
|
|
81
|
+
"& .MuiChip-label": { fontSize: "0.875rem" },
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
}
|
|
91
85
|
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
icon={<EditOutlinedIcon sx={{ fontSize: 14 }} />}
|
|
95
|
-
label="Editing"
|
|
96
|
-
sx={{
|
|
97
|
-
fontWeight: 500,
|
|
98
|
-
bgcolor: theme.drillLink,
|
|
99
|
-
color: theme.tile,
|
|
100
|
-
"& .MuiChip-icon": { color: "inherit" },
|
|
101
|
-
}}
|
|
102
|
-
/>
|
|
103
|
-
<Typography
|
|
104
|
-
variant="body2"
|
|
105
|
-
sx={{
|
|
106
|
-
color: theme.tileTitle,
|
|
107
|
-
display: { xs: "none", md: "block" },
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
Drag a tile to move it, its right edge to resize it, or into the
|
|
111
|
-
empty end of a row to move it up.
|
|
112
|
-
</Typography>
|
|
113
|
-
|
|
114
|
-
<Stack
|
|
115
|
-
direction="row"
|
|
116
|
-
sx={{
|
|
117
|
-
ml: "auto",
|
|
118
|
-
alignItems: "center",
|
|
119
|
-
gap: 0.5,
|
|
120
|
-
// The hint beside the chip is what gives way when the bar is
|
|
121
|
-
// narrow; a button's label never wraps onto a second line.
|
|
122
|
-
flexShrink: 0,
|
|
123
|
-
"& .MuiButton-root": { whiteSpace: "nowrap" },
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
{onAddTile && (
|
|
127
|
-
<Button
|
|
128
|
-
size="small"
|
|
129
|
-
startIcon={<AddIcon fontSize="small" />}
|
|
130
|
-
onClick={onAddTile}
|
|
131
|
-
>
|
|
132
|
-
Add tile
|
|
133
|
-
</Button>
|
|
134
|
-
)}
|
|
86
|
+
{/* What the page is made of. */}
|
|
87
|
+
{onAddTile && (
|
|
135
88
|
<Button
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
aria-haspopup="menu"
|
|
89
|
+
startIcon={<AddIcon />}
|
|
90
|
+
onClick={onAddTile}
|
|
91
|
+
aria-label="Add tile"
|
|
140
92
|
>
|
|
141
|
-
|
|
93
|
+
Tile
|
|
142
94
|
</Button>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
95
|
+
)}
|
|
96
|
+
<Button
|
|
97
|
+
startIcon={<TuneIcon />}
|
|
98
|
+
onClick={(event) => onSettings(event.currentTarget)}
|
|
99
|
+
>
|
|
100
|
+
Settings
|
|
101
|
+
</Button>
|
|
102
|
+
|
|
103
|
+
{/* What happens to a change: take it back, or put it down. */}
|
|
104
|
+
<Divider orientation="vertical" flexItem sx={{ mx: 0.5 }} />
|
|
105
|
+
<Tooltip title={`Undo (${MOD}Z)`}>
|
|
106
|
+
{/* A span, because a disabled button dispatches no events and a
|
|
107
|
+
tooltip on one would never show. */}
|
|
108
|
+
<span>
|
|
109
|
+
<IconButton
|
|
110
|
+
aria-label="Undo"
|
|
111
|
+
disabled={!canUndo}
|
|
112
|
+
onClick={onUndo}
|
|
113
|
+
sx={{ width: 37, height: 37 }}
|
|
156
114
|
>
|
|
157
|
-
|
|
158
|
-
</
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
>
|
|
204
|
-
<UndoIcon fontSize="small" />
|
|
205
|
-
</IconButton>
|
|
206
|
-
</span>
|
|
207
|
-
</Tooltip>
|
|
208
|
-
<Tooltip title={`Redo (${MOD}⇧Z)`}>
|
|
209
|
-
<span>
|
|
210
|
-
<IconButton
|
|
211
|
-
aria-label="Redo"
|
|
212
|
-
size="small"
|
|
213
|
-
disabled={!canRedo}
|
|
214
|
-
onClick={onRedo}
|
|
215
|
-
>
|
|
216
|
-
<RedoIcon fontSize="small" />
|
|
217
|
-
</IconButton>
|
|
218
|
-
</span>
|
|
219
|
-
</Tooltip>
|
|
220
|
-
{onSave && (
|
|
221
|
-
<>
|
|
222
|
-
<Divider orientation="vertical" flexItem sx={{ mx: 0.5 }} />
|
|
223
|
-
{/* "Unsaved changes" beside Save: the button's label alone
|
|
224
|
-
reads as a command, not as a state. */}
|
|
225
|
-
<Typography
|
|
226
|
-
variant="caption"
|
|
227
|
-
aria-live="polite"
|
|
228
|
-
sx={{
|
|
229
|
-
color: theme.tileTitle,
|
|
230
|
-
minWidth: 108,
|
|
231
|
-
textAlign: "right",
|
|
232
|
-
// Room between the state and the button that acts on
|
|
233
|
-
// it: at the row's 4px gap the two read as one label.
|
|
234
|
-
mr: 1.5,
|
|
235
|
-
opacity: dirty && !saving ? 1 : 0,
|
|
236
|
-
transition: "opacity 120ms",
|
|
237
|
-
}}
|
|
238
|
-
>
|
|
239
|
-
Unsaved changes
|
|
240
|
-
</Typography>
|
|
241
|
-
<Tooltip title={dirty ? `Save (${MOD}S)` : ""}>
|
|
242
|
-
<span>
|
|
243
|
-
<Button
|
|
244
|
-
variant={dirty ? "contained" : "outlined"}
|
|
245
|
-
size="small"
|
|
246
|
-
disabled={!dirty || saving}
|
|
247
|
-
onClick={onSave}
|
|
248
|
-
startIcon={
|
|
249
|
-
!dirty && !saving ? (
|
|
250
|
-
<CheckIcon fontSize="small" />
|
|
251
|
-
) : undefined
|
|
252
|
-
}
|
|
253
|
-
sx={{ minWidth: 124 }}
|
|
254
|
-
>
|
|
255
|
-
{/* Says what will happen, then that it is happening,
|
|
256
|
-
then what did. */}
|
|
257
|
-
{saving
|
|
258
|
-
? "Saving…"
|
|
259
|
-
: dirty
|
|
260
|
-
? "Save changes"
|
|
261
|
-
: "Saved"}
|
|
262
|
-
</Button>
|
|
263
|
-
</span>
|
|
264
|
-
</Tooltip>
|
|
265
|
-
</>
|
|
266
|
-
)}
|
|
267
|
-
</Stack>
|
|
268
|
-
</Stack>
|
|
115
|
+
<UndoIcon fontSize="small" />
|
|
116
|
+
</IconButton>
|
|
117
|
+
</span>
|
|
118
|
+
</Tooltip>
|
|
119
|
+
<Tooltip title={`Redo (${MOD}⇧Z)`}>
|
|
120
|
+
<span>
|
|
121
|
+
<IconButton
|
|
122
|
+
aria-label="Redo"
|
|
123
|
+
disabled={!canRedo}
|
|
124
|
+
onClick={onRedo}
|
|
125
|
+
sx={{ width: 37, height: 37 }}
|
|
126
|
+
>
|
|
127
|
+
<RedoIcon fontSize="small" />
|
|
128
|
+
</IconButton>
|
|
129
|
+
</span>
|
|
130
|
+
</Tooltip>
|
|
131
|
+
{onSave && (
|
|
132
|
+
<>
|
|
133
|
+
<Tooltip title={dirty ? `Save (${MOD}S)` : ""}>
|
|
134
|
+
<span>
|
|
135
|
+
<Button
|
|
136
|
+
variant={dirty ? "contained" : "outlined"}
|
|
137
|
+
disabled={!dirty || saving}
|
|
138
|
+
onClick={onSave}
|
|
139
|
+
startIcon={
|
|
140
|
+
!dirty && !saving ? <CheckIcon /> : undefined
|
|
141
|
+
}
|
|
142
|
+
sx={{ minWidth: 124 }}
|
|
143
|
+
>
|
|
144
|
+
{/* Says what will happen, then that it is happening,
|
|
145
|
+
then what did. */}
|
|
146
|
+
{saving ? "Saving…" : dirty ? "Save changes" : "Saved"}
|
|
147
|
+
</Button>
|
|
148
|
+
</span>
|
|
149
|
+
</Tooltip>
|
|
150
|
+
</>
|
|
151
|
+
)}
|
|
152
|
+
|
|
153
|
+
{/* Leaving, where the reader's view has Edit. */}
|
|
154
|
+
{actions && (
|
|
155
|
+
<>
|
|
156
|
+
<Divider orientation="vertical" flexItem sx={{ mx: 0.5 }} />
|
|
157
|
+
{actions}
|
|
158
|
+
</>
|
|
159
|
+
)}
|
|
160
|
+
</DashboardBar>
|
|
269
161
|
);
|
|
270
162
|
}
|
|
@@ -625,17 +625,6 @@ describe("DashboardBuilder: widths and the page's own settings", () => {
|
|
|
625
625
|
expect(itemStyleOf("by_brand")).toContain("grid-column: span 6");
|
|
626
626
|
});
|
|
627
627
|
|
|
628
|
-
it("lays every tile the file owns to one width, as one history entry", async () => {
|
|
629
|
-
await mount();
|
|
630
|
-
fireEvent.click(button("Layout"));
|
|
631
|
-
fireEvent.click(screen.getByRole("menuitem", { name: "A quarter" }));
|
|
632
|
-
expect(itemStyleOf("by_cat")).toContain("grid-column: span 3");
|
|
633
|
-
expect(itemStyleOf("by_brand")).toContain("grid-column: span 3");
|
|
634
|
-
fireEvent.click(button("Undo"));
|
|
635
|
-
expect(itemStyleOf("by_cat")).toContain("grid-column: span 6");
|
|
636
|
-
expect(itemStyleOf("by_brand")).toContain("grid-column: span 6");
|
|
637
|
-
});
|
|
638
|
-
|
|
639
628
|
it("edits the page's title, width and autorun, and writes them to the tag", async () => {
|
|
640
629
|
let saved = "";
|
|
641
630
|
await mount((source) => {
|
|
@@ -831,6 +820,11 @@ describe("DashboardBuilder: saving", () => {
|
|
|
831
820
|
type: "dashboard.saved",
|
|
832
821
|
tiles: 2,
|
|
833
822
|
structural: false,
|
|
823
|
+
// Where it went: a save into the package is a change every reader of
|
|
824
|
+
// that server sees, and a browser save is one person's local copy.
|
|
825
|
+
// Reported, because the builder is handed a function and the two are
|
|
826
|
+
// indistinguishable from the outside.
|
|
827
|
+
where: "package",
|
|
834
828
|
});
|
|
835
829
|
});
|
|
836
830
|
|