@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
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
|
}
|
|
@@ -75350,7 +75428,9 @@ function confirm_then(gobj, message, detail, kw) {
|
|
|
75350
75428
|
kw = Object.assign({ model_gen: gobj.priv.model_gen }, kw);
|
|
75351
75429
|
yui_shell_confirm_danger(yui_shell_of(gobj), message, {
|
|
75352
75430
|
t,
|
|
75353
|
-
detail
|
|
75431
|
+
detail,
|
|
75432
|
+
confirm_label: "delete",
|
|
75433
|
+
cancel_label: "cancel"
|
|
75354
75434
|
}).then((yes) => {
|
|
75355
75435
|
if (!yes || gobj_is_destroying(gobj)) return;
|
|
75356
75436
|
gobj_send_event(gobj, "EV_CONFIRMED", kw, gobj);
|
|
@@ -75362,6 +75442,7 @@ function confirm_then(gobj, message, detail, kw) {
|
|
|
75362
75442
|
function ac_add_column(gobj, event, kw, src) {
|
|
75363
75443
|
let topic = current_topic(gobj);
|
|
75364
75444
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75445
|
+
if (reload_first(gobj, event)) return -1;
|
|
75365
75446
|
if (!topic) {
|
|
75366
75447
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
75367
75448
|
return -1;
|
|
@@ -75374,6 +75455,7 @@ function ac_edit_column(gobj, event, kw, src) {
|
|
|
75374
75455
|
let topic = current_topic(gobj);
|
|
75375
75456
|
let col = topic ? find_col(priv.model, priv.treedb_id, topic.name, kw.col) : null;
|
|
75376
75457
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75458
|
+
if (reload_first(gobj, event)) return -1;
|
|
75377
75459
|
if (!col) {
|
|
75378
75460
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
75379
75461
|
return -1;
|
|
@@ -75391,6 +75473,7 @@ function ac_duplicate_column(gobj, event, kw, src) {
|
|
|
75391
75473
|
let topic = current_topic(gobj);
|
|
75392
75474
|
let col = topic ? find_col(priv.model, priv.treedb_id, topic.name, kw.col) : null;
|
|
75393
75475
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75476
|
+
if (reload_first(gobj, event)) return -1;
|
|
75394
75477
|
if (!col) {
|
|
75395
75478
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
75396
75479
|
return -1;
|
|
@@ -75409,6 +75492,7 @@ function ac_save_column(gobj, event, kw, src) {
|
|
|
75409
75492
|
let topic = find_topic(priv.model, priv.treedb_id, kw.topic);
|
|
75410
75493
|
let col = kw.creating ? null : find_col(priv.model, priv.treedb_id, kw.topic, kw.col);
|
|
75411
75494
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75495
|
+
if (reload_first(gobj, event)) return -1;
|
|
75412
75496
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75413
75497
|
if (!topic || !kw.creating && !col) {
|
|
75414
75498
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.topic}.${kw.col}`);
|
|
@@ -75435,6 +75519,7 @@ function ac_delete_column(gobj, event, kw, src) {
|
|
|
75435
75519
|
let topic = current_topic(gobj);
|
|
75436
75520
|
let col = topic ? find_col(priv.model, priv.treedb_id, topic.name, kw.col) : null;
|
|
75437
75521
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75522
|
+
if (reload_first(gobj, event)) return -1;
|
|
75438
75523
|
if (!col) {
|
|
75439
75524
|
log_error(`${gobj_short_name(gobj)}: ${event} names no column: ${kw.col}`);
|
|
75440
75525
|
return -1;
|
|
@@ -75454,6 +75539,7 @@ function ac_delete_column(gobj, event, kw, src) {
|
|
|
75454
75539
|
function ac_move_column(gobj, event, kw, src) {
|
|
75455
75540
|
let topic = current_topic(gobj);
|
|
75456
75541
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75542
|
+
if (reload_first(gobj, event)) return -1;
|
|
75457
75543
|
if (!topic) {
|
|
75458
75544
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
75459
75545
|
return -1;
|
|
@@ -75489,6 +75575,7 @@ function ac_undo_order(gobj, event, kw, src) {
|
|
|
75489
75575
|
let priv = gobj.priv;
|
|
75490
75576
|
let topic = current_topic(gobj);
|
|
75491
75577
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75578
|
+
if (reload_first(gobj, event)) return -1;
|
|
75492
75579
|
if (!topic) {
|
|
75493
75580
|
log_error(`${gobj_short_name(gobj)}: ${event} with no topic open`);
|
|
75494
75581
|
return -1;
|
|
@@ -75507,6 +75594,7 @@ function ac_undo_order(gobj, event, kw, src) {
|
|
|
75507
75594
|
function ac_add_topic(gobj, event, kw, src) {
|
|
75508
75595
|
let treedb = current_treedb(gobj);
|
|
75509
75596
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75597
|
+
if (reload_first(gobj, event)) return -1;
|
|
75510
75598
|
if (!treedb) {
|
|
75511
75599
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75512
75600
|
return -1;
|
|
@@ -75519,6 +75607,7 @@ function ac_edit_topic(gobj, event, kw, src) {
|
|
|
75519
75607
|
let treedb = current_treedb(gobj);
|
|
75520
75608
|
let topic = treedb ? find_topic(priv.model, priv.treedb_id, kw.topic) : null;
|
|
75521
75609
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75610
|
+
if (reload_first(gobj, event)) return -1;
|
|
75522
75611
|
if (!topic) {
|
|
75523
75612
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
75524
75613
|
return -1;
|
|
@@ -75531,6 +75620,7 @@ function ac_save_topic(gobj, event, kw, src) {
|
|
|
75531
75620
|
let treedb = current_treedb(gobj);
|
|
75532
75621
|
let topic = kw.creating ? null : find_topic(priv.model, priv.treedb_id, kw.topic);
|
|
75533
75622
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75623
|
+
if (reload_first(gobj, event)) return -1;
|
|
75534
75624
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75535
75625
|
if (!treedb || !kw.creating && !topic) {
|
|
75536
75626
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
@@ -75559,6 +75649,7 @@ function ac_delete_topic(gobj, event, kw, src) {
|
|
|
75559
75649
|
let priv = gobj.priv;
|
|
75560
75650
|
let topic = find_topic(priv.model, priv.treedb_id, kw.topic);
|
|
75561
75651
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75652
|
+
if (reload_first(gobj, event)) return -1;
|
|
75562
75653
|
if (!topic) {
|
|
75563
75654
|
log_error(`${gobj_short_name(gobj)}: ${event} names no topic: ${kw.topic}`);
|
|
75564
75655
|
return -1;
|
|
@@ -75574,6 +75665,7 @@ function ac_delete_topic(gobj, event, kw, src) {
|
|
|
75574
75665
|
***************************************************************/
|
|
75575
75666
|
function ac_delete_orphan(gobj, event, kw, src) {
|
|
75576
75667
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75668
|
+
if (reload_first(gobj, event)) return -1;
|
|
75577
75669
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75578
75670
|
if (empty_string(kw.id)) {
|
|
75579
75671
|
log_error(`${gobj_short_name(gobj)}: ${event} names nothing`);
|
|
@@ -75592,6 +75684,7 @@ function ac_delete_orphan(gobj, event, kw, src) {
|
|
|
75592
75684
|
function ac_validate(gobj, event, kw, src) {
|
|
75593
75685
|
let priv = gobj.priv;
|
|
75594
75686
|
let treedb = current_treedb(gobj);
|
|
75687
|
+
if (reload_first(gobj, event)) return -1;
|
|
75595
75688
|
if (!treedb) {
|
|
75596
75689
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75597
75690
|
return -1;
|
|
@@ -75606,6 +75699,7 @@ function ac_validate(gobj, event, kw, src) {
|
|
|
75606
75699
|
}
|
|
75607
75700
|
function ac_export(gobj, event, kw, src) {
|
|
75608
75701
|
let treedb = current_treedb(gobj);
|
|
75702
|
+
if (reload_first(gobj, event)) return -1;
|
|
75609
75703
|
if (!treedb) {
|
|
75610
75704
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75611
75705
|
return -1;
|
|
@@ -75616,6 +75710,7 @@ function ac_export(gobj, event, kw, src) {
|
|
|
75616
75710
|
function ac_import(gobj, event, kw, src) {
|
|
75617
75711
|
let treedb = current_treedb(gobj);
|
|
75618
75712
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75713
|
+
if (reload_first(gobj, event)) return -1;
|
|
75619
75714
|
if (!treedb) {
|
|
75620
75715
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
75621
75716
|
return -1;
|
|
@@ -75631,6 +75726,7 @@ function ac_preview_import(gobj, event, kw, src) {
|
|
|
75631
75726
|
let priv = gobj.priv;
|
|
75632
75727
|
let treedb = current_treedb(gobj);
|
|
75633
75728
|
let incoming = null;
|
|
75729
|
+
if (reload_first(gobj, event)) return -1;
|
|
75634
75730
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75635
75731
|
if (!treedb) {
|
|
75636
75732
|
log_error(`${gobj_short_name(gobj)}: ${event} with no treedb open`);
|
|
@@ -75659,6 +75755,7 @@ function ac_preview_import(gobj, event, kw, src) {
|
|
|
75659
75755
|
function ac_apply_import(gobj, event, kw, src) {
|
|
75660
75756
|
let plan = gobj.priv.import_plan;
|
|
75661
75757
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75758
|
+
if (reload_first(gobj, event)) return -1;
|
|
75662
75759
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75663
75760
|
if (!plan || plan.writes.length === 0) {
|
|
75664
75761
|
log_error(`${gobj_short_name(gobj)}: ${event} with no plan to run`);
|
|
@@ -75677,7 +75774,8 @@ function run_import(gobj) {
|
|
|
75677
75774
|
let priv = gobj.priv;
|
|
75678
75775
|
let plan = priv.import_plan;
|
|
75679
75776
|
if (!plan) {
|
|
75680
|
-
|
|
75777
|
+
log_warning(`${gobj_short_name(gobj)}: the import plan is gone`);
|
|
75778
|
+
yui_shell_show_error(yui_shell_of(gobj), "the import plan is gone: preview it again", { t });
|
|
75681
75779
|
return -1;
|
|
75682
75780
|
}
|
|
75683
75781
|
close_dialog(gobj);
|
|
@@ -75702,6 +75800,7 @@ function run_import(gobj) {
|
|
|
75702
75800
|
function ac_confirmed(gobj, event, kw, src) {
|
|
75703
75801
|
let priv = gobj.priv;
|
|
75704
75802
|
if (refuse_if_readonly(gobj, event)) return -1;
|
|
75803
|
+
if (reload_first(gobj, event)) return -1;
|
|
75705
75804
|
if (built_on_a_replaced_model(gobj, event, kw)) return -1;
|
|
75706
75805
|
if (kw.what === "import") return run_import(gobj);
|
|
75707
75806
|
if (kw.what === "topic") {
|
|
@@ -75836,7 +75935,11 @@ function create_gclass$1(gclass_name) {
|
|
|
75836
75935
|
]
|
|
75837
75936
|
];
|
|
75838
75937
|
const states = [
|
|
75839
|
-
["ST_IDLE", COMMON.
|
|
75938
|
+
["ST_IDLE", COMMON.concat([[
|
|
75939
|
+
"EV_CONFIRMED",
|
|
75940
|
+
ac_confirmed_on_nothing,
|
|
75941
|
+
null
|
|
75942
|
+
]])],
|
|
75840
75943
|
["ST_LOADING", COMMON.concat([
|
|
75841
75944
|
[
|
|
75842
75945
|
"EV_SAVE_COLUMN",
|
|
@@ -75869,7 +75972,11 @@ function create_gclass$1(gclass_name) {
|
|
|
75869
75972
|
null
|
|
75870
75973
|
]
|
|
75871
75974
|
])],
|
|
75872
|
-
["ST_EMPTY", COMMON.
|
|
75975
|
+
["ST_EMPTY", COMMON.concat([[
|
|
75976
|
+
"EV_CONFIRMED",
|
|
75977
|
+
ac_confirmed_on_nothing,
|
|
75978
|
+
null
|
|
75979
|
+
]])],
|
|
75873
75980
|
["ST_TREEDBS", COMMON.concat([
|
|
75874
75981
|
[
|
|
75875
75982
|
"EV_SELECT_TREEDB",
|