@yuneta/gobj-ui 7.25.9 → 7.25.11
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 +168 -61
- package/dist/gobj-ui.es.js +168 -61
- package/package.json +1 -1
- package/src/c_yui_schema_editor.js +218 -41
- package/src/schema_editor_reload.wiring.test.js +254 -4
- 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
|
}
|
|
@@ -3398,9 +3504,15 @@ function ac_show_orphans(gobj, event, kw, src)
|
|
|
3398
3504
|
function confirm_then(gobj, message, detail, kw)
|
|
3399
3505
|
{
|
|
3400
3506
|
kw = Object.assign({model_gen: gobj.priv.model_gen}, kw);
|
|
3507
|
+
/* The answers are i18n KEYS: shell_modals names each button by its
|
|
3508
|
+
* label, and its defaults ("Delete", "Cancel") are not lower-case, so
|
|
3509
|
+
* no validated locale holds them -- they read English in every
|
|
3510
|
+
* language, text, title and aria-label alike. */
|
|
3401
3511
|
yui_shell_confirm_danger(yui_shell_of(gobj), message, {
|
|
3402
|
-
t:
|
|
3403
|
-
detail:
|
|
3512
|
+
t: t,
|
|
3513
|
+
detail: detail,
|
|
3514
|
+
confirm_label: "delete",
|
|
3515
|
+
cancel_label: "cancel"
|
|
3404
3516
|
}).then((yes) => {
|
|
3405
3517
|
if(!yes || gobj_is_destroying(gobj)) {
|
|
3406
3518
|
return;
|
|
@@ -3419,6 +3531,9 @@ function ac_add_column(gobj, event, kw, src)
|
|
|
3419
3531
|
if(refuse_if_readonly(gobj, event)) {
|
|
3420
3532
|
return -1;
|
|
3421
3533
|
}
|
|
3534
|
+
if(reload_first(gobj, event)) {
|
|
3535
|
+
return -1;
|
|
3536
|
+
}
|
|
3422
3537
|
if(!topic) {
|
|
3423
3538
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
3424
3539
|
return -1;
|
|
@@ -3436,6 +3551,9 @@ function ac_edit_column(gobj, event, kw, src)
|
|
|
3436
3551
|
if(refuse_if_readonly(gobj, event)) {
|
|
3437
3552
|
return -1;
|
|
3438
3553
|
}
|
|
3554
|
+
if(reload_first(gobj, event)) {
|
|
3555
|
+
return -1;
|
|
3556
|
+
}
|
|
3439
3557
|
if(!col) {
|
|
3440
3558
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
3441
3559
|
return -1;
|
|
@@ -3458,6 +3576,9 @@ function ac_duplicate_column(gobj, event, kw, src)
|
|
|
3458
3576
|
if(refuse_if_readonly(gobj, event)) {
|
|
3459
3577
|
return -1;
|
|
3460
3578
|
}
|
|
3579
|
+
if(reload_first(gobj, event)) {
|
|
3580
|
+
return -1;
|
|
3581
|
+
}
|
|
3461
3582
|
if(!col) {
|
|
3462
3583
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
3463
3584
|
return -1;
|
|
@@ -3483,6 +3604,9 @@ function ac_save_column(gobj, event, kw, src)
|
|
|
3483
3604
|
if(refuse_if_readonly(gobj, event)) {
|
|
3484
3605
|
return -1;
|
|
3485
3606
|
}
|
|
3607
|
+
if(reload_first(gobj, event)) {
|
|
3608
|
+
return -1;
|
|
3609
|
+
}
|
|
3486
3610
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3487
3611
|
return -1;
|
|
3488
3612
|
}
|
|
@@ -3518,6 +3642,9 @@ function ac_delete_column(gobj, event, kw, src)
|
|
|
3518
3642
|
if(refuse_if_readonly(gobj, event)) {
|
|
3519
3643
|
return -1;
|
|
3520
3644
|
}
|
|
3645
|
+
if(reload_first(gobj, event)) {
|
|
3646
|
+
return -1;
|
|
3647
|
+
}
|
|
3521
3648
|
if(!col) {
|
|
3522
3649
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
3523
3650
|
return -1;
|
|
@@ -3540,6 +3667,9 @@ function ac_move_column(gobj, event, kw, src)
|
|
|
3540
3667
|
if(refuse_if_readonly(gobj, event)) {
|
|
3541
3668
|
return -1;
|
|
3542
3669
|
}
|
|
3670
|
+
if(reload_first(gobj, event)) {
|
|
3671
|
+
return -1;
|
|
3672
|
+
}
|
|
3543
3673
|
if(!topic) {
|
|
3544
3674
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
3545
3675
|
return -1;
|
|
@@ -3579,6 +3709,9 @@ function ac_undo_order(gobj, event, kw, src)
|
|
|
3579
3709
|
if(refuse_if_readonly(gobj, event)) {
|
|
3580
3710
|
return -1;
|
|
3581
3711
|
}
|
|
3712
|
+
if(reload_first(gobj, event)) {
|
|
3713
|
+
return -1;
|
|
3714
|
+
}
|
|
3582
3715
|
if(!topic) {
|
|
3583
3716
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
3584
3717
|
return -1;
|
|
@@ -3606,6 +3739,9 @@ function ac_add_topic(gobj, event, kw, src)
|
|
|
3606
3739
|
if(refuse_if_readonly(gobj, event)) {
|
|
3607
3740
|
return -1;
|
|
3608
3741
|
}
|
|
3742
|
+
if(reload_first(gobj, event)) {
|
|
3743
|
+
return -1;
|
|
3744
|
+
}
|
|
3609
3745
|
if(!treedb) {
|
|
3610
3746
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3611
3747
|
return -1;
|
|
@@ -3623,6 +3759,9 @@ function ac_edit_topic(gobj, event, kw, src)
|
|
|
3623
3759
|
if(refuse_if_readonly(gobj, event)) {
|
|
3624
3760
|
return -1;
|
|
3625
3761
|
}
|
|
3762
|
+
if(reload_first(gobj, event)) {
|
|
3763
|
+
return -1;
|
|
3764
|
+
}
|
|
3626
3765
|
if(!topic) {
|
|
3627
3766
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
3628
3767
|
return -1;
|
|
@@ -3640,6 +3779,9 @@ function ac_save_topic(gobj, event, kw, src)
|
|
|
3640
3779
|
if(refuse_if_readonly(gobj, event)) {
|
|
3641
3780
|
return -1;
|
|
3642
3781
|
}
|
|
3782
|
+
if(reload_first(gobj, event)) {
|
|
3783
|
+
return -1;
|
|
3784
|
+
}
|
|
3643
3785
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3644
3786
|
return -1;
|
|
3645
3787
|
}
|
|
@@ -3679,6 +3821,9 @@ function ac_delete_topic(gobj, event, kw, src)
|
|
|
3679
3821
|
if(refuse_if_readonly(gobj, event)) {
|
|
3680
3822
|
return -1;
|
|
3681
3823
|
}
|
|
3824
|
+
if(reload_first(gobj, event)) {
|
|
3825
|
+
return -1;
|
|
3826
|
+
}
|
|
3682
3827
|
if(!topic) {
|
|
3683
3828
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
3684
3829
|
return -1;
|
|
@@ -3697,6 +3842,9 @@ function ac_delete_orphan(gobj, event, kw, src)
|
|
|
3697
3842
|
if(refuse_if_readonly(gobj, event)) {
|
|
3698
3843
|
return -1;
|
|
3699
3844
|
}
|
|
3845
|
+
if(reload_first(gobj, event)) {
|
|
3846
|
+
return -1;
|
|
3847
|
+
}
|
|
3700
3848
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3701
3849
|
return -1;
|
|
3702
3850
|
}
|
|
@@ -3720,6 +3868,10 @@ function ac_validate(gobj, event, kw, src)
|
|
|
3720
3868
|
let priv = gobj.priv;
|
|
3721
3869
|
let treedb = current_treedb(gobj);
|
|
3722
3870
|
|
|
3871
|
+
if(reload_first(gobj, event)) {
|
|
3872
|
+
return -1;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3723
3875
|
if(!treedb) {
|
|
3724
3876
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3725
3877
|
return -1;
|
|
@@ -3739,6 +3891,10 @@ function ac_export(gobj, event, kw, src)
|
|
|
3739
3891
|
{
|
|
3740
3892
|
let treedb = current_treedb(gobj);
|
|
3741
3893
|
|
|
3894
|
+
if(reload_first(gobj, event)) {
|
|
3895
|
+
return -1;
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3742
3898
|
if(!treedb) {
|
|
3743
3899
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3744
3900
|
return -1;
|
|
@@ -3754,6 +3910,9 @@ function ac_import(gobj, event, kw, src)
|
|
|
3754
3910
|
if(refuse_if_readonly(gobj, event)) {
|
|
3755
3911
|
return -1;
|
|
3756
3912
|
}
|
|
3913
|
+
if(reload_first(gobj, event)) {
|
|
3914
|
+
return -1;
|
|
3915
|
+
}
|
|
3757
3916
|
if(!treedb) {
|
|
3758
3917
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
3759
3918
|
return -1;
|
|
@@ -3772,6 +3931,10 @@ function ac_preview_import(gobj, event, kw, src)
|
|
|
3772
3931
|
let treedb = current_treedb(gobj);
|
|
3773
3932
|
let incoming = null;
|
|
3774
3933
|
|
|
3934
|
+
if(reload_first(gobj, event)) {
|
|
3935
|
+
return -1;
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3775
3938
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3776
3939
|
return -1;
|
|
3777
3940
|
}
|
|
@@ -3802,6 +3965,9 @@ function ac_apply_import(gobj, event, kw, src)
|
|
|
3802
3965
|
if(refuse_if_readonly(gobj, event)) {
|
|
3803
3966
|
return -1;
|
|
3804
3967
|
}
|
|
3968
|
+
if(reload_first(gobj, event)) {
|
|
3969
|
+
return -1;
|
|
3970
|
+
}
|
|
3805
3971
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3806
3972
|
return -1;
|
|
3807
3973
|
}
|
|
@@ -3828,8 +3994,12 @@ function run_import(gobj)
|
|
|
3828
3994
|
let priv = gobj.priv;
|
|
3829
3995
|
let plan = priv.import_plan;
|
|
3830
3996
|
|
|
3997
|
+
/* Not an ERROR: a load that left forgets the plan (request_model()),
|
|
3998
|
+
* and the confirmation of it may still be up. The operator's Yes
|
|
3999
|
+
* is answered, not lost in the log. */
|
|
3831
4000
|
if(!plan) {
|
|
3832
|
-
|
|
4001
|
+
log_warning(`${gobj_short_name(gobj)}: the import plan is gone`);
|
|
4002
|
+
yui_shell_show_error(yui_shell_of(gobj), "the import plan is gone: preview it again", {t: t});
|
|
3833
4003
|
return -1;
|
|
3834
4004
|
}
|
|
3835
4005
|
close_dialog(gobj);
|
|
@@ -3855,6 +4025,9 @@ function ac_confirmed(gobj, event, kw, src)
|
|
|
3855
4025
|
if(refuse_if_readonly(gobj, event)) {
|
|
3856
4026
|
return -1;
|
|
3857
4027
|
}
|
|
4028
|
+
if(reload_first(gobj, event)) {
|
|
4029
|
+
return -1;
|
|
4030
|
+
}
|
|
3858
4031
|
if(built_on_a_replaced_model(gobj, event, kw)) {
|
|
3859
4032
|
return -1;
|
|
3860
4033
|
}
|
|
@@ -3953,7 +4126,9 @@ function create_gclass(gclass_name)
|
|
|
3953
4126
|
* a click is worth routing through a machine.
|
|
3954
4127
|
*---------------------------------------------*/
|
|
3955
4128
|
const states = [
|
|
3956
|
-
["ST_IDLE", COMMON.
|
|
4129
|
+
["ST_IDLE", COMMON.concat([
|
|
4130
|
+
["EV_CONFIRMED", ac_confirmed_on_nothing, null]
|
|
4131
|
+
])],
|
|
3957
4132
|
|
|
3958
4133
|
["ST_LOADING", COMMON.concat([
|
|
3959
4134
|
["EV_SAVE_COLUMN", ac_wait_for_the_load, null],
|
|
@@ -3964,7 +4139,9 @@ function create_gclass(gclass_name)
|
|
|
3964
4139
|
["EV_CONFIRMED", ac_wait_for_the_load, null]
|
|
3965
4140
|
])],
|
|
3966
4141
|
|
|
3967
|
-
["ST_EMPTY", COMMON.
|
|
4142
|
+
["ST_EMPTY", COMMON.concat([
|
|
4143
|
+
["EV_CONFIRMED", ac_confirmed_on_nothing, null]
|
|
4144
|
+
])],
|
|
3968
4145
|
|
|
3969
4146
|
["ST_TREEDBS", COMMON.concat([
|
|
3970
4147
|
["EV_SELECT_TREEDB", ac_select_treedb, null],
|