@trismegisto/spine 3.0.3 → 3.0.5
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/fesm2022/{trismegisto-spine-auto-service-apps.usage-DeLfYMeO.mjs → trismegisto-spine-auto-service-apps.usage-po9Ds_SU.mjs} +21 -22
- package/fesm2022/trismegisto-spine-auto-service-apps.usage-po9Ds_SU.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-BNtNWfiu.mjs → trismegisto-spine-auto-service-auto-service-audit.component-tfGcVR3i.mjs} +2 -2
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-BNtNWfiu.mjs.map → trismegisto-spine-auto-service-auto-service-audit.component-tfGcVR3i.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs +65 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-client.component-DXl1y6Sx.mjs → trismegisto-spine-auto-service-auto-service-client.component-DzmlpLPu.mjs} +152 -94
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-DzmlpLPu.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-delete-B1tXgMvi.mjs → trismegisto-spine-auto-service-auto-service-delete-CV_t9vxm.mjs} +3 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-delete-CV_t9vxm.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-groups.component-C4iQ2GPX.mjs → trismegisto-spine-auto-service-auto-service-groups.component-2xCG_wS9.mjs} +11 -6
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-2xCG_wS9.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-login-attempts.component-B87vibNB.mjs → trismegisto-spine-auto-service-auto-service-login-attempts.component-CRvxfSWD.mjs} +2 -2
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-login-attempts.component-B87vibNB.mjs.map → trismegisto-spine-auto-service-auto-service-login-attempts.component-CRvxfSWD.mjs.map} +1 -1
- package/fesm2022/{trismegisto-spine-auto-service-auto-service.component-DAXv__zg.mjs → trismegisto-spine-auto-service-auto-service.component-C4FBAefe.mjs} +90 -56
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-C4FBAefe.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-client.usage-CcJANb20.mjs → trismegisto-spine-auto-service-client.usage-B16r3IHk.mjs} +16 -12
- package/fesm2022/trismegisto-spine-auto-service-client.usage-B16r3IHk.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-optional-id.validator-0JPeqhjm.mjs +20 -0
- package/fesm2022/trismegisto-spine-auto-service-optional-id.validator-0JPeqhjm.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service.mjs +7 -7
- package/fesm2022/trismegisto-spine-auto-service.mjs.map +1 -1
- package/fesm2022/trismegisto-spine.mjs +54 -3
- package/fesm2022/trismegisto-spine.mjs.map +1 -1
- package/package.json +6 -6
- package/types/trismegisto-spine-auto-service.d.ts +1 -0
- package/types/trismegisto-spine-auto-service.d.ts.map +1 -1
- package/types/trismegisto-spine.d.ts +29 -0
- package/types/trismegisto-spine.d.ts.map +1 -1
- package/fesm2022/trismegisto-spine-auto-service-apps.usage-DeLfYMeO.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-DdtDk_xl.mjs +0 -51
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-DdtDk_xl.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-DXl1y6Sx.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-delete-B1tXgMvi.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-C4iQ2GPX.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-DAXv__zg.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-client.usage-CcJANb20.mjs.map +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, computed, Input, ChangeDetectionStrategy, Component, ElementRef, Injector, EventEmitter, afterNextRender, Output } from '@angular/core';
|
|
2
|
+
import { inject, ChangeDetectorRef, computed, Input, ChangeDetectionStrategy, Component, ElementRef, Injector, EventEmitter, afterNextRender, Output, signal } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { ButtonComponent, CheckboxComponent, ComboboxComponent, IconComponent, InputComponent, TextareaComponent, ModalComponent, DataGridComponent, DataGridCellDirective, TagComponent, AlertComponent, IconButtonComponent, ReorderListComponent, ComboboxMultiComponent, DividerComponent, DrawerComponent, TabsComponent, TabComponent, TabContentDirective } from '@trismegisto/angular';
|
|
6
|
-
import { A as AutoServiceClientPickerComponent } from './trismegisto-spine-auto-service-auto-service-client-picker.component-
|
|
5
|
+
import { ButtonComponent, CheckboxComponent, ComboboxComponent, IconComponent, InputComponent, TextareaComponent, ModalComponent, DataGridComponent, DataGridCellDirective, TagComponent, CopyButtonComponent, AlertComponent, IconButtonComponent, ReorderListComponent, ComboboxMultiComponent, DividerComponent, DataGridActionBarComponent, DrawerComponent, TreeComponent, TabsComponent, TabComponent, TabContentDirective } from '@trismegisto/angular';
|
|
6
|
+
import { A as AutoServiceClientPickerComponent } from './trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs';
|
|
7
7
|
import * as i3 from '@angular/forms';
|
|
8
8
|
import { FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
9
9
|
import { HERMES_ICONS } from '@trismegisto/icons/catalog';
|
|
10
|
-
import { formatMessage, pluralMessage, moveItem
|
|
11
|
-
import { A as AutoServiceDeleteFeedback, a as autoServiceErrorText } from './trismegisto-spine-auto-service-auto-service-delete-
|
|
10
|
+
import { formatMessage, pluralMessage, moveItem } from '@trismegisto/primitives';
|
|
11
|
+
import { A as AutoServiceDeleteFeedback, a as autoServiceErrorText } from './trismegisto-spine-auto-service-auto-service-delete-CV_t9vxm.mjs';
|
|
12
12
|
import { SPINE_MESSAGES } from '@trismegisto/spine';
|
|
13
|
+
import { o as optionalIdValidator, a as optionalIdBody } from './trismegisto-spine-auto-service-optional-id.validator-0JPeqhjm.mjs';
|
|
13
14
|
import { AutoServiceService } from './trismegisto-spine-auto-service.mjs';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -40,6 +41,9 @@ class AutoServiceRoutesComponent {
|
|
|
40
41
|
this.loading = false;
|
|
41
42
|
this.showRouteModal = false;
|
|
42
43
|
this.editingRouteId = '';
|
|
44
|
+
/** Id opcional só na criação (mesma rota com o mesmo id em homologação e produção). */
|
|
45
|
+
this.newId = new FormControl('', { nonNullable: true, validators: [optionalIdValidator] });
|
|
46
|
+
this.idMessages = computed(() => ({ optionalId: this.text.optionalIdInvalid }), ...(ngDevMode ? [{ debugName: "idMessages" }] : /* istanbul ignore next */ []));
|
|
43
47
|
this.name = new FormControl('', { nonNullable: true });
|
|
44
48
|
this.displayName = new FormControl('', { nonNullable: true });
|
|
45
49
|
this.icon = new FormControl('', { nonNullable: true });
|
|
@@ -65,6 +69,7 @@ class AutoServiceRoutesComponent {
|
|
|
65
69
|
key: 'excludable', title: this.text.colExcludable, sortable: true,
|
|
66
70
|
value: (r) => (r.excludable ? this.text.excludableYes : this.text.excludableNo),
|
|
67
71
|
},
|
|
72
|
+
{ key: 'id', title: this.text.colId, value: (r) => r.id },
|
|
68
73
|
], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
69
74
|
// Rota de template não se edita nem se exclui aqui (403 no admin-server); excluir, além disso, só em rota
|
|
70
75
|
// excluível (409). Linha sem ação nenhuma fica sem o kebab.
|
|
@@ -77,6 +82,10 @@ class AutoServiceRoutesComponent {
|
|
|
77
82
|
},
|
|
78
83
|
], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
|
|
79
84
|
}
|
|
85
|
+
/** Nome acessível do botão de copiar: diz de qual rota é o id. */
|
|
86
|
+
copyIdLabel(r) {
|
|
87
|
+
return formatMessage(this.text.copyRouteId, { name: r.display_name || r.name });
|
|
88
|
+
}
|
|
80
89
|
ngOnChanges(changes) { if (changes['clientId'])
|
|
81
90
|
this.load(); }
|
|
82
91
|
async load() {
|
|
@@ -117,6 +126,7 @@ class AutoServiceRoutesComponent {
|
|
|
117
126
|
openCreateRoute() {
|
|
118
127
|
this.editingRouteId = '';
|
|
119
128
|
this.resetForm();
|
|
129
|
+
this.newId.reset('');
|
|
120
130
|
this.showRouteModal = true;
|
|
121
131
|
}
|
|
122
132
|
openEditRoute(r) {
|
|
@@ -128,7 +138,7 @@ class AutoServiceRoutesComponent {
|
|
|
128
138
|
}
|
|
129
139
|
async saveRoute() {
|
|
130
140
|
// O botão já fica desabilitado; a guarda cobre chamadas diretas (ex.: Enter no form).
|
|
131
|
-
if (!this.name.value || this.path.invalid)
|
|
141
|
+
if (!this.name.value || this.path.invalid || (!this.editingRouteId && this.newId.invalid))
|
|
132
142
|
return;
|
|
133
143
|
const body = {
|
|
134
144
|
name: this.name.value, display_name: this.displayName.value, icon: this.icon.value,
|
|
@@ -138,7 +148,7 @@ class AutoServiceRoutesComponent {
|
|
|
138
148
|
await this.service.updateWebRoute(this.clientId, this.editingRouteId, body);
|
|
139
149
|
}
|
|
140
150
|
else {
|
|
141
|
-
await this.service.createWebRoute(this.clientId, body);
|
|
151
|
+
await this.service.createWebRoute(this.clientId, { ...optionalIdBody('route_id', this.newId.value), ...body });
|
|
142
152
|
}
|
|
143
153
|
this.showRouteModal = false;
|
|
144
154
|
await this.load();
|
|
@@ -157,14 +167,14 @@ class AutoServiceRoutesComponent {
|
|
|
157
167
|
void this.deleteRoute(e.row);
|
|
158
168
|
}
|
|
159
169
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceRoutesComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
160
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
170
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: AutoServiceRoutesComponent, isStandalone: true, selector: "spine-auto-service-routes", inputs: { clientId: "clientId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"routes\"\n [rowId]=\"rowId\"\n [caption]=\"text.routesCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noRoutes\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreateRoute()\">{{ text.newRoute }}</hm-button>\n <ng-template hmCell=\"name\" let-r>\n <span class=\"name-cell\">\n {{ r.name }}\n <hm-tag *ngIf=\"r.templated\" [name]=\"text.templateTag\" color=\"info\" [title]=\"text.templateLocked\" />\n </span>\n </ng-template>\n <ng-template hmCell=\"icon\" let-r>\n <span class=\"icon-cell\">\n <hm-icon *ngIf=\"r.icon\" [shape]=\"r.icon\"></hm-icon>\n {{ r.icon || '\u2014' }}\n </span>\n </ng-template>\n <!-- UUID da rota: s\u00F3 o bot\u00E3o de copiar (para criar a mesma rota com o mesmo id no outro ambiente). -->\n <ng-template hmCell=\"id\" let-r>\n <hm-copy-button [value]=\"r.id\" [label]=\"copyIdLabel(r)\" [copiedLabel]=\"text.idCopied\" />\n </ng-template>\n</hm-data-grid>\n\n<!-- Modal: criar/editar rota -->\n<hm-modal [open]=\"showRouteModal\" (openChange)=\"showRouteModal = $event\" [heading]=\"editingRouteId ? text.editRoute : text.newRoute\" (closed)=\"showRouteModal = false\">\n <div class=\"form-stack\">\n @if (!editingRouteId) {\n <hm-input [formControl]=\"newId\" [label]=\"text.optionalId\" [placeholder]=\"text.optionalIdPlaceholder\" [hint]=\"text.optionalIdHint\" [messages]=\"idMessages()\" />\n }\n <hm-input [formControl]=\"name\" [label]=\"text.internalName\" />\n <hm-input [formControl]=\"displayName\" [label]=\"text.displayName\" />\n <hm-combobox [options]=\"iconOptions\" [formControl]=\"icon\" [label]=\"text.icon\" [placeholder]=\"text.iconPlaceholder\" />\n <hm-input [formControl]=\"path\" [label]=\"text.path\" [placeholder]=\"text.pathPlaceholder\" [hint]=\"text.pathHint\" [messages]=\"pathMessages()\" />\n <hm-textarea [formControl]=\"info\" [label]=\"text.info\" />\n <hm-checkbox [formControl]=\"excludable\" [label]=\"text.excludable\" />\n <p *ngIf=\"excludableLocked\" class=\"field-note\">{{ text.excludableLocked }}</p>\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"showRouteModal = false\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!name.value || path.invalid || (!editingRouteId && newId.invalid)\" (clicked)=\"saveRoute()\">\n {{ editingRouteId ? text.save : text.create }}\n </hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}.form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}.field-note{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.name-cell{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.icon-cell{display:inline-flex;align-items:center;gap:var(--hm-space-micro)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "busy", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: CheckboxComponent, selector: "hm-checkbox", inputs: ["label", "labelHidden", "checked", "indeterminate"], outputs: ["checkedChange"] }, { kind: "component", type: ComboboxComponent, selector: "hm-combobox", inputs: ["label", "options", "value", "placeholder", "icon", "hint", "help", "size", "labelHidden", "clearable", "requiredManual", "loading", "allowCustomValue"], outputs: ["valueChange"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: InputComponent, selector: "hm-input", inputs: ["value", "label", "type", "placeholder", "icon", "labelHidden", "hint", "prefix", "suffix", "prefixIcon", "mask", "maskValue", "min", "max", "step", "stepButtons", "maxLength", "autocomplete", "inputMode"], outputs: ["valueChange"] }, { kind: "component", type: TextareaComponent, selector: "hm-textarea", inputs: ["value", "label", "hint", "help", "placeholder", "maxLength", "rows", "autoGrow", "labelHidden", "loading", "maxRows", "submitKey"], outputs: ["valueChange", "submitted"] }, { kind: "component", type: ModalComponent, selector: "hm-modal", inputs: ["open", "heading", "size", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: DataGridComponent, selector: "hm-data-grid", inputs: ["columns", "rows", "rowId", "caption", "rowActions", "loading", "error", "emptyMessage", "noResultsMessage", "filterable", "paginated", "pageState", "pagination", "totalItems", "sort", "selectable", "selectionMode", "selection", "rowSelectable", "rowSelectableReason", "rowDetailDisabled", "rowDetailHidden", "virtual", "rowHeight", "pinnedColumns", "columnState", "pageSizes", "fillHeight", "maxHeight", "bordered", "rowState", "rowClickable", "remoteSearch", "remoteSort", "itemsLabel", "pageSizeLabel", "exportable", "exportFileName", "groupBy", "aggregates", "aggregateFormatter", "persistKey", "persistStorage", "advancedFilter", "filterQuery", "columnManager", "columnOrder", "searchTerm"], outputs: ["pageStateChange", "sortChange", "selectionChange", "pinnedColumnsChange", "columnStateChange", "actionTriggered", "detailToggled", "rowClicked", "clearFiltersRequested", "filteredChange", "searchTermChanged", "groupByChange", "filterQueryChange", "columnOrderChange", "searchTermChange", "detailPaneToggled"] }, { kind: "directive", type: DataGridCellDirective, selector: "ng-template[hmCell]", inputs: ["hmCell"] }, { kind: "component", type: TagComponent, selector: "hm-tag", inputs: ["name", "color", "compact"] }, { kind: "component", type: CopyButtonComponent, selector: "hm-copy-button", inputs: ["value", "label", "copiedLabel", "variant", "size", "disabled", "feedbackDuration"], outputs: ["copied", "copyFailed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
161
171
|
}
|
|
162
172
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceRoutesComponent, decorators: [{
|
|
163
173
|
type: Component,
|
|
164
174
|
args: [{ selector: 'spine-auto-service-routes', standalone: true, imports: [
|
|
165
175
|
CommonModule, ReactiveFormsModule, ButtonComponent, CheckboxComponent, ComboboxComponent, IconComponent, InputComponent,
|
|
166
|
-
TextareaComponent, ModalComponent, DataGridComponent, DataGridCellDirective, TagComponent,
|
|
167
|
-
], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"routes\"\n [rowId]=\"rowId\"\n [caption]=\"text.routesCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noRoutes\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreateRoute()\">{{ text.newRoute }}</hm-button>\n <ng-template hmCell=\"name\" let-r>\n <span class=\"name-cell\">\n {{ r.name }}\n <hm-tag *ngIf=\"r.templated\" [name]=\"text.templateTag\" color=\"info\" [title]=\"text.templateLocked\" />\n </span>\n </ng-template>\n <ng-template hmCell=\"icon\" let-r>\n <span class=\"icon-cell\">\n <hm-icon *ngIf=\"r.icon\" [shape]=\"r.icon\"></hm-icon>\n {{ r.icon || '\u2014' }}\n </span>\n </ng-template>\n <ng-template hmCell=\"
|
|
176
|
+
TextareaComponent, ModalComponent, DataGridComponent, DataGridCellDirective, TagComponent, CopyButtonComponent,
|
|
177
|
+
], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"routes\"\n [rowId]=\"rowId\"\n [caption]=\"text.routesCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noRoutes\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreateRoute()\">{{ text.newRoute }}</hm-button>\n <ng-template hmCell=\"name\" let-r>\n <span class=\"name-cell\">\n {{ r.name }}\n <hm-tag *ngIf=\"r.templated\" [name]=\"text.templateTag\" color=\"info\" [title]=\"text.templateLocked\" />\n </span>\n </ng-template>\n <ng-template hmCell=\"icon\" let-r>\n <span class=\"icon-cell\">\n <hm-icon *ngIf=\"r.icon\" [shape]=\"r.icon\"></hm-icon>\n {{ r.icon || '\u2014' }}\n </span>\n </ng-template>\n <!-- UUID da rota: s\u00F3 o bot\u00E3o de copiar (para criar a mesma rota com o mesmo id no outro ambiente). -->\n <ng-template hmCell=\"id\" let-r>\n <hm-copy-button [value]=\"r.id\" [label]=\"copyIdLabel(r)\" [copiedLabel]=\"text.idCopied\" />\n </ng-template>\n</hm-data-grid>\n\n<!-- Modal: criar/editar rota -->\n<hm-modal [open]=\"showRouteModal\" (openChange)=\"showRouteModal = $event\" [heading]=\"editingRouteId ? text.editRoute : text.newRoute\" (closed)=\"showRouteModal = false\">\n <div class=\"form-stack\">\n @if (!editingRouteId) {\n <hm-input [formControl]=\"newId\" [label]=\"text.optionalId\" [placeholder]=\"text.optionalIdPlaceholder\" [hint]=\"text.optionalIdHint\" [messages]=\"idMessages()\" />\n }\n <hm-input [formControl]=\"name\" [label]=\"text.internalName\" />\n <hm-input [formControl]=\"displayName\" [label]=\"text.displayName\" />\n <hm-combobox [options]=\"iconOptions\" [formControl]=\"icon\" [label]=\"text.icon\" [placeholder]=\"text.iconPlaceholder\" />\n <hm-input [formControl]=\"path\" [label]=\"text.path\" [placeholder]=\"text.pathPlaceholder\" [hint]=\"text.pathHint\" [messages]=\"pathMessages()\" />\n <hm-textarea [formControl]=\"info\" [label]=\"text.info\" />\n <hm-checkbox [formControl]=\"excludable\" [label]=\"text.excludable\" />\n <p *ngIf=\"excludableLocked\" class=\"field-note\">{{ text.excludableLocked }}</p>\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"showRouteModal = false\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!name.value || path.invalid || (!editingRouteId && newId.invalid)\" (clicked)=\"saveRoute()\">\n {{ editingRouteId ? text.save : text.create }}\n </hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}.form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}.field-note{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.name-cell{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.icon-cell{display:inline-flex;align-items:center;gap:var(--hm-space-micro)}\n"] }]
|
|
168
178
|
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
169
179
|
type: Input
|
|
170
180
|
}] } });
|
|
@@ -352,6 +362,9 @@ class AutoServiceRoutersComponent {
|
|
|
352
362
|
constructor(service) {
|
|
353
363
|
this.service = service;
|
|
354
364
|
this.text = inject(SPINE_MESSAGES).autoService;
|
|
365
|
+
/** Id opcional só na criação (mesmo roteador com o mesmo id em homologação e produção). */
|
|
366
|
+
this.newId = new FormControl('', { nonNullable: true, validators: [optionalIdValidator] });
|
|
367
|
+
this.idMessages = computed(() => ({ optionalId: this.text.optionalIdInvalid }), ...(ngDevMode ? [{ debugName: "idMessages" }] : /* istanbul ignore next */ []));
|
|
355
368
|
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
356
369
|
this.cdr = inject(ChangeDetectorRef);
|
|
357
370
|
this.deletion = inject(AutoServiceDeleteFeedback);
|
|
@@ -380,6 +393,7 @@ class AutoServiceRoutersComponent {
|
|
|
380
393
|
{ key: 'description', title: this.text.colDescription, value: (r) => r.description ?? '' },
|
|
381
394
|
{ key: 'is_private', title: this.text.colVisibility, value: (r) => (r.is_private ? this.text.private : this.text.public), sortable: true },
|
|
382
395
|
{ key: 'allowed_type_ids', title: this.text.colAllowedBadges, value: (r) => this.allowedTypeNames(r.allowed_type_ids).join(', ') || this.text.anyBadge },
|
|
396
|
+
{ key: 'id', title: this.text.colId, value: (r) => r.id },
|
|
383
397
|
], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
384
398
|
// Router de template não se edita nem se exclui aqui (403 no admin-server): a linha fica sem o kebab.
|
|
385
399
|
this.rowActions = computed(() => [
|
|
@@ -393,6 +407,10 @@ class AutoServiceRoutersComponent {
|
|
|
393
407
|
/** Níveis da hierarquia, de cima para baixo (a página é a folha e fica fora: sempre obrigatória). */
|
|
394
408
|
this.hierarchyLevels = HIERARCHY_LEVELS;
|
|
395
409
|
}
|
|
410
|
+
/** Nome acessível do botão de copiar: diz de qual roteador é o id (o caminho montado identifica a tela). */
|
|
411
|
+
copyIdLabel(r) {
|
|
412
|
+
return formatMessage(this.text.copyRouterId, { name: r.built_path || this.routeName(r.page_id) });
|
|
413
|
+
}
|
|
396
414
|
get routeOptions() {
|
|
397
415
|
return this.routes.map((r) => ({ value: r.id, label: r.display_name || r.name }));
|
|
398
416
|
}
|
|
@@ -443,6 +461,7 @@ class AutoServiceRoutersComponent {
|
|
|
443
461
|
this.editingRouterId = '';
|
|
444
462
|
this.routerError = null;
|
|
445
463
|
this.routerForm = emptyRouterForm();
|
|
464
|
+
this.newId.reset('');
|
|
446
465
|
this.showRouterModal = true;
|
|
447
466
|
}
|
|
448
467
|
openEditRouter(r) {
|
|
@@ -486,7 +505,7 @@ class AutoServiceRoutersComponent {
|
|
|
486
505
|
}
|
|
487
506
|
}
|
|
488
507
|
async saveRouter() {
|
|
489
|
-
if (!this.routerForm.page_id || this.hierarchyGap || this.savingRouter)
|
|
508
|
+
if (!this.routerForm.page_id || this.hierarchyGap || this.savingRouter || (!this.editingRouterId && this.newId.invalid))
|
|
490
509
|
return;
|
|
491
510
|
const body = {
|
|
492
511
|
page_id: this.routerForm.page_id,
|
|
@@ -507,7 +526,7 @@ class AutoServiceRoutersComponent {
|
|
|
507
526
|
await this.service.updateRouter(this.clientId, this.editingRouterId, body);
|
|
508
527
|
}
|
|
509
528
|
else {
|
|
510
|
-
await this.service.createRouter(this.clientId, body);
|
|
529
|
+
await this.service.createRouter(this.clientId, { ...optionalIdBody('router_id', this.newId.value), ...body });
|
|
511
530
|
}
|
|
512
531
|
}
|
|
513
532
|
catch (err) {
|
|
@@ -536,14 +555,15 @@ class AutoServiceRoutersComponent {
|
|
|
536
555
|
void this.deleteRouter(e.row.id);
|
|
537
556
|
}
|
|
538
557
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceRoutersComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
539
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceRoutersComponent, isStandalone: true, selector: "spine-auto-service-routers", inputs: { clientId: "clientId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"routers\"\n [rowId]=\"rowId\"\n [caption]=\"text.routersCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noRouters\"\n>\n <hm-button dataGridActions emphasis=\"medium\" icon=\"sort-vertical\" [disabled]=\"!routers.length\" (clicked)=\"showReorder = true\">{{ text.reorder }}</hm-button>\n <hm-button dataGridActions icon=\"plus\" [disabled]=\"!routes.length\" (clicked)=\"openCreateRouter()\">{{ text.newRouter }}</hm-button>\n <ng-template hmCell=\"page\" let-r>\n <span class=\"name-cell\">\n {{ routeName(r.page_id) }}\n <hm-tag *ngIf=\"r.templated\" [name]=\"text.templateTag\" color=\"info\" [title]=\"text.templateLocked\" />\n </span>\n </ng-template>\n <ng-template hmCell=\"is_private\" let-r>\n <hm-tag [name]=\"r.is_private ? text.private : text.public\" [color]=\"r.is_private ? 'warning' : 'success'\" />\n </ng-template>\n <ng-template hmCell=\"allowed_type_ids\" let-r>\n <span *ngIf=\"!r.allowed_type_ids?.length; else badges\" class=\"muted\">{{ text.anyBadge }}</span>\n <ng-template #badges>\n <span class=\"name-cell\">\n <hm-tag *ngFor=\"let name of allowedTypeNames(r.allowed_type_ids)\" [name]=\"name\" color=\"info\" />\n </span>\n </ng-template>\n </ng-template>\n <ng-template hmCell=\"built_path\" let-r>\n <code>{{ r.built_path }}</code>\n </ng-template>\n</hm-data-grid>\n\n<!-- Modal: ordem dos itens no menu do app (vale tamb\u00E9m para roteadores de template) -->\n<spine-auto-service-routers-reorder [clientId]=\"clientId\" [open]=\"showReorder\" (openChange)=\"showReorder = $event\" (saved)=\"load()\" />\n\n<!-- Modal: criar/editar roteador -->\n<hm-modal [open]=\"showRouterModal\" (openChange)=\"showRouterModal = $event\" [heading]=\"editingRouterId ? text.editRouter : text.newRouter\" size=\"large\" (closed)=\"showRouterModal = false\">\n <div class=\"form-stack\">\n <hm-alert *ngIf=\"routerError\" variant=\"error\">{{ routerError }}</hm-alert>\n <hm-combobox [label]=\"text.page\" [options]=\"routeOptions\" [value]=\"routerForm.page_id\" (valueChange)=\"routerForm.page_id = $event\"></hm-combobox>\n <hm-textarea [label]=\"text.routerDescription\" [rows]=\"2\" [hint]=\"text.routerDescriptionHint\" [(ngModel)]=\"routerForm.description\" />\n\n <hm-divider [label]=\"text.hierarchy\" />\n <p class=\"hierarchy-hint muted\">{{ text.hierarchyHint }}</p>\n\n <!-- De cima para baixo: cada n\u00EDvel s\u00F3 abre com o de cima escolhido; limpar um n\u00EDvel limpa os de baixo. -->\n <hm-combobox *ngFor=\"let level of hierarchyLevels\" [label]=\"levelLabel(level)\" [options]=\"routeOptions\" [clearable]=\"true\"\n [disabled]=\"levelLocked(level)\" [value]=\"routerForm[level]\" (valueChange)=\"setLevel(level, $event)\"></hm-combobox>\n <hm-alert *ngIf=\"hierarchyGap\" variant=\"warning\">{{ text.routerErrors.hierarchyGap }}</hm-alert>\n\n <hm-divider />\n <hm-checkbox [(ngModel)]=\"routerForm.is_private\" [label]=\"text.privateHint\" />\n <!-- Vazio = qualquer crach\u00E1 (mesma regra do modal de roteador do argos-admin). -->\n <hm-combobox-multi [label]=\"text.colAllowedBadges\" [options]=\"groupTypeOptions\" [placeholder]=\"text.anyBadge\"\n [hint]=\"text.allowedBadgesHint\" [visibleChipsLimit]=\"null\" [selected]=\"routerForm.allowed_type_ids\"\n (selectedChange)=\"routerForm.allowed_type_ids = [...$event]; routerError = null\" />\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"showRouterModal = false\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!routerForm.page_id || hierarchyGap\" [loading]=\"savingRouter\" (clicked)=\"saveRouter()\">\n {{ editingRouterId ? text.save : text.create }}\n </hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}.name-cell{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}.hierarchy-hint{margin:0;font-size:var(--hm-font-size-sm)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: AlertComponent, selector: "hm-alert", inputs: ["variant", "appearance", "heading", "closable", "size", "showIcon", "link", "linkLabel", "linkTarget", "dismissKey", "duration"], outputs: ["closed"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "busy", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: CheckboxComponent, selector: "hm-checkbox", inputs: ["label", "labelHidden", "checked", "indeterminate"], outputs: ["checkedChange"] }, { kind: "component", type: ComboboxComponent, selector: "hm-combobox", inputs: ["label", "options", "value", "placeholder", "icon", "hint", "help", "size", "labelHidden", "clearable", "requiredManual", "loading", "allowCustomValue"], outputs: ["valueChange"] }, { kind: "component", type: ComboboxMultiComponent, selector: "hm-combobox-multi", inputs: ["label", "options", "selected", "extraOptions", "unknownLabel", "placeholder", "hint", "help", "max", "visibleChipsLimit"], outputs: ["selectedChange"] }, { kind: "component", type: DividerComponent, selector: "hm-divider", inputs: ["orientation", "label", "labelAlign", "emphasis", "thickness", "spacing", "decorative"] }, { kind: "component", type: ModalComponent, selector: "hm-modal", inputs: ["open", "heading", "size", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: DataGridComponent, selector: "hm-data-grid", inputs: ["columns", "rows", "rowId", "caption", "rowActions", "loading", "error", "emptyMessage", "noResultsMessage", "filterable", "paginated", "pageState", "pagination", "totalItems", "sort", "selectable", "selectionMode", "selection", "rowSelectable", "rowSelectableReason", "rowDetailDisabled", "rowDetailHidden", "virtual", "rowHeight", "pinnedColumns", "columnState", "pageSizes", "fillHeight", "maxHeight", "bordered", "rowState", "rowClickable", "remoteSearch", "remoteSort", "itemsLabel", "pageSizeLabel", "exportable", "exportFileName", "groupBy", "aggregates", "aggregateFormatter", "persistKey", "persistStorage", "advancedFilter", "filterQuery", "columnManager", "columnOrder", "searchTerm"], outputs: ["pageStateChange", "sortChange", "selectionChange", "pinnedColumnsChange", "columnStateChange", "actionTriggered", "detailToggled", "rowClicked", "clearFiltersRequested", "filteredChange", "searchTermChanged", "groupByChange", "filterQueryChange", "columnOrderChange", "searchTermChange", "detailPaneToggled"] }, { kind: "directive", type: DataGridCellDirective, selector: "ng-template[hmCell]", inputs: ["hmCell"] }, { kind: "component", type: TagComponent, selector: "hm-tag", inputs: ["name", "color", "compact"] }, { kind: "component", type: TextareaComponent, selector: "hm-textarea", inputs: ["value", "label", "hint", "help", "placeholder", "maxLength", "rows", "autoGrow", "labelHidden", "loading", "maxRows", "submitKey"], outputs: ["valueChange", "submitted"] }, { kind: "component", type: AutoServiceRoutersReorderComponent, selector: "spine-auto-service-routers-reorder", inputs: ["clientId", "open"], outputs: ["openChange", "saved"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
558
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: AutoServiceRoutersComponent, isStandalone: true, selector: "spine-auto-service-routers", inputs: { clientId: "clientId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"routers\"\n [rowId]=\"rowId\"\n [caption]=\"text.routersCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noRouters\"\n>\n <hm-button dataGridActions emphasis=\"medium\" icon=\"sort-vertical\" [disabled]=\"!routers.length\" (clicked)=\"showReorder = true\">{{ text.reorder }}</hm-button>\n <hm-button dataGridActions icon=\"plus\" [disabled]=\"!routes.length\" (clicked)=\"openCreateRouter()\">{{ text.newRouter }}</hm-button>\n <ng-template hmCell=\"page\" let-r>\n <span class=\"name-cell\">\n {{ routeName(r.page_id) }}\n <hm-tag *ngIf=\"r.templated\" [name]=\"text.templateTag\" color=\"info\" [title]=\"text.templateLocked\" />\n </span>\n </ng-template>\n <ng-template hmCell=\"is_private\" let-r>\n <hm-tag [name]=\"r.is_private ? text.private : text.public\" [color]=\"r.is_private ? 'warning' : 'success'\" />\n </ng-template>\n <ng-template hmCell=\"allowed_type_ids\" let-r>\n <span *ngIf=\"!r.allowed_type_ids?.length; else badges\" class=\"muted\">{{ text.anyBadge }}</span>\n <ng-template #badges>\n <span class=\"name-cell\">\n <hm-tag *ngFor=\"let name of allowedTypeNames(r.allowed_type_ids)\" [name]=\"name\" color=\"info\" />\n </span>\n </ng-template>\n </ng-template>\n <ng-template hmCell=\"built_path\" let-r>\n <code>{{ r.built_path }}</code>\n </ng-template>\n <!-- UUID do roteador: s\u00F3 o bot\u00E3o de copiar (para criar o mesmo roteador com o mesmo id no outro ambiente). -->\n <ng-template hmCell=\"id\" let-r>\n <hm-copy-button [value]=\"r.id\" [label]=\"copyIdLabel(r)\" [copiedLabel]=\"text.idCopied\" />\n </ng-template>\n</hm-data-grid>\n\n<!-- Modal: ordem dos itens no menu do app (vale tamb\u00E9m para roteadores de template) -->\n<spine-auto-service-routers-reorder [clientId]=\"clientId\" [open]=\"showReorder\" (openChange)=\"showReorder = $event\" (saved)=\"load()\" />\n\n<!-- Modal: criar/editar roteador -->\n<hm-modal [open]=\"showRouterModal\" (openChange)=\"showRouterModal = $event\" [heading]=\"editingRouterId ? text.editRouter : text.newRouter\" size=\"large\" (closed)=\"showRouterModal = false\">\n <div class=\"form-stack\">\n <hm-alert *ngIf=\"routerError\" variant=\"error\">{{ routerError }}</hm-alert>\n @if (!editingRouterId) {\n <hm-input [formControl]=\"newId\" [label]=\"text.optionalId\" [placeholder]=\"text.optionalIdPlaceholder\" [hint]=\"text.optionalIdHint\" [messages]=\"idMessages()\" />\n }\n <hm-combobox [label]=\"text.page\" [options]=\"routeOptions\" [value]=\"routerForm.page_id\" (valueChange)=\"routerForm.page_id = $event\"></hm-combobox>\n <hm-textarea [label]=\"text.routerDescription\" [rows]=\"2\" [hint]=\"text.routerDescriptionHint\" [(ngModel)]=\"routerForm.description\" />\n\n <hm-divider [label]=\"text.hierarchy\" />\n <p class=\"hierarchy-hint muted\">{{ text.hierarchyHint }}</p>\n\n <!-- De cima para baixo: cada n\u00EDvel s\u00F3 abre com o de cima escolhido; limpar um n\u00EDvel limpa os de baixo. -->\n <hm-combobox *ngFor=\"let level of hierarchyLevels\" [label]=\"levelLabel(level)\" [options]=\"routeOptions\" [clearable]=\"true\"\n [disabled]=\"levelLocked(level)\" [value]=\"routerForm[level]\" (valueChange)=\"setLevel(level, $event)\"></hm-combobox>\n <hm-alert *ngIf=\"hierarchyGap\" variant=\"warning\">{{ text.routerErrors.hierarchyGap }}</hm-alert>\n\n <hm-divider />\n <hm-checkbox [(ngModel)]=\"routerForm.is_private\" [label]=\"text.privateHint\" />\n <!-- Vazio = qualquer crach\u00E1 (mesma regra do modal de roteador do argos-admin). -->\n <hm-combobox-multi [label]=\"text.colAllowedBadges\" [options]=\"groupTypeOptions\" [placeholder]=\"text.anyBadge\"\n [hint]=\"text.allowedBadgesHint\" [visibleChipsLimit]=\"null\" [selected]=\"routerForm.allowed_type_ids\"\n (selectedChange)=\"routerForm.allowed_type_ids = [...$event]; routerError = null\" />\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"showRouterModal = false\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!routerForm.page_id || hierarchyGap || (!editingRouterId && newId.invalid)\" [loading]=\"savingRouter\" (clicked)=\"saveRouter()\">\n {{ editingRouterId ? text.save : text.create }}\n </hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}.name-cell{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}.hierarchy-hint{margin:0;font-size:var(--hm-font-size-sm)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: AlertComponent, selector: "hm-alert", inputs: ["variant", "appearance", "heading", "closable", "size", "showIcon", "link", "linkLabel", "linkTarget", "dismissKey", "duration"], outputs: ["closed"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "busy", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: CheckboxComponent, selector: "hm-checkbox", inputs: ["label", "labelHidden", "checked", "indeterminate"], outputs: ["checkedChange"] }, { kind: "component", type: ComboboxComponent, selector: "hm-combobox", inputs: ["label", "options", "value", "placeholder", "icon", "hint", "help", "size", "labelHidden", "clearable", "requiredManual", "loading", "allowCustomValue"], outputs: ["valueChange"] }, { kind: "component", type: ComboboxMultiComponent, selector: "hm-combobox-multi", inputs: ["label", "options", "selected", "extraOptions", "unknownLabel", "placeholder", "hint", "help", "max", "visibleChipsLimit"], outputs: ["selectedChange"] }, { kind: "component", type: DividerComponent, selector: "hm-divider", inputs: ["orientation", "label", "labelAlign", "emphasis", "thickness", "spacing", "decorative"] }, { kind: "component", type: InputComponent, selector: "hm-input", inputs: ["value", "label", "type", "placeholder", "icon", "labelHidden", "hint", "prefix", "suffix", "prefixIcon", "mask", "maskValue", "min", "max", "step", "stepButtons", "maxLength", "autocomplete", "inputMode"], outputs: ["valueChange"] }, { kind: "component", type: ModalComponent, selector: "hm-modal", inputs: ["open", "heading", "size", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: DataGridComponent, selector: "hm-data-grid", inputs: ["columns", "rows", "rowId", "caption", "rowActions", "loading", "error", "emptyMessage", "noResultsMessage", "filterable", "paginated", "pageState", "pagination", "totalItems", "sort", "selectable", "selectionMode", "selection", "rowSelectable", "rowSelectableReason", "rowDetailDisabled", "rowDetailHidden", "virtual", "rowHeight", "pinnedColumns", "columnState", "pageSizes", "fillHeight", "maxHeight", "bordered", "rowState", "rowClickable", "remoteSearch", "remoteSort", "itemsLabel", "pageSizeLabel", "exportable", "exportFileName", "groupBy", "aggregates", "aggregateFormatter", "persistKey", "persistStorage", "advancedFilter", "filterQuery", "columnManager", "columnOrder", "searchTerm"], outputs: ["pageStateChange", "sortChange", "selectionChange", "pinnedColumnsChange", "columnStateChange", "actionTriggered", "detailToggled", "rowClicked", "clearFiltersRequested", "filteredChange", "searchTermChanged", "groupByChange", "filterQueryChange", "columnOrderChange", "searchTermChange", "detailPaneToggled"] }, { kind: "directive", type: DataGridCellDirective, selector: "ng-template[hmCell]", inputs: ["hmCell"] }, { kind: "component", type: TagComponent, selector: "hm-tag", inputs: ["name", "color", "compact"] }, { kind: "component", type: TextareaComponent, selector: "hm-textarea", inputs: ["value", "label", "hint", "help", "placeholder", "maxLength", "rows", "autoGrow", "labelHidden", "loading", "maxRows", "submitKey"], outputs: ["valueChange", "submitted"] }, { kind: "component", type: AutoServiceRoutersReorderComponent, selector: "spine-auto-service-routers-reorder", inputs: ["clientId", "open"], outputs: ["openChange", "saved"] }, { kind: "component", type: CopyButtonComponent, selector: "hm-copy-button", inputs: ["value", "label", "copiedLabel", "variant", "size", "disabled", "feedbackDuration"], outputs: ["copied", "copyFailed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
540
559
|
}
|
|
541
560
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceRoutersComponent, decorators: [{
|
|
542
561
|
type: Component,
|
|
543
562
|
args: [{ selector: 'spine-auto-service-routers', standalone: true, imports: [
|
|
544
|
-
CommonModule, FormsModule, AlertComponent, ButtonComponent, CheckboxComponent, ComboboxComponent, ComboboxMultiComponent, DividerComponent,
|
|
545
|
-
DataGridComponent, DataGridCellDirective, TagComponent, TextareaComponent, AutoServiceRoutersReorderComponent,
|
|
546
|
-
|
|
563
|
+
CommonModule, FormsModule, ReactiveFormsModule, AlertComponent, ButtonComponent, CheckboxComponent, ComboboxComponent, ComboboxMultiComponent, DividerComponent,
|
|
564
|
+
InputComponent, ModalComponent, DataGridComponent, DataGridCellDirective, TagComponent, TextareaComponent, AutoServiceRoutersReorderComponent,
|
|
565
|
+
CopyButtonComponent,
|
|
566
|
+
], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"routers\"\n [rowId]=\"rowId\"\n [caption]=\"text.routersCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noRouters\"\n>\n <hm-button dataGridActions emphasis=\"medium\" icon=\"sort-vertical\" [disabled]=\"!routers.length\" (clicked)=\"showReorder = true\">{{ text.reorder }}</hm-button>\n <hm-button dataGridActions icon=\"plus\" [disabled]=\"!routes.length\" (clicked)=\"openCreateRouter()\">{{ text.newRouter }}</hm-button>\n <ng-template hmCell=\"page\" let-r>\n <span class=\"name-cell\">\n {{ routeName(r.page_id) }}\n <hm-tag *ngIf=\"r.templated\" [name]=\"text.templateTag\" color=\"info\" [title]=\"text.templateLocked\" />\n </span>\n </ng-template>\n <ng-template hmCell=\"is_private\" let-r>\n <hm-tag [name]=\"r.is_private ? text.private : text.public\" [color]=\"r.is_private ? 'warning' : 'success'\" />\n </ng-template>\n <ng-template hmCell=\"allowed_type_ids\" let-r>\n <span *ngIf=\"!r.allowed_type_ids?.length; else badges\" class=\"muted\">{{ text.anyBadge }}</span>\n <ng-template #badges>\n <span class=\"name-cell\">\n <hm-tag *ngFor=\"let name of allowedTypeNames(r.allowed_type_ids)\" [name]=\"name\" color=\"info\" />\n </span>\n </ng-template>\n </ng-template>\n <ng-template hmCell=\"built_path\" let-r>\n <code>{{ r.built_path }}</code>\n </ng-template>\n <!-- UUID do roteador: s\u00F3 o bot\u00E3o de copiar (para criar o mesmo roteador com o mesmo id no outro ambiente). -->\n <ng-template hmCell=\"id\" let-r>\n <hm-copy-button [value]=\"r.id\" [label]=\"copyIdLabel(r)\" [copiedLabel]=\"text.idCopied\" />\n </ng-template>\n</hm-data-grid>\n\n<!-- Modal: ordem dos itens no menu do app (vale tamb\u00E9m para roteadores de template) -->\n<spine-auto-service-routers-reorder [clientId]=\"clientId\" [open]=\"showReorder\" (openChange)=\"showReorder = $event\" (saved)=\"load()\" />\n\n<!-- Modal: criar/editar roteador -->\n<hm-modal [open]=\"showRouterModal\" (openChange)=\"showRouterModal = $event\" [heading]=\"editingRouterId ? text.editRouter : text.newRouter\" size=\"large\" (closed)=\"showRouterModal = false\">\n <div class=\"form-stack\">\n <hm-alert *ngIf=\"routerError\" variant=\"error\">{{ routerError }}</hm-alert>\n @if (!editingRouterId) {\n <hm-input [formControl]=\"newId\" [label]=\"text.optionalId\" [placeholder]=\"text.optionalIdPlaceholder\" [hint]=\"text.optionalIdHint\" [messages]=\"idMessages()\" />\n }\n <hm-combobox [label]=\"text.page\" [options]=\"routeOptions\" [value]=\"routerForm.page_id\" (valueChange)=\"routerForm.page_id = $event\"></hm-combobox>\n <hm-textarea [label]=\"text.routerDescription\" [rows]=\"2\" [hint]=\"text.routerDescriptionHint\" [(ngModel)]=\"routerForm.description\" />\n\n <hm-divider [label]=\"text.hierarchy\" />\n <p class=\"hierarchy-hint muted\">{{ text.hierarchyHint }}</p>\n\n <!-- De cima para baixo: cada n\u00EDvel s\u00F3 abre com o de cima escolhido; limpar um n\u00EDvel limpa os de baixo. -->\n <hm-combobox *ngFor=\"let level of hierarchyLevels\" [label]=\"levelLabel(level)\" [options]=\"routeOptions\" [clearable]=\"true\"\n [disabled]=\"levelLocked(level)\" [value]=\"routerForm[level]\" (valueChange)=\"setLevel(level, $event)\"></hm-combobox>\n <hm-alert *ngIf=\"hierarchyGap\" variant=\"warning\">{{ text.routerErrors.hierarchyGap }}</hm-alert>\n\n <hm-divider />\n <hm-checkbox [(ngModel)]=\"routerForm.is_private\" [label]=\"text.privateHint\" />\n <!-- Vazio = qualquer crach\u00E1 (mesma regra do modal de roteador do argos-admin). -->\n <hm-combobox-multi [label]=\"text.colAllowedBadges\" [options]=\"groupTypeOptions\" [placeholder]=\"text.anyBadge\"\n [hint]=\"text.allowedBadgesHint\" [visibleChipsLimit]=\"null\" [selected]=\"routerForm.allowed_type_ids\"\n (selectedChange)=\"routerForm.allowed_type_ids = [...$event]; routerError = null\" />\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"showRouterModal = false\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!routerForm.page_id || hierarchyGap || (!editingRouterId && newId.invalid)\" [loading]=\"savingRouter\" (clicked)=\"saveRouter()\">\n {{ editingRouterId ? text.save : text.create }}\n </hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}.name-cell{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}.hierarchy-hint{margin:0;font-size:var(--hm-font-size-sm)}\n"] }]
|
|
547
567
|
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
548
568
|
type: Input
|
|
549
569
|
}] } });
|
|
@@ -603,62 +623,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
603
623
|
}] } });
|
|
604
624
|
|
|
605
625
|
/**
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
* desmarca um guard); pasta = só rótulo, sem estado próprio.
|
|
626
|
+
* "Gerenciar rotas" de um acesso do client: as telas privadas que o grupo pode receber (roteadores sem restrição de
|
|
627
|
+
* crachá ou que aceitam o crachá do grupo), em `hm-tree` pelos níveis do menu, como no painel do Argos. No topo, só o
|
|
628
|
+
* filtro; a seleção guarda só folhas (páginas) e a diferença vira guard criado ou removido ao confirmar.
|
|
610
629
|
*/
|
|
611
|
-
class RouteTreeNodeComponent {
|
|
612
|
-
constructor() {
|
|
613
|
-
this.selectedChange = new EventEmitter();
|
|
614
|
-
}
|
|
615
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: RouteTreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
616
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: RouteTreeNodeComponent, isStandalone: true, selector: "spine-route-tree-node", inputs: { node: "node" }, outputs: { selectedChange: "selectedChange" }, ngImport: i0, template: `
|
|
617
|
-
<li class="tree-node" [class.tree-node--folder]="node.isFolder">
|
|
618
|
-
<label *ngIf="!node.isFolder" class="tree-node__leaf">
|
|
619
|
-
<input type="checkbox" class="hm-check" [(ngModel)]="node.selected" (ngModelChange)="selectedChange.emit()" />
|
|
620
|
-
<hm-icon shape="router" class="tree-node__icon"></hm-icon>
|
|
621
|
-
<span>{{ node.name }}</span>
|
|
622
|
-
</label>
|
|
623
|
-
|
|
624
|
-
<div *ngIf="node.isFolder" class="tree-node__folder">
|
|
625
|
-
<hm-icon shape="filter-grid" class="tree-node__icon"></hm-icon>
|
|
626
|
-
<span>{{ node.name }}</span>
|
|
627
|
-
</div>
|
|
628
|
-
|
|
629
|
-
<ul class="tree-node__children" *ngIf="node.children.length">
|
|
630
|
-
<spine-route-tree-node *ngFor="let child of node.children" [node]="child" (selectedChange)="selectedChange.emit()"></spine-route-tree-node>
|
|
631
|
-
</ul>
|
|
632
|
-
</li>
|
|
633
|
-
`, isInline: true, styles: [".tree-node{list-style:none}.tree-node__children{list-style:none;margin:0;padding-inline-start:var(--hm-space-lg)}.tree-node__leaf,.tree-node__folder{display:flex;align-items:center;gap:var(--hm-space-xs);padding:var(--hm-space-micro) 0;font-size:var(--hm-font-size-sm)}.tree-node__leaf{cursor:pointer}.tree-node__folder{font-weight:var(--hm-font-weight-semibold);color:var(--hm-muted)}.tree-node__icon{flex:0 0 auto;color:var(--hm-action)}\n"], dependencies: [{ kind: "component", type: RouteTreeNodeComponent, selector: "spine-route-tree-node", inputs: ["node"], outputs: ["selectedChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
634
|
-
}
|
|
635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: RouteTreeNodeComponent, decorators: [{
|
|
636
|
-
type: Component,
|
|
637
|
-
args: [{ selector: 'spine-route-tree-node', standalone: true, imports: [CommonModule, FormsModule, IconComponent, RouteTreeNodeComponent], changeDetection: ChangeDetectionStrategy.Eager, template: `
|
|
638
|
-
<li class="tree-node" [class.tree-node--folder]="node.isFolder">
|
|
639
|
-
<label *ngIf="!node.isFolder" class="tree-node__leaf">
|
|
640
|
-
<input type="checkbox" class="hm-check" [(ngModel)]="node.selected" (ngModelChange)="selectedChange.emit()" />
|
|
641
|
-
<hm-icon shape="router" class="tree-node__icon"></hm-icon>
|
|
642
|
-
<span>{{ node.name }}</span>
|
|
643
|
-
</label>
|
|
644
|
-
|
|
645
|
-
<div *ngIf="node.isFolder" class="tree-node__folder">
|
|
646
|
-
<hm-icon shape="filter-grid" class="tree-node__icon"></hm-icon>
|
|
647
|
-
<span>{{ node.name }}</span>
|
|
648
|
-
</div>
|
|
649
|
-
|
|
650
|
-
<ul class="tree-node__children" *ngIf="node.children.length">
|
|
651
|
-
<spine-route-tree-node *ngFor="let child of node.children" [node]="child" (selectedChange)="selectedChange.emit()"></spine-route-tree-node>
|
|
652
|
-
</ul>
|
|
653
|
-
</li>
|
|
654
|
-
`, styles: [".tree-node{list-style:none}.tree-node__children{list-style:none;margin:0;padding-inline-start:var(--hm-space-lg)}.tree-node__leaf,.tree-node__folder{display:flex;align-items:center;gap:var(--hm-space-xs);padding:var(--hm-space-micro) 0;font-size:var(--hm-font-size-sm)}.tree-node__leaf{cursor:pointer}.tree-node__folder{font-weight:var(--hm-font-weight-semibold);color:var(--hm-muted)}.tree-node__icon{flex:0 0 auto;color:var(--hm-action)}\n"] }]
|
|
655
|
-
}], propDecorators: { node: [{
|
|
656
|
-
type: Input,
|
|
657
|
-
args: [{ required: true }]
|
|
658
|
-
}], selectedChange: [{
|
|
659
|
-
type: Output
|
|
660
|
-
}] } });
|
|
661
|
-
|
|
662
630
|
class AutoServiceAccessGuardsComponent {
|
|
663
631
|
constructor(service) {
|
|
664
632
|
this.service = service;
|
|
@@ -666,8 +634,6 @@ class AutoServiceAccessGuardsComponent {
|
|
|
666
634
|
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
667
635
|
this.cdr = inject(ChangeDetectorRef);
|
|
668
636
|
this.fmt = formatMessage;
|
|
669
|
-
/** Para `[innerHTML]`: escapa os parâmetros (o tipo de grupo vem do servidor). */
|
|
670
|
-
this.fmtHtml = formatMessageHtml;
|
|
671
637
|
this.clientId = '';
|
|
672
638
|
this.access = null;
|
|
673
639
|
this.open = false;
|
|
@@ -676,9 +642,20 @@ class AutoServiceAccessGuardsComponent {
|
|
|
676
642
|
this.availableRoutes = [];
|
|
677
643
|
this.clientPrivateRouters = [];
|
|
678
644
|
this.guards = [];
|
|
679
|
-
this.tree = [];
|
|
680
645
|
this.loading = false;
|
|
681
646
|
this.saving = false;
|
|
647
|
+
this.tree = signal([], ...(ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []));
|
|
648
|
+
/** Termo do filtro no topo do drawer; a árvore mostrada é `visibleTree`. */
|
|
649
|
+
this.filter = signal('', ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
650
|
+
this.visibleTree = computed(() => filterRouteTree(this.tree(), this.filter()), ...(ngDevMode ? [{ debugName: "visibleTree" }] : /* istanbul ignore next */ []));
|
|
651
|
+
this.treeNodes = computed(() => this.visibleTree().map(n => toTreeNode(n)), ...(ngDevMode ? [{ debugName: "treeNodes" }] : /* istanbul ignore next */ []));
|
|
652
|
+
/** Só folhas (páginas): o que tem guard agora na árvore. */
|
|
653
|
+
this.selectedIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
|
|
654
|
+
this.expandedIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
|
|
655
|
+
this.originalSelectedIds = new Set();
|
|
656
|
+
this.nodesByKey = computed(() => indexByKey(this.tree()), ...(ngDevMode ? [{ debugName: "nodesByKey" }] : /* istanbul ignore next */ []));
|
|
657
|
+
/** Nós visíveis por chave: marcar uma pasta com o filtro ativo só mexe nas páginas que aparecem. */
|
|
658
|
+
this.visibleByKey = computed(() => indexByKey(this.visibleTree()), ...(ngDevMode ? [{ debugName: "visibleByKey" }] : /* istanbul ignore next */ []));
|
|
682
659
|
this.levels = ['header_id', 'navigation_id', 'menu_id', 'item_id', 'submenu_id'];
|
|
683
660
|
}
|
|
684
661
|
ngOnChanges(changes) { if (changes['open'] && this.open) {
|
|
@@ -728,19 +705,57 @@ class AutoServiceAccessGuardsComponent {
|
|
|
728
705
|
routerId: router.id, guardId: guard?.guard_id, selected: !!guard, children: [],
|
|
729
706
|
});
|
|
730
707
|
}
|
|
731
|
-
this.tree
|
|
708
|
+
this.tree.set(root);
|
|
709
|
+
const original = new Set(root.flatMap(collectLeaves).filter(l => l.selected).map(l => l.key));
|
|
710
|
+
this.originalSelectedIds = original;
|
|
711
|
+
this.selectedIds.set(new Set(original));
|
|
712
|
+
this.expandedIds.set(new Set());
|
|
713
|
+
this.filter.set('');
|
|
714
|
+
}
|
|
715
|
+
/** Filtrar abre as pastas que sobraram, para as telas encontradas aparecerem sem clique. */
|
|
716
|
+
onFilterChange(term) {
|
|
717
|
+
this.filter.set(term);
|
|
718
|
+
if (!term.trim())
|
|
719
|
+
return;
|
|
720
|
+
this.expandedIds.update(current => new Set([...current, ...folderKeys(this.visibleTree())]));
|
|
721
|
+
}
|
|
722
|
+
/** Com caixas o hm-tree emite folhas (ou a pasta sem folhas): pasta vira as páginas dela que estão à vista. */
|
|
723
|
+
onTreeChanged(changes) {
|
|
724
|
+
this.selectedIds.update(current => {
|
|
725
|
+
const next = new Set(current);
|
|
726
|
+
for (const change of changes) {
|
|
727
|
+
const node = this.visibleByKey().get(change.id);
|
|
728
|
+
if (!node)
|
|
729
|
+
continue;
|
|
730
|
+
for (const leaf of collectLeaves(node)) {
|
|
731
|
+
if (change.selected)
|
|
732
|
+
next.add(leaf.key);
|
|
733
|
+
else
|
|
734
|
+
next.delete(leaf.key);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return next;
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
get hasChanges() {
|
|
741
|
+
const selected = this.selectedIds();
|
|
742
|
+
if (selected.size !== this.originalSelectedIds.size)
|
|
743
|
+
return true;
|
|
744
|
+
for (const id of selected)
|
|
745
|
+
if (!this.originalSelectedIds.has(id))
|
|
746
|
+
return true;
|
|
747
|
+
return false;
|
|
732
748
|
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
return node.
|
|
749
|
+
/** Folha (página) pela chave; `undefined` para pasta ou chave desconhecida. */
|
|
750
|
+
leafByKey(key) {
|
|
751
|
+
const node = this.nodesByKey().get(key);
|
|
752
|
+
return node && !node.isFolder ? node : undefined;
|
|
737
753
|
}
|
|
738
|
-
get allLeaves() { return this.tree.flatMap(node => this.collectLeaves(node)); }
|
|
739
|
-
get hasChanges() { return this.allLeaves.some(leaf => !!leaf.selected !== !!leaf.guardId); }
|
|
740
754
|
async confirm() {
|
|
741
|
-
const
|
|
742
|
-
const
|
|
743
|
-
const
|
|
755
|
+
const selected = this.selectedIds();
|
|
756
|
+
const isLeaf = (l) => !!l;
|
|
757
|
+
const toAdd = [...selected].filter(id => !this.originalSelectedIds.has(id)).map(id => this.leafByKey(id)).filter(isLeaf);
|
|
758
|
+
const toRemove = [...this.originalSelectedIds].filter(id => !selected.has(id)).map(id => this.leafByKey(id)).filter(isLeaf);
|
|
744
759
|
if (toAdd.length === 0 && toRemove.length === 0) {
|
|
745
760
|
this.close();
|
|
746
761
|
return;
|
|
@@ -761,11 +776,11 @@ class AutoServiceAccessGuardsComponent {
|
|
|
761
776
|
}
|
|
762
777
|
}
|
|
763
778
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAccessGuardsComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
764
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAccessGuardsComponent, isStandalone: true, selector: "spine-auto-service-access-guards", inputs: { clientId: "clientId", access: "access", open: "open" }, outputs: { openChange: "openChange" }, usesOnChanges: true, ngImport: i0, template: "<hm-drawer [open]=\"open\" (openChange)=\"open = $event\" [heading]=\"fmt(text.routesOf, { group: access?.group_name ?? '' })\" (closed)=\"close()\">\n <
|
|
779
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAccessGuardsComponent, isStandalone: true, selector: "spine-auto-service-access-guards", inputs: { clientId: "clientId", access: "access", open: "open" }, outputs: { openChange: "openChange" }, usesOnChanges: true, ngImport: i0, template: "<hm-drawer [open]=\"open\" (openChange)=\"open = $event\" [heading]=\"fmt(text.routesOf, { group: access?.group_name ?? '' })\" (closed)=\"close()\">\n <div *ngIf=\"loading\" class=\"loading-row\">\n <span>{{ text.loading }}</span>\n </div>\n\n <!-- Topo sem mensagens: s\u00F3 o filtro, com o mesmo visual da busca das grades. -->\n <hm-data-grid-action-bar *ngIf=\"!loading && tree().length\"\n [search]=\"filter()\" (searchChange)=\"onFilterChange($event)\"\n [placeholder]=\"text.filterRoutes\" [label]=\"text.filterRoutes\" />\n\n <hm-tree\n *ngIf=\"!loading && treeNodes().length\"\n [nodes]=\"treeNodes()\"\n [label]=\"text.routesTreeLabel\"\n [selected]=\"selectedIds()\"\n [(expanded)]=\"expandedIds\"\n (changed)=\"onTreeChanged($event)\"\n />\n\n <div class=\"empty-state\" *ngIf=\"!loading && tree().length > 0 && treeNodes().length === 0\">\n <hm-icon shape=\"search\" size=\"xl\"></hm-icon>\n <p>{{ fmt(text.noFilterMatch, { term: filter() }) }}</p>\n </div>\n\n <div class=\"empty-state\" *ngIf=\"!loading && tree().length === 0\">\n <hm-icon shape=\"filter-grid\" size=\"xl\"></hm-icon>\n <p>{{ text.noPrivateRoutes }}</p>\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"close()\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!hasChanges\" [loading]=\"saving\" (clicked)=\"confirm()\">{{ text.confirmChanges }}</hm-button>\n </ng-container>\n</hm-drawer>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}.loading-row{display:flex;justify-content:center;padding:var(--hm-space-xl);color:var(--hm-muted)}.empty-state{display:flex;flex-direction:column;align-items:center;gap:var(--hm-space-xs);padding:var(--hm-space-xl);color:var(--hm-muted);text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "busy", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: DataGridActionBarComponent, selector: "hm-data-grid-action-bar", inputs: ["search", "placeholder", "label"], outputs: ["searchChange"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: DrawerComponent, selector: "hm-drawer", inputs: ["open", "heading", "size", "position", "pinned", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: TreeComponent, selector: "hm-tree", inputs: ["nodes", "label", "emptyMessage", "selectable", "selectionMode", "selection", "selected", "expanded", "activeId", "loadChildren", "draggable", "canDrop", "nodeActions"], outputs: ["selectionChange", "expandedChange", "activeIdChange", "changed", "activated", "moved", "nodeAction"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
765
780
|
}
|
|
766
781
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAccessGuardsComponent, decorators: [{
|
|
767
782
|
type: Component,
|
|
768
|
-
args: [{ selector: 'spine-auto-service-access-guards', standalone: true, imports: [CommonModule, ButtonComponent, IconComponent, DrawerComponent,
|
|
783
|
+
args: [{ selector: 'spine-auto-service-access-guards', standalone: true, imports: [CommonModule, ButtonComponent, DataGridActionBarComponent, IconComponent, DrawerComponent, TreeComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-drawer [open]=\"open\" (openChange)=\"open = $event\" [heading]=\"fmt(text.routesOf, { group: access?.group_name ?? '' })\" (closed)=\"close()\">\n <div *ngIf=\"loading\" class=\"loading-row\">\n <span>{{ text.loading }}</span>\n </div>\n\n <!-- Topo sem mensagens: s\u00F3 o filtro, com o mesmo visual da busca das grades. -->\n <hm-data-grid-action-bar *ngIf=\"!loading && tree().length\"\n [search]=\"filter()\" (searchChange)=\"onFilterChange($event)\"\n [placeholder]=\"text.filterRoutes\" [label]=\"text.filterRoutes\" />\n\n <hm-tree\n *ngIf=\"!loading && treeNodes().length\"\n [nodes]=\"treeNodes()\"\n [label]=\"text.routesTreeLabel\"\n [selected]=\"selectedIds()\"\n [(expanded)]=\"expandedIds\"\n (changed)=\"onTreeChanged($event)\"\n />\n\n <div class=\"empty-state\" *ngIf=\"!loading && tree().length > 0 && treeNodes().length === 0\">\n <hm-icon shape=\"search\" size=\"xl\"></hm-icon>\n <p>{{ fmt(text.noFilterMatch, { term: filter() }) }}</p>\n </div>\n\n <div class=\"empty-state\" *ngIf=\"!loading && tree().length === 0\">\n <hm-icon shape=\"filter-grid\" size=\"xl\"></hm-icon>\n <p>{{ text.noPrivateRoutes }}</p>\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"close()\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!hasChanges\" [loading]=\"saving\" (clicked)=\"confirm()\">{{ text.confirmChanges }}</hm-button>\n </ng-container>\n</hm-drawer>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}.loading-row{display:flex;justify-content:center;padding:var(--hm-space-xl);color:var(--hm-muted)}.empty-state{display:flex;flex-direction:column;align-items:center;gap:var(--hm-space-xs);padding:var(--hm-space-xl);color:var(--hm-muted);text-align:center}\n"] }]
|
|
769
784
|
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
770
785
|
type: Input
|
|
771
786
|
}], access: [{
|
|
@@ -775,6 +790,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
775
790
|
}], openChange: [{
|
|
776
791
|
type: Output
|
|
777
792
|
}] } });
|
|
793
|
+
function toTreeNode(node) {
|
|
794
|
+
return {
|
|
795
|
+
id: node.key, label: node.name, leaf: !node.isFolder,
|
|
796
|
+
children: node.isFolder ? node.children.map(toTreeNode) : undefined,
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
function collectLeaves(node) {
|
|
800
|
+
return node.isFolder ? node.children.flatMap(collectLeaves) : [node];
|
|
801
|
+
}
|
|
802
|
+
function indexByKey(root) {
|
|
803
|
+
const map = new Map();
|
|
804
|
+
const walk = (nodes) => { for (const n of nodes) {
|
|
805
|
+
map.set(n.key, n);
|
|
806
|
+
walk(n.children);
|
|
807
|
+
} };
|
|
808
|
+
walk(root);
|
|
809
|
+
return map;
|
|
810
|
+
}
|
|
811
|
+
function folderKeys(root) {
|
|
812
|
+
return [...indexByKey(root).values()].filter(n => n.isFolder).map(n => n.key);
|
|
813
|
+
}
|
|
814
|
+
/** Minúsculo e sem acento: "operacao" casa com "Operação". */
|
|
815
|
+
function normalize(value) {
|
|
816
|
+
return (value ?? '').normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase();
|
|
817
|
+
}
|
|
818
|
+
/** A árvore só com as telas cujo nome casa com o termo; a pasta que casa pelo nome vem inteira. Termo vazio = tudo. */
|
|
819
|
+
function filterRouteTree(nodes, term) {
|
|
820
|
+
const needle = normalize(term.trim());
|
|
821
|
+
if (!needle)
|
|
822
|
+
return nodes;
|
|
823
|
+
const walk = (list) => list.flatMap((n) => {
|
|
824
|
+
if (n.isFolder) {
|
|
825
|
+
if (normalize(n.name).includes(needle))
|
|
826
|
+
return [n];
|
|
827
|
+
const children = walk(n.children);
|
|
828
|
+
return children.length ? [{ ...n, children }] : [];
|
|
829
|
+
}
|
|
830
|
+
return normalize(n.name).includes(needle) ? [n] : [];
|
|
831
|
+
});
|
|
832
|
+
return walk(nodes);
|
|
833
|
+
}
|
|
778
834
|
|
|
779
835
|
class AutoServiceAccessComponent {
|
|
780
836
|
constructor(service) {
|
|
@@ -793,12 +849,13 @@ class AutoServiceAccessComponent {
|
|
|
793
849
|
this.rowId = (a) => a.access_id;
|
|
794
850
|
this.columns = computed(() => [
|
|
795
851
|
{ key: 'group_name', title: this.text.colGroup, value: (a) => a.group_name, sortable: true },
|
|
796
|
-
{ key: 'group_type_name', title: this.text.
|
|
852
|
+
{ key: 'group_type_name', title: this.text.colType, value: (a) => a.group_type_name, sortable: true },
|
|
853
|
+
// Como no painel do Argos: "Gerenciar rotas" é um botão na linha, não um item do menu.
|
|
854
|
+
{ key: 'guards', title: this.text.colGuards, value: () => '' },
|
|
797
855
|
], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
798
856
|
this.rowActions = computed(() => [
|
|
799
|
-
{ id: 'guards', icon: 'shield', label: this.text.manageRoutes },
|
|
800
857
|
{
|
|
801
|
-
id: 'delete', icon: 'trash', label: this.text.remove, danger: true,
|
|
858
|
+
id: 'delete', icon: 'trash', label: this.text.remove, danger: true,
|
|
802
859
|
confirm: (a) => ({ heading: this.text.confirmRemoveAccessHeading, message: formatMessage(this.text.confirmRemoveAccess, { group: a.group_name }) }),
|
|
803
860
|
},
|
|
804
861
|
], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
|
|
@@ -842,17 +899,18 @@ class AutoServiceAccessComponent {
|
|
|
842
899
|
}
|
|
843
900
|
openGuards(access) { this.activeAccess = access; this.showGuards = true; }
|
|
844
901
|
onAction(e) {
|
|
845
|
-
if (e.action === 'guards')
|
|
846
|
-
this.openGuards(e.row);
|
|
847
902
|
if (e.action === 'delete')
|
|
848
903
|
void this.deleteAccess(e.row.access_id);
|
|
849
904
|
}
|
|
850
905
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAccessComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
851
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAccessComponent, isStandalone: true, selector: "spine-auto-service-access", inputs: { clientId: "clientId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"entries\"\n [rowId]=\"rowId\"\n [caption]=\"text.accessCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noAccess\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreate()\">{{ text.newAccess }}</hm-button>\n</hm-data-grid>\n\n<spine-auto-service-access-create\n [clientId]=\"clientId\"\n [availableGroups]=\"availableGroups\"\n [open]=\"showCreate\"\n (openChange)=\"showCreate = $event\"\n (created)=\"onCreated()\">\n</spine-auto-service-access-create>\n\n<spine-auto-service-access-guards\n *ngIf=\"activeAccess\"\n [clientId]=\"clientId\"\n [access]=\"activeAccess\"\n [open]=\"showGuards\"\n (openChange)=\"showGuards = $event\">\n</spine-auto-service-access-guards>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "busy", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: DataGridComponent, selector: "hm-data-grid", inputs: ["columns", "rows", "rowId", "caption", "rowActions", "loading", "error", "emptyMessage", "noResultsMessage", "filterable", "paginated", "pageState", "pagination", "totalItems", "sort", "selectable", "selectionMode", "selection", "rowSelectable", "rowSelectableReason", "rowDetailDisabled", "rowDetailHidden", "virtual", "rowHeight", "pinnedColumns", "columnState", "pageSizes", "fillHeight", "maxHeight", "bordered", "rowState", "rowClickable", "remoteSearch", "remoteSort", "itemsLabel", "pageSizeLabel", "exportable", "exportFileName", "groupBy", "aggregates", "aggregateFormatter", "persistKey", "persistStorage", "advancedFilter", "filterQuery", "columnManager", "columnOrder", "searchTerm"], outputs: ["pageStateChange", "sortChange", "selectionChange", "pinnedColumnsChange", "columnStateChange", "actionTriggered", "detailToggled", "rowClicked", "clearFiltersRequested", "filteredChange", "searchTermChanged", "groupByChange", "filterQueryChange", "columnOrderChange", "searchTermChange", "detailPaneToggled"] }, { kind: "component", type: AutoServiceAccessCreateComponent, selector: "spine-auto-service-access-create", inputs: ["clientId", "availableGroups", "open"], outputs: ["openChange", "created"] }, { kind: "component", type: AutoServiceAccessGuardsComponent, selector: "spine-auto-service-access-guards", inputs: ["clientId", "access", "open"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
906
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAccessComponent, isStandalone: true, selector: "spine-auto-service-access", inputs: { clientId: "clientId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"entries\"\n [rowId]=\"rowId\"\n [caption]=\"text.accessCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noAccess\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreate()\">{{ text.newAccess }}</hm-button>\n <ng-template hmCell=\"group_type_name\" let-a>\n <hm-tag [name]=\"a.group_type_name\" color=\"neutral\" />\n </ng-template>\n <ng-template hmCell=\"guards\" let-a>\n <hm-button emphasis=\"minimal\" icon=\"shield\" (clicked)=\"openGuards(a)\">{{ text.manageRoutes }}</hm-button>\n </ng-template>\n</hm-data-grid>\n\n<spine-auto-service-access-create\n [clientId]=\"clientId\"\n [availableGroups]=\"availableGroups\"\n [open]=\"showCreate\"\n (openChange)=\"showCreate = $event\"\n (created)=\"onCreated()\">\n</spine-auto-service-access-create>\n\n<spine-auto-service-access-guards\n *ngIf=\"activeAccess\"\n [clientId]=\"clientId\"\n [access]=\"activeAccess\"\n [open]=\"showGuards\"\n (openChange)=\"showGuards = $event\">\n</spine-auto-service-access-guards>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "busy", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: DataGridComponent, selector: "hm-data-grid", inputs: ["columns", "rows", "rowId", "caption", "rowActions", "loading", "error", "emptyMessage", "noResultsMessage", "filterable", "paginated", "pageState", "pagination", "totalItems", "sort", "selectable", "selectionMode", "selection", "rowSelectable", "rowSelectableReason", "rowDetailDisabled", "rowDetailHidden", "virtual", "rowHeight", "pinnedColumns", "columnState", "pageSizes", "fillHeight", "maxHeight", "bordered", "rowState", "rowClickable", "remoteSearch", "remoteSort", "itemsLabel", "pageSizeLabel", "exportable", "exportFileName", "groupBy", "aggregates", "aggregateFormatter", "persistKey", "persistStorage", "advancedFilter", "filterQuery", "columnManager", "columnOrder", "searchTerm"], outputs: ["pageStateChange", "sortChange", "selectionChange", "pinnedColumnsChange", "columnStateChange", "actionTriggered", "detailToggled", "rowClicked", "clearFiltersRequested", "filteredChange", "searchTermChanged", "groupByChange", "filterQueryChange", "columnOrderChange", "searchTermChange", "detailPaneToggled"] }, { kind: "directive", type: DataGridCellDirective, selector: "ng-template[hmCell]", inputs: ["hmCell"] }, { kind: "component", type: TagComponent, selector: "hm-tag", inputs: ["name", "color", "compact"] }, { kind: "component", type: AutoServiceAccessCreateComponent, selector: "spine-auto-service-access-create", inputs: ["clientId", "availableGroups", "open"], outputs: ["openChange", "created"] }, { kind: "component", type: AutoServiceAccessGuardsComponent, selector: "spine-auto-service-access-guards", inputs: ["clientId", "access", "open"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
852
907
|
}
|
|
853
908
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAccessComponent, decorators: [{
|
|
854
909
|
type: Component,
|
|
855
|
-
args: [{ selector: 'spine-auto-service-access', standalone: true, imports: [
|
|
910
|
+
args: [{ selector: 'spine-auto-service-access', standalone: true, imports: [
|
|
911
|
+
CommonModule, ButtonComponent, IconComponent, DataGridComponent, DataGridCellDirective, TagComponent,
|
|
912
|
+
AutoServiceAccessCreateComponent, AutoServiceAccessGuardsComponent,
|
|
913
|
+
], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"entries\"\n [rowId]=\"rowId\"\n [caption]=\"text.accessCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noAccess\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreate()\">{{ text.newAccess }}</hm-button>\n <ng-template hmCell=\"group_type_name\" let-a>\n <hm-tag [name]=\"a.group_type_name\" color=\"neutral\" />\n </ng-template>\n <ng-template hmCell=\"guards\" let-a>\n <hm-button emphasis=\"minimal\" icon=\"shield\" (clicked)=\"openGuards(a)\">{{ text.manageRoutes }}</hm-button>\n </ng-template>\n</hm-data-grid>\n\n<spine-auto-service-access-create\n [clientId]=\"clientId\"\n [availableGroups]=\"availableGroups\"\n [open]=\"showCreate\"\n (openChange)=\"showCreate = $event\"\n (created)=\"onCreated()\">\n</spine-auto-service-access-create>\n\n<spine-auto-service-access-guards\n *ngIf=\"activeAccess\"\n [clientId]=\"clientId\"\n [access]=\"activeAccess\"\n [open]=\"showGuards\"\n (openChange)=\"showGuards = $event\">\n</spine-auto-service-access-guards>\n", styles: [".as-stack{display:flex;flex-direction:column;gap:var(--hm-space-md);min-inline-size:0}.as-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--hm-space-xs)}.as-field-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--hm-space-sm)}.as-field-row>hm-combobox{flex:1 1 16rem;min-inline-size:0}.as-summary{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-sm)}.as-summary__info{display:flex;flex:1 1 16rem;flex-direction:column;gap:var(--hm-space-micro);min-inline-size:0}.as-summary__title{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs);margin:0;color:var(--hm-text);font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold)}.as-summary__detail{margin:0;color:var(--hm-muted);font-size:var(--hm-font-size-sm)}.muted{color:var(--hm-muted)}.as-empty{margin:var(--hm-space-xs) 0 0;font-size:var(--hm-font-size-sm)}.as-secret{display:grid;gap:var(--hm-space-micro)}.as-secret__label{color:var(--hm-muted);font-size:var(--hm-font-size-xs)}.as-secret__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.as-secret__value{flex:1 1 240px;min-width:0;border:var(--hm-border-hairline) solid var(--hm-divider);border-radius:var(--hm-radius-control);padding:var(--hm-space-xs) var(--hm-space-sm);background:var(--hm-surface);color:var(--hm-text);font-family:var(--hm-font-mono);font-size:var(--hm-font-size-sm);overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}:host{display:block}\n"] }]
|
|
856
914
|
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
857
915
|
type: Input
|
|
858
916
|
}] } });
|
|
@@ -877,4 +935,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
877
935
|
}] });
|
|
878
936
|
|
|
879
937
|
export { AutoServiceClientComponent };
|
|
880
|
-
//# sourceMappingURL=trismegisto-spine-auto-service-auto-service-client.component-
|
|
938
|
+
//# sourceMappingURL=trismegisto-spine-auto-service-auto-service-client.component-DzmlpLPu.mjs.map
|