@trismegisto/spine 2.1.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -19
- package/fesm2022/trismegisto-spine-audit.mjs +264 -10
- package/fesm2022/trismegisto-spine-audit.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-auto-service-apps.technical-BAKdkVdz.mjs +84 -0
- package/fesm2022/trismegisto-spine-auto-service-apps.technical-BAKdkVdz.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-apps.usage-CAXMP5r8.mjs +87 -0
- package/fesm2022/trismegisto-spine-auto-service-apps.usage-CAXMP5r8.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-audit.technical-C901aIIQ.mjs → trismegisto-spine-auto-service-audit.technical-B75d4mh2.mjs} +6 -5
- package/fesm2022/trismegisto-spine-auto-service-audit.technical-B75d4mh2.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-audit.usage-GIJ2RwuH.mjs → trismegisto-spine-auto-service-audit.usage-IdXMruv5.mjs} +9 -8
- package/fesm2022/trismegisto-spine-auto-service-audit.usage-IdXMruv5.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-CCiz-q8o.mjs → trismegisto-spine-auto-service-auto-service-audit.component-BIL8tH1I.mjs} +4 -4
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-CCiz-q8o.mjs.map → trismegisto-spine-auto-service-auto-service-audit.component-BIL8tH1I.mjs.map} +1 -1
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-client-picker.component-Z0wCANF6.mjs → trismegisto-spine-auto-service-auto-service-client-picker.component-CBt_0Uli.mjs} +3 -3
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-client-picker.component-Z0wCANF6.mjs.map → trismegisto-spine-auto-service-auto-service-client-picker.component-CBt_0Uli.mjs.map} +1 -1
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-client.component-C7SPavrX.mjs → trismegisto-spine-auto-service-auto-service-client.component-DAxhZC-a.mjs} +123 -27
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-DAxhZC-a.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-delete-CoJYTtBU.mjs +87 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-delete-CoJYTtBU.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-UVMGF7-B.mjs +544 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-UVMGF7-B.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-login-attempts.component-Boi-kG0G.mjs +37 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-login-attempts.component-Boi-kG0G.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-DmLafUkX.mjs +943 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-DmLafUkX.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-client.technical-BHWhpyWv.mjs → trismegisto-spine-auto-service-client.technical-DP5G8i3o.mjs} +24 -3
- package/fesm2022/trismegisto-spine-auto-service-client.technical-DP5G8i3o.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-client.usage-CM2WB2e2.mjs → trismegisto-spine-auto-service-client.usage-CcJANb20.mjs} +15 -6
- package/fesm2022/trismegisto-spine-auto-service-client.usage-CcJANb20.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-BlktCM70.mjs +65 -0
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-BlktCM70.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-groups.usage-Cz5sCKgn.mjs +81 -0
- package/fesm2022/trismegisto-spine-auto-service-groups.usage-Cz5sCKgn.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-home.component-vl3BPFnk.mjs → trismegisto-spine-auto-service-home.component-5_aji1hf.mjs} +5 -4
- package/fesm2022/trismegisto-spine-auto-service-home.component-5_aji1hf.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-login-attempts.technical-CasKIIws.mjs +37 -0
- package/fesm2022/trismegisto-spine-auto-service-login-attempts.technical-CasKIIws.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-login-attempts.usage-BMgLNu7W.mjs +60 -0
- package/fesm2022/trismegisto-spine-auto-service-login-attempts.usage-BMgLNu7W.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service.mjs +49 -29
- package/fesm2022/trismegisto-spine-auto-service.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-layout.mjs +1850 -217
- package/fesm2022/trismegisto-spine-layout.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-shell.mjs +28 -8
- package/fesm2022/trismegisto-spine-shell.mjs.map +1 -1
- package/fesm2022/trismegisto-spine.mjs +1163 -87
- package/fesm2022/trismegisto-spine.mjs.map +1 -1
- package/package.json +6 -6
- package/types/trismegisto-spine-audit.d.ts +180 -5
- package/types/trismegisto-spine-audit.d.ts.map +1 -1
- package/types/trismegisto-spine-auto-service.d.ts +100 -7
- package/types/trismegisto-spine-auto-service.d.ts.map +1 -1
- package/types/trismegisto-spine-layout.d.ts +885 -22
- package/types/trismegisto-spine-layout.d.ts.map +1 -1
- package/types/trismegisto-spine-shell.d.ts +11 -2
- package/types/trismegisto-spine-shell.d.ts.map +1 -1
- package/types/trismegisto-spine.d.ts +496 -34
- package/types/trismegisto-spine.d.ts.map +1 -1
- package/fesm2022/trismegisto-spine-auto-service-apps.technical-ClMKB9cK.mjs +0 -48
- package/fesm2022/trismegisto-spine-auto-service-apps.technical-ClMKB9cK.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-apps.usage-Cf5SG-oQ.mjs +0 -55
- package/fesm2022/trismegisto-spine-auto-service-apps.usage-Cf5SG-oQ.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-audit.technical-C901aIIQ.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-audit.usage-GIJ2RwuH.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-C7SPavrX.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-delete-6Bk46MOf.mjs +0 -39
- package/fesm2022/trismegisto-spine-auto-service-auto-service-delete-6Bk46MOf.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-CqIVe2LU.mjs +0 -357
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-CqIVe2LU.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-BLN49F4a.mjs +0 -502
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-BLN49F4a.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-client.technical-BHWhpyWv.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-client.usage-CM2WB2e2.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-jQlwaQPn.mjs +0 -39
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-jQlwaQPn.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-groups.usage-Bh7ig2zZ.mjs +0 -54
- package/fesm2022/trismegisto-spine-auto-service-groups.usage-Bh7ig2zZ.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.component-vl3BPFnk.mjs.map +0 -1
|
@@ -1,502 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, computed } from '@angular/core';
|
|
3
|
-
import * as i2 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { A as AutoServiceClientPickerComponent } from './trismegisto-spine-auto-service-auto-service-client-picker.component-Z0wCANF6.mjs';
|
|
6
|
-
import * as i3 from '@angular/forms';
|
|
7
|
-
import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
8
|
-
import { ButtonComponent, CheckboxComponent, InputComponent, ModalComponent, DataGridComponent, DataGridCellDirective, TagComponent, ComboboxComponent, DrawerComponent, IconComponent, HermesDialogService, AlertComponent, CardComponent, TabsComponent, TabComponent, TabContentDirective } from '@trismegisto/angular';
|
|
9
|
-
import { pluralMessage, formatMessage } from '@trismegisto/primitives';
|
|
10
|
-
import { A as AutoServiceDeleteFeedback } from './trismegisto-spine-auto-service-auto-service-delete-6Bk46MOf.mjs';
|
|
11
|
-
import { SPINE_MESSAGES } from '@trismegisto/spine';
|
|
12
|
-
import { AutoServiceService } from './trismegisto-spine-auto-service.mjs';
|
|
13
|
-
|
|
14
|
-
class AutoServiceAppsModalComponent {
|
|
15
|
-
constructor(service) {
|
|
16
|
-
this.service = service;
|
|
17
|
-
this.text = inject(SPINE_MESSAGES).autoService;
|
|
18
|
-
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
19
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
20
|
-
this.app = null;
|
|
21
|
-
this.clientId = '';
|
|
22
|
-
this.open = false;
|
|
23
|
-
this.openChange = new EventEmitter();
|
|
24
|
-
this.saved = new EventEmitter();
|
|
25
|
-
this.name = new FormControl('', { nonNullable: true, validators: [Validators.required] });
|
|
26
|
-
this.grants = new FormControl('client_credentials', { nonNullable: true });
|
|
27
|
-
this.enabled = new FormControl(true, { nonNullable: true });
|
|
28
|
-
this.saving = false;
|
|
29
|
-
}
|
|
30
|
-
get isEdit() { return !!this.app?.id; }
|
|
31
|
-
ngOnChanges(changes) { if (changes['open'] && this.open) {
|
|
32
|
-
this.resetForm();
|
|
33
|
-
} }
|
|
34
|
-
resetForm() {
|
|
35
|
-
if (this.isEdit) {
|
|
36
|
-
this.name.setValue(this.app.name);
|
|
37
|
-
this.grants.setValue(this.app.allowed_grants?.join(', ') ?? '');
|
|
38
|
-
this.enabled.setValue(this.app.enabled);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.name.setValue('');
|
|
42
|
-
this.grants.setValue('client_credentials');
|
|
43
|
-
this.enabled.setValue(true);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
onModalOpenChange(value) { this.open = value; this.openChange.emit(value); }
|
|
47
|
-
close() { this.onModalOpenChange(false); }
|
|
48
|
-
async save() {
|
|
49
|
-
this.saving = true;
|
|
50
|
-
try {
|
|
51
|
-
const allowed_grants = this.grants.value.split(',').map(s => s.trim()).filter(Boolean);
|
|
52
|
-
if (this.isEdit) {
|
|
53
|
-
await this.service.updateApp(this.clientId, this.app.id, { name: this.name.value, allowed_grants, enabled: this.enabled.value });
|
|
54
|
-
this.saved.emit();
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
const res = await this.service.createApp(this.clientId, { name: this.name.value, allowed_grants });
|
|
58
|
-
this.saved.emit(res.secret);
|
|
59
|
-
}
|
|
60
|
-
this.close();
|
|
61
|
-
}
|
|
62
|
-
finally {
|
|
63
|
-
this.saving = false;
|
|
64
|
-
this.cdr.markForCheck();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppsModalComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
68
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAppsModalComponent, isStandalone: true, selector: "spine-auto-service-apps-modal", inputs: { app: "app", clientId: "clientId", open: "open" }, outputs: { openChange: "openChange", saved: "saved" }, usesOnChanges: true, ngImport: i0, template: "<hm-modal [open]=\"open\" (openChange)=\"onModalOpenChange($event)\" [heading]=\"isEdit ? text.editApp : text.newApp\" (closed)=\"close()\">\n <div class=\"form-stack\">\n <hm-input [formControl]=\"name\" [label]=\"text.name\" />\n <hm-input [formControl]=\"grants\" [label]=\"text.grants\" placeholder=\"client_credentials\" />\n <hm-checkbox *ngIf=\"isEdit\" [formControl]=\"enabled\" [label]=\"text.active\" />\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"close()\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!name.value\" [loading]=\"saving\" (clicked)=\"save()\">{{ text.save }}</hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}\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: 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"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
69
|
-
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppsModalComponent, decorators: [{
|
|
71
|
-
type: Component,
|
|
72
|
-
args: [{ selector: 'spine-auto-service-apps-modal', standalone: true, imports: [CommonModule, ReactiveFormsModule, ButtonComponent, CheckboxComponent, InputComponent, ModalComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-modal [open]=\"open\" (openChange)=\"onModalOpenChange($event)\" [heading]=\"isEdit ? text.editApp : text.newApp\" (closed)=\"close()\">\n <div class=\"form-stack\">\n <hm-input [formControl]=\"name\" [label]=\"text.name\" />\n <hm-input [formControl]=\"grants\" [label]=\"text.grants\" placeholder=\"client_credentials\" />\n <hm-checkbox *ngIf=\"isEdit\" [formControl]=\"enabled\" [label]=\"text.active\" />\n </div>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"close()\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!name.value\" [loading]=\"saving\" (clicked)=\"save()\">{{ text.save }}</hm-button>\n </ng-container>\n</hm-modal>\n", styles: [".form-stack{display:flex;flex-direction:column;gap:var(--hm-space-sm)}\n"] }]
|
|
73
|
-
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { app: [{
|
|
74
|
-
type: Input
|
|
75
|
-
}], clientId: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}], open: [{
|
|
78
|
-
type: Input
|
|
79
|
-
}], openChange: [{
|
|
80
|
-
type: Output
|
|
81
|
-
}], saved: [{
|
|
82
|
-
type: Output
|
|
83
|
-
}] } });
|
|
84
|
-
|
|
85
|
-
class AutoServiceAppOperationsComponent {
|
|
86
|
-
constructor(service) {
|
|
87
|
-
this.service = service;
|
|
88
|
-
this.text = inject(SPINE_MESSAGES).autoService;
|
|
89
|
-
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
90
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
91
|
-
this.messages = inject(SPINE_MESSAGES);
|
|
92
|
-
this.clientId = '';
|
|
93
|
-
this.appId = '';
|
|
94
|
-
this.operations = [];
|
|
95
|
-
this.loading = false;
|
|
96
|
-
this.rowId = (op) => op.operation_id;
|
|
97
|
-
this.columns = computed(() => [
|
|
98
|
-
{ key: 'identifier', title: this.text.colIdentifier, value: (op) => op.identifier, sortable: true },
|
|
99
|
-
{ key: 'method', title: this.text.colMethod, value: (op) => op.method, sortable: true },
|
|
100
|
-
{ key: 'level', title: this.text.colLevel, value: (op) => op.level, sortable: true },
|
|
101
|
-
{ key: 'description', title: this.text.colDescription, value: (op) => op.description || '—' },
|
|
102
|
-
{
|
|
103
|
-
key: 'allowed_groups', title: this.text.colAllowedGroups,
|
|
104
|
-
value: (op) => op.allowed_groups?.length ? pluralMessage(this.text.groupCount, op.allowed_groups.length, this.messages.meta.locale) : '—',
|
|
105
|
-
},
|
|
106
|
-
], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
107
|
-
}
|
|
108
|
-
ngOnChanges(changes) { if (changes['appId']) {
|
|
109
|
-
this.load();
|
|
110
|
-
} }
|
|
111
|
-
async load() {
|
|
112
|
-
if (!this.appId) {
|
|
113
|
-
this.operations = [];
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this.loading = true;
|
|
117
|
-
try {
|
|
118
|
-
const res = await this.service.getAppOperations(this.clientId, this.appId);
|
|
119
|
-
this.operations = res.operations;
|
|
120
|
-
}
|
|
121
|
-
finally {
|
|
122
|
-
this.loading = false;
|
|
123
|
-
this.cdr.markForCheck();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/** Nível da operação no selo: pública em verde, protegida em amarelo; o resto neutro. */
|
|
127
|
-
levelTagColor(level) {
|
|
128
|
-
if (level === 'public')
|
|
129
|
-
return 'success';
|
|
130
|
-
if (level === 'protected')
|
|
131
|
-
return 'warning';
|
|
132
|
-
return 'neutral';
|
|
133
|
-
}
|
|
134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppOperationsComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
135
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAppOperationsComponent, isStandalone: true, selector: "spine-auto-service-app-operations", inputs: { clientId: "clientId", appId: "appId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"operations\"\n [rowId]=\"rowId\"\n [caption]=\"text.operationsCaption\"\n [loading]=\"loading\"\n [emptyMessage]=\"text.noOperations\"\n>\n <ng-template hmCell=\"identifier\" let-op>\n <code>{{ op.identifier }}</code>\n </ng-template>\n\n <ng-template hmCell=\"method\" let-op>\n <hm-tag [name]=\"op.method\" />\n </ng-template>\n\n <ng-template hmCell=\"level\" let-op>\n <hm-tag [name]=\"op.level\" [color]=\"levelTagColor(op.level)\" />\n </ng-template>\n</hm-data-grid>\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>:first-child{flex:1 1 20rem;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)}:host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
136
|
-
}
|
|
137
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppOperationsComponent, decorators: [{
|
|
138
|
-
type: Component,
|
|
139
|
-
args: [{ selector: 'spine-auto-service-app-operations', standalone: true, imports: [CommonModule, DataGridComponent, DataGridCellDirective, TagComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"operations\"\n [rowId]=\"rowId\"\n [caption]=\"text.operationsCaption\"\n [loading]=\"loading\"\n [emptyMessage]=\"text.noOperations\"\n>\n <ng-template hmCell=\"identifier\" let-op>\n <code>{{ op.identifier }}</code>\n </ng-template>\n\n <ng-template hmCell=\"method\" let-op>\n <hm-tag [name]=\"op.method\" />\n </ng-template>\n\n <ng-template hmCell=\"level\" let-op>\n <hm-tag [name]=\"op.level\" [color]=\"levelTagColor(op.level)\" />\n </ng-template>\n</hm-data-grid>\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>:first-child{flex:1 1 20rem;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)}:host{display:block}\n"] }]
|
|
140
|
-
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
141
|
-
type: Input
|
|
142
|
-
}], appId: [{
|
|
143
|
-
type: Input
|
|
144
|
-
}] } });
|
|
145
|
-
|
|
146
|
-
class AutoServiceConsumerCreateComponent {
|
|
147
|
-
constructor(service) {
|
|
148
|
-
this.service = service;
|
|
149
|
-
this.text = inject(SPINE_MESSAGES).autoService;
|
|
150
|
-
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
151
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
152
|
-
this.clientId = '';
|
|
153
|
-
this.appId = '';
|
|
154
|
-
this.availableGroups = [];
|
|
155
|
-
this.open = false;
|
|
156
|
-
this.openChange = new EventEmitter();
|
|
157
|
-
this.created = new EventEmitter();
|
|
158
|
-
this.groupId = '';
|
|
159
|
-
this.saving = false;
|
|
160
|
-
}
|
|
161
|
-
get groupOptions() {
|
|
162
|
-
return this.availableGroups.map((g) => ({ value: g.id, label: g.type ? `${g.name} (${g.type.name})` : g.name }));
|
|
163
|
-
}
|
|
164
|
-
ngOnChanges(changes) { if (changes['open'] && this.open) {
|
|
165
|
-
this.groupId = '';
|
|
166
|
-
} }
|
|
167
|
-
onModalOpenChange(value) { this.open = value; this.openChange.emit(value); }
|
|
168
|
-
close() { this.onModalOpenChange(false); }
|
|
169
|
-
async save() {
|
|
170
|
-
if (!this.groupId)
|
|
171
|
-
return;
|
|
172
|
-
this.saving = true;
|
|
173
|
-
try {
|
|
174
|
-
await this.service.createAppConsumer(this.clientId, this.appId, this.groupId);
|
|
175
|
-
this.created.emit();
|
|
176
|
-
this.close();
|
|
177
|
-
}
|
|
178
|
-
finally {
|
|
179
|
-
this.saving = false;
|
|
180
|
-
this.cdr.markForCheck();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceConsumerCreateComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
184
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceConsumerCreateComponent, isStandalone: true, selector: "spine-auto-service-consumer-create", inputs: { clientId: "clientId", appId: "appId", availableGroups: "availableGroups", open: "open" }, outputs: { openChange: "openChange", created: "created" }, usesOnChanges: true, ngImport: i0, template: "<hm-modal [open]=\"open\" (openChange)=\"onModalOpenChange($event)\" [heading]=\"text.newAccessHeading\" (closed)=\"close()\">\n <hm-combobox [label]=\"text.group\" [options]=\"groupOptions\" [value]=\"groupId\" (valueChange)=\"groupId = $event\"></hm-combobox>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"close()\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!groupId\" [loading]=\"saving\" (clicked)=\"save()\">{{ text.create }}</hm-button>\n </ng-container>\n</hm-modal>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: ComboboxComponent, selector: "hm-combobox", inputs: ["label", "options", "value", "placeholder", "icon", "hint", "help", "size", "labelHidden", "clearable", "requiredManual", "loading", "allowCustomValue"], outputs: ["valueChange"] }, { kind: "component", type: ModalComponent, selector: "hm-modal", inputs: ["open", "heading", "size", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
185
|
-
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceConsumerCreateComponent, decorators: [{
|
|
187
|
-
type: Component,
|
|
188
|
-
args: [{ selector: 'spine-auto-service-consumer-create', standalone: true, imports: [CommonModule, ButtonComponent, ComboboxComponent, ModalComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-modal [open]=\"open\" (openChange)=\"onModalOpenChange($event)\" [heading]=\"text.newAccessHeading\" (closed)=\"close()\">\n <hm-combobox [label]=\"text.group\" [options]=\"groupOptions\" [value]=\"groupId\" (valueChange)=\"groupId = $event\"></hm-combobox>\n\n <ng-container footer>\n <hm-button emphasis=\"medium\" (clicked)=\"close()\">{{ text.cancel }}</hm-button>\n <hm-button [disabled]=\"!groupId\" [loading]=\"saving\" (clicked)=\"save()\">{{ text.create }}</hm-button>\n </ng-container>\n</hm-modal>\n" }]
|
|
189
|
-
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
190
|
-
type: Input
|
|
191
|
-
}], appId: [{
|
|
192
|
-
type: Input
|
|
193
|
-
}], availableGroups: [{
|
|
194
|
-
type: Input
|
|
195
|
-
}], open: [{
|
|
196
|
-
type: Input
|
|
197
|
-
}], openChange: [{
|
|
198
|
-
type: Output
|
|
199
|
-
}], created: [{
|
|
200
|
-
type: Output
|
|
201
|
-
}] } });
|
|
202
|
-
|
|
203
|
-
class AutoServiceConsumerPermissionsComponent {
|
|
204
|
-
constructor(service) {
|
|
205
|
-
this.service = service;
|
|
206
|
-
this.text = inject(SPINE_MESSAGES).autoService;
|
|
207
|
-
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
208
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
209
|
-
this.fmt = formatMessage;
|
|
210
|
-
this.clientId = '';
|
|
211
|
-
this.appId = '';
|
|
212
|
-
this.consumer = null;
|
|
213
|
-
this.open = false;
|
|
214
|
-
this.openChange = new EventEmitter();
|
|
215
|
-
this.rows = [];
|
|
216
|
-
this.loading = false;
|
|
217
|
-
this.saving = false;
|
|
218
|
-
}
|
|
219
|
-
ngOnChanges(changes) { if (changes['open'] && this.open) {
|
|
220
|
-
this.reset();
|
|
221
|
-
} }
|
|
222
|
-
close() { this.open = false; this.openChange.emit(false); }
|
|
223
|
-
async reset() {
|
|
224
|
-
this.loading = true;
|
|
225
|
-
try {
|
|
226
|
-
const [opsRes, permsRes] = await Promise.all([
|
|
227
|
-
this.service.getAppOperations(this.clientId, this.appId),
|
|
228
|
-
this.service.getAppPermissions(this.clientId, this.consumer.consumer_id),
|
|
229
|
-
]);
|
|
230
|
-
const operations = opsRes.operations ?? [];
|
|
231
|
-
const permissions = permsRes.permissions ?? [];
|
|
232
|
-
this.rows = operations.map((op) => {
|
|
233
|
-
const perm = permissions.find((p) => p.operation_id === op.operation_id);
|
|
234
|
-
return {
|
|
235
|
-
operation_id: op.operation_id, identifier: op.identifier, method: op.method, level: op.level,
|
|
236
|
-
description: op.description, permissionId: perm?.permission_id,
|
|
237
|
-
control: new FormControl(!!perm, { nonNullable: true }),
|
|
238
|
-
};
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
finally {
|
|
242
|
-
this.loading = false;
|
|
243
|
-
this.cdr.markForCheck();
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
get hasChanges() { return this.rows.some(r => r.control.value !== !!r.permissionId); }
|
|
247
|
-
async confirm() {
|
|
248
|
-
const toAdd = this.rows.filter(r => r.control.value && !r.permissionId);
|
|
249
|
-
const toRemove = this.rows.filter(r => !r.control.value && r.permissionId);
|
|
250
|
-
if (toAdd.length === 0 && toRemove.length === 0) {
|
|
251
|
-
this.close();
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
this.saving = true;
|
|
255
|
-
try {
|
|
256
|
-
for (const r of toAdd) {
|
|
257
|
-
await this.service.addAppPermission(this.clientId, this.consumer.consumer_id, r.operation_id);
|
|
258
|
-
}
|
|
259
|
-
for (const r of toRemove) {
|
|
260
|
-
await this.service.removeAppPermission(this.clientId, this.consumer.consumer_id, r.permissionId);
|
|
261
|
-
}
|
|
262
|
-
this.close();
|
|
263
|
-
}
|
|
264
|
-
finally {
|
|
265
|
-
this.saving = false;
|
|
266
|
-
this.cdr.markForCheck();
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceConsumerPermissionsComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
270
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceConsumerPermissionsComponent, isStandalone: true, selector: "spine-auto-service-consumer-permissions", inputs: { clientId: "clientId", appId: "appId", consumer: "consumer", open: "open" }, outputs: { openChange: "openChange" }, usesOnChanges: true, ngImport: i0, template: "<hm-drawer [open]=\"open\" (openChange)=\"open = $event\" [heading]=\"fmt(text.operationsOf, { group: consumer?.group_name ?? '' })\" (closed)=\"close()\">\n <div *ngIf=\"loading\" class=\"loading-row\">{{ text.loading }}</div>\n\n <div class=\"op-list\" *ngIf=\"!loading\">\n <label class=\"op-row\" *ngFor=\"let row of rows\">\n <input type=\"checkbox\" class=\"hm-check\" [formControl]=\"row.control\" />\n <span class=\"op-row__body\">\n <code>{{ row.identifier }}</code>\n <hm-tag [name]=\"row.method\" />\n <hm-tag [name]=\"row.level\" />\n <span class=\"op-row__desc muted\" *ngIf=\"row.description\">{{ row.description }}</span>\n </span>\n </label>\n </div>\n\n <div class=\"empty-state\" *ngIf=\"!loading && rows.length === 0\">\n <hm-icon shape=\"filter-grid\" size=\"xl\"></hm-icon>\n <p>{{ text.noOperations }}</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: ["@charset \"UTF-8\";.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>:first-child{flex:1 1 20rem;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)}.loading-row{display:flex;justify-content:center;padding:var(--hm-space-xl);color:var(--hm-muted)}.op-list{display:flex;flex-direction:column;gap:var(--hm-space-micro)}.op-row{display:flex;align-items:flex-start;gap:var(--hm-space-sm);padding:var(--hm-space-xs);border-radius:var(--hm-radius-control);cursor:pointer}.op-row:hover{background:var(--hm-hover)}.op-row input[type=checkbox]{margin-top:var(--hm-space-micro)}.op-row__body{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.op-row__desc{flex-basis:100%;font-size:var(--hm-font-size-xs)}.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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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.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: DrawerComponent, selector: "hm-drawer", inputs: ["open", "heading", "size", "position", "pinned", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: TagComponent, selector: "hm-tag", inputs: ["name", "color", "compact"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
271
|
-
}
|
|
272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceConsumerPermissionsComponent, decorators: [{
|
|
273
|
-
type: Component,
|
|
274
|
-
args: [{ selector: 'spine-auto-service-consumer-permissions', standalone: true, imports: [CommonModule, ReactiveFormsModule, ButtonComponent, DrawerComponent, IconComponent, TagComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-drawer [open]=\"open\" (openChange)=\"open = $event\" [heading]=\"fmt(text.operationsOf, { group: consumer?.group_name ?? '' })\" (closed)=\"close()\">\n <div *ngIf=\"loading\" class=\"loading-row\">{{ text.loading }}</div>\n\n <div class=\"op-list\" *ngIf=\"!loading\">\n <label class=\"op-row\" *ngFor=\"let row of rows\">\n <input type=\"checkbox\" class=\"hm-check\" [formControl]=\"row.control\" />\n <span class=\"op-row__body\">\n <code>{{ row.identifier }}</code>\n <hm-tag [name]=\"row.method\" />\n <hm-tag [name]=\"row.level\" />\n <span class=\"op-row__desc muted\" *ngIf=\"row.description\">{{ row.description }}</span>\n </span>\n </label>\n </div>\n\n <div class=\"empty-state\" *ngIf=\"!loading && rows.length === 0\">\n <hm-icon shape=\"filter-grid\" size=\"xl\"></hm-icon>\n <p>{{ text.noOperations }}</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: ["@charset \"UTF-8\";.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>:first-child{flex:1 1 20rem;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)}.loading-row{display:flex;justify-content:center;padding:var(--hm-space-xl);color:var(--hm-muted)}.op-list{display:flex;flex-direction:column;gap:var(--hm-space-micro)}.op-row{display:flex;align-items:flex-start;gap:var(--hm-space-sm);padding:var(--hm-space-xs);border-radius:var(--hm-radius-control);cursor:pointer}.op-row:hover{background:var(--hm-hover)}.op-row input[type=checkbox]{margin-top:var(--hm-space-micro)}.op-row__body{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hm-space-xs)}.op-row__desc{flex-basis:100%;font-size:var(--hm-font-size-xs)}.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"] }]
|
|
275
|
-
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
276
|
-
type: Input
|
|
277
|
-
}], appId: [{
|
|
278
|
-
type: Input
|
|
279
|
-
}], consumer: [{
|
|
280
|
-
type: Input
|
|
281
|
-
}], open: [{
|
|
282
|
-
type: Input
|
|
283
|
-
}], openChange: [{
|
|
284
|
-
type: Output
|
|
285
|
-
}] } });
|
|
286
|
-
|
|
287
|
-
class AutoServiceAppAccessComponent {
|
|
288
|
-
constructor(service) {
|
|
289
|
-
this.service = service;
|
|
290
|
-
this.text = inject(SPINE_MESSAGES).autoService;
|
|
291
|
-
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
292
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
293
|
-
this.deletion = inject(AutoServiceDeleteFeedback);
|
|
294
|
-
this.clientId = '';
|
|
295
|
-
this.appId = '';
|
|
296
|
-
this.entries = [];
|
|
297
|
-
this.availableGroups = [];
|
|
298
|
-
this.loading = false;
|
|
299
|
-
this.showCreate = false;
|
|
300
|
-
this.showPermissions = false;
|
|
301
|
-
this.activeConsumer = null;
|
|
302
|
-
this.rowId = (c) => c.consumer_id;
|
|
303
|
-
this.columns = computed(() => [
|
|
304
|
-
{ key: 'group_name', title: this.text.colGroup, value: (c) => c.group_name, sortable: true },
|
|
305
|
-
{ key: 'group_type_name', title: this.text.colType, value: (c) => c.group_type_name, sortable: true },
|
|
306
|
-
], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
307
|
-
this.rowActions = computed(() => [
|
|
308
|
-
{ id: 'permissions', icon: 'shield', label: this.text.manageOperations },
|
|
309
|
-
{
|
|
310
|
-
id: 'delete', icon: 'trash', label: this.text.remove, danger: true, separatorAbove: true,
|
|
311
|
-
confirm: (c) => ({ heading: this.text.confirmRemoveConsumerHeading, message: formatMessage(this.text.confirmRemoveConsumer, { group: c.group_name }) }),
|
|
312
|
-
},
|
|
313
|
-
], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
|
|
314
|
-
}
|
|
315
|
-
ngOnChanges(changes) {
|
|
316
|
-
if (changes['appId']) {
|
|
317
|
-
this.load();
|
|
318
|
-
}
|
|
319
|
-
if (changes['clientId']) {
|
|
320
|
-
this.loadGroups();
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
async load() {
|
|
324
|
-
if (!this.appId) {
|
|
325
|
-
this.entries = [];
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
this.loading = true;
|
|
329
|
-
try {
|
|
330
|
-
const res = await this.service.getAppConsumers(this.clientId, this.appId);
|
|
331
|
-
this.entries = res.consumers;
|
|
332
|
-
}
|
|
333
|
-
finally {
|
|
334
|
-
this.loading = false;
|
|
335
|
-
this.cdr.markForCheck();
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
async loadGroups() {
|
|
339
|
-
if (!this.clientId) {
|
|
340
|
-
this.availableGroups = [];
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const res = await this.service.getGroups(this.clientId);
|
|
344
|
-
this.availableGroups = res.groups;
|
|
345
|
-
this.cdr.markForCheck();
|
|
346
|
-
}
|
|
347
|
-
openCreate() { this.showCreate = true; }
|
|
348
|
-
async onCreated() { await this.load(); }
|
|
349
|
-
/** Já confirmado pelo `confirm` da ação na grade. */
|
|
350
|
-
async deleteConsumer(consumerId) {
|
|
351
|
-
if (await this.deletion.run(() => this.service.deleteAppConsumer(this.clientId, consumerId)))
|
|
352
|
-
await this.load();
|
|
353
|
-
}
|
|
354
|
-
openPermissions(consumer) { this.activeConsumer = consumer; this.showPermissions = true; }
|
|
355
|
-
onAction(e) {
|
|
356
|
-
if (e.action === 'permissions')
|
|
357
|
-
this.openPermissions(e.row);
|
|
358
|
-
if (e.action === 'delete')
|
|
359
|
-
void this.deleteConsumer(e.row.consumer_id);
|
|
360
|
-
}
|
|
361
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppAccessComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
362
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAppAccessComponent, isStandalone: true, selector: "spine-auto-service-app-access", inputs: { clientId: "clientId", appId: "appId" }, usesOnChanges: true, ngImport: i0, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"entries\"\n [rowId]=\"rowId\"\n [caption]=\"text.appAccessCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noAppAccess\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreate()\">{{ text.newAccess }}</hm-button>\n</hm-data-grid>\n\n<spine-auto-service-consumer-create\n [clientId]=\"clientId\"\n [appId]=\"appId\"\n [availableGroups]=\"availableGroups\"\n [open]=\"showCreate\"\n (openChange)=\"showCreate = $event\"\n (created)=\"onCreated()\">\n</spine-auto-service-consumer-create>\n\n<spine-auto-service-consumer-permissions\n *ngIf=\"activeConsumer\"\n [clientId]=\"clientId\"\n [appId]=\"appId\"\n [consumer]=\"activeConsumer\"\n [open]=\"showPermissions\"\n (openChange)=\"showPermissions = $event\">\n</spine-auto-service-consumer-permissions>\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>:first-child{flex:1 1 20rem;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)}: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: AutoServiceConsumerCreateComponent, selector: "spine-auto-service-consumer-create", inputs: ["clientId", "appId", "availableGroups", "open"], outputs: ["openChange", "created"] }, { kind: "component", type: AutoServiceConsumerPermissionsComponent, selector: "spine-auto-service-consumer-permissions", inputs: ["clientId", "appId", "consumer", "open"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
363
|
-
}
|
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppAccessComponent, decorators: [{
|
|
365
|
-
type: Component,
|
|
366
|
-
args: [{ selector: 'spine-auto-service-app-access', standalone: true, imports: [CommonModule, ButtonComponent, IconComponent, DataGridComponent, AutoServiceConsumerCreateComponent, AutoServiceConsumerPermissionsComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<hm-data-grid\n [columns]=\"columns()\"\n [rows]=\"entries\"\n [rowId]=\"rowId\"\n [caption]=\"text.appAccessCaption\"\n [loading]=\"loading\"\n [rowActions]=\"rowActions()\"\n (actionTriggered)=\"onAction($event)\"\n [emptyMessage]=\"text.noAppAccess\"\n>\n <hm-button dataGridActions icon=\"plus\" (clicked)=\"openCreate()\">{{ text.newAccess }}</hm-button>\n</hm-data-grid>\n\n<spine-auto-service-consumer-create\n [clientId]=\"clientId\"\n [appId]=\"appId\"\n [availableGroups]=\"availableGroups\"\n [open]=\"showCreate\"\n (openChange)=\"showCreate = $event\"\n (created)=\"onCreated()\">\n</spine-auto-service-consumer-create>\n\n<spine-auto-service-consumer-permissions\n *ngIf=\"activeConsumer\"\n [clientId]=\"clientId\"\n [appId]=\"appId\"\n [consumer]=\"activeConsumer\"\n [open]=\"showPermissions\"\n (openChange)=\"showPermissions = $event\">\n</spine-auto-service-consumer-permissions>\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>:first-child{flex:1 1 20rem;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)}:host{display:block}\n"] }]
|
|
367
|
-
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
368
|
-
type: Input
|
|
369
|
-
}], appId: [{
|
|
370
|
-
type: Input
|
|
371
|
-
}] } });
|
|
372
|
-
|
|
373
|
-
class AutoServiceAppsComponent {
|
|
374
|
-
constructor(service) {
|
|
375
|
-
this.service = service;
|
|
376
|
-
this.text = inject(SPINE_MESSAGES).autoService;
|
|
377
|
-
/** Telas com estado em campo comum, preenchido depois de `await`: marca a view ao terminar (app sem zone.js). */
|
|
378
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
379
|
-
this.dialogs = inject(HermesDialogService);
|
|
380
|
-
this.deletion = inject(AutoServiceDeleteFeedback);
|
|
381
|
-
this.clientId = '';
|
|
382
|
-
this.loadingOptions = false;
|
|
383
|
-
this.appOptions = [];
|
|
384
|
-
this.selectedAppId = '';
|
|
385
|
-
this.app = null;
|
|
386
|
-
this.searchingApp = false;
|
|
387
|
-
this.modalApp = null;
|
|
388
|
-
this.showAppModal = false;
|
|
389
|
-
this.activeTab = 'operations';
|
|
390
|
-
this.newSecret = null;
|
|
391
|
-
}
|
|
392
|
-
get appComboOptions() {
|
|
393
|
-
return this.appOptions.map((a) => ({ value: a.id, label: a.name }));
|
|
394
|
-
}
|
|
395
|
-
// Trocar de client esconde o segredo recém-criado: ele é de uma aplicação do client anterior.
|
|
396
|
-
ngOnChanges(changes) { if (changes['clientId']) {
|
|
397
|
-
this.selectedAppId = '';
|
|
398
|
-
this.app = null;
|
|
399
|
-
this.newSecret = null;
|
|
400
|
-
this.loadAppOptions();
|
|
401
|
-
} }
|
|
402
|
-
async loadAppOptions() {
|
|
403
|
-
if (!this.clientId) {
|
|
404
|
-
this.appOptions = [];
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
this.loadingOptions = true;
|
|
408
|
-
try {
|
|
409
|
-
const res = await this.service.getApps(this.clientId);
|
|
410
|
-
this.appOptions = res.apps;
|
|
411
|
-
}
|
|
412
|
-
finally {
|
|
413
|
-
this.loadingOptions = false;
|
|
414
|
-
this.cdr.markForCheck();
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
async searchApp() {
|
|
418
|
-
if (!this.selectedAppId)
|
|
419
|
-
return;
|
|
420
|
-
this.searchingApp = true;
|
|
421
|
-
try {
|
|
422
|
-
this.app = this.appOptions.find(a => a.id === this.selectedAppId) ?? null;
|
|
423
|
-
this.activeTab = 'operations';
|
|
424
|
-
}
|
|
425
|
-
finally {
|
|
426
|
-
this.searchingApp = false;
|
|
427
|
-
this.cdr.markForCheck();
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
setTab(tab) { this.activeTab = tab; }
|
|
431
|
-
openCreate() { this.modalApp = null; this.showAppModal = true; }
|
|
432
|
-
openEdit() { this.modalApp = this.app; this.showAppModal = true; }
|
|
433
|
-
async onAppSaved(secret) {
|
|
434
|
-
if (secret)
|
|
435
|
-
this.newSecret = secret;
|
|
436
|
-
await this.loadAppOptions();
|
|
437
|
-
if (this.app?.id) {
|
|
438
|
-
this.app = this.appOptions.find(a => a.id === this.app.id) ?? this.app;
|
|
439
|
-
}
|
|
440
|
-
this.cdr.markForCheck();
|
|
441
|
-
}
|
|
442
|
-
async toggleEnabled() {
|
|
443
|
-
if (!this.app)
|
|
444
|
-
return;
|
|
445
|
-
await this.service.updateApp(this.clientId, this.app.id, { enabled: !this.app.enabled });
|
|
446
|
-
await this.loadAppOptions();
|
|
447
|
-
this.app = this.appOptions.find(a => a.id === this.app.id) ?? this.app;
|
|
448
|
-
this.cdr.markForCheck();
|
|
449
|
-
}
|
|
450
|
-
/** Pede confirmação; só então o DELETE (com toast de sucesso/erro). */
|
|
451
|
-
async deleteApp() {
|
|
452
|
-
const app = this.app;
|
|
453
|
-
if (!app)
|
|
454
|
-
return;
|
|
455
|
-
const ok = await this.dialogs.confirm({
|
|
456
|
-
heading: this.text.confirmDeleteAppHeading,
|
|
457
|
-
message: formatMessage(this.text.confirmDeleteApp, { name: app.name ?? app.id }),
|
|
458
|
-
confirmLabel: this.text.delete,
|
|
459
|
-
danger: true,
|
|
460
|
-
});
|
|
461
|
-
if (!ok)
|
|
462
|
-
return;
|
|
463
|
-
if (!(await this.deletion.run(() => this.service.deleteApp(this.clientId, app.id))))
|
|
464
|
-
return;
|
|
465
|
-
this.app = null;
|
|
466
|
-
this.selectedAppId = '';
|
|
467
|
-
this.newSecret = null;
|
|
468
|
-
await this.loadAppOptions();
|
|
469
|
-
}
|
|
470
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppsComponent, deps: [{ token: AutoServiceService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
471
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceAppsComponent, isStandalone: true, selector: "spine-auto-service-apps", inputs: { clientId: "clientId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"as-stack\">\n <div class=\"as-actions\">\n <hm-button icon=\"plus\" (clicked)=\"openCreate()\">{{ text.register }}</hm-button>\n </div>\n\n <hm-alert *ngIf=\"newSecret\" variant=\"success\" [closable]=\"true\" (closed)=\"newSecret = null\">\n {{ text.secretCreated }} <strong>{{ newSecret }}</strong>\n </hm-alert>\n\n <hm-card>\n <div class=\"as-field-row\">\n <hm-combobox [label]=\"text.pickApp\" [options]=\"appComboOptions\"\n [value]=\"selectedAppId\" (valueChange)=\"selectedAppId = $event\" [disabled]=\"loadingOptions\">\n </hm-combobox>\n <hm-button [disabled]=\"!selectedAppId || searchingApp\" (clicked)=\"searchApp()\" icon=\"search\">{{ text.search }}</hm-button>\n </div>\n </hm-card>\n\n <ng-container *ngIf=\"app\">\n <hm-card>\n <div class=\"as-summary\">\n <div class=\"as-summary__info\">\n <p class=\"as-summary__title\">\n {{ app.name }}\n <hm-tag [name]=\"app.enabled ? text.active : text.inactive\" [color]=\"app.enabled ? 'success' : 'danger'\" />\n </p>\n <p class=\"as-summary__detail\">{{ app.allowed_grants?.join(', ') }}</p>\n </div>\n <div class=\"as-actions\">\n <hm-button emphasis=\"medium\" icon=\"pencil\" (clicked)=\"openEdit()\">{{ text.edit }}</hm-button>\n <hm-button emphasis=\"medium\" (clicked)=\"toggleEnabled()\">{{ app.enabled ? text.disable : text.enable }}</hm-button>\n <hm-button intent=\"danger\" emphasis=\"medium\" icon=\"trash\" (clicked)=\"deleteApp()\">{{ text.delete }}</hm-button>\n </div>\n </div>\n </hm-card>\n\n <!-- Conte\u00FAdo de cada aba \u00E9 pregui\u00E7oso (*hmTabContent): s\u00F3 busca na API quando a aba \u00E9 aberta. -->\n <hm-tabs [label]=\"text.appSections\" [active]=\"activeTab\" (activeChange)=\"setTab($any($event))\">\n <hm-tab id=\"operations\" [label]=\"text.tabOperations\">\n <spine-auto-service-app-operations *hmTabContent [clientId]=\"clientId\" [appId]=\"app.id\"></spine-auto-service-app-operations>\n </hm-tab>\n <hm-tab id=\"access\" [label]=\"text.tabAccesses\">\n <spine-auto-service-app-access *hmTabContent [clientId]=\"clientId\" [appId]=\"app.id\"></spine-auto-service-app-access>\n </hm-tab>\n </hm-tabs>\n </ng-container>\n</div>\n\n<spine-auto-service-apps-modal\n [app]=\"modalApp\"\n [clientId]=\"clientId\"\n [open]=\"showAppModal\"\n (openChange)=\"showAppModal = $event\"\n (saved)=\"onAppSaved($event)\">\n</spine-auto-service-apps-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>:first-child{flex:1 1 20rem;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)}:host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { 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: CardComponent, selector: "hm-card", inputs: ["heading", "icon", "selected", "fill", "media", "mediaAlt", "mediaDecorative", "mediaPosition"] }, { 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: TabsComponent, selector: "hm-tabs", inputs: ["label", "active", "orientation", "mode", "overflow", "fillHeight", "noPanelGap"], outputs: ["activeChange"] }, { kind: "component", type: TabComponent, selector: "hm-tab", inputs: ["id", "label", "disabled", "count", "route", "exact", "destroyOnHide"] }, { kind: "directive", type: TabContentDirective, selector: "ng-template[hmTabContent]" }, { kind: "component", type: TagComponent, selector: "hm-tag", inputs: ["name", "color", "compact"] }, { kind: "component", type: AutoServiceAppsModalComponent, selector: "spine-auto-service-apps-modal", inputs: ["app", "clientId", "open"], outputs: ["openChange", "saved"] }, { kind: "component", type: AutoServiceAppOperationsComponent, selector: "spine-auto-service-app-operations", inputs: ["clientId", "appId"] }, { kind: "component", type: AutoServiceAppAccessComponent, selector: "spine-auto-service-app-access", inputs: ["clientId", "appId"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
472
|
-
}
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceAppsComponent, decorators: [{
|
|
474
|
-
type: Component,
|
|
475
|
-
args: [{ selector: 'spine-auto-service-apps', standalone: true, imports: [
|
|
476
|
-
CommonModule, FormsModule, AlertComponent, ButtonComponent, CardComponent, ComboboxComponent, TabsComponent, TabComponent,
|
|
477
|
-
TabContentDirective, TagComponent,
|
|
478
|
-
AutoServiceAppsModalComponent, AutoServiceAppOperationsComponent, AutoServiceAppAccessComponent,
|
|
479
|
-
], changeDetection: ChangeDetectionStrategy.Eager, template: "<div class=\"as-stack\">\n <div class=\"as-actions\">\n <hm-button icon=\"plus\" (clicked)=\"openCreate()\">{{ text.register }}</hm-button>\n </div>\n\n <hm-alert *ngIf=\"newSecret\" variant=\"success\" [closable]=\"true\" (closed)=\"newSecret = null\">\n {{ text.secretCreated }} <strong>{{ newSecret }}</strong>\n </hm-alert>\n\n <hm-card>\n <div class=\"as-field-row\">\n <hm-combobox [label]=\"text.pickApp\" [options]=\"appComboOptions\"\n [value]=\"selectedAppId\" (valueChange)=\"selectedAppId = $event\" [disabled]=\"loadingOptions\">\n </hm-combobox>\n <hm-button [disabled]=\"!selectedAppId || searchingApp\" (clicked)=\"searchApp()\" icon=\"search\">{{ text.search }}</hm-button>\n </div>\n </hm-card>\n\n <ng-container *ngIf=\"app\">\n <hm-card>\n <div class=\"as-summary\">\n <div class=\"as-summary__info\">\n <p class=\"as-summary__title\">\n {{ app.name }}\n <hm-tag [name]=\"app.enabled ? text.active : text.inactive\" [color]=\"app.enabled ? 'success' : 'danger'\" />\n </p>\n <p class=\"as-summary__detail\">{{ app.allowed_grants?.join(', ') }}</p>\n </div>\n <div class=\"as-actions\">\n <hm-button emphasis=\"medium\" icon=\"pencil\" (clicked)=\"openEdit()\">{{ text.edit }}</hm-button>\n <hm-button emphasis=\"medium\" (clicked)=\"toggleEnabled()\">{{ app.enabled ? text.disable : text.enable }}</hm-button>\n <hm-button intent=\"danger\" emphasis=\"medium\" icon=\"trash\" (clicked)=\"deleteApp()\">{{ text.delete }}</hm-button>\n </div>\n </div>\n </hm-card>\n\n <!-- Conte\u00FAdo de cada aba \u00E9 pregui\u00E7oso (*hmTabContent): s\u00F3 busca na API quando a aba \u00E9 aberta. -->\n <hm-tabs [label]=\"text.appSections\" [active]=\"activeTab\" (activeChange)=\"setTab($any($event))\">\n <hm-tab id=\"operations\" [label]=\"text.tabOperations\">\n <spine-auto-service-app-operations *hmTabContent [clientId]=\"clientId\" [appId]=\"app.id\"></spine-auto-service-app-operations>\n </hm-tab>\n <hm-tab id=\"access\" [label]=\"text.tabAccesses\">\n <spine-auto-service-app-access *hmTabContent [clientId]=\"clientId\" [appId]=\"app.id\"></spine-auto-service-app-access>\n </hm-tab>\n </hm-tabs>\n </ng-container>\n</div>\n\n<spine-auto-service-apps-modal\n [app]=\"modalApp\"\n [clientId]=\"clientId\"\n [open]=\"showAppModal\"\n (openChange)=\"showAppModal = $event\"\n (saved)=\"onAppSaved($event)\">\n</spine-auto-service-apps-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>:first-child{flex:1 1 20rem;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)}:host{display:block}\n"] }]
|
|
480
|
-
}], ctorParameters: () => [{ type: AutoServiceService }], propDecorators: { clientId: [{
|
|
481
|
-
type: Input
|
|
482
|
-
}] } });
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Página "Aplicações" do auto-serviço: o seletor de client e as aplicações dele. A auditoria tem página
|
|
486
|
-
* própria no menu Administração (`AUTO_SERVICE_SCREENS.audit`) — a aba que existia aqui duplicava a tela.
|
|
487
|
-
*/
|
|
488
|
-
class AutoServiceComponent {
|
|
489
|
-
constructor() {
|
|
490
|
-
this.client = null;
|
|
491
|
-
}
|
|
492
|
-
onClientChange(c) { this.client = c; }
|
|
493
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
494
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: AutoServiceComponent, isStandalone: true, selector: "spine-auto-service", ngImport: i0, template: "<!-- T\u00EDtulo e descri\u00E7\u00E3o da tela v\u00EAm da barra da p\u00E1gina (nome + description do router). -->\n<div class=\"as-stack\">\n <spine-auto-service-client-picker (clientChange)=\"onClientChange($event)\"></spine-auto-service-client-picker>\n <spine-auto-service-apps *ngIf=\"client as c\" [clientId]=\"c.id\"></spine-auto-service-apps>\n</div>\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>:first-child{flex:1 1 20rem;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)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AutoServiceClientPickerComponent, selector: "spine-auto-service-client-picker", outputs: ["clientChange"] }, { kind: "component", type: AutoServiceAppsComponent, selector: "spine-auto-service-apps", inputs: ["clientId"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
495
|
-
}
|
|
496
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AutoServiceComponent, decorators: [{
|
|
497
|
-
type: Component,
|
|
498
|
-
args: [{ selector: 'spine-auto-service', standalone: true, imports: [CommonModule, AutoServiceClientPickerComponent, AutoServiceAppsComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "<!-- T\u00EDtulo e descri\u00E7\u00E3o da tela v\u00EAm da barra da p\u00E1gina (nome + description do router). -->\n<div class=\"as-stack\">\n <spine-auto-service-client-picker (clientChange)=\"onClientChange($event)\"></spine-auto-service-client-picker>\n <spine-auto-service-apps *ngIf=\"client as c\" [clientId]=\"c.id\"></spine-auto-service-apps>\n</div>\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>:first-child{flex:1 1 20rem;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)}\n"] }]
|
|
499
|
-
}] });
|
|
500
|
-
|
|
501
|
-
export { AutoServiceComponent };
|
|
502
|
-
//# sourceMappingURL=trismegisto-spine-auto-service-auto-service.component-BLN49F4a.mjs.map
|