@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
package/dist/gobj-ui.es.js
CHANGED
|
@@ -3156,6 +3156,8 @@ function yui_shell_show_modal(shell, content, opts) {
|
|
|
3156
3156
|
{
|
|
3157
3157
|
class: "MODAL_BACK yui-dialog-back",
|
|
3158
3158
|
type: "button",
|
|
3159
|
+
title: t("back"),
|
|
3160
|
+
"data-i18n-title": "back",
|
|
3159
3161
|
"aria-label": t("back"),
|
|
3160
3162
|
"data-i18n-aria-label": "back"
|
|
3161
3163
|
},
|
|
@@ -3336,7 +3338,13 @@ function build_dialog(shell, message, buttons, opts) {
|
|
|
3336
3338
|
type: "button",
|
|
3337
3339
|
"data-modal-button-value": b.value
|
|
3338
3340
|
};
|
|
3339
|
-
if (typeof b.label === "string")
|
|
3341
|
+
if (typeof b.label === "string") {
|
|
3342
|
+
btn_attrs.i18n = b.label;
|
|
3343
|
+
btn_attrs.title = t(b.label);
|
|
3344
|
+
btn_attrs["data-i18n-title"] = b.label;
|
|
3345
|
+
btn_attrs["aria-label"] = t(b.label);
|
|
3346
|
+
btn_attrs["data-i18n-aria-label"] = b.label;
|
|
3347
|
+
}
|
|
3340
3348
|
return [
|
|
3341
3349
|
"button",
|
|
3342
3350
|
btn_attrs,
|
|
@@ -72097,9 +72105,10 @@ function write_options(op) {
|
|
|
72097
72105
|
* the owner's design of M36 (2026-09-21 review) every write here
|
|
72098
72106
|
* raised both versions, so an edit half made was already the
|
|
72099
72107
|
* schema of the next start. The topic list marks what this session
|
|
72100
|
-
* wrote and has not saved (the
|
|
72101
|
-
*
|
|
72102
|
-
*
|
|
72108
|
+
* wrote and has not saved (EV_REFRESH forgets it: the view's own
|
|
72109
|
+
* Refresh button sends it, and a host may after a save -- the
|
|
72110
|
+
* agent console's does not) and what the host says is not saved
|
|
72111
|
+
* (EV_DRAFTS, replaced whole each time it is sent).
|
|
72103
72112
|
*
|
|
72104
72113
|
* WHAT ELSE IS HERE, and why each is here and not somewhere else:
|
|
72105
72114
|
*
|
|
@@ -72377,6 +72386,45 @@ function built_on_a_replaced_model(gobj, event, kw) {
|
|
|
72377
72386
|
yui_shell_show_error(yui_shell_of(gobj), "the schemas were read again: open the dialog again", { t });
|
|
72378
72387
|
return true;
|
|
72379
72388
|
}
|
|
72389
|
+
/***************************************************************
|
|
72390
|
+
* The reload a load refused IN session left owed (a routing
|
|
72391
|
+
* adapter's deadline on a slow `nodes`, ac_mt_command_answer()):
|
|
72392
|
+
* the model shown is kept, and it may be older than the store.
|
|
72393
|
+
* The session is up, so no reconnect will ask for it again -- it
|
|
72394
|
+
* was owed for as long as the session lasted, and a form opened
|
|
72395
|
+
* on that model wrote every field of it over the newer record
|
|
72396
|
+
* (fifth independent review; A3 of the fourth, by another path).
|
|
72397
|
+
*
|
|
72398
|
+
* So the operator's NEXT action asks it. An edit -- a form, a
|
|
72399
|
+
* write, a confirmation, what reads the model whole (check,
|
|
72400
|
+
* export) -- is refused and said: it would be computed on what
|
|
72401
|
+
* the store may no longer hold, and the load that lands closes a
|
|
72402
|
+
* dialog built on the old model anyway (end_load()). A move is
|
|
72403
|
+
* not refused (reload_after_move()): it goes, and reads there.
|
|
72404
|
+
*
|
|
72405
|
+
* Not on a timer, and not at once: a load refused on a deadline
|
|
72406
|
+
* asked again at once is refused the same way, and one asked on a
|
|
72407
|
+
* clock is polling. Out of session nothing is asked; the reconnect
|
|
72408
|
+
* does it (ac_transport_state()). The reload keeps this session's
|
|
72409
|
+
* draft chips: the host did not ask for it.
|
|
72410
|
+
***************************************************************/
|
|
72411
|
+
function owes_reload(gobj) {
|
|
72412
|
+
let state = gobj_current_state(gobj);
|
|
72413
|
+
return gobj.priv.reload_on_open && transport_in_session(gobj) && state !== "ST_LOADING" && state !== "ST_SAVING";
|
|
72414
|
+
}
|
|
72415
|
+
function reload_first(gobj, event) {
|
|
72416
|
+
if (!owes_reload(gobj)) return false;
|
|
72417
|
+
gobj.priv.reload_on_open = false;
|
|
72418
|
+
log_warning(`${gobj_short_name(gobj)}: ${event} refused, the schemas shown may be out of date: they are read again first`);
|
|
72419
|
+
yui_shell_show_error(yui_shell_of(gobj), "the schemas shown may be out of date: they are read again, try again when they are in", { t });
|
|
72420
|
+
request_model(gobj, true);
|
|
72421
|
+
return true;
|
|
72422
|
+
}
|
|
72423
|
+
function reload_after_move(gobj) {
|
|
72424
|
+
if (!owes_reload(gobj)) return 0;
|
|
72425
|
+
gobj.priv.reload_on_open = false;
|
|
72426
|
+
return request_model(gobj, true);
|
|
72427
|
+
}
|
|
72380
72428
|
/***************************
|
|
72381
72429
|
* The model
|
|
72382
72430
|
***************************/
|
|
@@ -72395,11 +72443,14 @@ function built_on_a_replaced_model(gobj, event, kw) {
|
|
|
72395
72443
|
* and a load that LANDS closes it (end_load()): it was built on the
|
|
72396
72444
|
* model the load replaced, and its Save sends every field it shows.
|
|
72397
72445
|
* An import plan is forgotten here for the same reason: it is a list
|
|
72398
|
-
* of writes computed against the model going away
|
|
72446
|
+
* of writes computed against the model going away -- once the load
|
|
72447
|
+
* has LEFT (one that could not be sent replaces nothing).
|
|
72399
72448
|
*
|
|
72400
|
-
* `keep_written`: a load
|
|
72401
|
-
*
|
|
72402
|
-
*
|
|
72449
|
+
* `keep_written`: a load nobody ASKED for -- the reconnect, a write
|
|
72450
|
+
* that turned out done, the reload a refused load owed -- keeps what
|
|
72451
|
+
* this session wrote. Only EV_REFRESH forgets it: the view's own
|
|
72452
|
+
* Refresh button, or a host that sends it (after a Save, say; the
|
|
72453
|
+
* agent console does not).
|
|
72403
72454
|
*
|
|
72404
72455
|
* A load that cannot leave WHOLE did not happen (out of session it
|
|
72405
72456
|
* is not even asked): the records the model was built on are put
|
|
@@ -72412,8 +72463,7 @@ function built_on_a_replaced_model(gobj, event, kw) {
|
|
|
72412
72463
|
function request_model(gobj, keep_written) {
|
|
72413
72464
|
let priv = gobj.priv;
|
|
72414
72465
|
if (!gobj_read_pointer_attr(gobj, "gobj_remote_yuno")) return -1;
|
|
72415
|
-
|
|
72416
|
-
let previous = priv.records;
|
|
72466
|
+
let previous = gobj_current_state(gobj) === "ST_LOADING" ? priv.records_before : priv.records;
|
|
72417
72467
|
priv.records_before = previous;
|
|
72418
72468
|
priv.records = {
|
|
72419
72469
|
treedbs: [],
|
|
@@ -72448,6 +72498,7 @@ function request_model(gobj, keep_written) {
|
|
|
72448
72498
|
end_load(gobj);
|
|
72449
72499
|
return -1;
|
|
72450
72500
|
}
|
|
72501
|
+
forget_import_plan(gobj);
|
|
72451
72502
|
priv.pending = left;
|
|
72452
72503
|
return 0;
|
|
72453
72504
|
}
|
|
@@ -72513,8 +72564,8 @@ function build_model(gobj) {
|
|
|
72513
72564
|
* Called ONLY when records arrive from the store: that is what a
|
|
72514
72565
|
* measurement of "changed since" can be measured against.
|
|
72515
72566
|
*
|
|
72516
|
-
* `written` is forgotten only by
|
|
72517
|
-
*
|
|
72567
|
+
* `written` is forgotten only by an EV_REFRESH (the view's own
|
|
72568
|
+
* Refresh button, or a host that sends one). Since M36 a write moves no
|
|
72518
72569
|
* version, so `written` is the draft chip of what this session
|
|
72519
72570
|
* wrote and no longer half of a version measurement: a reload of
|
|
72520
72571
|
* the reconnect, or of a write that turned out done, forgot the
|
|
@@ -72536,10 +72587,12 @@ function start_measuring(gobj) {
|
|
|
72536
72587
|
* until the host saves it (C_TREEDB's save-schema, which raises the
|
|
72537
72588
|
* versions of what changed). Two sources say a topic is one, and
|
|
72538
72589
|
* they are kept APART because they are forgotten differently:
|
|
72539
|
-
* - `written`: what THIS session wrote. Only
|
|
72540
|
-
*
|
|
72541
|
-
*
|
|
72542
|
-
*
|
|
72590
|
+
* - `written`: what THIS session wrote. Only EV_REFRESH forgets
|
|
72591
|
+
* it -- the view's own Refresh button sends it (in the agent
|
|
72592
|
+
* console that is the only sender), and a host may after a
|
|
72593
|
+
* Save; the reconnect's reload, the one owed after a write, a
|
|
72594
|
+
* refused load's and a late write's keep it (start_measuring(),
|
|
72595
|
+
* request_model());
|
|
72543
72596
|
* - `host_ids`: what the host said last (EV_DRAFTS), replaced WHOLE
|
|
72544
72597
|
* by the next EV_DRAFTS. Folded into `written`, a topic the host
|
|
72545
72598
|
* named once stayed a draft after the Save that published it.
|
|
@@ -74248,40 +74301,40 @@ function open_export(gobj, treedb) {
|
|
|
74248
74301
|
[
|
|
74249
74302
|
[
|
|
74250
74303
|
"div",
|
|
74251
|
-
{ class: "SCHEMA_EXPORT_TABS
|
|
74304
|
+
{ class: "SCHEMA_EXPORT_TABS buttons has-addons mb-2" },
|
|
74252
74305
|
[[
|
|
74253
|
-
"
|
|
74254
|
-
{
|
|
74306
|
+
"button",
|
|
74307
|
+
{
|
|
74308
|
+
class: "SCHEMA_EXPORT_TAB button selected_state",
|
|
74309
|
+
type: "button",
|
|
74310
|
+
"data-pane": "c",
|
|
74311
|
+
"aria-pressed": "true",
|
|
74312
|
+
title: t("schema as c source"),
|
|
74313
|
+
"data-i18n-title": "schema as c source",
|
|
74314
|
+
"aria-label": t("schema as c source"),
|
|
74315
|
+
"data-i18n-aria-label": "schema as c source"
|
|
74316
|
+
},
|
|
74255
74317
|
[[
|
|
74256
|
-
"
|
|
74257
|
-
{
|
|
74258
|
-
|
|
74259
|
-
|
|
74260
|
-
|
|
74261
|
-
|
|
74262
|
-
|
|
74263
|
-
|
|
74264
|
-
|
|
74265
|
-
|
|
74266
|
-
|
|
74267
|
-
|
|
74268
|
-
|
|
74269
|
-
|
|
74270
|
-
|
|
74271
|
-
|
|
74272
|
-
|
|
74273
|
-
|
|
74274
|
-
|
|
74275
|
-
|
|
74276
|
-
[[
|
|
74277
|
-
"a",
|
|
74278
|
-
{},
|
|
74279
|
-
[[
|
|
74280
|
-
"span",
|
|
74281
|
-
{},
|
|
74282
|
-
"JSON"
|
|
74283
|
-
]]
|
|
74284
|
-
]]
|
|
74318
|
+
"span",
|
|
74319
|
+
{},
|
|
74320
|
+
"C"
|
|
74321
|
+
]]
|
|
74322
|
+
], [
|
|
74323
|
+
"button",
|
|
74324
|
+
{
|
|
74325
|
+
class: "SCHEMA_EXPORT_TAB button",
|
|
74326
|
+
type: "button",
|
|
74327
|
+
"data-pane": "json",
|
|
74328
|
+
"aria-pressed": "false",
|
|
74329
|
+
title: t("schema as json"),
|
|
74330
|
+
"data-i18n-title": "schema as json",
|
|
74331
|
+
"aria-label": t("schema as json"),
|
|
74332
|
+
"data-i18n-aria-label": "schema as json"
|
|
74333
|
+
},
|
|
74334
|
+
[[
|
|
74335
|
+
"span",
|
|
74336
|
+
{},
|
|
74337
|
+
"JSON"
|
|
74285
74338
|
]]
|
|
74286
74339
|
]]
|
|
74287
74340
|
],
|
|
@@ -74351,7 +74404,10 @@ function open_export(gobj, treedb) {
|
|
|
74351
74404
|
let $text = $content.querySelector(".SCHEMA_EXPORT_TEXT");
|
|
74352
74405
|
for (let $tab of $content.querySelectorAll(".SCHEMA_EXPORT_TAB")) $tab.addEventListener("click", (evt) => {
|
|
74353
74406
|
evt.stopPropagation();
|
|
74354
|
-
for (let $other of $content.querySelectorAll(".SCHEMA_EXPORT_TAB"))
|
|
74407
|
+
for (let $other of $content.querySelectorAll(".SCHEMA_EXPORT_TAB")) {
|
|
74408
|
+
$other.classList.toggle("selected_state", $other === $tab);
|
|
74409
|
+
$other.setAttribute("aria-pressed", $other === $tab ? "true" : "false");
|
|
74410
|
+
}
|
|
74355
74411
|
$text.value = $tab.dataset.pane === "c" ? c_text : json_text;
|
|
74356
74412
|
});
|
|
74357
74413
|
$content.querySelector(".SCHEMA_EXPORT_COPY").addEventListener("click", (evt) => {
|
|
@@ -75073,7 +75129,7 @@ function ac_mt_command_answer(gobj, event, kw, src) {
|
|
|
75073
75129
|
priv.records = priv.records_before;
|
|
75074
75130
|
priv.records_before = null;
|
|
75075
75131
|
priv.reload_on_open = true;
|
|
75076
|
-
yui_shell_show_error(yui_shell_of(gobj), "cannot read the schemas again: the
|
|
75132
|
+
yui_shell_show_error(yui_shell_of(gobj), "cannot read the schemas again: the ones shown may be out of date, your next change reads them first", { t });
|
|
75077
75133
|
return end_load(gobj);
|
|
75078
75134
|
}
|
|
75079
75135
|
priv.model = null;
|
|
@@ -75285,6 +75341,23 @@ function ac_wait_for_the_load(gobj, event, kw, src) {
|
|
|
75285
75341
|
return -1;
|
|
75286
75342
|
}
|
|
75287
75343
|
/***************************************************************
|
|
75344
|
+
* A confirmation answered where no treedb is open: ST_EMPTY (a
|
|
75345
|
+
* reload landed on zero treedbs while it was up) or ST_IDLE (no
|
|
75346
|
+
* model). A confirmation is a shell modal, not this view's dialog,
|
|
75347
|
+
* so the load that lands does not close it, and its Yes arrives
|
|
75348
|
+
* anyway. Undeclared, it answered "Event NOT DEFINED" (fifth
|
|
75349
|
+
* independent review).
|
|
75350
|
+
*
|
|
75351
|
+
* Refused with the stamp's own words: whatever it was decided on
|
|
75352
|
+
* is not on screen any more.
|
|
75353
|
+
***************************************************************/
|
|
75354
|
+
function ac_confirmed_on_nothing(gobj, event, kw, src) {
|
|
75355
|
+
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75356
|
+
log_warning(`${gobj_short_name(gobj)}: ${event} refused, no treedb is open`);
|
|
75357
|
+
yui_shell_show_error(yui_shell_of(gobj), "the schemas were read again: open the dialog again", { t });
|
|
75358
|
+
return -1;
|
|
75359
|
+
}
|
|
75360
|
+
/***************************************************************
|
|
75288
75361
|
* {drafts: {treedb_name: [topic names]}} -- the host says which
|
|
75289
75362
|
* topics hold a draft in __system__ that is not saved (C_TREEDB's
|
|
75290
75363
|
* saved-schema, `draft_changed`). The mark of a write lived in this
|
|
@@ -75309,20 +75382,23 @@ function ac_drafts(gobj, event, kw, src) {
|
|
|
75309
75382
|
* Moving about.
|
|
75310
75383
|
***************************************************************/
|
|
75311
75384
|
function ac_select_treedb(gobj, event, kw, src) {
|
|
75312
|
-
|
|
75385
|
+
go(gobj, kw.treedb, "", false, true);
|
|
75386
|
+
return reload_after_move(gobj);
|
|
75313
75387
|
}
|
|
75314
75388
|
function ac_select_topic(gobj, event, kw, src) {
|
|
75315
|
-
|
|
75389
|
+
go(gobj, gobj.priv.treedb_id, kw.topic, false, true);
|
|
75390
|
+
return reload_after_move(gobj);
|
|
75316
75391
|
}
|
|
75317
75392
|
function ac_back(gobj, event, kw, src) {
|
|
75318
75393
|
let priv = gobj.priv;
|
|
75319
|
-
if (priv.diagram)
|
|
75320
|
-
|
|
75321
|
-
return
|
|
75394
|
+
if (priv.diagram || priv.topic_name) go(gobj, priv.treedb_id, "", false, true);
|
|
75395
|
+
else go(gobj, "", "", false, true);
|
|
75396
|
+
return reload_after_move(gobj);
|
|
75322
75397
|
}
|
|
75323
75398
|
function ac_toggle_diagram(gobj, event, kw, src) {
|
|
75324
75399
|
let priv = gobj.priv;
|
|
75325
|
-
|
|
75400
|
+
go(gobj, priv.treedb_id, priv.topic_name, !priv.diagram, true);
|
|
75401
|
+
return reload_after_move(gobj);
|
|
75326
75402
|
}
|
|
75327
75403
|
/***************************************************************
|
|
75328
75404
|
* A topic clicked in the drawing. The diagram is a CHILD here
|
|
@@ -75332,9 +75408,11 @@ function ac_toggle_diagram(gobj, event, kw, src) {
|
|
|
75332
75408
|
function ac_node_click(gobj, event, kw, src) {
|
|
75333
75409
|
let topic = kw && kw.topic;
|
|
75334
75410
|
if (!topic) return 0;
|
|
75335
|
-
|
|
75411
|
+
go(gobj, gobj.priv.treedb_id, topic, false, true);
|
|
75412
|
+
return reload_after_move(gobj);
|
|
75336
75413
|
}
|
|
75337
75414
|
function ac_show_orphans(gobj, event, kw, src) {
|
|
75415
|
+
if (reload_first(gobj, event)) return -1;
|
|
75338
75416
|
open_orphans(gobj);
|
|
75339
75417
|
return 0;
|
|
75340
75418
|
}
|
|
@@ -75362,6 +75440,7 @@ function confirm_then(gobj, message, detail, kw) {
|
|
|
75362
75440
|
function ac_add_column(gobj, event, kw, src) {
|
|
75363
75441
|
let topic = current_topic(gobj);
|
|
75364
75442
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75443
|
+
if (reload_first(gobj, event)) return -1;
|
|
75365
75444
|
if (!topic) {
|
|
75366
75445
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
75367
75446
|
return -1;
|
|
@@ -75374,6 +75453,7 @@ function ac_edit_column(gobj, event, kw, src) {
|
|
|
75374
75453
|
let topic = current_topic(gobj);
|
|
75375
75454
|
let col = topic ? find_col(priv.model, priv.treedb_id, topic.name, kw.col) : null;
|
|
75376
75455
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75456
|
+
if (reload_first(gobj, event)) return -1;
|
|
75377
75457
|
if (!col) {
|
|
75378
75458
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
75379
75459
|
return -1;
|
|
@@ -75391,6 +75471,7 @@ function ac_duplicate_column(gobj, event, kw, src) {
|
|
|
75391
75471
|
let topic = current_topic(gobj);
|
|
75392
75472
|
let col = topic ? find_col(priv.model, priv.treedb_id, topic.name, kw.col) : null;
|
|
75393
75473
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75474
|
+
if (reload_first(gobj, event)) return -1;
|
|
75394
75475
|
if (!col) {
|
|
75395
75476
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
75396
75477
|
return -1;
|
|
@@ -75409,6 +75490,7 @@ function ac_save_column(gobj, event, kw, src) {
|
|
|
75409
75490
|
let topic = find_topic(priv.model, priv.treedb_id, kw.topic);
|
|
75410
75491
|
let col = kw.creating ? null : find_col(priv.model, priv.treedb_id, kw.topic, kw.col);
|
|
75411
75492
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75493
|
+
if (reload_first(gobj, event)) return -1;
|
|
75412
75494
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75413
75495
|
if (!topic || !kw.creating && !col) {
|
|
75414
75496
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.topic}.${kw.col}`);
|
|
@@ -75435,6 +75517,7 @@ function ac_delete_column(gobj, event, kw, src) {
|
|
|
75435
75517
|
let topic = current_topic(gobj);
|
|
75436
75518
|
let col = topic ? find_col(priv.model, priv.treedb_id, topic.name, kw.col) : null;
|
|
75437
75519
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75520
|
+
if (reload_first(gobj, event)) return -1;
|
|
75438
75521
|
if (!col) {
|
|
75439
75522
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
75440
75523
|
return -1;
|
|
@@ -75454,6 +75537,7 @@ function ac_delete_column(gobj, event, kw, src) {
|
|
|
75454
75537
|
function ac_move_column(gobj, event, kw, src) {
|
|
75455
75538
|
let topic = current_topic(gobj);
|
|
75456
75539
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75540
|
+
if (reload_first(gobj, event)) return -1;
|
|
75457
75541
|
if (!topic) {
|
|
75458
75542
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
75459
75543
|
return -1;
|
|
@@ -75489,6 +75573,7 @@ function ac_undo_order(gobj, event, kw, src) {
|
|
|
75489
75573
|
let priv = gobj.priv;
|
|
75490
75574
|
let topic = current_topic(gobj);
|
|
75491
75575
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75576
|
+
if (reload_first(gobj, event)) return -1;
|
|
75492
75577
|
if (!topic) {
|
|
75493
75578
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
75494
75579
|
return -1;
|
|
@@ -75507,6 +75592,7 @@ function ac_undo_order(gobj, event, kw, src) {
|
|
|
75507
75592
|
function ac_add_topic(gobj, event, kw, src) {
|
|
75508
75593
|
let treedb = current_treedb(gobj);
|
|
75509
75594
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75595
|
+
if (reload_first(gobj, event)) return -1;
|
|
75510
75596
|
if (!treedb) {
|
|
75511
75597
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75512
75598
|
return -1;
|
|
@@ -75519,6 +75605,7 @@ function ac_edit_topic(gobj, event, kw, src) {
|
|
|
75519
75605
|
let treedb = current_treedb(gobj);
|
|
75520
75606
|
let topic = treedb ? find_topic(priv.model, priv.treedb_id, kw.topic) : null;
|
|
75521
75607
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75608
|
+
if (reload_first(gobj, event)) return -1;
|
|
75522
75609
|
if (!topic) {
|
|
75523
75610
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
75524
75611
|
return -1;
|
|
@@ -75531,6 +75618,7 @@ function ac_save_topic(gobj, event, kw, src) {
|
|
|
75531
75618
|
let treedb = current_treedb(gobj);
|
|
75532
75619
|
let topic = kw.creating ? null : find_topic(priv.model, priv.treedb_id, kw.topic);
|
|
75533
75620
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75621
|
+
if (reload_first(gobj, event)) return -1;
|
|
75534
75622
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75535
75623
|
if (!treedb || !kw.creating && !topic) {
|
|
75536
75624
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
@@ -75559,6 +75647,7 @@ function ac_delete_topic(gobj, event, kw, src) {
|
|
|
75559
75647
|
let priv = gobj.priv;
|
|
75560
75648
|
let topic = find_topic(priv.model, priv.treedb_id, kw.topic);
|
|
75561
75649
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75650
|
+
if (reload_first(gobj, event)) return -1;
|
|
75562
75651
|
if (!topic) {
|
|
75563
75652
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
75564
75653
|
return -1;
|
|
@@ -75574,6 +75663,7 @@ function ac_delete_topic(gobj, event, kw, src) {
|
|
|
75574
75663
|
***************************************************************/
|
|
75575
75664
|
function ac_delete_orphan(gobj, event, kw, src) {
|
|
75576
75665
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75666
|
+
if (reload_first(gobj, event)) return -1;
|
|
75577
75667
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75578
75668
|
if (empty_string(kw.id)) {
|
|
75579
75669
|
log_error(`${gobj_short_name(gobj)}: ${event} names nothing`);
|
|
@@ -75592,6 +75682,7 @@ function ac_delete_orphan(gobj, event, kw, src) {
|
|
|
75592
75682
|
function ac_validate(gobj, event, kw, src) {
|
|
75593
75683
|
let priv = gobj.priv;
|
|
75594
75684
|
let treedb = current_treedb(gobj);
|
|
75685
|
+
if (reload_first(gobj, event)) return -1;
|
|
75595
75686
|
if (!treedb) {
|
|
75596
75687
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75597
75688
|
return -1;
|
|
@@ -75606,6 +75697,7 @@ function ac_validate(gobj, event, kw, src) {
|
|
|
75606
75697
|
}
|
|
75607
75698
|
function ac_export(gobj, event, kw, src) {
|
|
75608
75699
|
let treedb = current_treedb(gobj);
|
|
75700
|
+
if (reload_first(gobj, event)) return -1;
|
|
75609
75701
|
if (!treedb) {
|
|
75610
75702
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75611
75703
|
return -1;
|
|
@@ -75616,6 +75708,7 @@ function ac_export(gobj, event, kw, src) {
|
|
|
75616
75708
|
function ac_import(gobj, event, kw, src) {
|
|
75617
75709
|
let treedb = current_treedb(gobj);
|
|
75618
75710
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75711
|
+
if (reload_first(gobj, event)) return -1;
|
|
75619
75712
|
if (!treedb) {
|
|
75620
75713
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75621
75714
|
return -1;
|
|
@@ -75631,6 +75724,7 @@ function ac_preview_import(gobj, event, kw, src) {
|
|
|
75631
75724
|
let priv = gobj.priv;
|
|
75632
75725
|
let treedb = current_treedb(gobj);
|
|
75633
75726
|
let incoming = null;
|
|
75727
|
+
if (reload_first(gobj, event)) return -1;
|
|
75634
75728
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75635
75729
|
if (!treedb) {
|
|
75636
75730
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
@@ -75659,6 +75753,7 @@ function ac_preview_import(gobj, event, kw, src) {
|
|
|
75659
75753
|
function ac_apply_import(gobj, event, kw, src) {
|
|
75660
75754
|
let plan = gobj.priv.import_plan;
|
|
75661
75755
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75756
|
+
if (reload_first(gobj, event)) return -1;
|
|
75662
75757
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75663
75758
|
if (!plan || plan.writes.length === 0) {
|
|
75664
75759
|
log_error(`${gobj_short_name(gobj)}: ${event} with no plan to run`);
|
|
@@ -75677,7 +75772,8 @@ function run_import(gobj) {
|
|
|
75677
75772
|
let priv = gobj.priv;
|
|
75678
75773
|
let plan = priv.import_plan;
|
|
75679
75774
|
if (!plan) {
|
|
75680
|
-
|
|
75775
|
+
log_warning(`${gobj_short_name(gobj)}: the import plan is gone`);
|
|
75776
|
+
yui_shell_show_error(yui_shell_of(gobj), "the import plan is gone: preview it again", { t });
|
|
75681
75777
|
return -1;
|
|
75682
75778
|
}
|
|
75683
75779
|
close_dialog(gobj);
|
|
@@ -75702,6 +75798,7 @@ function run_import(gobj) {
|
|
|
75702
75798
|
function ac_confirmed(gobj, event, kw, src) {
|
|
75703
75799
|
let priv = gobj.priv;
|
|
75704
75800
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75801
|
+
if (reload_first(gobj, event)) return -1;
|
|
75705
75802
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75706
75803
|
if (kw.what === "import") return run_import(gobj);
|
|
75707
75804
|
if (kw.what === "topic") {
|
|
@@ -75836,7 +75933,11 @@ function create_gclass$1(gclass_name) {
|
|
|
75836
75933
|
]
|
|
75837
75934
|
];
|
|
75838
75935
|
const states = [
|
|
75839
|
-
["ST_IDLE", COMMON.
|
|
75936
|
+
["ST_IDLE", COMMON.concat([[
|
|
75937
|
+
"EV_CONFIRMED",
|
|
75938
|
+
ac_confirmed_on_nothing,
|
|
75939
|
+
null
|
|
75940
|
+
]])],
|
|
75840
75941
|
["ST_LOADING", COMMON.concat([
|
|
75841
75942
|
[
|
|
75842
75943
|
"EV_SAVE_COLUMN",
|
|
@@ -75869,7 +75970,11 @@ function create_gclass$1(gclass_name) {
|
|
|
75869
75970
|
null
|
|
75870
75971
|
]
|
|
75871
75972
|
])],
|
|
75872
|
-
["ST_EMPTY", COMMON.
|
|
75973
|
+
["ST_EMPTY", COMMON.concat([[
|
|
75974
|
+
"EV_CONFIRMED",
|
|
75975
|
+
ac_confirmed_on_nothing,
|
|
75976
|
+
null
|
|
75977
|
+
]])],
|
|
75873
75978
|
["ST_TREEDBS", COMMON.concat([
|
|
75874
75979
|
[
|
|
75875
75980
|
"EV_SELECT_TREEDB",
|