@lavalogic/scoria 0.38.1 → 0.38.2
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/Components/Table/Misc/TableConfigurationModal.svelte +16 -5
- package/dist/Components/Table/Misc/TableViewDropdown.svelte +0 -0
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +12 -4
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +21 -6
- package/package.json +1 -1
|
@@ -111,7 +111,14 @@
|
|
|
111
111
|
}, `Could not delete "${view.name}". Please try again.`);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Save the live state of the active section as a brand-new view.
|
|
116
|
+
* `saveCurrentAsNewView` re-fetches the saved views and makes the new
|
|
117
|
+
* one active; the `My …` list and the panel dropdowns are all driven
|
|
118
|
+
* off the reactive `_viewState.savedViews(section)` so they update
|
|
119
|
+
* without a reopen. On success we also switch to the `My …` tab so
|
|
120
|
+
* the user immediately sees the view they just saved.
|
|
121
|
+
*/
|
|
115
122
|
function saveNewView(): void {
|
|
116
123
|
const trimmed = newViewName.trim();
|
|
117
124
|
if (!trimmed) {
|
|
@@ -120,6 +127,7 @@
|
|
|
120
127
|
void guard(async () => {
|
|
121
128
|
await tableContext.saveCurrentAsNewView(trimmed, section);
|
|
122
129
|
newViewName = '';
|
|
130
|
+
selectTab('mine');
|
|
123
131
|
}, `Could not save the new ${sectionNoun.toLowerCase()}. Please try again.`);
|
|
124
132
|
}
|
|
125
133
|
|
|
@@ -451,7 +459,7 @@
|
|
|
451
459
|
/>
|
|
452
460
|
<Button
|
|
453
461
|
type="submit"
|
|
454
|
-
variant={Variant.
|
|
462
|
+
variant={Variant.Secondary}
|
|
455
463
|
size={Size.MediumSmall}
|
|
456
464
|
nowrap
|
|
457
465
|
disabled={!newViewName.trim()}
|
|
@@ -537,14 +545,17 @@
|
|
|
537
545
|
color: #aa1414;
|
|
538
546
|
}
|
|
539
547
|
|
|
540
|
-
/* The body of a single top tab.
|
|
541
|
-
frame
|
|
548
|
+
/* The body of a single top tab. A `min-height` floor keeps the modal
|
|
549
|
+
frame visually stable across every section/tab combination (short
|
|
550
|
+
tabs no longer shrink the dialog); the `max-height` + `overflow-y`
|
|
551
|
+
keep taller content scrolling within that fixed frame rather than
|
|
552
|
+
growing the dialog. */
|
|
542
553
|
.tab-body {
|
|
543
554
|
display: flex;
|
|
544
555
|
flex-flow: column nowrap;
|
|
545
556
|
gap: 0.75rem;
|
|
546
557
|
padding: 1rem;
|
|
547
|
-
min-height:
|
|
558
|
+
min-height: 30vh;
|
|
548
559
|
max-height: 60vh;
|
|
549
560
|
overflow-y: auto;
|
|
550
561
|
}
|
|
Binary file
|
|
@@ -892,10 +892,18 @@ export declare class TableContext<T extends object, RowIdType extends Primitive>
|
|
|
892
892
|
* `{ kind:'filter', filter: _captureFilter() }`, plus the
|
|
893
893
|
* host-supplied `datatableUuid` and the owning user;
|
|
894
894
|
* 2. `await remoteLayouts.createView(...)`;
|
|
895
|
-
* 3.
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
895
|
+
* 3. `await refreshSavedViews()` so the matching kind's saved-views
|
|
896
|
+
* list is re-fetched from the backend - the new view then appears
|
|
897
|
+
* in the Table Configuration modal's My-Layouts / My-Filters list
|
|
898
|
+
* (and the panel quick-switch dropdowns) immediately, without a
|
|
899
|
+
* reopen, because both read reactively off `_viewState`;
|
|
900
|
+
* 4. set the newly-saved view as that kind's active view via
|
|
901
|
+
* `applyDatatableView`, which re-points that kind's baseline and
|
|
902
|
+
* clears that kind's dirty flag - so the quick-switch dropdown
|
|
903
|
+
* shows the new view's name straight away rather than
|
|
904
|
+
* `'Custom (unsaved)'`. The authoritative refreshed copy (matched
|
|
905
|
+
* by id) is preferred over the raw `createView` return so the
|
|
906
|
+
* baseline reflects exactly what the backend persisted.
|
|
899
907
|
*
|
|
900
908
|
* Only the named kind's state is touched. No-op (dev-logged via
|
|
901
909
|
* `devCatch`) when remote saved views are disabled (`datatableUuid` /
|
|
@@ -2309,10 +2309,18 @@ export class TableContext {
|
|
|
2309
2309
|
* `{ kind:'filter', filter: _captureFilter() }`, plus the
|
|
2310
2310
|
* host-supplied `datatableUuid` and the owning user;
|
|
2311
2311
|
* 2. `await remoteLayouts.createView(...)`;
|
|
2312
|
-
* 3.
|
|
2313
|
-
*
|
|
2314
|
-
*
|
|
2315
|
-
*
|
|
2312
|
+
* 3. `await refreshSavedViews()` so the matching kind's saved-views
|
|
2313
|
+
* list is re-fetched from the backend - the new view then appears
|
|
2314
|
+
* in the Table Configuration modal's My-Layouts / My-Filters list
|
|
2315
|
+
* (and the panel quick-switch dropdowns) immediately, without a
|
|
2316
|
+
* reopen, because both read reactively off `_viewState`;
|
|
2317
|
+
* 4. set the newly-saved view as that kind's active view via
|
|
2318
|
+
* `applyDatatableView`, which re-points that kind's baseline and
|
|
2319
|
+
* clears that kind's dirty flag - so the quick-switch dropdown
|
|
2320
|
+
* shows the new view's name straight away rather than
|
|
2321
|
+
* `'Custom (unsaved)'`. The authoritative refreshed copy (matched
|
|
2322
|
+
* by id) is preferred over the raw `createView` return so the
|
|
2323
|
+
* baseline reflects exactly what the backend persisted.
|
|
2316
2324
|
*
|
|
2317
2325
|
* Only the named kind's state is touched. No-op (dev-logged via
|
|
2318
2326
|
* `devCatch`) when remote saved views are disabled (`datatableUuid` /
|
|
@@ -2342,8 +2350,15 @@ export class TableContext {
|
|
|
2342
2350
|
ownerUserId,
|
|
2343
2351
|
};
|
|
2344
2352
|
const created = await adapter.createView(request);
|
|
2345
|
-
|
|
2346
|
-
|
|
2353
|
+
// Re-fetch the authoritative saved-views lists so the new view
|
|
2354
|
+
// shows up in the modal and the panel dropdowns immediately.
|
|
2355
|
+
await this.refreshSavedViews();
|
|
2356
|
+
// Prefer the refreshed copy (matched by id); fall back to the
|
|
2357
|
+
// raw create return if the refresh did not surface it.
|
|
2358
|
+
const authoritative = this._viewState.savedViews(kind).find((view) => view.id === created.id) ?? created;
|
|
2359
|
+
// Make the just-saved view active so the quick-switch dropdown
|
|
2360
|
+
// shows its name (not "Custom (unsaved)") and dirty is cleared.
|
|
2361
|
+
this.applyDatatableView(authoritative);
|
|
2347
2362
|
}
|
|
2348
2363
|
catch (e) {
|
|
2349
2364
|
devCatch(e);
|