@rogatio/cli 5.8.1 → 5.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor/index.js +22 -46
- package/package.json +1 -1
package/dist/editor/index.js
CHANGED
|
@@ -3048,31 +3048,25 @@ var EditorControllerImpl = class {
|
|
|
3048
3048
|
const group = this.groupById(this.route.groupId);
|
|
3049
3049
|
if (!group) return;
|
|
3050
3050
|
const index = this.groupIndex(this.route.groupId);
|
|
3051
|
-
const name = displayName(group.name, "Unnamed group");
|
|
3052
3051
|
this.commandBar.append(
|
|
3053
3052
|
this.createCommandButton("Add rule", "add-rule", this.saving, {
|
|
3054
3053
|
groupId: this.route.groupId
|
|
3055
3054
|
}),
|
|
3056
3055
|
this.createCommandButton(
|
|
3057
|
-
|
|
3056
|
+
"Move group up",
|
|
3058
3057
|
"move-group-up",
|
|
3059
3058
|
this.saving || index <= 0,
|
|
3060
3059
|
{ groupId: this.route.groupId }
|
|
3061
3060
|
),
|
|
3062
3061
|
this.createCommandButton(
|
|
3063
|
-
|
|
3062
|
+
"Move group down",
|
|
3064
3063
|
"move-group-down",
|
|
3065
3064
|
this.saving || index >= this.draft.groups.length - 1,
|
|
3066
3065
|
{ groupId: this.route.groupId }
|
|
3067
3066
|
),
|
|
3068
|
-
this.createCommandButton(
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
this.saving,
|
|
3072
|
-
{
|
|
3073
|
-
groupId: this.route.groupId
|
|
3074
|
-
}
|
|
3075
|
-
)
|
|
3067
|
+
this.createCommandButton("Remove group", "remove-group", this.saving, {
|
|
3068
|
+
groupId: this.route.groupId
|
|
3069
|
+
})
|
|
3076
3070
|
);
|
|
3077
3071
|
}
|
|
3078
3072
|
renderProject() {
|
|
@@ -3306,7 +3300,9 @@ var EditorControllerImpl = class {
|
|
|
3306
3300
|
card.id = `rogatio-rule-${groupId}-${ruleId}`;
|
|
3307
3301
|
card.tabIndex = -1;
|
|
3308
3302
|
const heading = this.document.createElement("h3");
|
|
3303
|
+
heading.id = `${this.instanceId}-rule-title-${groupIndex}-${ruleIndex}`;
|
|
3309
3304
|
heading.textContent = ruleName;
|
|
3305
|
+
card.setAttribute("aria-labelledby", heading.id);
|
|
3310
3306
|
card.append(heading);
|
|
3311
3307
|
const fields = this.document.createElement("fieldset");
|
|
3312
3308
|
const legend = this.document.createElement("legend");
|
|
@@ -3318,23 +3314,18 @@ var EditorControllerImpl = class {
|
|
|
3318
3314
|
id.type = "text";
|
|
3319
3315
|
id.maxLength = 64;
|
|
3320
3316
|
id.value = safeText(rule.id);
|
|
3321
|
-
this.renderField(grid,
|
|
3317
|
+
this.renderField(grid, "Rule ID", `${rulePath}/id`, id);
|
|
3322
3318
|
const name = this.document.createElement("input");
|
|
3323
3319
|
name.type = "text";
|
|
3324
3320
|
name.maxLength = 100;
|
|
3325
3321
|
name.value = safeText(rule.name);
|
|
3326
|
-
this.renderField(
|
|
3327
|
-
grid,
|
|
3328
|
-
`Rule name for ${ruleName}`,
|
|
3329
|
-
`${rulePath}/name`,
|
|
3330
|
-
name
|
|
3331
|
-
);
|
|
3322
|
+
this.renderField(grid, "Rule name", `${rulePath}/name`, name);
|
|
3332
3323
|
const regex = this.document.createElement("textarea");
|
|
3333
3324
|
regex.maxLength = F2_MAX_URL_REGEX_LENGTH2;
|
|
3334
3325
|
regex.value = safeText(rule.urlRegex);
|
|
3335
3326
|
this.renderField(
|
|
3336
3327
|
grid,
|
|
3337
|
-
|
|
3328
|
+
"URL regular expression",
|
|
3338
3329
|
`${rulePath}/urlRegex`,
|
|
3339
3330
|
regex
|
|
3340
3331
|
);
|
|
@@ -3357,7 +3348,7 @@ var EditorControllerImpl = class {
|
|
|
3357
3348
|
groupIndex,
|
|
3358
3349
|
ruleIndex
|
|
3359
3350
|
);
|
|
3360
|
-
this.renderResourceTypes(card, rule, rulePath
|
|
3351
|
+
this.renderResourceTypes(card, rule, rulePath);
|
|
3361
3352
|
const matcherFields = this.document.createElement("fieldset");
|
|
3362
3353
|
const matcherLegend = this.document.createElement("legend");
|
|
3363
3354
|
matcherLegend.textContent = "Request constraints";
|
|
@@ -3370,12 +3361,7 @@ var EditorControllerImpl = class {
|
|
|
3370
3361
|
priority.max = "1000";
|
|
3371
3362
|
priority.step = "1";
|
|
3372
3363
|
priority.value = typeof rule.priority === "number" && Number.isFinite(rule.priority) ? String(rule.priority) : safeText(rule.priority);
|
|
3373
|
-
this.renderField(
|
|
3374
|
-
matcherGrid,
|
|
3375
|
-
`Priority for ${ruleName}`,
|
|
3376
|
-
`${rulePath}/priority`,
|
|
3377
|
-
priority
|
|
3378
|
-
);
|
|
3364
|
+
this.renderField(matcherGrid, "Priority", `${rulePath}/priority`, priority);
|
|
3379
3365
|
const method = this.document.createElement("select");
|
|
3380
3366
|
const anyMethod = this.document.createElement("option");
|
|
3381
3367
|
anyMethod.value = "";
|
|
@@ -3388,12 +3374,7 @@ var EditorControllerImpl = class {
|
|
|
3388
3374
|
method.append(option);
|
|
3389
3375
|
}
|
|
3390
3376
|
method.value = safeText(rule.method);
|
|
3391
|
-
this.renderField(
|
|
3392
|
-
matcherGrid,
|
|
3393
|
-
`Method for ${ruleName}`,
|
|
3394
|
-
`${rulePath}/method`,
|
|
3395
|
-
method
|
|
3396
|
-
);
|
|
3377
|
+
this.renderField(matcherGrid, "Method", `${rulePath}/method`, method);
|
|
3397
3378
|
matcherFields.append(matcherGrid);
|
|
3398
3379
|
card.append(matcherFields);
|
|
3399
3380
|
if (this.extensions.length > 0) {
|
|
@@ -3402,7 +3383,7 @@ var EditorControllerImpl = class {
|
|
|
3402
3383
|
)?.id ?? safeText(rule.type);
|
|
3403
3384
|
const typeFieldset = this.document.createElement("fieldset");
|
|
3404
3385
|
const typeLegend = this.document.createElement("legend");
|
|
3405
|
-
typeLegend.textContent =
|
|
3386
|
+
typeLegend.textContent = "Rule type";
|
|
3406
3387
|
const typeField = this.document.createElement("div");
|
|
3407
3388
|
typeField.dataset.editorField = "true";
|
|
3408
3389
|
const typeLabel = this.document.createElement("label");
|
|
@@ -3440,26 +3421,21 @@ var EditorControllerImpl = class {
|
|
|
3440
3421
|
actions.dataset.ruleActions = "true";
|
|
3441
3422
|
actions.append(
|
|
3442
3423
|
this.createCommandButton(
|
|
3443
|
-
|
|
3424
|
+
"Move rule up",
|
|
3444
3425
|
"move-rule-up",
|
|
3445
3426
|
this.saving || ruleIndex <= 0,
|
|
3446
3427
|
{ groupId, ruleId }
|
|
3447
3428
|
),
|
|
3448
3429
|
this.createCommandButton(
|
|
3449
|
-
|
|
3430
|
+
"Move rule down",
|
|
3450
3431
|
"move-rule-down",
|
|
3451
3432
|
this.saving || ruleIndex >= group.rules.length - 1,
|
|
3452
3433
|
{ groupId, ruleId }
|
|
3453
3434
|
),
|
|
3454
|
-
this.createCommandButton(
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
{
|
|
3459
|
-
groupId,
|
|
3460
|
-
ruleId
|
|
3461
|
-
}
|
|
3462
|
-
)
|
|
3435
|
+
this.createCommandButton("Remove rule", "remove-rule", this.saving, {
|
|
3436
|
+
groupId,
|
|
3437
|
+
ruleId
|
|
3438
|
+
})
|
|
3463
3439
|
);
|
|
3464
3440
|
card.append(actions);
|
|
3465
3441
|
return card;
|
|
@@ -3505,10 +3481,10 @@ var EditorControllerImpl = class {
|
|
|
3505
3481
|
);
|
|
3506
3482
|
parent.append(fieldset);
|
|
3507
3483
|
}
|
|
3508
|
-
renderResourceTypes(parent, rule, rulePath
|
|
3484
|
+
renderResourceTypes(parent, rule, rulePath) {
|
|
3509
3485
|
const fieldset = this.document.createElement("fieldset");
|
|
3510
3486
|
const legend = this.document.createElement("legend");
|
|
3511
|
-
legend.textContent =
|
|
3487
|
+
legend.textContent = "Resource types";
|
|
3512
3488
|
fieldset.append(legend);
|
|
3513
3489
|
const checks = this.document.createElement("div");
|
|
3514
3490
|
checks.dataset.editorChecks = "true";
|
package/package.json
CHANGED