@yuneta/gobj-ui 7.25.9 → 7.25.10
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 +44 -12
- package/dist/gobj-ui.cjs.js +165 -60
- package/dist/gobj-ui.es.js +165 -60
- package/package.json +1 -1
- package/src/c_yui_schema_editor.js +210 -39
- package/src/schema_editor_reload.wiring.test.js +233 -3
- package/src/shell_modals.js +9 -1
- package/src/shell_toast_once.test.js +36 -1
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
* the owner's design of M36 (2026-09-21 review) every write here
|
|
27
27
|
* raised both versions, so an edit half made was already the
|
|
28
28
|
* schema of the next start. The topic list marks what this session
|
|
29
|
-
* wrote and has not saved (the
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* wrote and has not saved (EV_REFRESH forgets it: the view's own
|
|
30
|
+
* Refresh button sends it, and a host may after a save -- the
|
|
31
|
+
* agent console's does not) and what the host says is not saved
|
|
32
|
+
* (EV_DRAFTS, replaced whole each time it is sent).
|
|
32
33
|
*
|
|
33
34
|
* WHAT ELSE IS HERE, and why each is here and not somewhere else:
|
|
34
35
|
*
|
|
@@ -124,6 +125,7 @@ import {yui_tint} from "./bulma_tint.js";
|
|
|
124
125
|
import {host_draft_ids} from "./host_drafts.js";
|
|
125
126
|
|
|
126
127
|
import "./c_yui_schema_editor.css";
|
|
128
|
+
import "./yui_toolbar.css"; /* `selected_state`, the export's chosen view */
|
|
127
129
|
|
|
128
130
|
import {
|
|
129
131
|
build_schema_model,
|
|
@@ -478,6 +480,60 @@ function built_on_a_replaced_model(gobj, event, kw)
|
|
|
478
480
|
return true;
|
|
479
481
|
}
|
|
480
482
|
|
|
483
|
+
/***************************************************************
|
|
484
|
+
* The reload a load refused IN session left owed (a routing
|
|
485
|
+
* adapter's deadline on a slow `nodes`, ac_mt_command_answer()):
|
|
486
|
+
* the model shown is kept, and it may be older than the store.
|
|
487
|
+
* The session is up, so no reconnect will ask for it again -- it
|
|
488
|
+
* was owed for as long as the session lasted, and a form opened
|
|
489
|
+
* on that model wrote every field of it over the newer record
|
|
490
|
+
* (fifth independent review; A3 of the fourth, by another path).
|
|
491
|
+
*
|
|
492
|
+
* So the operator's NEXT action asks it. An edit -- a form, a
|
|
493
|
+
* write, a confirmation, what reads the model whole (check,
|
|
494
|
+
* export) -- is refused and said: it would be computed on what
|
|
495
|
+
* the store may no longer hold, and the load that lands closes a
|
|
496
|
+
* dialog built on the old model anyway (end_load()). A move is
|
|
497
|
+
* not refused (reload_after_move()): it goes, and reads there.
|
|
498
|
+
*
|
|
499
|
+
* Not on a timer, and not at once: a load refused on a deadline
|
|
500
|
+
* asked again at once is refused the same way, and one asked on a
|
|
501
|
+
* clock is polling. Out of session nothing is asked; the reconnect
|
|
502
|
+
* does it (ac_transport_state()). The reload keeps this session's
|
|
503
|
+
* draft chips: the host did not ask for it.
|
|
504
|
+
***************************************************************/
|
|
505
|
+
function owes_reload(gobj)
|
|
506
|
+
{
|
|
507
|
+
let state = gobj_current_state(gobj);
|
|
508
|
+
|
|
509
|
+
return gobj.priv.reload_on_open && transport_in_session(gobj) &&
|
|
510
|
+
state !== "ST_LOADING" && state !== "ST_SAVING";
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function reload_first(gobj, event)
|
|
514
|
+
{
|
|
515
|
+
if(!owes_reload(gobj)) {
|
|
516
|
+
return false;
|
|
517
|
+
}
|
|
518
|
+
gobj.priv.reload_on_open = false;
|
|
519
|
+
log_warning(`${gobj_short_name(gobj)}: ${event} refused, the schemas shown ` +
|
|
520
|
+
`may be out of date: they are read again first`);
|
|
521
|
+
yui_shell_show_error(yui_shell_of(gobj),
|
|
522
|
+
"the schemas shown may be out of date: they are read again, try again when they are in",
|
|
523
|
+
{t: t});
|
|
524
|
+
request_model(gobj, true);
|
|
525
|
+
return true;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function reload_after_move(gobj)
|
|
529
|
+
{
|
|
530
|
+
if(!owes_reload(gobj)) {
|
|
531
|
+
return 0;
|
|
532
|
+
}
|
|
533
|
+
gobj.priv.reload_on_open = false;
|
|
534
|
+
return request_model(gobj, true);
|
|
535
|
+
}
|
|
536
|
+
|
|
481
537
|
|
|
482
538
|
|
|
483
539
|
|
|
@@ -503,11 +559,14 @@ function built_on_a_replaced_model(gobj, event, kw)
|
|
|
503
559
|
* and a load that LANDS closes it (end_load()): it was built on the
|
|
504
560
|
* model the load replaced, and its Save sends every field it shows.
|
|
505
561
|
* An import plan is forgotten here for the same reason: it is a list
|
|
506
|
-
* of writes computed against the model going away
|
|
562
|
+
* of writes computed against the model going away -- once the load
|
|
563
|
+
* has LEFT (one that could not be sent replaces nothing).
|
|
507
564
|
*
|
|
508
|
-
* `keep_written`: a load
|
|
509
|
-
*
|
|
510
|
-
*
|
|
565
|
+
* `keep_written`: a load nobody ASKED for -- the reconnect, a write
|
|
566
|
+
* that turned out done, the reload a refused load owed -- keeps what
|
|
567
|
+
* this session wrote. Only EV_REFRESH forgets it: the view's own
|
|
568
|
+
* Refresh button, or a host that sends it (after a Save, say; the
|
|
569
|
+
* agent console does not).
|
|
511
570
|
*
|
|
512
571
|
* A load that cannot leave WHOLE did not happen (out of session it
|
|
513
572
|
* is not even asked): the records the model was built on are put
|
|
@@ -526,9 +585,12 @@ function request_model(gobj, keep_written)
|
|
|
526
585
|
return -1; /* not mounted on a transport yet: mt_start retries via EV_TRANSPORT_STATE */
|
|
527
586
|
}
|
|
528
587
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
588
|
+
/* A load asked while one is in flight (the host's EV_REFRESH is
|
|
589
|
+
* heard in ST_LOADING) keeps the records the model SHOWN was built
|
|
590
|
+
* on: `priv.records` is the half the first load got by then, and
|
|
591
|
+
* put back after a failure it was a model with no treedb. */
|
|
592
|
+
let previous = (gobj_current_state(gobj) === "ST_LOADING")?
|
|
593
|
+
priv.records_before : priv.records;
|
|
532
594
|
priv.records_before = previous;
|
|
533
595
|
priv.records = {treedbs: [], topics: [], cols: []};
|
|
534
596
|
priv.load_error = "";
|
|
@@ -564,6 +626,9 @@ function request_model(gobj, keep_written)
|
|
|
564
626
|
end_load(gobj);
|
|
565
627
|
return -1;
|
|
566
628
|
}
|
|
629
|
+
/* Only a load that LEFT replaces the model the plan was computed
|
|
630
|
+
* on; one that could not be sent keeps it, and the plan with it. */
|
|
631
|
+
forget_import_plan(gobj);
|
|
567
632
|
priv.pending = left;
|
|
568
633
|
return 0;
|
|
569
634
|
}
|
|
@@ -649,8 +714,8 @@ function build_model(gobj)
|
|
|
649
714
|
* Called ONLY when records arrive from the store: that is what a
|
|
650
715
|
* measurement of "changed since" can be measured against.
|
|
651
716
|
*
|
|
652
|
-
* `written` is forgotten only by
|
|
653
|
-
*
|
|
717
|
+
* `written` is forgotten only by an EV_REFRESH (the view's own
|
|
718
|
+
* Refresh button, or a host that sends one). Since M36 a write moves no
|
|
654
719
|
* version, so `written` is the draft chip of what this session
|
|
655
720
|
* wrote and no longer half of a version measurement: a reload of
|
|
656
721
|
* the reconnect, or of a write that turned out done, forgot the
|
|
@@ -687,10 +752,12 @@ function start_measuring(gobj)
|
|
|
687
752
|
* until the host saves it (C_TREEDB's save-schema, which raises the
|
|
688
753
|
* versions of what changed). Two sources say a topic is one, and
|
|
689
754
|
* they are kept APART because they are forgotten differently:
|
|
690
|
-
* - `written`: what THIS session wrote. Only
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
755
|
+
* - `written`: what THIS session wrote. Only EV_REFRESH forgets
|
|
756
|
+
* it -- the view's own Refresh button sends it (in the agent
|
|
757
|
+
* console that is the only sender), and a host may after a
|
|
758
|
+
* Save; the reconnect's reload, the one owed after a write, a
|
|
759
|
+
* refused load's and a late write's keep it (start_measuring(),
|
|
760
|
+
* request_model());
|
|
694
761
|
* - `host_ids`: what the host said last (EV_DRAFTS), replaced WHOLE
|
|
695
762
|
* by the next EV_DRAFTS. Folded into `written`, a topic the host
|
|
696
763
|
* named once stayed a draft after the Save that published it.
|
|
@@ -2168,13 +2235,21 @@ function open_export(gobj, treedb)
|
|
|
2168
2235
|
|
|
2169
2236
|
let $content = createElement2(
|
|
2170
2237
|
["div", {class: "SCHEMA_EXPORT box"}, [
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2238
|
+
/* Two BUTTONS, not Bulma tabs: a tab's <a> with no href is
|
|
2239
|
+
* reached by no keyboard and named by nothing but its "C".
|
|
2240
|
+
* The one shown is the selected segment (`selected_state`,
|
|
2241
|
+
* yui_toolbar.css) and says so with aria-pressed. */
|
|
2242
|
+
["div", {class: "SCHEMA_EXPORT_TABS buttons has-addons mb-2"}, [
|
|
2243
|
+
["button", {class: "SCHEMA_EXPORT_TAB button selected_state", type: "button",
|
|
2244
|
+
"data-pane": "c", "aria-pressed": "true",
|
|
2245
|
+
title: t("schema as c source"), "data-i18n-title": "schema as c source",
|
|
2246
|
+
"aria-label": t("schema as c source"), "data-i18n-aria-label": "schema as c source"},
|
|
2247
|
+
[["span", {}, "C"]]],
|
|
2248
|
+
["button", {class: "SCHEMA_EXPORT_TAB button", type: "button",
|
|
2249
|
+
"data-pane": "json", "aria-pressed": "false",
|
|
2250
|
+
title: t("schema as json"), "data-i18n-title": "schema as json",
|
|
2251
|
+
"aria-label": t("schema as json"), "data-i18n-aria-label": "schema as json"},
|
|
2252
|
+
[["span", {}, "JSON"]]]
|
|
2178
2253
|
]],
|
|
2179
2254
|
["p", {class: "SCHEMA_EXPORT_HELP help mb-2",
|
|
2180
2255
|
i18n: "an edit made here works and lives in no source: this is what to paste back"},
|
|
@@ -2205,7 +2280,8 @@ function open_export(gobj, treedb)
|
|
|
2205
2280
|
$tab.addEventListener("click", (evt) => {
|
|
2206
2281
|
evt.stopPropagation();
|
|
2207
2282
|
for(let $other of $content.querySelectorAll(".SCHEMA_EXPORT_TAB")) {
|
|
2208
|
-
$other.classList.toggle("
|
|
2283
|
+
$other.classList.toggle("selected_state", $other === $tab);
|
|
2284
|
+
$other.setAttribute("aria-pressed", ($other === $tab)? "true": "false");
|
|
2209
2285
|
}
|
|
2210
2286
|
$text.value = ($tab.dataset.pane === "c") ? c_text : json_text;
|
|
2211
2287
|
});
|
|
@@ -3004,7 +3080,8 @@ function ac_mt_command_answer(gobj, event, kw, src)
|
|
|
3004
3080
|
* form with it -- a form's Save then answered "Event NOT
|
|
3005
3081
|
* DEFINED in state ST_IDLE" (fourth independent review). It
|
|
3006
3082
|
* stays, as it does when the load cannot leave, and the
|
|
3007
|
-
* reload is owed
|
|
3083
|
+
* reload is owed: the operator's next action asks it
|
|
3084
|
+
* (reload_first(), fifth independent review). */
|
|
3008
3085
|
if(priv.model) {
|
|
3009
3086
|
log_warning(`${gobj_short_name(gobj)}: the schemas could not be read ` +
|
|
3010
3087
|
`again (${priv.load_error}): the previous ones stay`);
|
|
@@ -3012,7 +3089,8 @@ function ac_mt_command_answer(gobj, event, kw, src)
|
|
|
3012
3089
|
priv.records_before = null;
|
|
3013
3090
|
priv.reload_on_open = true;
|
|
3014
3091
|
yui_shell_show_error(yui_shell_of(gobj),
|
|
3015
|
-
"cannot read the schemas again: the
|
|
3092
|
+
"cannot read the schemas again: the ones shown may be out of date, your next change reads them first",
|
|
3093
|
+
{t: t});
|
|
3016
3094
|
return end_load(gobj);
|
|
3017
3095
|
}
|
|
3018
3096
|
priv.model = null;
|
|
@@ -3307,6 +3385,28 @@ function ac_wait_for_the_load(gobj, event, kw, src)
|
|
|
3307
3385
|
return -1;
|
|
3308
3386
|
}
|
|
3309
3387
|
|
|
3388
|
+
/***************************************************************
|
|
3389
|
+
* A confirmation answered where no treedb is open: ST_EMPTY (a
|
|
3390
|
+
* reload landed on zero treedbs while it was up) or ST_IDLE (no
|
|
3391
|
+
* model). A confirmation is a shell modal, not this view's dialog,
|
|
3392
|
+
* so the load that lands does not close it, and its Yes arrives
|
|
3393
|
+
* anyway. Undeclared, it answered "Event NOT DEFINED" (fifth
|
|
3394
|
+
* independent review).
|
|
3395
|
+
*
|
|
3396
|
+
* Refused with the stamp's own words: whatever it was decided on
|
|
3397
|
+
* is not on screen any more.
|
|
3398
|
+
***************************************************************/
|
|
3399
|
+
function ac_confirmed_on_nothing(gobj, event, kw, src)
|
|
3400
|
+
{
|
|
3401
|
+
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3402
|
+
return -1;
|
|
3403
|
+
}
|
|
3404
|
+
log_warning(`${gobj_short_name(gobj)}: ${event} refused, no treedb is open`);
|
|
3405
|
+
yui_shell_show_error(yui_shell_of(gobj),
|
|
3406
|
+
"the schemas were read again: open the dialog again", {t: t});
|
|
3407
|
+
return -1;
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3310
3410
|
/***************************************************************
|
|
3311
3411
|
* {drafts: {treedb_name: [topic names]}} -- the host says which
|
|
3312
3412
|
* topics hold a draft in __system__ that is not saved (C_TREEDB's
|
|
@@ -3338,32 +3438,34 @@ function ac_drafts(gobj, event, kw, src)
|
|
|
3338
3438
|
***************************************************************/
|
|
3339
3439
|
function ac_select_treedb(gobj, event, kw, src)
|
|
3340
3440
|
{
|
|
3341
|
-
|
|
3441
|
+
go(gobj, kw.treedb, "", false, true);
|
|
3442
|
+
return reload_after_move(gobj);
|
|
3342
3443
|
}
|
|
3343
3444
|
|
|
3344
3445
|
function ac_select_topic(gobj, event, kw, src)
|
|
3345
3446
|
{
|
|
3346
|
-
|
|
3447
|
+
go(gobj, gobj.priv.treedb_id, kw.topic, false, true);
|
|
3448
|
+
return reload_after_move(gobj);
|
|
3347
3449
|
}
|
|
3348
3450
|
|
|
3349
3451
|
function ac_back(gobj, event, kw, src)
|
|
3350
3452
|
{
|
|
3351
3453
|
let priv = gobj.priv;
|
|
3352
3454
|
|
|
3353
|
-
if(priv.diagram) {
|
|
3354
|
-
|
|
3355
|
-
}
|
|
3356
|
-
|
|
3357
|
-
return go(gobj, priv.treedb_id, "", false, true);
|
|
3455
|
+
if(priv.diagram || priv.topic_name) {
|
|
3456
|
+
go(gobj, priv.treedb_id, "", false, true);
|
|
3457
|
+
} else {
|
|
3458
|
+
go(gobj, "", "", false, true);
|
|
3358
3459
|
}
|
|
3359
|
-
return
|
|
3460
|
+
return reload_after_move(gobj);
|
|
3360
3461
|
}
|
|
3361
3462
|
|
|
3362
3463
|
function ac_toggle_diagram(gobj, event, kw, src)
|
|
3363
3464
|
{
|
|
3364
3465
|
let priv = gobj.priv;
|
|
3365
3466
|
|
|
3366
|
-
|
|
3467
|
+
go(gobj, priv.treedb_id, priv.topic_name, !priv.diagram, true);
|
|
3468
|
+
return reload_after_move(gobj);
|
|
3367
3469
|
}
|
|
3368
3470
|
|
|
3369
3471
|
/***************************************************************
|
|
@@ -3378,11 +3480,15 @@ function ac_node_click(gobj, event, kw, src)
|
|
|
3378
3480
|
if(!topic) {
|
|
3379
3481
|
return 0;
|
|
3380
3482
|
}
|
|
3381
|
-
|
|
3483
|
+
go(gobj, gobj.priv.treedb_id, topic, false, true);
|
|
3484
|
+
return reload_after_move(gobj);
|
|
3382
3485
|
}
|
|
3383
3486
|
|
|
3384
3487
|
function ac_show_orphans(gobj, event, kw, src)
|
|
3385
3488
|
{
|
|
3489
|
+
if(reload_first(gobj, event)) {
|
|
3490
|
+
return -1;
|
|
3491
|
+
}
|
|
3386
3492
|
open_orphans(gobj);
|
|
3387
3493
|
return 0;
|
|
3388
3494
|
}
|
|
@@ -3419,6 +3525,9 @@ function ac_add_column(gobj, event, kw, src)
|
|
|
3419
3525
|
if(refuse_if_readonly(gobj, event)) {
|
|
3420
3526
|
return -1;
|
|
3421
3527
|
}
|
|
3528
|
+
if(reload_first(gobj, event)) {
|
|
3529
|
+
return -1;
|
|
3530
|
+
}
|
|
3422
3531
|
if(!topic) {
|
|
3423
3532
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
3424
3533
|
return -1;
|
|
@@ -3436,6 +3545,9 @@ function ac_edit_column(gobj, event, kw, src)
|
|
|
3436
3545
|
if(refuse_if_readonly(gobj, event)) {
|
|
3437
3546
|
return -1;
|
|
3438
3547
|
}
|
|
3548
|
+
if(reload_first(gobj, event)) {
|
|
3549
|
+
return -1;
|
|
3550
|
+
}
|
|
3439
3551
|
if(!col) {
|
|
3440
3552
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
3441
3553
|
return -1;
|
|
@@ -3458,6 +3570,9 @@ function ac_duplicate_column(gobj, event, kw, src)
|
|
|
3458
3570
|
if(refuse_if_readonly(gobj, event)) {
|
|
3459
3571
|
return -1;
|
|
3460
3572
|
}
|
|
3573
|
+
if(reload_first(gobj, event)) {
|
|
3574
|
+
return -1;
|
|
3575
|
+
}
|
|
3461
3576
|
if(!col) {
|
|
3462
3577
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
3463
3578
|
return -1;
|
|
@@ -3483,6 +3598,9 @@ function ac_save_column(gobj, event, kw, src)
|
|
|
3483
3598
|
if(refuse_if_readonly(gobj, event)) {
|
|
3484
3599
|
return -1;
|
|
3485
3600
|
}
|
|
3601
|
+
if(reload_first(gobj, event)) {
|
|
3602
|
+
return -1;
|
|
3603
|
+
}
|
|
3486
3604
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3487
3605
|
return -1;
|
|
3488
3606
|
}
|
|
@@ -3518,6 +3636,9 @@ function ac_delete_column(gobj, event, kw, src)
|
|
|
3518
3636
|
if(refuse_if_readonly(gobj, event)) {
|
|
3519
3637
|
return -1;
|
|
3520
3638
|
}
|
|
3639
|
+
if(reload_first(gobj, event)) {
|
|
3640
|
+
return -1;
|
|
3641
|
+
}
|
|
3521
3642
|
if(!col) {
|
|
3522
3643
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
3523
3644
|
return -1;
|
|
@@ -3540,6 +3661,9 @@ function ac_move_column(gobj, event, kw, src)
|
|
|
3540
3661
|
if(refuse_if_readonly(gobj, event)) {
|
|
3541
3662
|
return -1;
|
|
3542
3663
|
}
|
|
3664
|
+
if(reload_first(gobj, event)) {
|
|
3665
|
+
return -1;
|
|
3666
|
+
}
|
|
3543
3667
|
if(!topic) {
|
|
3544
3668
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
3545
3669
|
return -1;
|
|
@@ -3579,6 +3703,9 @@ function ac_undo_order(gobj, event, kw, src)
|
|
|
3579
3703
|
if(refuse_if_readonly(gobj, event)) {
|
|
3580
3704
|
return -1;
|
|
3581
3705
|
}
|
|
3706
|
+
if(reload_first(gobj, event)) {
|
|
3707
|
+
return -1;
|
|
3708
|
+
}
|
|
3582
3709
|
if(!topic) {
|
|
3583
3710
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
3584
3711
|
return -1;
|
|
@@ -3606,6 +3733,9 @@ function ac_add_topic(gobj, event, kw, src)
|
|
|
3606
3733
|
if(refuse_if_readonly(gobj, event)) {
|
|
3607
3734
|
return -1;
|
|
3608
3735
|
}
|
|
3736
|
+
if(reload_first(gobj, event)) {
|
|
3737
|
+
return -1;
|
|
3738
|
+
}
|
|
3609
3739
|
if(!treedb) {
|
|
3610
3740
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3611
3741
|
return -1;
|
|
@@ -3623,6 +3753,9 @@ function ac_edit_topic(gobj, event, kw, src)
|
|
|
3623
3753
|
if(refuse_if_readonly(gobj, event)) {
|
|
3624
3754
|
return -1;
|
|
3625
3755
|
}
|
|
3756
|
+
if(reload_first(gobj, event)) {
|
|
3757
|
+
return -1;
|
|
3758
|
+
}
|
|
3626
3759
|
if(!topic) {
|
|
3627
3760
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
3628
3761
|
return -1;
|
|
@@ -3640,6 +3773,9 @@ function ac_save_topic(gobj, event, kw, src)
|
|
|
3640
3773
|
if(refuse_if_readonly(gobj, event)) {
|
|
3641
3774
|
return -1;
|
|
3642
3775
|
}
|
|
3776
|
+
if(reload_first(gobj, event)) {
|
|
3777
|
+
return -1;
|
|
3778
|
+
}
|
|
3643
3779
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3644
3780
|
return -1;
|
|
3645
3781
|
}
|
|
@@ -3679,6 +3815,9 @@ function ac_delete_topic(gobj, event, kw, src)
|
|
|
3679
3815
|
if(refuse_if_readonly(gobj, event)) {
|
|
3680
3816
|
return -1;
|
|
3681
3817
|
}
|
|
3818
|
+
if(reload_first(gobj, event)) {
|
|
3819
|
+
return -1;
|
|
3820
|
+
}
|
|
3682
3821
|
if(!topic) {
|
|
3683
3822
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
3684
3823
|
return -1;
|
|
@@ -3697,6 +3836,9 @@ function ac_delete_orphan(gobj, event, kw, src)
|
|
|
3697
3836
|
if(refuse_if_readonly(gobj, event)) {
|
|
3698
3837
|
return -1;
|
|
3699
3838
|
}
|
|
3839
|
+
if(reload_first(gobj, event)) {
|
|
3840
|
+
return -1;
|
|
3841
|
+
}
|
|
3700
3842
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3701
3843
|
return -1;
|
|
3702
3844
|
}
|
|
@@ -3720,6 +3862,10 @@ function ac_validate(gobj, event, kw, src)
|
|
|
3720
3862
|
let priv = gobj.priv;
|
|
3721
3863
|
let treedb = current_treedb(gobj);
|
|
3722
3864
|
|
|
3865
|
+
if(reload_first(gobj, event)) {
|
|
3866
|
+
return -1;
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3723
3869
|
if(!treedb) {
|
|
3724
3870
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3725
3871
|
return -1;
|
|
@@ -3739,6 +3885,10 @@ function ac_export(gobj, event, kw, src)
|
|
|
3739
3885
|
{
|
|
3740
3886
|
let treedb = current_treedb(gobj);
|
|
3741
3887
|
|
|
3888
|
+
if(reload_first(gobj, event)) {
|
|
3889
|
+
return -1;
|
|
3890
|
+
}
|
|
3891
|
+
|
|
3742
3892
|
if(!treedb) {
|
|
3743
3893
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3744
3894
|
return -1;
|
|
@@ -3754,6 +3904,9 @@ function ac_import(gobj, event, kw, src)
|
|
|
3754
3904
|
if(refuse_if_readonly(gobj, event)) {
|
|
3755
3905
|
return -1;
|
|
3756
3906
|
}
|
|
3907
|
+
if(reload_first(gobj, event)) {
|
|
3908
|
+
return -1;
|
|
3909
|
+
}
|
|
3757
3910
|
if(!treedb) {
|
|
3758
3911
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3759
3912
|
return -1;
|
|
@@ -3772,6 +3925,10 @@ function ac_preview_import(gobj, event, kw, src)
|
|
|
3772
3925
|
let treedb = current_treedb(gobj);
|
|
3773
3926
|
let incoming = null;
|
|
3774
3927
|
|
|
3928
|
+
if(reload_first(gobj, event)) {
|
|
3929
|
+
return -1;
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3775
3932
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3776
3933
|
return -1;
|
|
3777
3934
|
}
|
|
@@ -3802,6 +3959,9 @@ function ac_apply_import(gobj, event, kw, src)
|
|
|
3802
3959
|
if(refuse_if_readonly(gobj, event)) {
|
|
3803
3960
|
return -1;
|
|
3804
3961
|
}
|
|
3962
|
+
if(reload_first(gobj, event)) {
|
|
3963
|
+
return -1;
|
|
3964
|
+
}
|
|
3805
3965
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3806
3966
|
return -1;
|
|
3807
3967
|
}
|
|
@@ -3828,8 +3988,12 @@ function run_import(gobj)
|
|
|
3828
3988
|
let priv = gobj.priv;
|
|
3829
3989
|
let plan = priv.import_plan;
|
|
3830
3990
|
|
|
3991
|
+
/* Not an ERROR: a load that left forgets the plan (request_model()),
|
|
3992
|
+
* and the confirmation of it may still be up. The operator's Yes
|
|
3993
|
+
* is answered, not lost in the log. */
|
|
3831
3994
|
if(!plan) {
|
|
3832
|
-
|
|
3995
|
+
log_warning(`${gobj_short_name(gobj)}: the import plan is gone`);
|
|
3996
|
+
yui_shell_show_error(yui_shell_of(gobj), "the import plan is gone: preview it again", {t: t});
|
|
3833
3997
|
return -1;
|
|
3834
3998
|
}
|
|
3835
3999
|
close_dialog(gobj);
|
|
@@ -3855,6 +4019,9 @@ function ac_confirmed(gobj, event, kw, src)
|
|
|
3855
4019
|
if(refuse_if_readonly(gobj, event)) {
|
|
3856
4020
|
return -1;
|
|
3857
4021
|
}
|
|
4022
|
+
if(reload_first(gobj, event)) {
|
|
4023
|
+
return -1;
|
|
4024
|
+
}
|
|
3858
4025
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3859
4026
|
return -1;
|
|
3860
4027
|
}
|
|
@@ -3953,7 +4120,9 @@ function create_gclass(gclass_name)
|
|
|
3953
4120
|
* a click is worth routing through a machine.
|
|
3954
4121
|
*---------------------------------------------*/
|
|
3955
4122
|
const states = [
|
|
3956
|
-
["ST_IDLE", COMMON.
|
|
4123
|
+
["ST_IDLE", COMMON.concat([
|
|
4124
|
+
["EV_CONFIRMED", ac_confirmed_on_nothing, null]
|
|
4125
|
+
])],
|
|
3957
4126
|
|
|
3958
4127
|
["ST_LOADING", COMMON.concat([
|
|
3959
4128
|
["EV_SAVE_COLUMN", ac_wait_for_the_load, null],
|
|
@@ -3964,7 +4133,9 @@ function create_gclass(gclass_name)
|
|
|
3964
4133
|
["EV_CONFIRMED", ac_wait_for_the_load, null]
|
|
3965
4134
|
])],
|
|
3966
4135
|
|
|
3967
|
-
["ST_EMPTY", COMMON.
|
|
4136
|
+
["ST_EMPTY", COMMON.concat([
|
|
4137
|
+
["EV_CONFIRMED", ac_confirmed_on_nothing, null]
|
|
4138
|
+
])],
|
|
3968
4139
|
|
|
3969
4140
|
["ST_TREEDBS", COMMON.concat([
|
|
3970
4141
|
["EV_SELECT_TREEDB", ac_select_treedb, null],
|