ngx-sp-auth 2.2.0 → 3.0.2
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/ngx-sp-auth.mjs +1644 -786
- package/fesm2022/ngx-sp-auth.mjs.map +1 -1
- package/lib/auth-config.d.ts +2 -0
- package/lib/auth.module.d.ts +1 -9
- package/lib/auth.routes.d.ts +2 -0
- package/lib/auth.service.d.ts +36 -8
- package/lib/components/login/login.component.d.ts +49 -21
- package/lib/components/login-os/login-os.component.d.ts +27 -0
- package/lib/components/menu-lateral/dropdown/primary-dropdown/primary-dropdown.component.d.ts +4 -2
- package/lib/components/menu-lateral/dropdown/secondary-dropdown/secondary-dropdown.component.d.ts +3 -1
- package/lib/components/menu-lateral/menu/menu-lateral.component.d.ts +31 -18
- package/lib/components/menu-lateral/menu/selecao-estabelecimentos-modal/selecao-estabelecimentos-modal.component.d.ts +4 -2
- package/lib/components/menu-lateral/menu-services.service.d.ts +21 -4
- package/lib/components/menu-lateral/model/dynamic-menu.d.ts +18 -0
- package/lib/components/menu-lateral/model/infrausuarioimg.d.ts +7 -7
- package/lib/components/menu-lateral/model/navsubmenu-searchitem.d.ts +5 -0
- package/lib/components/menu-lateral/model/ret-navsubmenu.d.ts +11 -0
- package/lib/components/menu-lateral/submenus/dynamic-menu/dynamic-menu.component.d.ts +3 -1
- package/lib/components/nova-senha/nova-senhacomponent.d.ts +7 -5
- package/lib/custom/{custom-menu.service.d.ts → lib-custom-menu.service.d.ts} +10 -14
- package/lib/custom/{custom-storage.service.d.ts → lib-custom-storage.service.d.ts} +1 -4
- package/lib/custom/{menu-config.service.d.ts → lib-menu-config.service.d.ts} +11 -16
- package/lib/custom/models/icustom-login-service.d.ts +2 -0
- package/lib/custom/models/icustom-menu-service.d.ts +2 -0
- package/lib/custom/models/icustom-storage-service.d.ts +0 -1
- package/lib/custom/models/imenu-config.d.ts +2 -2
- package/lib/environments/environments.service.d.ts +8 -1
- package/lib/environments/models/ienvironments.d.ts +9 -0
- package/lib/guards/external-login-guard.d.ts +3 -5
- package/lib/guards/login-os.guard.d.ts +13 -0
- package/lib/interceptors/auth-aplic.interceptor.d.ts +4 -4
- package/lib/interceptors/auth-infra.interceptor.d.ts +1 -1
- package/lib/models/infraIn2FaTypeId.d.ts +5 -0
- package/lib/models/infraInAuthTypeId.d.ts +5 -0
- package/lib/models/login-os.model.d.ts +7 -0
- package/lib/models/ret-autenthication.d.ts +14 -0
- package/lib/models/ret-login.d.ts +1 -4
- package/lib/project/project-utils.service.d.ts +18 -0
- package/lib/storage/auth-storage.service.d.ts +21 -4
- package/package.json +3 -1
- package/public-api.d.ts +13 -9
- package/README.md +0 -207
- package/lib/components/menu-lateral/menu/list-estab.service.d.ts +0 -19
- package/lib/components/menu-lateral/model/iestabelecimento.model.d.ts +0 -4
- package/lib/models/custom-propriedades-login.d.ts +0 -11
- package/lib/server/ret-server-config.d.ts +0 -7
- package/lib/server/server.service.d.ts +0 -14
- package/src/assets/imgs/Property1-cadeado.png +0 -0
- package/src/assets/imgs/Property1-calendariofino.png +0 -0
- package/src/assets/imgs/Property1-mao.png +0 -0
- /package/lib/custom/{custom-login.service.d.ts → lib-custom-login.service.d.ts} +0 -0
package/fesm2022/ngx-sp-auth.mjs
CHANGED
|
@@ -1,34 +1,125 @@
|
|
|
1
|
-
import * as i12 from '@angular/common';
|
|
2
|
-
import { CommonModule, NgIf, NgFor } from '@angular/common';
|
|
3
1
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable,
|
|
5
|
-
import * as
|
|
6
|
-
import {
|
|
2
|
+
import { importProvidersFrom, NgModule, Injectable, Inject, Component, EventEmitter, Output, Input, TemplateRef, ContentChild, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common/http';
|
|
4
|
+
import { HTTP_INTERCEPTORS, HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
5
|
+
import * as i1$2 from '@azure/msal-angular';
|
|
6
|
+
import { MsalInterceptor, MsalGuard, MsalModule, MSAL_GUARD_CONFIG } from '@azure/msal-angular';
|
|
7
|
+
import { LogLevel, PublicClientApplication, InteractionType } from '@azure/msal-browser';
|
|
8
|
+
import { take as take$1, tap as tap$1, map, switchMap } from 'rxjs/operators';
|
|
7
9
|
import * as i1$1 from '@angular/router';
|
|
8
|
-
import { RouterLink,
|
|
9
|
-
import
|
|
10
|
+
import { RouterLink, NavigationEnd, RouterOutlet } from '@angular/router';
|
|
11
|
+
import { BehaviorSubject, take, tap, Subject, Subscription, timer, map as map$1, filter, of, lastValueFrom, from } from 'rxjs';
|
|
12
|
+
import * as i3 from 'ngx-sp-infra';
|
|
13
|
+
import { Utils, FormUtils, InfraModule } from 'ngx-sp-infra';
|
|
14
|
+
import * as i3$2 from '@angular/common';
|
|
15
|
+
import { CommonModule, NgIf } from '@angular/common';
|
|
16
|
+
import * as i3$1 from '@angular/forms';
|
|
17
|
+
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
18
|
+
import * as i8 from '@angular/platform-browser';
|
|
19
|
+
import * as i10 from 'ngx-toastr';
|
|
20
|
+
import * as i12 from 'ngx-bootstrap/popover';
|
|
10
21
|
import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
11
|
-
import * as
|
|
22
|
+
import * as i13 from 'ngx-bootstrap/tooltip';
|
|
12
23
|
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
13
|
-
import * as
|
|
24
|
+
import * as i7 from 'ngx-pagination';
|
|
14
25
|
import { NgxPaginationModule } from 'ngx-pagination';
|
|
15
|
-
import * as
|
|
16
|
-
import { Utils, FormUtils, InfraModule, LibIconsComponent, FieldErrorMessageComponent } from 'ngx-sp-infra';
|
|
17
|
-
import { BehaviorSubject, take, tap, Subscription, timer, map as map$1, Subject, of, merge, Observable, lastValueFrom, from } from 'rxjs';
|
|
18
|
-
import * as i1$2 from 'ngx-bootstrap/modal';
|
|
19
|
-
import * as i1 from '@angular/common/http';
|
|
20
|
-
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
21
|
-
import { take as take$1, tap as tap$1, map, switchMap } from 'rxjs/operators';
|
|
22
|
-
import * as i9 from '@angular/platform-browser';
|
|
23
|
-
import * as i11 from 'ngx-toastr';
|
|
26
|
+
import * as i2 from 'ngx-bootstrap/modal';
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const isIE = false;
|
|
29
|
+
const hostAuthLogin = "http://localhost:4200/auth/login";
|
|
30
|
+
const msalConfig = {
|
|
31
|
+
auth: {
|
|
32
|
+
clientId: "clientId",
|
|
33
|
+
authority: "https://login.microsoftonline.com/tenantId",
|
|
34
|
+
redirectUri: hostAuthLogin + "/",
|
|
35
|
+
postLogoutRedirectUri: hostAuthLogin,
|
|
36
|
+
navigateToLoginRequestUrl: true
|
|
37
|
+
},
|
|
38
|
+
cache: {
|
|
39
|
+
cacheLocation: "localStorage",
|
|
40
|
+
storeAuthStateInCookie: isIE,
|
|
41
|
+
},
|
|
42
|
+
system: {
|
|
43
|
+
loggerOptions: {
|
|
44
|
+
loggerCallback: (logLevel, message, containsPii) => {
|
|
45
|
+
console.log(message);
|
|
46
|
+
},
|
|
47
|
+
logLevel: LogLevel.Error, // .Verbose
|
|
48
|
+
piiLoggingEnabled: false
|
|
49
|
+
}
|
|
30
50
|
}
|
|
31
|
-
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
class AuthModule {
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
55
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: AuthModule }); }
|
|
56
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, providers: [
|
|
57
|
+
importProvidersFrom(MsalModule.forRoot(new PublicClientApplication(msalConfig), {
|
|
58
|
+
// The routing guard configuration.
|
|
59
|
+
interactionType: InteractionType.Redirect,
|
|
60
|
+
authRequest: {
|
|
61
|
+
scopes: [
|
|
62
|
+
"user.read"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
// MSAL interceptor configuration.
|
|
67
|
+
// The protected resource mapping maps your web API with the corresponding app scopes. If your code needs to call another web API, add the URI mapping here.
|
|
68
|
+
interactionType: InteractionType.Redirect,
|
|
69
|
+
protectedResourceMap: new Map([])
|
|
70
|
+
})),
|
|
71
|
+
{
|
|
72
|
+
provide: HTTP_INTERCEPTORS,
|
|
73
|
+
useClass: MsalInterceptor,
|
|
74
|
+
multi: true
|
|
75
|
+
},
|
|
76
|
+
MsalGuard, // MsalGuard added as provider here
|
|
77
|
+
] }); }
|
|
78
|
+
}
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, decorators: [{
|
|
80
|
+
type: NgModule,
|
|
81
|
+
args: [{
|
|
82
|
+
providers: [
|
|
83
|
+
importProvidersFrom(MsalModule.forRoot(new PublicClientApplication(msalConfig), {
|
|
84
|
+
// The routing guard configuration.
|
|
85
|
+
interactionType: InteractionType.Redirect,
|
|
86
|
+
authRequest: {
|
|
87
|
+
scopes: [
|
|
88
|
+
"user.read"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
// MSAL interceptor configuration.
|
|
93
|
+
// The protected resource mapping maps your web API with the corresponding app scopes. If your code needs to call another web API, add the URI mapping here.
|
|
94
|
+
interactionType: InteractionType.Redirect,
|
|
95
|
+
protectedResourceMap: new Map([])
|
|
96
|
+
})),
|
|
97
|
+
{
|
|
98
|
+
provide: HTTP_INTERCEPTORS,
|
|
99
|
+
useClass: MsalInterceptor,
|
|
100
|
+
multi: true
|
|
101
|
+
},
|
|
102
|
+
MsalGuard, // MsalGuard added as provider here
|
|
103
|
+
]
|
|
104
|
+
}]
|
|
105
|
+
}] });
|
|
106
|
+
|
|
107
|
+
var InfraInAuthTypeId;
|
|
108
|
+
(function (InfraInAuthTypeId) {
|
|
109
|
+
InfraInAuthTypeId[InfraInAuthTypeId["Local"] = 1] = "Local";
|
|
110
|
+
InfraInAuthTypeId[InfraInAuthTypeId["Azure"] = 2] = "Azure";
|
|
111
|
+
InfraInAuthTypeId[InfraInAuthTypeId["LDAP"] = 3] = "LDAP";
|
|
112
|
+
})(InfraInAuthTypeId || (InfraInAuthTypeId = {}));
|
|
113
|
+
|
|
114
|
+
var InfraIn2FaTypeId;
|
|
115
|
+
(function (InfraIn2FaTypeId) {
|
|
116
|
+
InfraIn2FaTypeId[InfraIn2FaTypeId["Email"] = 1] = "Email";
|
|
117
|
+
InfraIn2FaTypeId[InfraIn2FaTypeId["Google"] = 2] = "Google";
|
|
118
|
+
InfraIn2FaTypeId[InfraIn2FaTypeId["Microsoft"] = 3] = "Microsoft";
|
|
119
|
+
})(InfraIn2FaTypeId || (InfraIn2FaTypeId = {}));
|
|
120
|
+
|
|
121
|
+
class LibCustomStorageService {
|
|
122
|
+
constructor() { }
|
|
32
123
|
// #region Métodos recebidos do projeto
|
|
33
124
|
storedStorageConstructor() { }
|
|
34
125
|
;
|
|
@@ -59,23 +150,9 @@ class LibCustomStorageService {
|
|
|
59
150
|
storageInitializeAutoStorage() {
|
|
60
151
|
this.storedStorageInitializeAutoStorage();
|
|
61
152
|
}
|
|
62
|
-
// Método executado para salvar as propriedades no LocalStorage (não deve ser modificado)
|
|
63
|
-
async __authStorageSaveLocalInstance() {
|
|
64
|
-
if (this.__isSaving) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.__isSaving = true;
|
|
68
|
-
this.storageSaveLocalInstance();
|
|
69
|
-
this.__authStorageNotSaving();
|
|
70
|
-
}
|
|
71
|
-
// Método executado para salvar as propriedades no LocalStorage (não deve ser modificado)
|
|
72
|
-
async __authStorageNotSaving() {
|
|
73
|
-
this.__isSaving = false;
|
|
74
|
-
}
|
|
75
153
|
// #endregion Métodos Customizadas para o Componente auth-storage.service.ts
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.__isSaving = customStorageService.isSaving;
|
|
154
|
+
// #region Métodos Publicos
|
|
155
|
+
InitializeCustomStorage(customStorageService) {
|
|
79
156
|
//passando implementação dos métodos do projeto para a lib
|
|
80
157
|
this.storedStorageConstructor = customStorageService.storageConstructor;
|
|
81
158
|
this.storedStorageInitializeAutoStorage = customStorageService.storageInitializeAutoStorage;
|
|
@@ -90,12 +167,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
90
167
|
args: [{ providedIn: 'root' }]
|
|
91
168
|
}], ctorParameters: () => [] });
|
|
92
169
|
|
|
170
|
+
/**Service responsável por pegar as opções do menu do projeto em que está sendo utilizada*/
|
|
171
|
+
class EnvironmentService {
|
|
172
|
+
constructor() {
|
|
173
|
+
this.production = false;
|
|
174
|
+
this.hostName = "";
|
|
175
|
+
this.product = "";
|
|
176
|
+
this.Sp2LocalhostInfra2AuthWS = "";
|
|
177
|
+
this.Sp2LocalhostInfra2LoginWS = "";
|
|
178
|
+
this.Sp2Localhost = "";
|
|
179
|
+
this.SpInfra2AuthWS = "";
|
|
180
|
+
this.SpInfra2LoginWS = "";
|
|
181
|
+
this.SpInfra2ErpWS = "";
|
|
182
|
+
}
|
|
183
|
+
ConfigurarEnvironments(properties) {
|
|
184
|
+
//passando propriedades do produto para a lib
|
|
185
|
+
this.production = properties.production;
|
|
186
|
+
this.hostName = properties.hostName;
|
|
187
|
+
this.product = properties.product;
|
|
188
|
+
this.Sp2LocalhostInfra2AuthWS = properties.Sp2LocalhostInfra2AuthWS;
|
|
189
|
+
this.Sp2LocalhostInfra2LoginWS = properties.Sp2LocalhostInfra2LoginWS;
|
|
190
|
+
this.Sp2Localhost = properties.Sp2LocalhostWS;
|
|
191
|
+
this.SpInfra2AuthWS = properties.SpInfra2AuthWS;
|
|
192
|
+
this.SpInfra2LoginWS = properties.SpInfra2LoginWS;
|
|
193
|
+
this.SpInfra2ErpWS = properties.SpInfra2ErpWS;
|
|
194
|
+
this.needsAuthAplic = properties.needsAuthAplic;
|
|
195
|
+
this.needsAuthInfra = properties.needsAuthInfra;
|
|
196
|
+
}
|
|
197
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EnvironmentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
198
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EnvironmentService, providedIn: 'root' }); }
|
|
199
|
+
}
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EnvironmentService, decorators: [{
|
|
201
|
+
type: Injectable,
|
|
202
|
+
args: [{ providedIn: 'root' }]
|
|
203
|
+
}] });
|
|
204
|
+
|
|
93
205
|
class AuthStorageService {
|
|
94
|
-
constructor(_httpBackend, _customStorageService) {
|
|
206
|
+
constructor(_httpBackend, _customStorageService, _environmentService) {
|
|
95
207
|
this._httpBackend = _httpBackend;
|
|
96
208
|
this._customStorageService = _customStorageService;
|
|
97
|
-
this.
|
|
98
|
-
this._BASE_URL =
|
|
209
|
+
this._environmentService = _environmentService;
|
|
210
|
+
this._BASE_URL = ''; // SpInfra2WS
|
|
99
211
|
this.__local_key = 'user_auth_v6';
|
|
100
212
|
// indica se objeto já está marcado para salvar os dados no local storage.
|
|
101
213
|
this.__isSaving = false;
|
|
@@ -131,27 +243,49 @@ class AuthStorageService {
|
|
|
131
243
|
this.__isExternalLogin = false;
|
|
132
244
|
/** Se é para ignorar o método reCheckLogin */
|
|
133
245
|
this.__ignoreCheckLogin = false;
|
|
246
|
+
//infraInAuthTypeId
|
|
247
|
+
this.__infraInAuthTypeId = 0;
|
|
248
|
+
//infraIn2FaTypeId
|
|
249
|
+
this.__infraIn2FaTypeId = null;
|
|
250
|
+
//is2FaEnabled
|
|
251
|
+
this.__is2FaEnabled = false;
|
|
252
|
+
// azureTenantId
|
|
253
|
+
this.__azureTenantId = "";
|
|
254
|
+
// azureClientId
|
|
255
|
+
this.__azureClientId = "";
|
|
134
256
|
this._httpClient = new HttpClient(_httpBackend);
|
|
135
|
-
|
|
257
|
+
this._BASE_URL = `${_environmentService.SpInfra2LoginWS}/LoginSisproERP`; // SpInfra2WS
|
|
258
|
+
this._BASE_URL = !_environmentService.production ? this._BASE_URL : `${_environmentService.SpInfra2LoginWS}/LoginSisproERP`;
|
|
136
259
|
// Método com customizações para inicializações da storage
|
|
137
260
|
this._customStorageService.storageConstructor();
|
|
138
261
|
const expectedLocalAuthStorage = localStorage.getItem(this.__local_key);
|
|
139
262
|
if (expectedLocalAuthStorage) {
|
|
140
263
|
const localAuthStorage = JSON.parse(expectedLocalAuthStorage);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
264
|
+
try {
|
|
265
|
+
this.__ip = localAuthStorage.__ip;
|
|
266
|
+
this.__tenantId = localAuthStorage.__tenantId;
|
|
267
|
+
this.__infraUsuarioId = localAuthStorage.__infraUsuarioId;
|
|
268
|
+
this.__infraEstabId = localAuthStorage.__infraEstabId;
|
|
269
|
+
this.__infraEstabNome = localAuthStorage.__infraEstabNome;
|
|
270
|
+
this.__infraEmpresaId = localAuthStorage.__infraEmpresaId;
|
|
271
|
+
this.__infraEmpresaNome = localAuthStorage.__infraEmpresaNome;
|
|
272
|
+
this.__user = localAuthStorage.__user;
|
|
273
|
+
this.__userName = localAuthStorage.__userName;
|
|
274
|
+
this.__tokenPayload = localAuthStorage.__tokenPayload;
|
|
275
|
+
this.__authToken = localAuthStorage.__authToken;
|
|
276
|
+
this.__dominio = localAuthStorage.__dominio;
|
|
277
|
+
this.__isExternalLogin = localAuthStorage.__isExternalLogin;
|
|
278
|
+
this.__infraInAuthTypeId = localAuthStorage.__infraInAuthTypeId;
|
|
279
|
+
this.__infraIn2FaTypeId = localAuthStorage.__infraIn2FaTypeId;
|
|
280
|
+
this.__is2FaEnabled = localAuthStorage.__is2FaEnabled;
|
|
281
|
+
this.__azureTenantId = localAuthStorage.__azureTenantId;
|
|
282
|
+
this.__azureClientId = localAuthStorage.__azureClientId;
|
|
283
|
+
this.startLoginCheck();
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
this.logout();
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
155
289
|
}
|
|
156
290
|
}
|
|
157
291
|
get ip() {
|
|
@@ -222,6 +356,10 @@ class AuthStorageService {
|
|
|
222
356
|
get tokenPayload() {
|
|
223
357
|
return this.__tokenPayload;
|
|
224
358
|
}
|
|
359
|
+
set tokenPayload(value) {
|
|
360
|
+
this.__tokenPayload = value;
|
|
361
|
+
this.__saveLocalInstance();
|
|
362
|
+
}
|
|
225
363
|
get authToken() {
|
|
226
364
|
return this.__authToken;
|
|
227
365
|
}
|
|
@@ -263,6 +401,41 @@ class AuthStorageService {
|
|
|
263
401
|
this.__ignoreCheckLogin = value;
|
|
264
402
|
this.__saveLocalInstance();
|
|
265
403
|
}
|
|
404
|
+
get infraInAuthTypeId() {
|
|
405
|
+
return this.__infraInAuthTypeId;
|
|
406
|
+
}
|
|
407
|
+
set infraInAuthTypeId(value) {
|
|
408
|
+
this.__infraInAuthTypeId = value;
|
|
409
|
+
this.__saveLocalInstance();
|
|
410
|
+
}
|
|
411
|
+
get infraIn2FaTypeId() {
|
|
412
|
+
return this.__infraIn2FaTypeId;
|
|
413
|
+
}
|
|
414
|
+
set infraIn2FaTypeId(value) {
|
|
415
|
+
this.__infraIn2FaTypeId = value;
|
|
416
|
+
this.__saveLocalInstance();
|
|
417
|
+
}
|
|
418
|
+
get is2FaEnabled() {
|
|
419
|
+
return this.__is2FaEnabled;
|
|
420
|
+
}
|
|
421
|
+
set is2FaEnabled(value) {
|
|
422
|
+
this.__is2FaEnabled = value;
|
|
423
|
+
this.__saveLocalInstance();
|
|
424
|
+
}
|
|
425
|
+
get azureTenantId() {
|
|
426
|
+
return this.__azureTenantId;
|
|
427
|
+
}
|
|
428
|
+
set azureTenantId(value) {
|
|
429
|
+
this.__azureTenantId = value;
|
|
430
|
+
this.__saveLocalInstance();
|
|
431
|
+
}
|
|
432
|
+
get azureClientId() {
|
|
433
|
+
return this.__azureClientId;
|
|
434
|
+
}
|
|
435
|
+
set azureClientId(value) {
|
|
436
|
+
this.__azureClientId = value;
|
|
437
|
+
this.__saveLocalInstance();
|
|
438
|
+
}
|
|
266
439
|
// #endregion GETTERS/SETTERS
|
|
267
440
|
async __saveLocalInstance() {
|
|
268
441
|
if (this.__isSaving) {
|
|
@@ -295,7 +468,12 @@ class AuthStorageService {
|
|
|
295
468
|
"__authToken": "${this.authToken}",
|
|
296
469
|
"__tokenPayload": ${JSON.stringify(this.tokenPayload)},
|
|
297
470
|
"__dominio": "${this.dominio}",
|
|
298
|
-
"__isExternalLogin": ${this.isExternalLogin}
|
|
471
|
+
"__isExternalLogin": ${this.isExternalLogin},
|
|
472
|
+
"__infraInAuthTypeId": ${this.infraInAuthTypeId},
|
|
473
|
+
"__infraIn2FaTypeId": ${this.infraIn2FaTypeId},
|
|
474
|
+
"__is2FaEnabled": ${this.is2FaEnabled},
|
|
475
|
+
"__azureTenantId": "${this.azureTenantId}",
|
|
476
|
+
"__azureClientId": "${this.azureClientId}"
|
|
299
477
|
}
|
|
300
478
|
`;
|
|
301
479
|
return json;
|
|
@@ -364,6 +542,11 @@ class AuthStorageService {
|
|
|
364
542
|
this.__dominio = "";
|
|
365
543
|
this.__tokenPayload = {};
|
|
366
544
|
this.__isExternalLogin = false;
|
|
545
|
+
this.__infraInAuthTypeId = 0;
|
|
546
|
+
this.__infraIn2FaTypeId = null;
|
|
547
|
+
this.__is2FaEnabled = false;
|
|
548
|
+
this.__azureTenantId = "";
|
|
549
|
+
this.__azureClientId = "";
|
|
367
550
|
localStorage.removeItem(this.__local_key);
|
|
368
551
|
// Método com customizações para finalizações da storage
|
|
369
552
|
this._customStorageService.storageLogout();
|
|
@@ -440,16 +623,27 @@ class AuthStorageService {
|
|
|
440
623
|
return false;
|
|
441
624
|
}
|
|
442
625
|
}
|
|
443
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthStorageService, deps: [{ token: i1.HttpBackend }, { token: LibCustomStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
626
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthStorageService, deps: [{ token: i1.HttpBackend }, { token: LibCustomStorageService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
444
627
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthStorageService, providedIn: 'root' }); }
|
|
445
628
|
}
|
|
446
629
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthStorageService, decorators: [{
|
|
447
630
|
type: Injectable,
|
|
448
631
|
args: [{ providedIn: 'root' }]
|
|
449
|
-
}], ctorParameters: () => [{ type: i1.HttpBackend }, { type: LibCustomStorageService }] });
|
|
632
|
+
}], ctorParameters: () => [{ type: i1.HttpBackend }, { type: LibCustomStorageService }, { type: EnvironmentService }] });
|
|
450
633
|
|
|
451
634
|
class LibCustomLoginService {
|
|
452
|
-
constructor() {
|
|
635
|
+
constructor() {
|
|
636
|
+
// #region Propriedade Customizadas para o Componente login.component.ts
|
|
637
|
+
this.loginTitle = "";
|
|
638
|
+
this.loginSubtitle = "";
|
|
639
|
+
this.loginBackground = "";
|
|
640
|
+
this.loginLogotipo = "";
|
|
641
|
+
this.loginAltLogotipo = "";
|
|
642
|
+
this.loginPageTitle = "";
|
|
643
|
+
this.loginDesenvDomain = "";
|
|
644
|
+
this.loginDesenvUser = "";
|
|
645
|
+
this.loginDesenvPassword = "";
|
|
646
|
+
}
|
|
453
647
|
// #endregion Propriedade Customizadas para o Componente login.component.ts
|
|
454
648
|
// #region Métodos Customizadas para o Componente auth.service.ts
|
|
455
649
|
/**
|
|
@@ -473,8 +667,10 @@ class LibCustomLoginService {
|
|
|
473
667
|
* @param router Objeto de Router que será utilizado
|
|
474
668
|
*/
|
|
475
669
|
authNavigateToPage(router) {
|
|
476
|
-
|
|
670
|
+
this.storedAuthNavigateToPage(router);
|
|
477
671
|
}
|
|
672
|
+
// #endregion Métodos recebidos do projeto
|
|
673
|
+
// #region Métodos Publicos
|
|
478
674
|
ConfigurarCustomLogin(customLoginService) {
|
|
479
675
|
//passando propriedades do projeto para a lib
|
|
480
676
|
this.loginTitle = customLoginService.loginTitle;
|
|
@@ -489,6 +685,7 @@ class LibCustomLoginService {
|
|
|
489
685
|
//passando implementação dos métodos do projeto para a lib
|
|
490
686
|
this.storedAuthLogin = customLoginService.authLogin;
|
|
491
687
|
this.storedAuthLogout = customLoginService.authLogout;
|
|
688
|
+
this.storedAuthNavigateToPage = customLoginService.authNavigateToPage;
|
|
492
689
|
}
|
|
493
690
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibCustomLoginService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
494
691
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibCustomLoginService, providedIn: 'root' }); }
|
|
@@ -498,31 +695,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
498
695
|
args: [{ providedIn: 'root' }]
|
|
499
696
|
}], ctorParameters: () => [] });
|
|
500
697
|
|
|
698
|
+
class ProjectUtilservice {
|
|
699
|
+
constructor(router, authStorageService, checkUrlAndMethodService, messageService, _environmentService) {
|
|
700
|
+
this.router = router;
|
|
701
|
+
this.authStorageService = authStorageService;
|
|
702
|
+
this.checkUrlAndMethodService = checkUrlAndMethodService;
|
|
703
|
+
this.messageService = messageService;
|
|
704
|
+
this._environmentService = _environmentService;
|
|
705
|
+
}
|
|
706
|
+
// Exibe a mensagem de erro de uma requisição http
|
|
707
|
+
showHttpError(error) {
|
|
708
|
+
if (error.error instanceof ErrorEvent) {
|
|
709
|
+
// Erro ocorreu no lado do cliente
|
|
710
|
+
this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
// Erro ocorreu no lado do servidor
|
|
714
|
+
let isUnauthorizedAccess = error.status === 401;
|
|
715
|
+
if (isUnauthorizedAccess) {
|
|
716
|
+
let isFromAplic = this.checkUrlAndMethodService.needsAuthRequest(error.url, "*", this._environmentService.needsAuthAplic);
|
|
717
|
+
if (isFromAplic) {
|
|
718
|
+
// Remove a autenticação do usuário.
|
|
719
|
+
this.authStorageService.isLoggedInSub.next(false);
|
|
720
|
+
this.authStorageService.urlRedirect = "/";
|
|
721
|
+
let promise = this.router.navigate(["/auth/login"]);
|
|
722
|
+
promise.then(this.showExpiredAccess.bind(this));
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
// Mostra uma mensagem de sessão expirada.
|
|
734
|
+
showExpiredAccess(navigationResult) {
|
|
735
|
+
if (navigationResult) {
|
|
736
|
+
this.messageService.showAlertWarning("Sessão expirada, logue-se novamente.");
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
// Obtém o hostName
|
|
740
|
+
getHostName() {
|
|
741
|
+
return this._environmentService.hostName;
|
|
742
|
+
}
|
|
743
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProjectUtilservice, deps: [{ token: i1$1.Router }, { token: AuthStorageService }, { token: i3.CheckUrlAndMethodService }, { token: i3.MessageService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
744
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProjectUtilservice, providedIn: 'root' }); }
|
|
745
|
+
}
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProjectUtilservice, decorators: [{
|
|
747
|
+
type: Injectable,
|
|
748
|
+
args: [{
|
|
749
|
+
providedIn: 'root'
|
|
750
|
+
}]
|
|
751
|
+
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthStorageService }, { type: i3.CheckUrlAndMethodService }, { type: i3.MessageService }, { type: EnvironmentService }] });
|
|
752
|
+
|
|
501
753
|
class AuthService {
|
|
502
754
|
// #endregion PRIVATE
|
|
503
755
|
// #endregion ==========> PROPERTIES <==========
|
|
504
|
-
constructor(_httpClient, _router, _authStorageService, _customLoginService,
|
|
756
|
+
constructor(_httpClient, _router, _authStorageService, _ipServiceService, _customLoginService, _projectUtilservice, _environmentService) {
|
|
505
757
|
this._httpClient = _httpClient;
|
|
506
758
|
this._router = _router;
|
|
507
759
|
this._authStorageService = _authStorageService;
|
|
508
|
-
this._customLoginService = _customLoginService;
|
|
509
760
|
this._ipServiceService = _ipServiceService;
|
|
761
|
+
this._customLoginService = _customLoginService;
|
|
762
|
+
this._projectUtilservice = _projectUtilservice;
|
|
763
|
+
this._environmentService = _environmentService;
|
|
510
764
|
// #region ==========> PROPERTIES <==========
|
|
511
765
|
// #region PRIVATE
|
|
512
|
-
|
|
513
|
-
//
|
|
514
|
-
//
|
|
515
|
-
this.
|
|
516
|
-
this._BASE_URL = `${this._HOSTNAME}/SisproErpCloud/Service_Private/Infra/SpInfra2LoginWS/api/LoginSisproERP`; // SpInfra2WS
|
|
766
|
+
this._pendingWarning = null;
|
|
767
|
+
this._BASE_URL = ''; // SpInfra2WS
|
|
768
|
+
this._AUTH_BASE_URL = ''; // SpInfra2AuthWS
|
|
769
|
+
this._BASE_OS_URL = ''; // SpInfra2LoginWS
|
|
517
770
|
this._HTTP_HEADERS = new HttpHeaders().set('Content-Type', 'application/json');
|
|
518
771
|
this.ip = "undefined";
|
|
519
772
|
this.city = "undefined";
|
|
520
773
|
this.state = "undefined";
|
|
521
774
|
this.country = "undefined";
|
|
522
|
-
|
|
523
|
-
this.
|
|
524
|
-
|
|
525
|
-
|
|
775
|
+
this._BASE_URL = `${this._environmentService.SpInfra2LoginWS}/LoginSisproERP`; // SpInfra2WS
|
|
776
|
+
this._AUTH_BASE_URL = `${this._environmentService.SpInfra2AuthWS}/Auth`; // SpInfra2AuthWS
|
|
777
|
+
this._BASE_OS_URL = `${this._environmentService.SpInfra2LoginWS}/LoginIntegradoOS`; // SpInfra2LoginWS
|
|
778
|
+
this._BASE_URL = !this._environmentService.production ? this._BASE_URL : `${this._environmentService.SpInfra2LoginWS}/LoginSisproERP`;
|
|
779
|
+
this._AUTH_BASE_URL = !this._environmentService.production ? this._AUTH_BASE_URL : `${this._environmentService.SpInfra2AuthWS}/Auth`;
|
|
780
|
+
this._BASE_OS_URL = !this._environmentService.production ? this._BASE_OS_URL : `${this._environmentService.SpInfra2LoginWS}/LoginIntegradoOS`;
|
|
526
781
|
this.getParms();
|
|
527
782
|
}
|
|
528
783
|
// #region ==========> SERVICE METHODS <==========
|
|
@@ -549,7 +804,7 @@ class AuthService {
|
|
|
549
804
|
},
|
|
550
805
|
});
|
|
551
806
|
}
|
|
552
|
-
|
|
807
|
+
getHostName() {
|
|
553
808
|
let product = window.location.pathname;
|
|
554
809
|
let index = product.indexOf("/auth/login");
|
|
555
810
|
if (index != -1) {
|
|
@@ -558,25 +813,55 @@ class AuthService {
|
|
|
558
813
|
else {
|
|
559
814
|
product = "";
|
|
560
815
|
}
|
|
561
|
-
return this.
|
|
816
|
+
return this._projectUtilservice.getHostName() + product;
|
|
562
817
|
}
|
|
563
818
|
// #endregion GET
|
|
564
819
|
// #region POST
|
|
820
|
+
/** Obtém o método de autenticação
|
|
821
|
+
* @param domain Domínio do login
|
|
822
|
+
* @returns Observable com os dados do método de autenticação, seja erro ou sucesso
|
|
823
|
+
*/
|
|
824
|
+
getAuthentication(domain) {
|
|
825
|
+
const params = new HttpParams()
|
|
826
|
+
.set('domain', domain);
|
|
827
|
+
const url = `${this._AUTH_BASE_URL}/GetAuthentication`;
|
|
828
|
+
const headers = this._HTTP_HEADERS;
|
|
829
|
+
return this._httpClient
|
|
830
|
+
.post(url, null, { 'params': params, 'headers': headers })
|
|
831
|
+
.pipe(take$1(1), tap$1((response) => {
|
|
832
|
+
if (response.Error) {
|
|
833
|
+
throw Error(response.ErrorMessage);
|
|
834
|
+
}
|
|
835
|
+
localStorage.setItem('configServerUser', response.User);
|
|
836
|
+
localStorage.setItem('configServerPassword', response.Password);
|
|
837
|
+
this._authStorageService.tenantId = response.TenantId;
|
|
838
|
+
this._authStorageService.dominio = response.Domain;
|
|
839
|
+
this._authStorageService.infraInAuthTypeId = response.InfraInAuthTypeId;
|
|
840
|
+
this._authStorageService.infraIn2FaTypeId = response.InfraIn2FaTypeId;
|
|
841
|
+
this._authStorageService.is2FaEnabled = response.Is2FaEnabled;
|
|
842
|
+
this._authStorageService.azureTenantId = response.AzureTenantId;
|
|
843
|
+
this._authStorageService.azureClientId = response.AzureClientId;
|
|
844
|
+
this._authStorageService.tokenPayload = {};
|
|
845
|
+
}));
|
|
846
|
+
}
|
|
565
847
|
/** Realiza o login no sistema
|
|
566
848
|
* @param login Informações do formulário de login
|
|
567
849
|
* @returns Observable com os dados do login realizado, seja erro ou sucesso
|
|
568
850
|
*/
|
|
569
|
-
login(
|
|
851
|
+
login(domain, user, password) {
|
|
570
852
|
let login = {
|
|
571
|
-
usuario:
|
|
572
|
-
senha:
|
|
853
|
+
usuario: user,
|
|
854
|
+
senha: password
|
|
573
855
|
};
|
|
574
856
|
const params = new HttpParams()
|
|
575
|
-
.set('dominio',
|
|
576
|
-
.set('urlServidor', this.
|
|
857
|
+
.set('dominio', domain)
|
|
858
|
+
.set('urlServidor', this.getHostName())
|
|
577
859
|
.set('ip', this.ip)
|
|
578
860
|
.set('browse', `${this._ipServiceService.getDataBrowserUser().browser} - ${this._ipServiceService.getDataBrowserUser().so}`)
|
|
579
|
-
.set('localization', `${this.city}, ${this.state}, ${this.country}`)
|
|
861
|
+
.set('localization', `${this.city}, ${this.state}, ${this.country}`)
|
|
862
|
+
.set('infraInAuthTypeId', this._authStorageService.infraInAuthTypeId)
|
|
863
|
+
.set('infraIn2FaTypeId', this._authStorageService.infraIn2FaTypeId)
|
|
864
|
+
.set('is2FaEnabled', this._authStorageService.is2FaEnabled);
|
|
580
865
|
const url = `${this._BASE_URL}/ValidateLogin`;
|
|
581
866
|
const headers = this._HTTP_HEADERS;
|
|
582
867
|
return this._httpClient
|
|
@@ -592,7 +877,7 @@ class AuthService {
|
|
|
592
877
|
//Inicializar password
|
|
593
878
|
this._authStorageService.logout();
|
|
594
879
|
}
|
|
595
|
-
else if (
|
|
880
|
+
else if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Local && this._authStorageService.infraIn2FaTypeId != null && this._authStorageService.infraIn2FaTypeId == InfraIn2FaTypeId.Email && this._authStorageService.is2FaEnabled) {
|
|
596
881
|
//Inicializar Autenticação Local 2 Fatores via Email
|
|
597
882
|
this._authStorageService.logout();
|
|
598
883
|
this._authStorageService.ip = this.ip;
|
|
@@ -602,6 +887,9 @@ class AuthService {
|
|
|
602
887
|
this._authStorageService.userName = response.UserName;
|
|
603
888
|
this._authStorageService.dominio = response.Dominio;
|
|
604
889
|
this._authStorageService.isExternalLogin = false;
|
|
890
|
+
this._authStorageService.infraInAuthTypeId = InfraInAuthTypeId.Local;
|
|
891
|
+
this._authStorageService.infraIn2FaTypeId = InfraIn2FaTypeId.Email;
|
|
892
|
+
this._authStorageService.is2FaEnabled = true;
|
|
605
893
|
}
|
|
606
894
|
else {
|
|
607
895
|
this._authStorageService.ignoreCheckLogin = true;
|
|
@@ -631,6 +919,62 @@ class AuthService {
|
|
|
631
919
|
}
|
|
632
920
|
}));
|
|
633
921
|
}
|
|
922
|
+
/** Realiza o login no sistema (Azure)
|
|
923
|
+
* @param domain Domínio de login
|
|
924
|
+
* @param user usuário de login (mail)
|
|
925
|
+
* @returns Observable com os dados do login realizado, seja erro ou sucesso
|
|
926
|
+
*/
|
|
927
|
+
loginAzure(domain, user) {
|
|
928
|
+
let login = {
|
|
929
|
+
usuario: user,
|
|
930
|
+
senha: "azure"
|
|
931
|
+
};
|
|
932
|
+
const params = new HttpParams()
|
|
933
|
+
.set('dominio', domain)
|
|
934
|
+
.set('urlServidor', this.getHostName())
|
|
935
|
+
.set('ip', this.ip)
|
|
936
|
+
.set('browse', `${this._ipServiceService.getDataBrowserUser().browser} - ${this._ipServiceService.getDataBrowserUser().so}`)
|
|
937
|
+
.set('localization', `${this.city}, ${this.state}, ${this.country}`)
|
|
938
|
+
.set('infraInAuthTypeId', this._authStorageService.infraInAuthTypeId)
|
|
939
|
+
.set('infraIn2FaTypeId', this._authStorageService.infraIn2FaTypeId)
|
|
940
|
+
.set('is2FaEnabled', this._authStorageService.is2FaEnabled);
|
|
941
|
+
const url = `${this._BASE_URL}/ValidateLogin`;
|
|
942
|
+
const headers = this._HTTP_HEADERS;
|
|
943
|
+
return this._httpClient
|
|
944
|
+
.post(url, login, { 'params': params, 'headers': headers })
|
|
945
|
+
.pipe(take$1(1), tap$1((response) => {
|
|
946
|
+
if (response.FeedbackMessage != "") {
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
if (response.Error) {
|
|
950
|
+
throw Error(response.ErrorMessage);
|
|
951
|
+
}
|
|
952
|
+
this._authStorageService.ignoreCheckLogin = true;
|
|
953
|
+
this._authStorageService.isLoggedInSub.next(true);
|
|
954
|
+
this._authStorageService.ip = this.ip;
|
|
955
|
+
this._authStorageService.tenantId = response.TenantId;
|
|
956
|
+
this._authStorageService.infraUsuarioId = response.InfraUsuarioId;
|
|
957
|
+
this._authStorageService.infraEstabId = response.EstabelecimentoId;
|
|
958
|
+
this._authStorageService.infraEstabNome = response.NomeEstabelecimento;
|
|
959
|
+
this._authStorageService.infraEmpresaId = response.EmpresaId;
|
|
960
|
+
this._authStorageService.infraEmpresaNome = response.NomeEmpresa;
|
|
961
|
+
this._authStorageService.user = login.usuario;
|
|
962
|
+
this._authStorageService.userName = response.UserName;
|
|
963
|
+
this._authStorageService.authToken = response.Token;
|
|
964
|
+
this._authStorageService.dominio = response.Dominio;
|
|
965
|
+
this._authStorageService.isExternalLogin = false;
|
|
966
|
+
// Método com customizações para inicializações do Login
|
|
967
|
+
this._customLoginService.authLogin();
|
|
968
|
+
if (this._authStorageService.urlRedirect == '' || this._authStorageService.urlRedirect == '/' || this._authStorageService.urlRedirect == '/auth/login') {
|
|
969
|
+
// Método com customizações para redirecionamento da tela inicial após login ok
|
|
970
|
+
this._customLoginService.authNavigateToPage(this._router);
|
|
971
|
+
}
|
|
972
|
+
else {
|
|
973
|
+
this._router.navigate([this._authStorageService.urlRedirect]);
|
|
974
|
+
}
|
|
975
|
+
this._authStorageService.urlRedirect = "/";
|
|
976
|
+
}));
|
|
977
|
+
}
|
|
634
978
|
loginExternal(dominio, user, password) {
|
|
635
979
|
let login = {
|
|
636
980
|
usuario: user,
|
|
@@ -662,6 +1006,73 @@ class AuthService {
|
|
|
662
1006
|
return response.Error;
|
|
663
1007
|
}));
|
|
664
1008
|
}
|
|
1009
|
+
/** Este método é utilizado para realizar o login no sistema integrado com a OS.
|
|
1010
|
+
* Originalmente pensado para utilizar apenas pelo componente de integração de login.
|
|
1011
|
+
* @param parmsLogin Informações do formulário de login
|
|
1012
|
+
* @param serialV6 Serial do V6
|
|
1013
|
+
*
|
|
1014
|
+
* @returns Observable com os dados do login realizado, seja erro ou sucesso
|
|
1015
|
+
*/
|
|
1016
|
+
loginOS(parmsLogin, serialV6) {
|
|
1017
|
+
let login = {
|
|
1018
|
+
usuario: parmsLogin.usuario,
|
|
1019
|
+
senha: parmsLogin.senha
|
|
1020
|
+
};
|
|
1021
|
+
const params = new HttpParams()
|
|
1022
|
+
.set('dominio', parmsLogin.dominio)
|
|
1023
|
+
.set('urlServidor', this.getHostName())
|
|
1024
|
+
.set('ip', this.ip)
|
|
1025
|
+
.set('browse', `${this._ipServiceService.getDataBrowserUser().browser} - ${this._ipServiceService.getDataBrowserUser().so}`)
|
|
1026
|
+
.set('localization', `${this.city}, ${this.state}, ${this.country}`)
|
|
1027
|
+
.set('infraInAuthTypeId', this._authStorageService.infraInAuthTypeId)
|
|
1028
|
+
.set('infraIn2FaTypeId', this._authStorageService.infraIn2FaTypeId)
|
|
1029
|
+
.set('is2FaEnabled', this._authStorageService.is2FaEnabled)
|
|
1030
|
+
.set('serialV6', serialV6);
|
|
1031
|
+
const url = `${this._BASE_OS_URL}/ValidateOSLogin`;
|
|
1032
|
+
const headers = this._HTTP_HEADERS;
|
|
1033
|
+
return this._httpClient
|
|
1034
|
+
.post(url, login, { 'params': params, 'headers': headers })
|
|
1035
|
+
.pipe(take$1(1), tap$1((response) => {
|
|
1036
|
+
if (response.FeedbackMessage != "" && response.FeedbackMessage != null) {
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
if (response.Error) {
|
|
1040
|
+
this._authStorageService.logout();
|
|
1041
|
+
throw Error(response.ErrorMessage);
|
|
1042
|
+
}
|
|
1043
|
+
if (response.InitializePassword) {
|
|
1044
|
+
//Inicializar password
|
|
1045
|
+
this._authStorageService.logout();
|
|
1046
|
+
}
|
|
1047
|
+
else if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Local && this._authStorageService.infraIn2FaTypeId != null && this._authStorageService.infraIn2FaTypeId == InfraIn2FaTypeId.Email && this._authStorageService.is2FaEnabled) {
|
|
1048
|
+
//Inicializar Autenticação Local 2 Fatores via Email
|
|
1049
|
+
this._authStorageService.logout();
|
|
1050
|
+
this._authStorageService.ip = this.ip;
|
|
1051
|
+
this._authStorageService.tenantId = response.TenantId;
|
|
1052
|
+
this._authStorageService.infraUsuarioId = response.InfraUsuarioId;
|
|
1053
|
+
this._authStorageService.user = login.usuario;
|
|
1054
|
+
this._authStorageService.userName = response.UserName;
|
|
1055
|
+
this._authStorageService.dominio = response.Dominio;
|
|
1056
|
+
this._authStorageService.isExternalLogin = false;
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
this._authStorageService.ignoreCheckLogin = true;
|
|
1060
|
+
this._authStorageService.isLoggedInSub.next(true);
|
|
1061
|
+
this._authStorageService.ip = this.ip;
|
|
1062
|
+
this._authStorageService.tenantId = response.TenantId;
|
|
1063
|
+
this._authStorageService.infraUsuarioId = response.InfraUsuarioId;
|
|
1064
|
+
this._authStorageService.infraEstabId = response.EstabelecimentoId;
|
|
1065
|
+
this._authStorageService.infraEstabNome = response.NomeEstabelecimento;
|
|
1066
|
+
this._authStorageService.infraEmpresaId = response.EmpresaId;
|
|
1067
|
+
this._authStorageService.infraEmpresaNome = response.NomeEmpresa;
|
|
1068
|
+
this._authStorageService.user = login.usuario;
|
|
1069
|
+
this._authStorageService.userName = response.UserName;
|
|
1070
|
+
this._authStorageService.authToken = response.Token;
|
|
1071
|
+
this._authStorageService.dominio = response.Dominio;
|
|
1072
|
+
this._authStorageService.isExternalLogin = false;
|
|
1073
|
+
}
|
|
1074
|
+
}));
|
|
1075
|
+
}
|
|
665
1076
|
logout() {
|
|
666
1077
|
this._authStorageService.logout();
|
|
667
1078
|
localStorage.removeItem('configsServerUser');
|
|
@@ -735,7 +1146,7 @@ class AuthService {
|
|
|
735
1146
|
const params = new HttpParams()
|
|
736
1147
|
.set('domain', parms.dominioFgtPsw)
|
|
737
1148
|
.set('user', parms.usuarioFgtPsw)
|
|
738
|
-
.set('urlServidor', this.
|
|
1149
|
+
.set('urlServidor', this.getHostName())
|
|
739
1150
|
.set('ip', this.ip)
|
|
740
1151
|
.set('browse', `${this._ipServiceService.getDataBrowserUser().browser} - ${this._ipServiceService.getDataBrowserUser().so}`)
|
|
741
1152
|
.set('localization', `${this.city}, ${this.state}, ${this.country}`);
|
|
@@ -787,105 +1198,401 @@ class AuthService {
|
|
|
787
1198
|
}
|
|
788
1199
|
}));
|
|
789
1200
|
}
|
|
790
|
-
|
|
1201
|
+
// #endregion POST
|
|
1202
|
+
// #endregion ==========> SERVICE METHODS <==========
|
|
1203
|
+
// #region ==========> UTILS <==========
|
|
1204
|
+
setPendingWarning(message) {
|
|
1205
|
+
this._pendingWarning = message;
|
|
1206
|
+
}
|
|
1207
|
+
consumePendingWarning() {
|
|
1208
|
+
const message = this._pendingWarning;
|
|
1209
|
+
this._pendingWarning = null;
|
|
1210
|
+
return message;
|
|
1211
|
+
}
|
|
1212
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthService, deps: [{ token: i1.HttpClient }, { token: i1$1.Router }, { token: AuthStorageService }, { token: i3.IpServiceService }, { token: LibCustomLoginService }, { token: ProjectUtilservice }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
791
1213
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthService, providedIn: 'root' }); }
|
|
792
1214
|
}
|
|
793
1215
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthService, decorators: [{
|
|
794
1216
|
type: Injectable,
|
|
795
1217
|
args: [{ providedIn: 'root' }]
|
|
796
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Router }, { type: AuthStorageService }, { type: LibCustomLoginService }, { type:
|
|
1218
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i1$1.Router }, { type: AuthStorageService }, { type: i3.IpServiceService }, { type: LibCustomLoginService }, { type: ProjectUtilservice }, { type: EnvironmentService }] });
|
|
797
1219
|
|
|
798
|
-
class
|
|
799
|
-
constructor(_httpClient) {
|
|
1220
|
+
class MenuServicesService {
|
|
1221
|
+
constructor(_authStorageService, _httpClient, _environmentService) {
|
|
1222
|
+
this._authStorageService = _authStorageService;
|
|
800
1223
|
this._httpClient = _httpClient;
|
|
801
|
-
|
|
802
|
-
//
|
|
803
|
-
// : `https://${window.location.hostname}`;
|
|
804
|
-
this._HOSTNAME = "https://siscandesv6.sispro.com.br";
|
|
805
|
-
this._BASE_URL = `${this._HOSTNAME}/SisproErpCloud/Service_Private/Infra/SpInfra2ConfigWS/api/Config`;
|
|
1224
|
+
this._environmentService = _environmentService;
|
|
1225
|
+
this._BASE_URL = ""; // SpInfra2AplicWS
|
|
806
1226
|
this._HTTP_HEADERS = new HttpHeaders().set('Content-Type', 'application/json');
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1227
|
+
// #endregion Menu Dinâmico
|
|
1228
|
+
// #endregion ==========> SERVICES <==========
|
|
1229
|
+
// #region ==========> UTILITIES <==========
|
|
1230
|
+
this._menuFooterImg = null;
|
|
1231
|
+
// #region NewImg Event
|
|
1232
|
+
// Implementação de lógica vista no link: https://hasangalakdinu.medium.com/how-to-call-a-function-in-another-component-angular-using-rxjs-3f2e85920705
|
|
1233
|
+
this._subject = new Subject();
|
|
1234
|
+
this._BASE_URL = `${this._environmentService.SpInfra2ErpWS}`; // SpInfra2ErpWS
|
|
1235
|
+
this._BASE_URL = !this._environmentService.production ? this._BASE_URL : `${this._environmentService.SpInfra2ErpWS}`;
|
|
810
1236
|
}
|
|
811
|
-
// #region
|
|
812
|
-
|
|
813
|
-
|
|
1237
|
+
// #region ==========> SERVICES <==========
|
|
1238
|
+
// #region PREPARATION
|
|
1239
|
+
// #region Menu: Usuário
|
|
1240
|
+
// [...]
|
|
1241
|
+
// #endregion Menu: Usuário
|
|
1242
|
+
// #region Menu: Estabelecimentos
|
|
1243
|
+
getEstabelecimentosModalList(usuarioID, pesquisa) {
|
|
1244
|
+
const params = new HttpParams()
|
|
1245
|
+
.set('pesquisa', pesquisa);
|
|
1246
|
+
const headers = new HttpHeaders()
|
|
1247
|
+
.set('Content-Type', 'application/json');
|
|
1248
|
+
const url = `${this._BASE_URL}/InfraEstabelecimento/GetEstabelecimentosModal`;
|
|
814
1249
|
return this._httpClient
|
|
815
|
-
.
|
|
1250
|
+
.get(url, { 'params': params, 'headers': headers })
|
|
816
1251
|
.pipe(take(1), tap(response => {
|
|
817
|
-
|
|
818
|
-
|
|
1252
|
+
if (response.Error) {
|
|
1253
|
+
throw Error(response.ErrorMessage);
|
|
1254
|
+
}
|
|
819
1255
|
}));
|
|
820
1256
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
1257
|
+
// #endregion Menu: Estabelecimentos
|
|
1258
|
+
// #endregion PREPARATION
|
|
1259
|
+
// #region GET
|
|
1260
|
+
// #region Menu: Usuário
|
|
1261
|
+
getImagemMenu() {
|
|
1262
|
+
const url = `${this._BASE_URL}/InfraUsuario/GetImagemMenu`;
|
|
1263
|
+
return this._httpClient
|
|
1264
|
+
.get(url, { 'headers': this._HTTP_HEADERS })
|
|
1265
|
+
.pipe(take(1), tap(response => {
|
|
1266
|
+
if (response.Error) {
|
|
1267
|
+
throw Error(response.ErrorMessage);
|
|
1268
|
+
}
|
|
1269
|
+
this.saveImageToStorage(response.InfraUsuarioImg.IMAGEM, response.InfraUsuarioImg.FILENAME);
|
|
1270
|
+
}));
|
|
1271
|
+
}
|
|
1272
|
+
// #endregion Menu: Usuário
|
|
1273
|
+
// #region Menu: Estabelecimentos
|
|
1274
|
+
getEstabelecimentoSession(estabID) {
|
|
1275
|
+
const params = new HttpParams()
|
|
1276
|
+
.set('id', estabID);
|
|
1277
|
+
const url = `${this._BASE_URL}/InfraEstabelecimento/GetEstabelecimentoSession`;
|
|
1278
|
+
return this._httpClient
|
|
1279
|
+
.get(url, { 'params': params, 'headers': this._HTTP_HEADERS })
|
|
1280
|
+
.pipe(take(1), tap(response => {
|
|
1281
|
+
if (response.Error) {
|
|
1282
|
+
throw Error(response.ErrorMessage);
|
|
1283
|
+
}
|
|
1284
|
+
}));
|
|
1285
|
+
}
|
|
1286
|
+
// #endregion Menu: Estabelecimentos
|
|
1287
|
+
// #region Get Usuario Email
|
|
1288
|
+
getUsuarioEmail() {
|
|
1289
|
+
const url = `${this._BASE_URL}/InfraUsuario/GetUsuarioEmail`;
|
|
1290
|
+
return this._httpClient
|
|
1291
|
+
.get(url, { 'headers': this._HTTP_HEADERS })
|
|
1292
|
+
.pipe(take(1), tap(response => {
|
|
1293
|
+
if (response.Error) {
|
|
1294
|
+
throw Error(response.ErrorMessage);
|
|
1295
|
+
}
|
|
1296
|
+
}));
|
|
1297
|
+
}
|
|
1298
|
+
// #endregion Get Usuario Email
|
|
1299
|
+
// #endregion GET
|
|
1300
|
+
// #region UPDATE
|
|
1301
|
+
// #region Menu: Usuário
|
|
1302
|
+
updateLastLogEstabID(estabID) {
|
|
1303
|
+
const params = new HttpParams()
|
|
1304
|
+
.set('estabID', estabID);
|
|
1305
|
+
const url = `${this._BASE_URL}/InfraUsuario/UpdateLastSelectedEstabelecimento`;
|
|
1306
|
+
return this._httpClient
|
|
1307
|
+
.post(url, null, { 'params': params, 'headers': this._HTTP_HEADERS })
|
|
1308
|
+
.pipe(take(1), tap(response => {
|
|
1309
|
+
if (response.Error) {
|
|
1310
|
+
throw Error(response.ErrorMessage);
|
|
1311
|
+
}
|
|
1312
|
+
}));
|
|
1313
|
+
}
|
|
1314
|
+
// #endregion Menu: Usuário
|
|
1315
|
+
// #region Menu: Estabelecimentos
|
|
1316
|
+
defineDefaultEstabelecimento(estabID, usuarioID, isDefault) {
|
|
1317
|
+
const params = new HttpParams()
|
|
1318
|
+
.set('estabID', estabID)
|
|
1319
|
+
.set('isDefault', isDefault);
|
|
1320
|
+
const url = `${this._BASE_URL}/InfraEstabelecimento/DefineDefaultEstab`;
|
|
1321
|
+
return this._httpClient
|
|
1322
|
+
.post(url, null, { 'params': params, 'headers': this._HTTP_HEADERS })
|
|
1323
|
+
.pipe(take(1), tap(response => {
|
|
1324
|
+
if (response.Error) {
|
|
1325
|
+
throw Error(response.ErrorMessage);
|
|
1326
|
+
}
|
|
1327
|
+
}));
|
|
1328
|
+
}
|
|
1329
|
+
// #endregion Menu: Estabelecimentos
|
|
1330
|
+
// #endregion UPDATE
|
|
1331
|
+
// #region Menu Dinâmico
|
|
1332
|
+
/** Método executado para pegar o Menu lateral levando em conta as permissões do usuário, grupo e o tenant ativo
|
|
1333
|
+
* Executado caso o getter do boolean Menu Dynamic seja true
|
|
1334
|
+
*/
|
|
1335
|
+
getMenuLateral(moduloId) {
|
|
1336
|
+
const headers = new HttpHeaders().set("Content-Type", "application/json");
|
|
1337
|
+
const url = `${this._BASE_URL}/Menu/GetMenuLateral`;
|
|
1338
|
+
const params = new HttpParams()
|
|
1339
|
+
.set('moduloId', moduloId);
|
|
1340
|
+
return this._httpClient
|
|
1341
|
+
.get(url, { params: params, headers: headers })
|
|
1342
|
+
.pipe(take(1), tap((response) => {
|
|
1343
|
+
if (response.Error) {
|
|
1344
|
+
throw Error(response.ErrorMessage);
|
|
1345
|
+
}
|
|
1346
|
+
}));
|
|
1347
|
+
}
|
|
1348
|
+
/** Método executado para montar estrutura de título, submenu e telas de acordo com os modelos presentes na ngx-sp-infra
|
|
1349
|
+
* envia-se o título deste grupo de submenus, ícone e enum daqueles submenus que
|
|
1350
|
+
* ficarão alocados no grupo de determinado título enviado
|
|
1351
|
+
*/
|
|
1352
|
+
getTelaSubmenus(NavSubmenuSearchItems) {
|
|
1353
|
+
const headers = new HttpHeaders()
|
|
1354
|
+
.set('Content-Type', 'application/json');
|
|
1355
|
+
const url = `${this._BASE_URL}/Menu/GetTelaSubmenus`;
|
|
1356
|
+
return this._httpClient
|
|
1357
|
+
.post(url, JSON.stringify(NavSubmenuSearchItems), { 'headers': headers })
|
|
1358
|
+
.pipe(take(1), tap(response => {
|
|
1359
|
+
if (response.Error) {
|
|
1360
|
+
throw Error(response.ErrorMessage);
|
|
1361
|
+
}
|
|
1362
|
+
}));
|
|
1363
|
+
}
|
|
1364
|
+
/** Método executado para montar estrutura da tela de submenu com os cards baseado no IdUnico do menu acessado em específico
|
|
1365
|
+
*/
|
|
1366
|
+
getTelaSubmenusWithCards(MenuIdUnico) {
|
|
1367
|
+
const headers = new HttpHeaders()
|
|
1368
|
+
.set('Content-Type', 'application/json');
|
|
1369
|
+
const url = `${this._BASE_URL}/Menu/GetTelaSubmenusWithCards`;
|
|
1370
|
+
const params = new HttpParams()
|
|
1371
|
+
.set('MenuIdUnico', MenuIdUnico);
|
|
1372
|
+
return this._httpClient
|
|
1373
|
+
.get(url, { 'params': params, 'headers': headers })
|
|
1374
|
+
.pipe(take(1), tap(response => {
|
|
1375
|
+
if (response.Error) {
|
|
1376
|
+
throw Error(response.ErrorMessage);
|
|
1377
|
+
}
|
|
1378
|
+
}));
|
|
1379
|
+
}
|
|
1380
|
+
getMenuFooterImg() {
|
|
1381
|
+
const cachedFooterImg = JSON.parse(localStorage.getItem('menuFooterImg'));
|
|
1382
|
+
if (cachedFooterImg) {
|
|
1383
|
+
return cachedFooterImg;
|
|
1384
|
+
}
|
|
1385
|
+
return this._menuFooterImg;
|
|
1386
|
+
}
|
|
1387
|
+
setMenuFooterImg(value) {
|
|
1388
|
+
this._menuFooterImg = value;
|
|
1389
|
+
localStorage.setItem('menuFooterImg', JSON.stringify(value));
|
|
1390
|
+
}
|
|
1391
|
+
saveImageToStorage(footerImgSrc, footerImgName) {
|
|
1392
|
+
this.setMenuFooterImg({ USUARIOID: this._authStorageService.infraUsuarioId, FILENAME: footerImgName, FILE: footerImgSrc });
|
|
1393
|
+
}
|
|
1394
|
+
newUserImageEvent(value) {
|
|
1395
|
+
this._subject.next(value);
|
|
1396
|
+
}
|
|
1397
|
+
getNewUserImageEvent() {
|
|
1398
|
+
return this._subject.asObservable();
|
|
1399
|
+
}
|
|
1400
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuServicesService, deps: [{ token: AuthStorageService }, { token: i1.HttpClient }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1401
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuServicesService, providedIn: 'root' }); }
|
|
1402
|
+
}
|
|
1403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuServicesService, decorators: [{
|
|
1404
|
+
type: Injectable,
|
|
1405
|
+
args: [{
|
|
1406
|
+
providedIn: 'root'
|
|
1407
|
+
}]
|
|
1408
|
+
}], ctorParameters: () => [{ type: AuthStorageService }, { type: i1.HttpClient }, { type: EnvironmentService }] });
|
|
1409
|
+
|
|
831
1410
|
/**Service responsável por pegar as opções do menu do projeto em que está sendo utilizada*/
|
|
832
|
-
class
|
|
1411
|
+
class LibMenuConfigService {
|
|
833
1412
|
constructor() {
|
|
834
|
-
this.
|
|
835
|
-
this.
|
|
1413
|
+
this.menu = [];
|
|
1414
|
+
this.menuDropdown = [];
|
|
836
1415
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
1416
|
+
/** Inicializa as opções do menu com base na rota atual e em uma lista personalizada (opcional).
|
|
1417
|
+
* @param currentRoute A rota atual da aplicação
|
|
1418
|
+
* @param customList Uma lista personalizada de opções de menu (opcional).
|
|
1419
|
+
* @returns As opções do menu inicializadas.
|
|
1420
|
+
*/
|
|
1421
|
+
initializeMenu(currentRoute, customList) {
|
|
1422
|
+
this.menu = this.storedInitializeMenu(currentRoute, customList);
|
|
1423
|
+
return this.menu;
|
|
841
1424
|
}
|
|
842
|
-
|
|
843
|
-
|
|
1425
|
+
setMenuType(isStaticMenu) {
|
|
1426
|
+
this.storedSetMenuType(isStaticMenu);
|
|
1427
|
+
}
|
|
1428
|
+
updateRouteSelection(currentRoute, currentList) {
|
|
1429
|
+
return this.updateRouteSelection(currentRoute, currentList);
|
|
1430
|
+
}
|
|
1431
|
+
/** Inicializa as opções do menu dropdown com base em uma lista personalizada (opcional).
|
|
1432
|
+
* @param primaryDropdownList Uma lista personalizada de opções do dropdown (opcional).
|
|
1433
|
+
* @returns As opções do dropdown inicializadas.
|
|
1434
|
+
*/
|
|
1435
|
+
initializeMenuDropdown(primaryDropdownList) {
|
|
1436
|
+
this.menuDropdown = this.storedInitializeMenuDropdown(primaryDropdownList);
|
|
1437
|
+
return this.menuDropdown;
|
|
1438
|
+
}
|
|
1439
|
+
ConfigurarMenuConfig(menuConfig) {
|
|
1440
|
+
//passando implementação dos métodos do projeto para a lib
|
|
1441
|
+
this.storedInitializeMenu = menuConfig.initializeMenu;
|
|
1442
|
+
this.storedInitializeMenuDropdown = menuConfig.initializeMenuDropdown;
|
|
1443
|
+
this.storedSetMenuType = menuConfig.setMenuType;
|
|
1444
|
+
this.updateRouteSelection = menuConfig.updateRouteSelection;
|
|
1445
|
+
}
|
|
1446
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibMenuConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1447
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibMenuConfigService, providedIn: 'root' }); }
|
|
844
1448
|
}
|
|
845
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibMenuConfigService, decorators: [{
|
|
846
1450
|
type: Injectable,
|
|
847
1451
|
args: [{ providedIn: 'root' }]
|
|
848
1452
|
}] });
|
|
849
1453
|
|
|
1454
|
+
class LibCustomMenuService {
|
|
1455
|
+
/** Obtém as opções do menu. */
|
|
1456
|
+
get menuItems() {
|
|
1457
|
+
return this._menuItems;
|
|
1458
|
+
}
|
|
1459
|
+
set menuItems(value) {
|
|
1460
|
+
this._menuItems = value;
|
|
1461
|
+
}
|
|
1462
|
+
setEmpresa(value) { this.empresaId.next(value); }
|
|
1463
|
+
// ! Definição do BehaviorSubject: responsável principal da emissão do evento
|
|
1464
|
+
// #endregion Propriedade do Menu
|
|
1465
|
+
constructor(_menuConfig, _authStorageService) {
|
|
1466
|
+
this._menuConfig = _menuConfig;
|
|
1467
|
+
this._authStorageService = _authStorageService;
|
|
1468
|
+
// #region Propriedade Customizadas do Menu
|
|
1469
|
+
this.menuDynamic = false;
|
|
1470
|
+
this.menuDynamicCustom = false;
|
|
1471
|
+
this.moduleName = "";
|
|
1472
|
+
this.moduleImg = "";
|
|
1473
|
+
this.moduleSvg = "";
|
|
1474
|
+
this.themeColor = "";
|
|
1475
|
+
// #endregion Propriedade Customizadas do Menu
|
|
1476
|
+
// #region Propriedade do Menu
|
|
1477
|
+
this._menuItems = [];
|
|
1478
|
+
// ! Definição do BehaviorSubject: responsável principal da emissão do evento
|
|
1479
|
+
this.empresaId = new BehaviorSubject({ estabelecimentoID: "", empresaID: "" });
|
|
1480
|
+
this.applyEmpresa$ = this.empresaId.asObservable();
|
|
1481
|
+
// inicializações do Menu Dinâmico
|
|
1482
|
+
this.menuConfig = _menuConfig;
|
|
1483
|
+
}
|
|
1484
|
+
// #region - Métodos Customizadas para o Menu dinâmico
|
|
1485
|
+
// Método executado no menu-lateral.component.ts - método: onInit ()
|
|
1486
|
+
// Utilizado para obter o Módulo para montagem do Menu Dinâmico Lateral
|
|
1487
|
+
menuDynamicGetModuloId() {
|
|
1488
|
+
return this.storeMenuDynamicGetModuloId();
|
|
1489
|
+
}
|
|
1490
|
+
// Método executado no menu-lateral.component.ts - método: onInit ()
|
|
1491
|
+
// Utilizado para inicializações diversas
|
|
1492
|
+
menuDynamicOnInit() {
|
|
1493
|
+
this.storedMenuDynamicOnInit();
|
|
1494
|
+
}
|
|
1495
|
+
// Método executado no menu-lateral.component.ts - método: onInit ()
|
|
1496
|
+
// Utilizado para inicializações diversas
|
|
1497
|
+
menuStaticOnInit() {
|
|
1498
|
+
this.storedMenuStaticOnInit();
|
|
1499
|
+
}
|
|
1500
|
+
// Método executado no menu-lateral.component.ts - método: openExpansibleMenu()
|
|
1501
|
+
// Utilizado para inicializações ao Expandir a opção de Menu
|
|
1502
|
+
menuopenExpansibleMenu(ref) {
|
|
1503
|
+
this.storedMenuopenExpansibleMenu(ref);
|
|
1504
|
+
}
|
|
1505
|
+
/** Método que deve ser chamado na seleção de um novo estabelecimento, ele atualizará os valores do nosso BehaviorSubject para que possamos utilizá-lo em outras partes do sistema. */
|
|
1506
|
+
emitEstabelecimentoEvent() {
|
|
1507
|
+
this.setEmpresa({
|
|
1508
|
+
estabelecimentoID: this._authStorageService.infraEstabId,
|
|
1509
|
+
empresaID: this._authStorageService.infraEmpresaId
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
// #endregion Métodos recebidos do projeto
|
|
1513
|
+
// #region Métodos Publicos
|
|
1514
|
+
ConfigurarCustomMenuService(RealcustomMenuService) {
|
|
1515
|
+
//passando propriedades do projeto para a lib
|
|
1516
|
+
this.menuDynamic = RealcustomMenuService.menuDynamic;
|
|
1517
|
+
this.menuDynamicCustom = RealcustomMenuService.menuDynamicCustom;
|
|
1518
|
+
this.moduleName = RealcustomMenuService.moduleName;
|
|
1519
|
+
this.moduleImg = RealcustomMenuService.moduleImg;
|
|
1520
|
+
this.moduleSvg = RealcustomMenuService.moduleSvg;
|
|
1521
|
+
this.themeColor = RealcustomMenuService.themeColor;
|
|
1522
|
+
//passando implementação dos métodos do projeto para a lib
|
|
1523
|
+
this.storeMenuDynamicGetModuloId = RealcustomMenuService.menuDynamicGetModuloId;
|
|
1524
|
+
this.storedMenuStaticOnInit = RealcustomMenuService.menuStaticOnInit;
|
|
1525
|
+
this.storedMenuopenExpansibleMenu = RealcustomMenuService.menuopenExpansibleMenu;
|
|
1526
|
+
this.storedMenuDynamicOnInit = RealcustomMenuService.menuDynamicOnInit;
|
|
1527
|
+
}
|
|
1528
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibCustomMenuService, deps: [{ token: LibMenuConfigService }, { token: AuthStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1529
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibCustomMenuService, providedIn: 'root' }); }
|
|
1530
|
+
}
|
|
1531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LibCustomMenuService, decorators: [{
|
|
1532
|
+
type: Injectable,
|
|
1533
|
+
args: [{ providedIn: 'root' }]
|
|
1534
|
+
}], ctorParameters: () => [{ type: LibMenuConfigService }, { type: AuthStorageService }] });
|
|
1535
|
+
|
|
1536
|
+
var LoginProgress;
|
|
1537
|
+
(function (LoginProgress) {
|
|
1538
|
+
LoginProgress[LoginProgress["Domain"] = 1] = "Domain";
|
|
1539
|
+
LoginProgress[LoginProgress["Local"] = 2] = "Local";
|
|
1540
|
+
LoginProgress[LoginProgress["Azure"] = 3] = "Azure";
|
|
1541
|
+
})(LoginProgress || (LoginProgress = {}));
|
|
1542
|
+
// ajustes ERICK
|
|
1543
|
+
var SituacaoLogin;
|
|
1544
|
+
(function (SituacaoLogin) {
|
|
1545
|
+
SituacaoLogin[SituacaoLogin["LOGIN"] = 0] = "LOGIN";
|
|
1546
|
+
SituacaoLogin[SituacaoLogin["AUTENTICACAO_2_FATORES"] = 1] = "AUTENTICACAO_2_FATORES";
|
|
1547
|
+
SituacaoLogin[SituacaoLogin["ESQUECEU_SENHA"] = 2] = "ESQUECEU_SENHA";
|
|
1548
|
+
})(SituacaoLogin || (SituacaoLogin = {}));
|
|
1549
|
+
;
|
|
1550
|
+
// ajustes ERICK
|
|
850
1551
|
class LoginComponent {
|
|
851
|
-
constructor(
|
|
852
|
-
|
|
853
|
-
|
|
1552
|
+
constructor(_msalGuardConfiguration, _msalService, _customLoginService, _formBuilder, _projectUtilservice, _authService, _environmentService, _authStorageService, _title, _router, _toastrService,
|
|
1553
|
+
// Exibição de alerta para caso o payload do login OS não seja infromado corretamente
|
|
1554
|
+
_messageService) {
|
|
1555
|
+
this._msalGuardConfiguration = _msalGuardConfiguration;
|
|
1556
|
+
this._msalService = _msalService;
|
|
1557
|
+
this._customLoginService = _customLoginService;
|
|
854
1558
|
this._formBuilder = _formBuilder;
|
|
1559
|
+
this._projectUtilservice = _projectUtilservice;
|
|
855
1560
|
this._authService = _authService;
|
|
856
|
-
this._serverService = _serverService;
|
|
857
1561
|
this._environmentService = _environmentService;
|
|
858
1562
|
this._authStorageService = _authStorageService;
|
|
859
|
-
this._customLoginService = _customLoginService;
|
|
860
1563
|
this._title = _title;
|
|
861
1564
|
this._router = _router;
|
|
862
1565
|
this._toastrService = _toastrService;
|
|
1566
|
+
this._messageService = _messageService;
|
|
863
1567
|
// #region ==========> PROPERTIES <==========
|
|
864
1568
|
// #region PRIVATE
|
|
865
|
-
this.
|
|
1569
|
+
this._situacaoLogin = SituacaoLogin.LOGIN;
|
|
1570
|
+
// #endregion PRIVATE
|
|
1571
|
+
// #region PUBLIC
|
|
866
1572
|
// Variáveis específicas para funcionalidades padrões dos formulários
|
|
867
1573
|
this.currentTime = new Date();
|
|
868
1574
|
this.year = this.currentTime.getFullYear();
|
|
869
|
-
this.
|
|
1575
|
+
this.isLoadingDomain = false;
|
|
1576
|
+
this.isLoadingLogin = false;
|
|
1577
|
+
this.isLoadingAzure = false;
|
|
1578
|
+
this.isLoadingForgottenPassword = false;
|
|
870
1579
|
this.isLoadingSendAuthentication2Fa = false;
|
|
871
|
-
this.showParmsAuthentication2Fa = false;
|
|
872
1580
|
this.isLoadingGetNewCode = false;
|
|
873
|
-
|
|
874
|
-
|
|
1581
|
+
this.showParmsAuthentication2Fa = false;
|
|
1582
|
+
this.loginProgress = LoginProgress.Domain;
|
|
875
1583
|
// #endregion PUBLIC
|
|
876
1584
|
// #region Timer
|
|
877
1585
|
this._subscription = new Subscription();
|
|
878
1586
|
this.timerDuration = 90;
|
|
879
1587
|
this.secondsLeft = this.timerDuration;
|
|
880
1588
|
this.countdown$ = timer(0, 1000).pipe(take(this.timerDuration + 1), map$1(secondsElapsed => this.timerDuration - secondsElapsed));
|
|
881
|
-
// #endregion Timer
|
|
882
|
-
// #region ==========> FORM BUILDER <==========
|
|
883
|
-
this.form = new FormGroup({});
|
|
884
|
-
this.formFgtPsw = new FormGroup({});
|
|
885
|
-
this.formAuthentication2Fa = new FormGroup({});
|
|
886
1589
|
}
|
|
887
|
-
;
|
|
888
|
-
|
|
1590
|
+
get situacaoLogin() { return this._situacaoLogin; }
|
|
1591
|
+
set situacaoLogin(value) {
|
|
1592
|
+
this._situacaoLogin = value;
|
|
1593
|
+
if (value === SituacaoLogin.ESQUECEU_SENHA)
|
|
1594
|
+
this.createFormForgottenPassword();
|
|
1595
|
+
}
|
|
889
1596
|
// Propriedade necessário para que a classe static FormUtils possa ser utilizada no Html
|
|
890
1597
|
get FormUtils() {
|
|
891
1598
|
return FormUtils;
|
|
@@ -893,13 +1600,19 @@ class LoginComponent {
|
|
|
893
1600
|
// #region FORM DATA
|
|
894
1601
|
// Variáveis específicas para funcionalidades padrões dos formulários (Login)
|
|
895
1602
|
get dominio() {
|
|
896
|
-
return this.
|
|
1603
|
+
return this.formDomain.get('dominio')?.value;
|
|
897
1604
|
}
|
|
898
1605
|
get usuario() {
|
|
899
|
-
return this.
|
|
1606
|
+
return this.formLogin.get('usuario')?.value;
|
|
900
1607
|
}
|
|
901
1608
|
get senha() {
|
|
902
|
-
return this.
|
|
1609
|
+
return this.formLogin.get('senha')?.value;
|
|
1610
|
+
}
|
|
1611
|
+
get usuarioAzure() {
|
|
1612
|
+
return this.formAzure.get('usuario')?.value;
|
|
1613
|
+
}
|
|
1614
|
+
get senhaAzure() {
|
|
1615
|
+
return this.formAzure.get('senha')?.value;
|
|
903
1616
|
}
|
|
904
1617
|
// Variáveis específicas para funcionalidades padrões dos formulários (RequestRecoverPassword)
|
|
905
1618
|
get dominioFgtPsw() {
|
|
@@ -914,7 +1627,7 @@ class LoginComponent {
|
|
|
914
1627
|
}
|
|
915
1628
|
// #endregion FORM DATA
|
|
916
1629
|
// #endregion ==========> PROPERTIES <==========
|
|
917
|
-
ngOnInit() {
|
|
1630
|
+
async ngOnInit() {
|
|
918
1631
|
this._title.setTitle(this._customLoginService.loginPageTitle);
|
|
919
1632
|
if (this._customLoginService.loginTitle != "") {
|
|
920
1633
|
document.getElementById("title").innerHTML = this._customLoginService.loginTitle;
|
|
@@ -922,34 +1635,59 @@ class LoginComponent {
|
|
|
922
1635
|
if (this._customLoginService.loginSubtitle != "") {
|
|
923
1636
|
document.getElementById("subtitle").innerHTML = this._customLoginService.loginSubtitle;
|
|
924
1637
|
}
|
|
925
|
-
this.
|
|
1638
|
+
this.loginProgress = LoginProgress.Domain;
|
|
1639
|
+
this.createFormDomain();
|
|
1640
|
+
if (this._router.url.toLowerCase().startsWith('/auth/login#code=')) {
|
|
1641
|
+
this.loginProgress = LoginProgress.Azure;
|
|
1642
|
+
this.createFormAzure();
|
|
1643
|
+
await this.initMsalForLoginOk().then;
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
926
1646
|
}
|
|
927
1647
|
// #region FORM VALIDATORS
|
|
928
1648
|
// Método para configuração dos campos de edição do formulário (Login)
|
|
929
|
-
|
|
930
|
-
// Dados originais de Login
|
|
1649
|
+
createFormDomain() {
|
|
1650
|
+
// Dados originais de Login (Domínio)
|
|
931
1651
|
if (this._environmentService.production) {
|
|
932
|
-
this.
|
|
1652
|
+
this.formDomain = this._formBuilder.group({
|
|
933
1653
|
dominio: ['', [Validators.required, Validators.maxLength(50)]],
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
else {
|
|
1657
|
+
this.formDomain = this._formBuilder.group({
|
|
1658
|
+
dominio: [this._customLoginService.loginDesenvDomain, [Validators.required, Validators.maxLength(50)]],
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
createFormLogin() {
|
|
1663
|
+
// Dados originais de Login (Usuário e Senha)
|
|
1664
|
+
if (this._environmentService.production) {
|
|
1665
|
+
this.formLogin = this._formBuilder.group({
|
|
934
1666
|
usuario: ['', [Validators.required, Validators.maxLength(100)]],
|
|
935
1667
|
senha: ['', [Validators.required, Validators.maxLength(100)]]
|
|
936
1668
|
});
|
|
937
1669
|
}
|
|
938
1670
|
else {
|
|
939
|
-
this.
|
|
940
|
-
dominio: [this._customLoginService.loginDesenvDomain, [Validators.required, Validators.maxLength(50)]],
|
|
1671
|
+
this.formLogin = this._formBuilder.group({
|
|
941
1672
|
usuario: [this._customLoginService.loginDesenvUser, [Validators.required, Validators.maxLength(100)]],
|
|
942
1673
|
senha: [this._customLoginService.loginDesenvPassword, [Validators.required, Validators.maxLength(100)]]
|
|
943
1674
|
});
|
|
944
1675
|
}
|
|
945
1676
|
}
|
|
1677
|
+
createFormAzure() {
|
|
1678
|
+
// Dados originais de Login (Azure)
|
|
1679
|
+
this.formAzure = this._formBuilder.group({
|
|
1680
|
+
usuario: ['', [Validators.required, Validators.maxLength(100)]],
|
|
1681
|
+
senha: ['', [Validators.required, Validators.maxLength(100)]]
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
946
1684
|
// Método para configuração dos campos de edição do formulário (RequestRecoverPassword)
|
|
947
1685
|
createFormForgottenPassword() {
|
|
948
1686
|
this.formFgtPsw = this._formBuilder.group({
|
|
949
1687
|
dominioFgtPsw: ['', [Validators.required, Validators.maxLength(50)]],
|
|
950
1688
|
usuarioFgtPsw: ['', [Validators.required, Validators.maxLength(100)]],
|
|
951
1689
|
});
|
|
952
|
-
this.formFgtPsw.get('
|
|
1690
|
+
this.formFgtPsw.get('dominioFgtPsw')?.setValue('');
|
|
953
1691
|
this.formFgtPsw.get('usuarioFgtPsw')?.setValue('');
|
|
954
1692
|
}
|
|
955
1693
|
// Método para configuração dos campos de edição do formulário (Autenticação 2 Fatores)
|
|
@@ -957,11 +1695,71 @@ class LoginComponent {
|
|
|
957
1695
|
this.formAuthentication2Fa = this._formBuilder.group({
|
|
958
1696
|
code: ['', [Validators.required, Validators.maxLength(6)]],
|
|
959
1697
|
});
|
|
960
|
-
this.
|
|
1698
|
+
this.formAuthentication2Fa.get('code')?.setValue('');
|
|
961
1699
|
}
|
|
962
1700
|
// #endregion FORM VALIDATORS
|
|
963
1701
|
// #endregion ==========> FORM BUILDER <==========
|
|
964
1702
|
// #region ==========> SERVICE METHODS <==========
|
|
1703
|
+
// #region Azure
|
|
1704
|
+
async configMsal() {
|
|
1705
|
+
const isIE = window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1;
|
|
1706
|
+
const hostAuthLogin = !this._environmentService.production ? "http://localhost:4200/auth/login" : `${this._environmentService.hostName}/SisproErpCloud/${this._environmentService.product}/auth/login`;
|
|
1707
|
+
this._msalService.instance = new PublicClientApplication({
|
|
1708
|
+
auth: {
|
|
1709
|
+
clientId: `${this._authStorageService.azureClientId}`,
|
|
1710
|
+
authority: `https://login.microsoftonline.com/${this._authStorageService.azureTenantId}`,
|
|
1711
|
+
redirectUri: hostAuthLogin + "/",
|
|
1712
|
+
postLogoutRedirectUri: hostAuthLogin,
|
|
1713
|
+
navigateToLoginRequestUrl: true
|
|
1714
|
+
},
|
|
1715
|
+
cache: {
|
|
1716
|
+
cacheLocation: "localStorage",
|
|
1717
|
+
storeAuthStateInCookie: isIE
|
|
1718
|
+
},
|
|
1719
|
+
system: {
|
|
1720
|
+
loggerOptions: {
|
|
1721
|
+
loggerCallback: (logLevel, message, containsPii) => {
|
|
1722
|
+
console.log(message);
|
|
1723
|
+
},
|
|
1724
|
+
logLevel: LogLevel.Error,
|
|
1725
|
+
piiLoggingEnabled: false
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
async initMsal() {
|
|
1731
|
+
await this.configMsal().then(() => {
|
|
1732
|
+
this._msalService.handleRedirectObservable().subscribe({
|
|
1733
|
+
next: (result) => {
|
|
1734
|
+
if (!this._msalService.instance.getActiveAccount() && this._msalService.instance.getAllAccounts().length > 0) {
|
|
1735
|
+
this._msalService.instance.setActiveAccount(result.account);
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
error: (error) => {
|
|
1739
|
+
this._toastrService.warning(`Erro na inicialização dos parâmetros de configuração do 'Azure': ${error}`, '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
async initMsalForLoginOk() {
|
|
1745
|
+
await this.configMsal().then(() => {
|
|
1746
|
+
this._msalService.handleRedirectObservable().subscribe({
|
|
1747
|
+
next: (result) => {
|
|
1748
|
+
if (!this._msalService.instance.getActiveAccount() && this._msalService.instance.getAllAccounts().length > 0) {
|
|
1749
|
+
this._msalService.instance.setActiveAccount(result.account);
|
|
1750
|
+
}
|
|
1751
|
+
this.logOnAzureOk();
|
|
1752
|
+
},
|
|
1753
|
+
error: (error) => {
|
|
1754
|
+
this.loginProgress = LoginProgress.Domain;
|
|
1755
|
+
this.createFormDomain();
|
|
1756
|
+
this._router.navigate(["/auth/login"]);
|
|
1757
|
+
this._toastrService.warning(`Erro na inicialização dos parâmetros de configuração do 'Azure': ${error}`, '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
1758
|
+
}
|
|
1759
|
+
});
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
// #endregion Azure
|
|
965
1763
|
// #region GET
|
|
966
1764
|
// Obtém a Url do Config Erp
|
|
967
1765
|
geturlErpConfig() {
|
|
@@ -969,77 +1767,164 @@ class LoginComponent {
|
|
|
969
1767
|
return `${this._environmentService.hostName}/SisproErpCloud/ConfigErp`;
|
|
970
1768
|
}
|
|
971
1769
|
/*
|
|
972
|
-
* Obtém os parâmetros de
|
|
1770
|
+
* Obtém os parâmetros de método de autenticação
|
|
973
1771
|
*/
|
|
974
|
-
|
|
975
|
-
if (this.
|
|
976
|
-
this.
|
|
977
|
-
this.
|
|
978
|
-
next: response => {
|
|
979
|
-
|
|
1772
|
+
async getAuthentication() {
|
|
1773
|
+
if (this.formDomain.valid) {
|
|
1774
|
+
this.isLoadingDomain = true;
|
|
1775
|
+
this._authService.getAuthentication(this.dominio).subscribe({
|
|
1776
|
+
next: async (response) => {
|
|
1777
|
+
if (response.InfraInAuthTypeId == InfraInAuthTypeId.Local) {
|
|
1778
|
+
this.loginProgress = LoginProgress.Local;
|
|
1779
|
+
this.createFormLogin();
|
|
1780
|
+
}
|
|
1781
|
+
else if (response.InfraInAuthTypeId == InfraInAuthTypeId.Azure) {
|
|
1782
|
+
this.loginProgress = LoginProgress.Azure;
|
|
1783
|
+
this.createFormAzure();
|
|
1784
|
+
await this.initMsal();
|
|
1785
|
+
}
|
|
1786
|
+
else if (response.InfraInAuthTypeId == InfraInAuthTypeId.LDAP) {
|
|
1787
|
+
this.loginProgress = LoginProgress.Local;
|
|
1788
|
+
this.createFormLogin();
|
|
1789
|
+
}
|
|
1790
|
+
this.isLoadingDomain = false;
|
|
980
1791
|
},
|
|
981
1792
|
error: (error) => {
|
|
982
|
-
this.
|
|
983
|
-
|
|
984
|
-
this._messageService.showAlertDanger(error);
|
|
985
|
-
//pode ser substituido por console.error
|
|
986
|
-
throw new Error(error);
|
|
1793
|
+
this.isLoadingDomain = false;
|
|
1794
|
+
this._projectUtilservice.showHttpError(error);
|
|
987
1795
|
},
|
|
988
1796
|
});
|
|
989
1797
|
}
|
|
990
1798
|
else {
|
|
991
|
-
FormUtils.validateFields(this.
|
|
1799
|
+
FormUtils.validateFields(this.formDomain);
|
|
992
1800
|
}
|
|
993
1801
|
}
|
|
994
1802
|
// #endregion GET
|
|
995
1803
|
// #region POST
|
|
996
1804
|
// Executa o Login
|
|
997
1805
|
logOn() {
|
|
998
|
-
|
|
1806
|
+
if (this.formLogin.valid) {
|
|
1807
|
+
this.isLoadingLogin = true;
|
|
1808
|
+
this._authService.login(this.dominio, this.usuario, this.senha).subscribe({
|
|
1809
|
+
next: (response) => {
|
|
1810
|
+
this.isLoadingLogin = false;
|
|
1811
|
+
if (response.FeedbackMessage != "") {
|
|
1812
|
+
this._toastrService.warning(response.FeedbackMessage, '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
//Incialização de Senha
|
|
1816
|
+
if (response.InitializePassword) {
|
|
1817
|
+
let param = btoa(`true$${this.dominio}$${this.usuario}$${response.StatusSenha}`);
|
|
1818
|
+
this._router.navigate([`auth/login/novaSenha/${param}`]);
|
|
1819
|
+
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1820
|
+
}
|
|
1821
|
+
if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Local && this._authStorageService.infraIn2FaTypeId != null && this._authStorageService.infraIn2FaTypeId == InfraIn2FaTypeId.Email && this._authStorageService.is2FaEnabled) {
|
|
1822
|
+
this.createFormAuthentication2Fa();
|
|
1823
|
+
this._subscription = this.countdown$.subscribe(secondsLeft => {
|
|
1824
|
+
this.secondsLeft = secondsLeft;
|
|
1825
|
+
});
|
|
1826
|
+
this.showParmsAuthentication2Fa = true;
|
|
1827
|
+
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1828
|
+
}
|
|
1829
|
+
},
|
|
1830
|
+
error: (error) => {
|
|
1831
|
+
this.isLoadingLogin = false;
|
|
1832
|
+
this._projectUtilservice.showHttpError(error);
|
|
1833
|
+
},
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
else {
|
|
1837
|
+
FormUtils.validateFields(this.formLogin);
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
// Executa o Login (Admin)
|
|
1841
|
+
logOnAdmin() {
|
|
1842
|
+
if (this.formAzure.valid) {
|
|
1843
|
+
if (this.usuarioAzure.toUpperCase() != "ADMIN") {
|
|
1844
|
+
this._toastrService.warning("Esta opção é somente permitida para o usuário 'Admin'.", '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
1845
|
+
}
|
|
1846
|
+
else {
|
|
1847
|
+
const infraInAuthTypeId = this._authStorageService.infraInAuthTypeId;
|
|
1848
|
+
const infraIn2FaTypeId = this._authStorageService.infraIn2FaTypeId;
|
|
1849
|
+
const is2FaEnabled = this._authStorageService.is2FaEnabled;
|
|
1850
|
+
this._authStorageService.infraInAuthTypeId = InfraInAuthTypeId.Local;
|
|
1851
|
+
this._authStorageService.infraIn2FaTypeId = null;
|
|
1852
|
+
this._authStorageService.is2FaEnabled = false;
|
|
1853
|
+
this.isLoadingAzure = true;
|
|
1854
|
+
this._authService.login(this.dominio, this.usuarioAzure, this.senhaAzure).subscribe({
|
|
1855
|
+
next: (response) => {
|
|
1856
|
+
this.isLoadingAzure = false;
|
|
1857
|
+
if (response.FeedbackMessage != "") {
|
|
1858
|
+
this._toastrService.warning(response.FeedbackMessage, '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
1859
|
+
return;
|
|
1860
|
+
}
|
|
1861
|
+
//Incialização de Senha
|
|
1862
|
+
if (response.InitializePassword) {
|
|
1863
|
+
let param = btoa(`true$${this.dominio}$${this.usuarioAzure}$${response.StatusSenha}`);
|
|
1864
|
+
this._router.navigate([`auth/login/novaSenha/${param}`]);
|
|
1865
|
+
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1866
|
+
}
|
|
1867
|
+
if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Local && this._authStorageService.infraIn2FaTypeId != null && this._authStorageService.infraIn2FaTypeId == InfraIn2FaTypeId.Email && this._authStorageService.is2FaEnabled) {
|
|
1868
|
+
this.createFormAuthentication2Fa();
|
|
1869
|
+
this._subscription = this.countdown$.subscribe(secondsLeft => {
|
|
1870
|
+
this.secondsLeft = secondsLeft;
|
|
1871
|
+
});
|
|
1872
|
+
this.showParmsAuthentication2Fa = true;
|
|
1873
|
+
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1874
|
+
}
|
|
1875
|
+
},
|
|
1876
|
+
error: (error) => {
|
|
1877
|
+
this.isLoadingAzure = false;
|
|
1878
|
+
this._projectUtilservice.showHttpError(error);
|
|
1879
|
+
},
|
|
1880
|
+
});
|
|
1881
|
+
this._authStorageService.infraInAuthTypeId = infraInAuthTypeId;
|
|
1882
|
+
this._authStorageService.infraIn2FaTypeId = infraIn2FaTypeId;
|
|
1883
|
+
this._authStorageService.is2FaEnabled = is2FaEnabled;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
else {
|
|
1887
|
+
FormUtils.validateFields(this.formAzure);
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
// Executa o Login (Azure)
|
|
1891
|
+
logOnAzure() {
|
|
1892
|
+
if (this._msalGuardConfiguration.authRequest) {
|
|
1893
|
+
this._msalService.loginRedirect({ ...this._msalGuardConfiguration.authRequest });
|
|
1894
|
+
}
|
|
1895
|
+
else {
|
|
1896
|
+
this._msalService.loginRedirect();
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
// Executa o Login após o retorno ok do Azure
|
|
1900
|
+
async logOnAzureOk() {
|
|
1901
|
+
let username = this._msalService.instance.getActiveAccount()?.idTokenClaims?.preferred_username;
|
|
1902
|
+
this._authService.loginAzure(this._authStorageService.dominio, username ?? "").subscribe({
|
|
999
1903
|
next: (response) => {
|
|
1000
|
-
this.isLoading = false;
|
|
1001
1904
|
if (response.FeedbackMessage != "") {
|
|
1002
|
-
this._toastrService.warning(response.FeedbackMessage, '', {
|
|
1003
|
-
timeOut: 3000,
|
|
1004
|
-
extendedTimeOut: 2000
|
|
1005
|
-
});
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
//Incialização de Senha
|
|
1009
|
-
if (response.InitializePassword) {
|
|
1010
|
-
let param = btoa(`true$${this.dominio}$${this.usuario}$${response.statusSenha}`);
|
|
1011
|
-
this._router.navigate([`auth/login/novaSenha/${param}`]);
|
|
1012
|
-
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1013
|
-
}
|
|
1014
|
-
if (response.InfraInAuthTypeId == 1 && response.InfraIn2FaTypeId != null && response.InfraIn2FaTypeId == 1 && response.Is2FaEnabled) {
|
|
1015
|
-
this.createFormAuthentication2Fa();
|
|
1016
|
-
this._subscription = this.countdown$.subscribe(secondsLeft => {
|
|
1017
|
-
this.secondsLeft = secondsLeft;
|
|
1018
|
-
});
|
|
1019
|
-
this.showParmsAuthentication2Fa = true;
|
|
1020
|
-
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1905
|
+
this._toastrService.warning(response.FeedbackMessage, '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
1021
1906
|
}
|
|
1022
1907
|
},
|
|
1023
1908
|
error: (error) => {
|
|
1024
|
-
this.
|
|
1025
|
-
|
|
1026
|
-
this.
|
|
1027
|
-
|
|
1909
|
+
this.loginProgress = LoginProgress.Domain;
|
|
1910
|
+
this.createFormDomain();
|
|
1911
|
+
this._router.navigate(["/auth/login"]);
|
|
1912
|
+
this._projectUtilservice.showHttpError(error);
|
|
1028
1913
|
},
|
|
1029
1914
|
});
|
|
1030
1915
|
}
|
|
1031
1916
|
// Envia requisição para esquecer senha
|
|
1032
1917
|
sendForgottenPassword() {
|
|
1033
1918
|
if (this.formFgtPsw.valid) {
|
|
1034
|
-
this.
|
|
1919
|
+
this.isLoadingForgottenPassword = true;
|
|
1920
|
+
this._authService.getAuthentication(this.dominio).subscribe({
|
|
1035
1921
|
next: response => {
|
|
1036
1922
|
this.forgottenPassword();
|
|
1037
1923
|
},
|
|
1038
1924
|
error: (error) => {
|
|
1039
|
-
|
|
1040
|
-
this.
|
|
1041
|
-
|
|
1042
|
-
},
|
|
1925
|
+
this.isLoadingForgottenPassword = false;
|
|
1926
|
+
this._projectUtilservice.showHttpError(error);
|
|
1927
|
+
}
|
|
1043
1928
|
});
|
|
1044
1929
|
}
|
|
1045
1930
|
else {
|
|
@@ -1049,16 +1934,16 @@ class LoginComponent {
|
|
|
1049
1934
|
// Requisição para esquecer senha
|
|
1050
1935
|
forgottenPassword() {
|
|
1051
1936
|
this._authService.forgottenPassword(this.formFgtPsw.value).subscribe({
|
|
1052
|
-
next: (
|
|
1053
|
-
this.
|
|
1937
|
+
next: () => {
|
|
1938
|
+
this.isLoadingForgottenPassword = false;
|
|
1054
1939
|
let param = btoa(`false$${this.dominioFgtPsw}$${this.usuarioFgtPsw}$${3}`);
|
|
1055
|
-
this._router.navigate([`auth/login/novaSenha/${param}`])
|
|
1056
|
-
|
|
1940
|
+
this._router.navigate([`auth/login/novaSenha/${param}`]).then(() => {
|
|
1941
|
+
this._toastrService.success("Verifique no seu e-mail o código de validação.");
|
|
1942
|
+
});
|
|
1057
1943
|
},
|
|
1058
1944
|
error: (error) => {
|
|
1059
|
-
|
|
1060
|
-
this.
|
|
1061
|
-
throw new Error(error);
|
|
1945
|
+
this.isLoadingForgottenPassword = false;
|
|
1946
|
+
this._projectUtilservice.showHttpError(error);
|
|
1062
1947
|
},
|
|
1063
1948
|
});
|
|
1064
1949
|
}
|
|
@@ -1068,483 +1953,323 @@ class LoginComponent {
|
|
|
1068
1953
|
this.isLoadingSendAuthentication2Fa = true;
|
|
1069
1954
|
this.validateCode();
|
|
1070
1955
|
}
|
|
1071
|
-
else {
|
|
1072
|
-
FormUtils.validateFields(this.formAuthentication2Fa);
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
// Validação do código 2 fatores
|
|
1076
|
-
validateCode() {
|
|
1077
|
-
this._authService.validateAuthentication2Fa(this.code).subscribe({
|
|
1078
|
-
next: (response) => {
|
|
1079
|
-
this._subscription.unsubscribe();
|
|
1080
|
-
this.isLoadingSendAuthentication2Fa = false;
|
|
1081
|
-
},
|
|
1082
|
-
error: (error) => {
|
|
1083
|
-
this.isLoadingSendAuthentication2Fa = false;
|
|
1084
|
-
//this._projectUtilservice.showHttpError(error);
|
|
1085
|
-
this._messageService.showAlertDanger(error);
|
|
1086
|
-
throw new Error(error);
|
|
1087
|
-
},
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
// Envia requisição para validar código 2 fatores
|
|
1091
|
-
getNewCode() {
|
|
1092
|
-
this.isLoadingGetNewCode = true;
|
|
1093
|
-
this._serverService.getServer().subscribe({
|
|
1094
|
-
next: response => {
|
|
1095
|
-
this._subscription = this.countdown$.subscribe(secondsLeft => {
|
|
1096
|
-
this.secondsLeft = secondsLeft;
|
|
1097
|
-
});
|
|
1098
|
-
this.GetNewCode2Fa();
|
|
1099
|
-
},
|
|
1100
|
-
error: (error) => {
|
|
1101
|
-
//this._projectUtilservice.showHttpError(error);
|
|
1102
|
-
this._messageService.showAlertDanger(error);
|
|
1103
|
-
throw new Error(error);
|
|
1104
|
-
},
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1107
|
-
// Validação do código 2 fatores
|
|
1108
|
-
GetNewCode2Fa() {
|
|
1109
|
-
this._authService.GetNewCode2Fa().subscribe({
|
|
1110
|
-
next: (response) => {
|
|
1111
|
-
this.isLoadingGetNewCode = false;
|
|
1112
|
-
this._toastrService.success("Enviamos um novo código para o endereço de e-mail vinculado ao seu usuário. Verifique o lixo eletrônico (SPAM) da sua caixa de entrada, caso não tenha encontrado nossa mensagem.");
|
|
1113
|
-
},
|
|
1114
|
-
error: (error) => {
|
|
1115
|
-
this.isLoadingGetNewCode = false;
|
|
1116
|
-
//this._projectUtilservice.showHttpError(error);
|
|
1117
|
-
this._messageService.showAlertDanger(error);
|
|
1118
|
-
throw new Error(error);
|
|
1119
|
-
},
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
|
-
// #endregion POST
|
|
1123
|
-
// #region UTILIDADES
|
|
1124
|
-
// Retorno para a tela de login
|
|
1125
|
-
voltar() {
|
|
1126
|
-
this._subscription.unsubscribe();
|
|
1127
|
-
this.showParmsAuthentication2Fa = false;
|
|
1128
|
-
this._authStorageService.logout();
|
|
1129
|
-
this._router.navigate(["/auth/login"]);
|
|
1130
|
-
}
|
|
1131
|
-
// #endregion UTILIDADES
|
|
1132
|
-
// #endregion ==========> SERVICE METHODS <==========
|
|
1133
|
-
// #region ==========> MODALS <==========
|
|
1134
|
-
// Executa esquecer senha
|
|
1135
|
-
openForgottenPasswordModal(template) {
|
|
1136
|
-
this.createFormForgottenPassword();
|
|
1137
|
-
this.modalRef = this._bsModalService.show(template, {
|
|
1138
|
-
class: 'modal-dialog-centered',
|
|
1139
|
-
ignoreBackdropClick: false,
|
|
1140
|
-
keyboard: false,
|
|
1141
|
-
id: this.idFgtPsw
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
// Encerra esquecer senha
|
|
1145
|
-
closeForgottenPasswordModal() {
|
|
1146
|
-
this._bsModalService.hide(this.idFgtPsw);
|
|
1147
|
-
}
|
|
1148
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginComponent, deps: [{ token: i1$2.BsModalService }, { token: i5.MessageService }, { token: i3.FormBuilder }, { token: AuthService }, { token: ServerService }, { token: EnvironmentService }, { token: AuthStorageService }, { token: LibCustomLoginService }, { token: i9.Title }, { token: i1$1.Router }, { token: i11.ToastrService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1149
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: LoginComponent, isStandalone: false, selector: "lib-login", ngImport: i0, template: "<div class=\"container-fluid\">\n\t<div class=\"row\">\n\t\t<!-- Conte\u00FAdo da DIV do background -->\n\t\t<div class=\"col-md-7\">\n\t\t\t<div class=\"background\" style=\"background-image: linear-gradient(to bottom, rgba(10, 44, 81, 0.9), rgba(10, 44, 81, 0.9)), url({{_customLoginService.loginBackground}})\">\n\t\t\t\t<div class=\"text-position texto-apresentacao ps-5\">\n\t\t\t\t\t<h1 class=\"title\" id=\"title\"></h1>\n\t\t\t\t\t<p class=\"subtitle\" id=\"subtitle\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- Conte\u00FAdo da DIV de Login -->\n\t\t<div class=\"col-md-5\">\n\n\t\t\t<div class=\"div-size\">\n\t\t\t\t<div class=\"logotipo\">\n\t\t\t\t\t<img style=\"height: 95px;\" src=\"{{ _customLoginService.loginLogotipo }}\" alt=\"{{ _customLoginService.loginAltLogotipo }}\" />\n\t\t\t\t</div>\n\t\t\t\t<form *ngIf=\"!showParmsAuthentication2Fa; else Authentication2Fa\" [formGroup]=\"form\" class=\"form-position\">\n\t\t\t\t\t<div class=\"input-group input-group-lg form-item\">\n\t\t\t\t\t\t<span class=\"input-group-text\" id=\"basic-addon1\"\n\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px\">\n\t\t\t\t\t\t\t<img src=\"assets/icons/cloud.svg\" alt=\"cloud icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"dominio\" id=\"dominio\"\n\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"Dom\u00EDnio\" aria-label=\"Dom\u00EDnio\"\n\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('dominio'))\">\n\t\t\t\t\t\t<app-field-error-message [control]=\"form.get('dominio')\" label=\"Dom\u00EDnio\"></app-field-error-message>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"input-group input-group-lg form-item\">\n\t\t\t\t\t\t<span class=\"input-group-text\" id=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px\">\n\t\t\t\t\t\t\t<img src=\"assets/icons/at-sign.svg\" alt=\"at-sign icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"usuario\" id=\"usuario\"\n\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"Usu\u00E1rio\" aria-label=\"Usu\u00E1rio\"\n\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('usuario'))\">\n\t\t\t\t\t\t<app-field-error-message [control]=\"form.get('usuario')\" label=\"Usu\u00E1rio\"></app-field-error-message>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"input-group input-group-lg form-item\" style=\"margin-bottom: 8px;\">\n\t\t\t\t\t\t<span class=\"input-group-text\" id=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px;\">\n\t\t\t\t\t\t\t<img src=\"assets/icons/lock.svg\" alt=\"lock-icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<input type=\"password\" class=\"form-control\" formControlName=\"senha\" id=\"senha\"\n\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"Senha\" aria-label=\"senha\"\n\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('senha'))\">\n\t\t\t\t\t\t<app-field-error-message [control]=\"form.get('senha')\" label=\"Senha\"></app-field-error-message>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"remember-password\">\n\t\t\t\t\t<!-- Lembrar Senha\n\t\t\t\t\t\t<input id=\"checkboxLembrarSenha\" type=\"checkbox\" />\n\t\t\t\t\t\t<label for=\"checkboxLembrarSenha\"> Lembrar minha senha </label>\n \t\t\t\t\t-->\n\t\t\t\t\t</div>\n\t\t\t\t\t<button [disabled]=\"isLoading\" (click)=\"getServer()\" type=\"submit\"\n\t\t\t\t\t\tclass=\"btn btn-primary btn-acessar btn-lg\">\n\t\t\t\t\t\t<app-loading-button [isLoading]=\"isLoading\"></app-loading-button>\n\t\t\t\t\t\t<span> Acessar </span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button type=\"button\" (click)=\"openForgottenPasswordModal(forgottenPasswordModal)\" class=\"forgotten-password\">\n\t\t\t\t\t\t<span> Esqueceu sua senha? </span>\n\t\t\t\t\t</button>\n\t\t\t\t</form>\n\n\t\t\t\t<ng-template #Authentication2Fa>\n\t\t\t\t\t<form [formGroup]=\"formAuthentication2Fa\" class=\"form-position\">\n\t\t\t\t\t\t<div class=\"input-group input-group-lg form-item mb-3\">\n\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px;\">\n\t\t\t\t\t\t\t\t<img src=\"assets/icons/lock.svg\" alt=\"lock-icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"code\" id=\"code\"\n\t\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"C\u00F3digo de 2 fatores\" aria-label=\"C\u00F3digo de 2 fatores\"\n\t\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAuthentication2Fa.get('code'))\">\n\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAuthentication2Fa.get('code')\" label=\"C\u00F3digo de 2 fatores\"></app-field-error-message>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row mb-3\">\n\t\t\t\t\t\t\t<button (click)=\"voltar()\" type=\"button\" class=\"btn btn-acessar glb-btn-outline-dark-disabled col me-1\">\n\t\t\t\t\t\t\t\tVoltar\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button [disabled]=\"isLoadingSendAuthentication2Fa\" (click)=\"sendCode()\" type=\"button\" class=\"btn btn-acessar btn-primary col ms-1\">\n\t\t\t\t\t\t\t\t<app-loading-button [isLoading]=\"isLoadingSendAuthentication2Fa\"></app-loading-button>\n\t\t\t\t\t\t\t\tAcessar\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<button *ngIf=\"secondsLeft == 0; else newCode\" \n\t\t\t\t\t\t\t\t[disabled]=\"isLoading\" (click)=\"getNewCode()\" type=\"button\" class=\"btn btn-acessar btn-outline-primary col\">\n\t\t\t\t\t\t\t\t<app-loading-button [isLoading]=\"isLoading\"></app-loading-button>\n\t\t\t\t\t\t\t\tEnviar novo c\u00F3digo\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<ng-template #newCode>\n\t\t\t\t\t\t\t\t<p class=\"text-center\">{{ secondsLeft}} {{ secondsLeft == 1 ? 'segundo' : 'segundos' }} para obter novo c\u00F3digo</p>\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\t\n\t\t\t\t</ng-template>\n\t\t\t\t\n\t\t\t\t<div class=\"footer-position\">\n\t\t\t\t\t<footer>\n\t\t\t\t\t\t<span class=\"footer\"> \n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/JmGeNlJdw/1/poli%CC%81tica-de-privacidade/pt_BR?s=1685731510066\" target=\"_blank\" class=\"sispro text-primary\"> Pol\u00EDtica de Privacidade </a>\n\t\t\t\t\t\t\t<p class=\"separator\"> | </p>\n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/Rork35NN2/2/poli%CC%81tica-de-cookies/pt_BR?s=1685731551976\" target=\"_blank\" class=\"sispro text-primary\"> Pol\u00EDtica de Cookies </a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"footer\"> Desenvolvido por \n\t\t\t\t\t\t\t<a href=\"https://www.sispro.com.br/\" target=\"_blank\" class=\"sispro text-primary\"> SISPRO </a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"footer\"> Servi\u00E7os e Tecnologia da Informa\u00E7\u00E3o LTDA \u00A9 {{ year }} Todos os direitos reservados </span>\n\t\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t\t<a href=\"https://pt-br.facebook.com/SisproERP/\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<lib-icon class=\"text-primary\" iconName=\"facebook\" iconSize=\"medium-small\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<a href=\"https://www.instagram.com/accounts/login/?next=/sispro_software/\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<lib-icon class=\"text-primary\" iconName=\"instagram\" iconSize=\"medium-small\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<a href=\"https://br.linkedin.com/company/sispro\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<lib-icon class=\"text-primary\" iconName=\"linkedin\" iconSize=\"medium-small\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"d-flex justify-content-center\">\n\t\t\t\t\t\t\t\t<a [href]=\"geturlErpConfig()\" style=\"text-decoration: none; font-size: 12px;\">\n\t\t\t\t\t\t\t\t\tConfigurar ERP\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</footer>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<!-- Template do modal de senha esquecida -->\n<ng-template #forgottenPasswordModal>\n\t<form [formGroup]=\"formFgtPsw\">\n\t\t<div class=\"modal-content\" style=\"box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.5);\">\n\t\t\t<div class=\"modal-header p-3\">\n\t\t\t\t<h4 class=\"modal-title\"> Recupera\u00E7\u00E3o de senha </h4>\n\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"\n\t\t\t\t\t(click)=\"closeForgottenPasswordModal()\">\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div class=\"modal-body\">\n\t\t\t\t<label for=\"inputDominioFgtPsw\" class=\"input-label\"> Dom\u00EDnio <span class=\"text-danger\">*</span></label>\n\t\t\t\t<input type=\"text\" id=\"inputDominioFgtPsw\" formControlName=\"dominioFgtPsw\"\n\t\t\t\t\tclass=\"form-control input-text\" aria-label=\"Sizing example input\" aria-label=\"Dom\u00EDnio\"\n\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('dominioFgtPsw'))\">\n\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('dominioFgtPsw')\" label=\"Dom\u00EDnio\"></app-field-error-message>\t\t\t\t\n\n\t\t\t\t<label for=\"inputUsuarioFgtPsw\" class=\"input-label\"> Usu\u00E1rio <span class=\"text-danger\">*</span></label>\n\t\t\t\t<input type=\"text\" id=\"inputUsuarioFgtPsw\" formControlName=\"usuarioFgtPsw\"\n\t\t\t\t\tclass=\"form-control input-text\" aria-label=\"Sizing example input\" aria-label=\"Usu\u00E1rio\"\n\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('usuarioFgtPsw'))\">\n\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('usuarioFgtPsw')\" label=\"Usu\u00E1rio\"></app-field-error-message>\t\t\t\t\n\t\t\n\t\t\t</div>\n\t\t\t<div class=\"modal-footer\">\n\t\t\t\t<button type=\"button\" class=\"btn glb-btn-dark-disabled modal-button\" (click)=\"closeForgottenPasswordModal()\">\n\t\t\t\t\t<span> Cancelar </span>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"btn btn-primary modal-button\" (click)=\"sendForgottenPassword();\">\n\t\t\t\t\t<span> Continuar </span>\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t</div>\n\t</form>\n</ng-template>\n", styles: ["@charset \"UTF-8\";*{padding:0;margin:0;font-family:Open Sans,sans-serif}.background{display:grid;height:100vh;align-content:center;background-size:cover;color:#f5f5f5;align-items:center;justify-content:center}.div-size{display:flex;flex-direction:column;justify-content:space-around;width:100%;height:100vh;align-items:center;background-color:#f5f5f5;box-shadow:0 0 15px #333}.title{font-size:3.5vw;text-transform:uppercase;font-weight:700}.subtitle{font-size:21px}.logotipo{display:flex;justify-content:center;margin-top:10%}.form-position{display:flex;flex-direction:column;align-content:center;width:378px}.form-item{margin-bottom:16px}.input-group-text{padding:10px 11px;border-radius:4px 0 0 4px}.remember-password{display:flex;align-items:center;margin-bottom:8px;justify-content:center}.remember-password label{margin-left:8px}.forgotten-password{background-color:#f5f5f5;border:none;text-decoration:underline;font-size:14px;box-shadow:none;margin-top:8px;cursor:pointer}.forgotten-password:focus{outline-style:none}.input-label{font-size:16px;padding:10px 0 8px 16px}.input-label:first-child{font-size:16px;padding-top:16px}.input-text{width:343px;height:38px;margin:0 0 10px 16px;padding:0 8px}.input-text:last-child{font-size:16px;margin-bottom:24px}.form-control{max-width:341px}.footer{display:flex;justify-content:center}.footer-position{font-size:14px;display:flex;justify-content:center;align-items:flex-end}.icons{display:flex;justify-content:center;align-items:center;margin-top:16px}.icons a{padding:4px}.icon-item{margin-left:24px;color:#007bff}.sispro{color:#2847a0;margin-left:5px;text-transform:uppercase;text-decoration:none;font-weight:700}.modal-footer{padding:0}.modal:before{content:\"\";display:inline-block;height:100%;vertical-align:middle}.modal-style{display:flex;align-items:center;justify-content:center}.modal-style h4{font-size:20px;font-weight:700;padding:10px}.modal-button{margin:16px 0;padding:7px 12px}.modal-button:last-child{margin-right:16px;margin-left:8px}.modal-close{display:flex;align-content:center;margin-right:10px;padding:6px}.col-md-7,.col-md-5{padding:0}.btn-acessar{height:48px;outline-style:none}.texto-apresentacao{align-items:start}.separator{margin-left:5px}\n"], dependencies: [{ kind: "directive", type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.FieldErrorMessageComponent, selector: "app-field-error-message, lib-error-message", inputs: ["customMessage", "control", "label"] }, { kind: "component", type: i5.LoadingButtonComponent, selector: "app-loading-button, lib-loading-button", inputs: ["isLoading"] }, { kind: "component", type: i5.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }], preserveWhitespaces: true }); }
|
|
1150
|
-
}
|
|
1151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginComponent, decorators: [{
|
|
1152
|
-
type: Component,
|
|
1153
|
-
args: [{ selector: 'lib-login', standalone: false, preserveWhitespaces: true, template: "<div class=\"container-fluid\">\n\t<div class=\"row\">\n\t\t<!-- Conte\u00FAdo da DIV do background -->\n\t\t<div class=\"col-md-7\">\n\t\t\t<div class=\"background\" style=\"background-image: linear-gradient(to bottom, rgba(10, 44, 81, 0.9), rgba(10, 44, 81, 0.9)), url({{_customLoginService.loginBackground}})\">\n\t\t\t\t<div class=\"text-position texto-apresentacao ps-5\">\n\t\t\t\t\t<h1 class=\"title\" id=\"title\"></h1>\n\t\t\t\t\t<p class=\"subtitle\" id=\"subtitle\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- Conte\u00FAdo da DIV de Login -->\n\t\t<div class=\"col-md-5\">\n\n\t\t\t<div class=\"div-size\">\n\t\t\t\t<div class=\"logotipo\">\n\t\t\t\t\t<img style=\"height: 95px;\" src=\"{{ _customLoginService.loginLogotipo }}\" alt=\"{{ _customLoginService.loginAltLogotipo }}\" />\n\t\t\t\t</div>\n\t\t\t\t<form *ngIf=\"!showParmsAuthentication2Fa; else Authentication2Fa\" [formGroup]=\"form\" class=\"form-position\">\n\t\t\t\t\t<div class=\"input-group input-group-lg form-item\">\n\t\t\t\t\t\t<span class=\"input-group-text\" id=\"basic-addon1\"\n\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px\">\n\t\t\t\t\t\t\t<img src=\"assets/icons/cloud.svg\" alt=\"cloud icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"dominio\" id=\"dominio\"\n\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"Dom\u00EDnio\" aria-label=\"Dom\u00EDnio\"\n\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('dominio'))\">\n\t\t\t\t\t\t<app-field-error-message [control]=\"form.get('dominio')\" label=\"Dom\u00EDnio\"></app-field-error-message>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"input-group input-group-lg form-item\">\n\t\t\t\t\t\t<span class=\"input-group-text\" id=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px\">\n\t\t\t\t\t\t\t<img src=\"assets/icons/at-sign.svg\" alt=\"at-sign icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"usuario\" id=\"usuario\"\n\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"Usu\u00E1rio\" aria-label=\"Usu\u00E1rio\"\n\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('usuario'))\">\n\t\t\t\t\t\t<app-field-error-message [control]=\"form.get('usuario')\" label=\"Usu\u00E1rio\"></app-field-error-message>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"input-group input-group-lg form-item\" style=\"margin-bottom: 8px;\">\n\t\t\t\t\t\t<span class=\"input-group-text\" id=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px;\">\n\t\t\t\t\t\t\t<img src=\"assets/icons/lock.svg\" alt=\"lock-icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<input type=\"password\" class=\"form-control\" formControlName=\"senha\" id=\"senha\"\n\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"Senha\" aria-label=\"senha\"\n\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('senha'))\">\n\t\t\t\t\t\t<app-field-error-message [control]=\"form.get('senha')\" label=\"Senha\"></app-field-error-message>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"remember-password\">\n\t\t\t\t\t<!-- Lembrar Senha\n\t\t\t\t\t\t<input id=\"checkboxLembrarSenha\" type=\"checkbox\" />\n\t\t\t\t\t\t<label for=\"checkboxLembrarSenha\"> Lembrar minha senha </label>\n \t\t\t\t\t-->\n\t\t\t\t\t</div>\n\t\t\t\t\t<button [disabled]=\"isLoading\" (click)=\"getServer()\" type=\"submit\"\n\t\t\t\t\t\tclass=\"btn btn-primary btn-acessar btn-lg\">\n\t\t\t\t\t\t<app-loading-button [isLoading]=\"isLoading\"></app-loading-button>\n\t\t\t\t\t\t<span> Acessar </span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button type=\"button\" (click)=\"openForgottenPasswordModal(forgottenPasswordModal)\" class=\"forgotten-password\">\n\t\t\t\t\t\t<span> Esqueceu sua senha? </span>\n\t\t\t\t\t</button>\n\t\t\t\t</form>\n\n\t\t\t\t<ng-template #Authentication2Fa>\n\t\t\t\t\t<form [formGroup]=\"formAuthentication2Fa\" class=\"form-position\">\n\t\t\t\t\t\t<div class=\"input-group input-group-lg form-item mb-3\">\n\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t\tstyle=\"padding: 10px; border-radius: 4px 0px 0px 4px;\">\n\t\t\t\t\t\t\t\t<img src=\"assets/icons/lock.svg\" alt=\"lock-icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"code\" id=\"code\"\n\t\t\t\t\t\t\t\taria-label=\"Sizing example input\" placeholder=\"C\u00F3digo de 2 fatores\" aria-label=\"C\u00F3digo de 2 fatores\"\n\t\t\t\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAuthentication2Fa.get('code'))\">\n\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAuthentication2Fa.get('code')\" label=\"C\u00F3digo de 2 fatores\"></app-field-error-message>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row mb-3\">\n\t\t\t\t\t\t\t<button (click)=\"voltar()\" type=\"button\" class=\"btn btn-acessar glb-btn-outline-dark-disabled col me-1\">\n\t\t\t\t\t\t\t\tVoltar\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button [disabled]=\"isLoadingSendAuthentication2Fa\" (click)=\"sendCode()\" type=\"button\" class=\"btn btn-acessar btn-primary col ms-1\">\n\t\t\t\t\t\t\t\t<app-loading-button [isLoading]=\"isLoadingSendAuthentication2Fa\"></app-loading-button>\n\t\t\t\t\t\t\t\tAcessar\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<button *ngIf=\"secondsLeft == 0; else newCode\" \n\t\t\t\t\t\t\t\t[disabled]=\"isLoading\" (click)=\"getNewCode()\" type=\"button\" class=\"btn btn-acessar btn-outline-primary col\">\n\t\t\t\t\t\t\t\t<app-loading-button [isLoading]=\"isLoading\"></app-loading-button>\n\t\t\t\t\t\t\t\tEnviar novo c\u00F3digo\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<ng-template #newCode>\n\t\t\t\t\t\t\t\t<p class=\"text-center\">{{ secondsLeft}} {{ secondsLeft == 1 ? 'segundo' : 'segundos' }} para obter novo c\u00F3digo</p>\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\t\n\t\t\t\t</ng-template>\n\t\t\t\t\n\t\t\t\t<div class=\"footer-position\">\n\t\t\t\t\t<footer>\n\t\t\t\t\t\t<span class=\"footer\"> \n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/JmGeNlJdw/1/poli%CC%81tica-de-privacidade/pt_BR?s=1685731510066\" target=\"_blank\" class=\"sispro text-primary\"> Pol\u00EDtica de Privacidade </a>\n\t\t\t\t\t\t\t<p class=\"separator\"> | </p>\n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/Rork35NN2/2/poli%CC%81tica-de-cookies/pt_BR?s=1685731551976\" target=\"_blank\" class=\"sispro text-primary\"> Pol\u00EDtica de Cookies </a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"footer\"> Desenvolvido por \n\t\t\t\t\t\t\t<a href=\"https://www.sispro.com.br/\" target=\"_blank\" class=\"sispro text-primary\"> SISPRO </a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"footer\"> Servi\u00E7os e Tecnologia da Informa\u00E7\u00E3o LTDA \u00A9 {{ year }} Todos os direitos reservados </span>\n\t\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t\t<a href=\"https://pt-br.facebook.com/SisproERP/\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<lib-icon class=\"text-primary\" iconName=\"facebook\" iconSize=\"medium-small\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<a href=\"https://www.instagram.com/accounts/login/?next=/sispro_software/\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<lib-icon class=\"text-primary\" iconName=\"instagram\" iconSize=\"medium-small\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<a href=\"https://br.linkedin.com/company/sispro\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<lib-icon class=\"text-primary\" iconName=\"linkedin\" iconSize=\"medium-small\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"d-flex justify-content-center\">\n\t\t\t\t\t\t\t\t<a [href]=\"geturlErpConfig()\" style=\"text-decoration: none; font-size: 12px;\">\n\t\t\t\t\t\t\t\t\tConfigurar ERP\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</footer>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<!-- Template do modal de senha esquecida -->\n<ng-template #forgottenPasswordModal>\n\t<form [formGroup]=\"formFgtPsw\">\n\t\t<div class=\"modal-content\" style=\"box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.5);\">\n\t\t\t<div class=\"modal-header p-3\">\n\t\t\t\t<h4 class=\"modal-title\"> Recupera\u00E7\u00E3o de senha </h4>\n\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"\n\t\t\t\t\t(click)=\"closeForgottenPasswordModal()\">\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div class=\"modal-body\">\n\t\t\t\t<label for=\"inputDominioFgtPsw\" class=\"input-label\"> Dom\u00EDnio <span class=\"text-danger\">*</span></label>\n\t\t\t\t<input type=\"text\" id=\"inputDominioFgtPsw\" formControlName=\"dominioFgtPsw\"\n\t\t\t\t\tclass=\"form-control input-text\" aria-label=\"Sizing example input\" aria-label=\"Dom\u00EDnio\"\n\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('dominioFgtPsw'))\">\n\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('dominioFgtPsw')\" label=\"Dom\u00EDnio\"></app-field-error-message>\t\t\t\t\n\n\t\t\t\t<label for=\"inputUsuarioFgtPsw\" class=\"input-label\"> Usu\u00E1rio <span class=\"text-danger\">*</span></label>\n\t\t\t\t<input type=\"text\" id=\"inputUsuarioFgtPsw\" formControlName=\"usuarioFgtPsw\"\n\t\t\t\t\tclass=\"form-control input-text\" aria-label=\"Sizing example input\" aria-label=\"Usu\u00E1rio\"\n\t\t\t\t\taria-describedby=\"inputGroup-sizing-lg\"\n\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('usuarioFgtPsw'))\">\n\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('usuarioFgtPsw')\" label=\"Usu\u00E1rio\"></app-field-error-message>\t\t\t\t\n\t\t\n\t\t\t</div>\n\t\t\t<div class=\"modal-footer\">\n\t\t\t\t<button type=\"button\" class=\"btn glb-btn-dark-disabled modal-button\" (click)=\"closeForgottenPasswordModal()\">\n\t\t\t\t\t<span> Cancelar </span>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"btn btn-primary modal-button\" (click)=\"sendForgottenPassword();\">\n\t\t\t\t\t<span> Continuar </span>\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t</div>\n\t</form>\n</ng-template>\n", styles: ["@charset \"UTF-8\";*{padding:0;margin:0;font-family:Open Sans,sans-serif}.background{display:grid;height:100vh;align-content:center;background-size:cover;color:#f5f5f5;align-items:center;justify-content:center}.div-size{display:flex;flex-direction:column;justify-content:space-around;width:100%;height:100vh;align-items:center;background-color:#f5f5f5;box-shadow:0 0 15px #333}.title{font-size:3.5vw;text-transform:uppercase;font-weight:700}.subtitle{font-size:21px}.logotipo{display:flex;justify-content:center;margin-top:10%}.form-position{display:flex;flex-direction:column;align-content:center;width:378px}.form-item{margin-bottom:16px}.input-group-text{padding:10px 11px;border-radius:4px 0 0 4px}.remember-password{display:flex;align-items:center;margin-bottom:8px;justify-content:center}.remember-password label{margin-left:8px}.forgotten-password{background-color:#f5f5f5;border:none;text-decoration:underline;font-size:14px;box-shadow:none;margin-top:8px;cursor:pointer}.forgotten-password:focus{outline-style:none}.input-label{font-size:16px;padding:10px 0 8px 16px}.input-label:first-child{font-size:16px;padding-top:16px}.input-text{width:343px;height:38px;margin:0 0 10px 16px;padding:0 8px}.input-text:last-child{font-size:16px;margin-bottom:24px}.form-control{max-width:341px}.footer{display:flex;justify-content:center}.footer-position{font-size:14px;display:flex;justify-content:center;align-items:flex-end}.icons{display:flex;justify-content:center;align-items:center;margin-top:16px}.icons a{padding:4px}.icon-item{margin-left:24px;color:#007bff}.sispro{color:#2847a0;margin-left:5px;text-transform:uppercase;text-decoration:none;font-weight:700}.modal-footer{padding:0}.modal:before{content:\"\";display:inline-block;height:100%;vertical-align:middle}.modal-style{display:flex;align-items:center;justify-content:center}.modal-style h4{font-size:20px;font-weight:700;padding:10px}.modal-button{margin:16px 0;padding:7px 12px}.modal-button:last-child{margin-right:16px;margin-left:8px}.modal-close{display:flex;align-content:center;margin-right:10px;padding:6px}.col-md-7,.col-md-5{padding:0}.btn-acessar{height:48px;outline-style:none}.texto-apresentacao{align-items:start}.separator{margin-left:5px}\n"] }]
|
|
1154
|
-
}], ctorParameters: () => [{ type: i1$2.BsModalService }, { type: i5.MessageService }, { type: i3.FormBuilder }, { type: AuthService }, { type: ServerService }, { type: EnvironmentService }, { type: AuthStorageService }, { type: LibCustomLoginService }, { type: i9.Title }, { type: i1$1.Router }, { type: i11.ToastrService }] });
|
|
1155
|
-
|
|
1156
|
-
class AuthModule {
|
|
1157
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1158
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, declarations: [LoginComponent], imports: [CommonModule,
|
|
1159
|
-
ReactiveFormsModule,
|
|
1160
|
-
InfraModule,
|
|
1161
|
-
NgxPaginationModule,
|
|
1162
|
-
PopoverModule,
|
|
1163
|
-
TooltipModule,
|
|
1164
|
-
CommonModule,
|
|
1165
|
-
RouterLink,
|
|
1166
|
-
RouterOutlet], exports: [LoginComponent] }); }
|
|
1167
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, imports: [CommonModule,
|
|
1168
|
-
ReactiveFormsModule,
|
|
1169
|
-
InfraModule,
|
|
1170
|
-
NgxPaginationModule,
|
|
1171
|
-
PopoverModule,
|
|
1172
|
-
TooltipModule,
|
|
1173
|
-
CommonModule] }); }
|
|
1174
|
-
}
|
|
1175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthModule, decorators: [{
|
|
1176
|
-
type: NgModule,
|
|
1177
|
-
args: [{
|
|
1178
|
-
declarations: [
|
|
1179
|
-
LoginComponent,
|
|
1180
|
-
],
|
|
1181
|
-
imports: [
|
|
1182
|
-
CommonModule,
|
|
1183
|
-
ReactiveFormsModule,
|
|
1184
|
-
InfraModule,
|
|
1185
|
-
NgxPaginationModule,
|
|
1186
|
-
PopoverModule,
|
|
1187
|
-
TooltipModule,
|
|
1188
|
-
CommonModule,
|
|
1189
|
-
RouterLink,
|
|
1190
|
-
RouterOutlet
|
|
1191
|
-
],
|
|
1192
|
-
exports: [
|
|
1193
|
-
LoginComponent,
|
|
1194
|
-
]
|
|
1195
|
-
}]
|
|
1196
|
-
}] });
|
|
1197
|
-
|
|
1198
|
-
class MenuServicesService {
|
|
1199
|
-
constructor(_authStorageService, _httpClient) {
|
|
1200
|
-
this._authStorageService = _authStorageService;
|
|
1201
|
-
this._httpClient = _httpClient;
|
|
1202
|
-
this._BASE_URL = "https://siscandesv6.sispro.com.br/SisproErpCloud/Service_Private/Infra/SpInfra2ErpWS/api"; // SpInfra2AplicWS
|
|
1203
|
-
this._HTTP_HEADERS = new HttpHeaders().set('Content-Type', 'application/json');
|
|
1204
|
-
// #endregion Menu: Estabelecimentos
|
|
1205
|
-
// #endregion UPDATE
|
|
1206
|
-
// #region DELETE
|
|
1207
|
-
// [...]
|
|
1208
|
-
// #endregion DELETE
|
|
1209
|
-
// #endregion ==========> SERVICES <==========
|
|
1210
|
-
// #region ==========> UTILITIES <==========
|
|
1211
|
-
this._menuFooterImg = null;
|
|
1212
|
-
// #region NewImg Event
|
|
1213
|
-
// Implementação de lógica vista no link: https://hasangalakdinu.medium.com/how-to-call-a-function-in-another-component-angular-using-rxjs-3f2e85920705
|
|
1214
|
-
this._subject = new Subject();
|
|
1215
|
-
//verificar se é a melhor solucão
|
|
1216
|
-
//this._BASE_URL = !environment.production ? this._BASE_URL : `${environment.SpInfra2ErpWS}`;
|
|
1217
|
-
}
|
|
1218
|
-
// #region ==========> SERVICES <==========
|
|
1219
|
-
// #region PREPARATION
|
|
1220
|
-
// #region Menu: Usuário
|
|
1221
|
-
// [...]
|
|
1222
|
-
// #endregion Menu: Usuário
|
|
1223
|
-
// #region Menu: Estabelecimentos
|
|
1224
|
-
getEstabelecimentosModalList(usuarioID, pesquisa) {
|
|
1225
|
-
const params = new HttpParams()
|
|
1226
|
-
.set('pesquisa', pesquisa);
|
|
1227
|
-
const headers = new HttpHeaders()
|
|
1228
|
-
.set('Content-Type', 'application/json');
|
|
1229
|
-
const url = `${this._BASE_URL}/InfraEstabelecimento/GetEstabelecimentosModal`;
|
|
1230
|
-
return this._httpClient
|
|
1231
|
-
.get(url, { 'params': params, 'headers': headers })
|
|
1232
|
-
.pipe(take(1), tap(response => {
|
|
1233
|
-
if (response.Error) {
|
|
1234
|
-
throw Error(response.ErrorMessage);
|
|
1235
|
-
}
|
|
1236
|
-
}));
|
|
1237
|
-
}
|
|
1238
|
-
// #endregion Menu: Estabelecimentos
|
|
1239
|
-
// #endregion PREPARATION
|
|
1240
|
-
// #region GET
|
|
1241
|
-
// #region Menu: Usuário
|
|
1242
|
-
getImagemMenu() {
|
|
1243
|
-
const url = `${this._BASE_URL}/InfraUsuario/GetImagemMenu`;
|
|
1244
|
-
return this._httpClient
|
|
1245
|
-
.get(url, { 'headers': this._HTTP_HEADERS })
|
|
1246
|
-
.pipe(take(1), tap(response => {
|
|
1247
|
-
if (response.Error) {
|
|
1248
|
-
throw Error(response.ErrorMessage);
|
|
1249
|
-
}
|
|
1250
|
-
this.saveImageToStorage(response.InfraUsuarioImg.Imagem, response.InfraUsuarioImg.FileName);
|
|
1251
|
-
}));
|
|
1252
|
-
}
|
|
1253
|
-
// #endregion Menu: Usuário
|
|
1254
|
-
// #region Menu: Estabelecimentos
|
|
1255
|
-
getEstabelecimentoSession(estabID) {
|
|
1256
|
-
const params = new HttpParams()
|
|
1257
|
-
.set('id', estabID);
|
|
1258
|
-
const url = `${this._BASE_URL}/InfraEstabelecimento/GetEstabelecimentoSession`;
|
|
1259
|
-
return this._httpClient
|
|
1260
|
-
.get(url, { 'params': params, 'headers': this._HTTP_HEADERS })
|
|
1261
|
-
.pipe(take(1), tap(response => {
|
|
1262
|
-
if (response.Error) {
|
|
1263
|
-
throw Error(response.ErrorMessage);
|
|
1264
|
-
}
|
|
1265
|
-
}));
|
|
1266
|
-
}
|
|
1267
|
-
// #endregion Menu: Estabelecimentos
|
|
1268
|
-
// #region Get Usuario Email
|
|
1269
|
-
getUsuarioEmail() {
|
|
1270
|
-
const url = `${this._BASE_URL}/InfraUsuario/GetUsuarioEmail`;
|
|
1271
|
-
return this._httpClient
|
|
1272
|
-
.get(url, { 'headers': this._HTTP_HEADERS })
|
|
1273
|
-
.pipe(take(1), tap(response => {
|
|
1274
|
-
if (response.Error) {
|
|
1275
|
-
throw Error(response.ErrorMessage);
|
|
1276
|
-
}
|
|
1277
|
-
}));
|
|
1278
|
-
}
|
|
1279
|
-
// #endregion Get Usuario Email
|
|
1280
|
-
// #endregion GET
|
|
1281
|
-
// #region CREATE
|
|
1282
|
-
// [...]
|
|
1283
|
-
// #endregion CREATE
|
|
1284
|
-
// #region UPDATE
|
|
1285
|
-
// #region Menu: Usuário
|
|
1286
|
-
updateLastLogEstabID(estabID) {
|
|
1287
|
-
const params = new HttpParams()
|
|
1288
|
-
.set('estabID', estabID);
|
|
1289
|
-
const url = `${this._BASE_URL}/InfraUsuario/UpdateLastSelectedEstabelecimento`;
|
|
1290
|
-
return this._httpClient
|
|
1291
|
-
.post(url, null, { 'params': params, 'headers': this._HTTP_HEADERS })
|
|
1292
|
-
.pipe(take(1), tap(response => {
|
|
1293
|
-
if (response.Error) {
|
|
1294
|
-
throw Error(response.ErrorMessage);
|
|
1295
|
-
}
|
|
1296
|
-
}));
|
|
1297
|
-
}
|
|
1298
|
-
// #endregion Menu: Usuário
|
|
1299
|
-
// #region Menu: Estabelecimentos
|
|
1300
|
-
defineDefaultEstabelecimento(estabID, usuarioID, isDefault) {
|
|
1301
|
-
const params = new HttpParams()
|
|
1302
|
-
.set('estabID', estabID)
|
|
1303
|
-
.set('isDefault', isDefault);
|
|
1304
|
-
const url = `${this._BASE_URL}/InfraEstabelecimento/DefineDefaultEstab`;
|
|
1305
|
-
return this._httpClient
|
|
1306
|
-
.post(url, null, { 'params': params, 'headers': this._HTTP_HEADERS })
|
|
1307
|
-
.pipe(take(1), tap(response => {
|
|
1308
|
-
if (response.Error) {
|
|
1309
|
-
throw Error(response.ErrorMessage);
|
|
1310
|
-
}
|
|
1311
|
-
}));
|
|
1312
|
-
}
|
|
1313
|
-
getMenuFooterImg() {
|
|
1314
|
-
const cachedFooterImg = JSON.parse(localStorage.getItem('menuFooterImg'));
|
|
1315
|
-
if (cachedFooterImg) {
|
|
1316
|
-
return cachedFooterImg;
|
|
1317
|
-
}
|
|
1318
|
-
return this._menuFooterImg;
|
|
1319
|
-
}
|
|
1320
|
-
setMenuFooterImg(value) {
|
|
1321
|
-
this._menuFooterImg = value;
|
|
1322
|
-
localStorage.setItem('menuFooterImg', JSON.stringify(value));
|
|
1323
|
-
}
|
|
1324
|
-
saveImageToStorage(footerImgSrc, footerImgName) {
|
|
1325
|
-
this.setMenuFooterImg({ USUARIOID: this._authStorageService.infraUsuarioId, FILENAME: footerImgName, FILE: footerImgSrc });
|
|
1326
|
-
}
|
|
1327
|
-
newUserImageEvent(value) {
|
|
1328
|
-
this._subject.next(value);
|
|
1329
|
-
}
|
|
1330
|
-
getNewUserImageEvent() {
|
|
1331
|
-
return this._subject.asObservable();
|
|
1332
|
-
}
|
|
1333
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuServicesService, deps: [{ token: AuthStorageService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1334
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuServicesService, providedIn: 'root' }); }
|
|
1335
|
-
}
|
|
1336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuServicesService, decorators: [{
|
|
1337
|
-
type: Injectable,
|
|
1338
|
-
args: [{
|
|
1339
|
-
providedIn: 'root'
|
|
1340
|
-
}]
|
|
1341
|
-
}], ctorParameters: () => [{ type: AuthStorageService }, { type: i1.HttpClient }] });
|
|
1342
|
-
|
|
1343
|
-
class ListEstabService {
|
|
1344
|
-
constructor(http) {
|
|
1345
|
-
this.http = http;
|
|
1346
|
-
this.cacheName = "";
|
|
1347
|
-
this.menuKey = `${this.cacheName}_ListaEstabs`;
|
|
1348
|
-
this.baseUrl = "assets/jsons/lista-estabs.json";
|
|
1349
|
-
this.storage = window.localStorage;
|
|
1350
|
-
}
|
|
1351
|
-
getList() {
|
|
1352
|
-
let iMenu = this.get();
|
|
1353
|
-
let httpCall = this.http.get(this.baseUrl).pipe(tap((iMenuFromServer) => {
|
|
1354
|
-
this.set(iMenuFromServer);
|
|
1355
|
-
}));
|
|
1356
|
-
// Caso o menu já esteja gravado no local, é retornado ele no observable e logo em seguida
|
|
1357
|
-
// é realizada a chamada HTTP para buscar o mais novo menu.
|
|
1358
|
-
if (iMenu) {
|
|
1359
|
-
let obs = of(iMenu);
|
|
1360
|
-
let obsMerged = merge(obs, httpCall);
|
|
1361
|
-
return obsMerged;
|
|
1362
|
-
}
|
|
1363
|
-
return httpCall;
|
|
1364
|
-
}
|
|
1365
|
-
set(value) {
|
|
1366
|
-
let iMenuJson = JSON.stringify(value);
|
|
1367
|
-
this.storage.setItem(this.menuKey, iMenuJson);
|
|
1368
|
-
}
|
|
1369
|
-
get() {
|
|
1370
|
-
let possibleIMenus = this.storage.getItem(this.menuKey);
|
|
1371
|
-
if (possibleIMenus) {
|
|
1372
|
-
let iMenus = JSON.parse(possibleIMenus);
|
|
1373
|
-
return iMenus;
|
|
1956
|
+
else {
|
|
1957
|
+
FormUtils.validateFields(this.formAuthentication2Fa);
|
|
1374
1958
|
}
|
|
1375
|
-
return null;
|
|
1376
1959
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1960
|
+
// Validação do código 2 fatores
|
|
1961
|
+
validateCode() {
|
|
1962
|
+
this._authService.validateAuthentication2Fa(this.code).subscribe({
|
|
1963
|
+
next: (response) => {
|
|
1964
|
+
this._subscription.unsubscribe();
|
|
1965
|
+
this.isLoadingSendAuthentication2Fa = false;
|
|
1966
|
+
},
|
|
1967
|
+
error: (error) => {
|
|
1968
|
+
this.isLoadingSendAuthentication2Fa = false;
|
|
1969
|
+
this._projectUtilservice.showHttpError(error);
|
|
1970
|
+
},
|
|
1971
|
+
});
|
|
1383
1972
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
/** Indica se o menu é estático ou dinâmico. */
|
|
1399
|
-
this._isMenuStatic = false;
|
|
1400
|
-
this.menu = [];
|
|
1401
|
-
this.menuDropdown = [];
|
|
1973
|
+
// Envia requisição para validar código 2 fatores
|
|
1974
|
+
getNewCode() {
|
|
1975
|
+
this.isLoadingGetNewCode = true;
|
|
1976
|
+
this._authService.getAuthentication(this._authStorageService.dominio).subscribe({
|
|
1977
|
+
next: response => {
|
|
1978
|
+
this._subscription = this.countdown$.subscribe(secondsLeft => {
|
|
1979
|
+
this.secondsLeft = secondsLeft;
|
|
1980
|
+
});
|
|
1981
|
+
this.GetNewCode2Fa();
|
|
1982
|
+
},
|
|
1983
|
+
error: (error) => {
|
|
1984
|
+
this._projectUtilservice.showHttpError(error);
|
|
1985
|
+
},
|
|
1986
|
+
});
|
|
1402
1987
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1988
|
+
// Validação do código 2 fatores
|
|
1989
|
+
GetNewCode2Fa() {
|
|
1990
|
+
this._authService.GetNewCode2Fa().subscribe({
|
|
1991
|
+
next: (response) => {
|
|
1992
|
+
this.isLoadingGetNewCode = false;
|
|
1993
|
+
this._toastrService.success("Enviamos um novo código para o endereço de e-mail vinculado ao seu usuário. Verifique o lixo eletrônico (SPAM) da sua caixa de entrada, caso não tenha encontrado nossa mensagem.");
|
|
1994
|
+
},
|
|
1995
|
+
error: (error) => {
|
|
1996
|
+
this.isLoadingGetNewCode = false;
|
|
1997
|
+
this._projectUtilservice.showHttpError(error);
|
|
1998
|
+
},
|
|
1999
|
+
});
|
|
1413
2000
|
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
2001
|
+
// #endregion POST
|
|
2002
|
+
// #region UTILIDADES
|
|
2003
|
+
// Retorno para a tela de login
|
|
2004
|
+
voltar() {
|
|
2005
|
+
this.loginProgress = LoginProgress.Domain;
|
|
2006
|
+
this.createFormDomain();
|
|
2007
|
+
this._subscription.unsubscribe();
|
|
2008
|
+
this.showParmsAuthentication2Fa = false;
|
|
2009
|
+
this._authStorageService.logout();
|
|
2010
|
+
this._router.navigate(["/auth/login"]);
|
|
1419
2011
|
}
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
item.isSelected = false;
|
|
1427
|
-
if (!item.children && currentRoute.includes(item.route)) {
|
|
1428
|
-
item.isSelected = true;
|
|
1429
|
-
}
|
|
1430
|
-
else if (item.children && anyChildSelected) {
|
|
1431
|
-
item.isSelected = true;
|
|
1432
|
-
}
|
|
1433
|
-
});
|
|
1434
|
-
return currentList;
|
|
2012
|
+
// Retorno para a tela de login
|
|
2013
|
+
returnDomain() {
|
|
2014
|
+
this.loginProgress = LoginProgress.Domain;
|
|
2015
|
+
this.createFormDomain();
|
|
2016
|
+
this._authStorageService.logout();
|
|
2017
|
+
this._router.navigate(["/auth/login"]);
|
|
1435
2018
|
}
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
initializeMenuDropdown(primaryDropdownList) {
|
|
1441
|
-
if (this.storedInitializeMenuDropdown) {
|
|
1442
|
-
this.menuDropdown = this.storedInitializeMenuDropdown(primaryDropdownList);
|
|
2019
|
+
showIntegracaoAlert() {
|
|
2020
|
+
const warningMessage = this._authService.consumePendingWarning();
|
|
2021
|
+
if (warningMessage) {
|
|
2022
|
+
this._messageService.showAlertWarning(warningMessage);
|
|
1443
2023
|
}
|
|
1444
|
-
return this.menuDropdown;
|
|
1445
2024
|
}
|
|
1446
|
-
|
|
1447
|
-
//passando propriedades do projeto para a lib
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
2025
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginComponent, deps: [{ token: MSAL_GUARD_CONFIG }, { token: i1$2.MsalService }, { token: LibCustomLoginService }, { token: i3$1.FormBuilder }, { token: ProjectUtilservice }, { token: AuthService }, { token: EnvironmentService }, { token: AuthStorageService }, { token: i8.Title }, { token: i1$1.Router }, { token: i10.ToastrService }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2026
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: LoginComponent, isStandalone: true, selector: "app-login", ngImport: i0, template: "<div id=\"login\" class=\"container-fluid\">\n\t<div class=\"row\">\n\t\t<!-- Conte\u00FAdo da DIV do background -->\n\t\t<div class=\"col-md-6 px-0\">\n\t\t\t<div class=\"background\" style=\"background-image: linear-gradient(to bottom, rgba(10, 44, 81, 0.9), rgba(10, 44, 81, 0.9)), url({{_customLoginService.loginBackground}})\">\n\t\t\t\t<div class=\"text-position texto-apresentacao ps-5\">\n\t\t\t\t\t<h1 class=\"title\" id=\"title\"></h1>\n\t\t\t\t\t<p class=\"subtitle\" id=\"subtitle\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- Conte\u00FAdo da DIV de Login -->\n\t\t<div class=\"col-md-6 px-0\">\n\n\t\t\t<div class=\"div-size\">\n\t\t\t\t<div class=\"logotipo\">\n\t\t\t\t\t<img style=\"height: 95px;\" src=\"{{ this._customLoginService.loginLogotipo }}\" alt=\"{{ this._customLoginService.loginAltLogotipo }}\" />\n\t\t\t\t</div>\n\n\t\t\t\t@if (situacaoLogin !== 2) {\n\t\t\t\t\t@if (!showParmsAuthentication2Fa) {\n\t\t\t\t\t\t@switch (loginProgress) {\n\t\t\t\t\t\t\t@case(1) {\n\t\t\t\t\t\t\t\t<form [formGroup]=\"formDomain\" class=\"form-position\">\n\t\t\t\t\t\t\t\t\t<div class=\"col mb-3\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"predio\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" placeholder=\"Dom\u00EDnio\" formControlName=\"dominio\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formDomain.get('dominio'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formDomain.get('dominio')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingDomain\" loadingText=\"Acessando...\" class=\"btn btn-primary\" [disabled]=\"isLoadingDomain\" (click)=\"getAuthentication()\">\n\t\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t@case(2) {\n\t\t\t\t\t\t\t\t<form [formGroup]=\"formLogin\" class=\"form-position\">\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"usuario-quadro\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control px-3\" formControlName=\"usuario\" placeholder=\"Usu\u00E1rio\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formLogin.get('usuario'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formLogin.get('usuario')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-lock-text\"><lib-icon iconName=\"chave\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"password\" class=\"form-control px-3\" formControlName=\"senha\" placeholder=\"Senha\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formLogin.get('senha'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formLogin.get('senha')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button (click)=\"returnDomain()\" type=\"button\" class=\"btn btn-outline-secondary w-100\">\n\t\t\t\t\t\t\t\t\t\t\t\tVoltar\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingLogin\" loadingText=\"Acessando...\" class=\"btn btn-primary btn-heigth-48 w-100\" [disabled]=\"isLoadingLogin\" (click)=\"logOn()\">\n\t\t\t\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\n\t\t\t\t\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t\t\t\t\t<a type=\"button\" (click)=\"situacaoLogin = 2\" class=\"fw-bold text-decoration-none text-secondary\"\n\t\t\t\t\t\t\t\t\t\t\ttooltip=\"N\u00E3o se preocupe, clique aqui e informe o dom\u00EDnio e o usu\u00E1rio desejados que enviaremos um e-mail com maiores informa\u00E7\u00F5es.\">\n\t\t\t\t\t\t\t\t\t\t\tEsqueceu sua senha? </a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t@case(3) {\n\t\t\t\t\t\t\t\t<form [formGroup]=\"formAzure\" class=\"form-position formAzure\">\n\t\t\t\t\t\t\t\t\t<div class=\"w-100 mb-3\">\n\t\t\t\t\t\t\t\t\t\t<button type=\"button\" loadingText=\"Acessando...\" class=\"btn btn-primary p-2 mb-3 w-100 d-flex align-items-center justify-content-center gap-2\" (click)=\"logOnAzure()\">\n\t\t\t\t\t\t\t\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" heigth=\"14\" width=\"14\" viewBox=\"0 0 23 23\"><path fill=\"transparent\" d=\"M0 0h23v23H0z\"/><path fill=\"#f35325\" d=\"M1 1h10v10H1z\"/><path fill=\"#81bc06\" d=\"M12 1h10v10H12z\"/><path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\"/><path fill=\"#ffba08\" d=\"M12 12h10v10H12z\"/></svg>\n\t\t\t\t\t\t\t\t\t\t\tMicrosoft\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<div class=\"w-100 text-center text-secondary\">\n\t\t\t\t\t\t\t\t\t\t\t<span id=\"ou-text\"> ou </span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"usuario-quadro\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control px-3\" formControlName=\"usuario\" placeholder=\"Usu\u00E1rio\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAzure.get('usuario'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAzure.get('usuario')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-lock-text\"><lib-icon iconName=\"chave\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"password\" class=\"form-control px-3\" formControlName=\"senha\" placeholder=\"Senha\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAzure.get('senha'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAzure.get('senha')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button (click)=\"returnDomain()\" type=\"button\" class=\"btn btn-outline-secondary w-100\">\n\t\t\t\t\t\t\t\t\t\t\t\t<lib-icon iconName=\"seta-esquerda\" /> VOLTAR\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingAzure\" loadingText=\"Acessando...\" class=\"btn btn-primary btn-heigth-48 w-100\" [disabled]=\"isLoadingAzure\" (click)=\"logOnAdmin()\">\n\t\t\t\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@else {\n\t\t\t\t\t\t<form [formGroup]=\"formAuthentication2Fa\" class=\"form-position\">\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><img src=\"assets/icons/lock.svg\" alt=\"lock-icon\" /></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"code\" id=\"code\" placeholder=\"C\u00F3digo de 2 fatores\"\n\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAuthentication2Fa.get('code'))\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAuthentication2Fa.get('code')\" />\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"d-flex flex-row align-items-center gap-3 mb-3\">\n\t\t\t\t\t\t\t\t<button (click)=\"voltar()\" type=\"button\" class=\"btn btn-outline-secondary col\"> <lib-icon iconName=\"seta-esquerda\" /> VOLTAR </button>\n\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingSendAuthentication2Fa\" [disabled]=\"isLoadingSendAuthentication2Fa\" (click)=\"sendCode()\" type=\"button\" class=\"btn btn-primary col\">\n\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"d-flex flex-row align-items-center justify-content-center\">\n\t\t\t\t\t\t\t\t@if (secondsLeft === 0) {\n\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingForgottenPassword\" loadingText=\"Enviando...\" [disabled]=\"isLoadingForgottenPassword\" (click)=\"getNewCode()\" type=\"button\" class=\"btn btn-outline-primary col\">\n\t\t\t\t\t\t\t\t\t\tEnviar novo c\u00F3digo <lib-icon iconName=\"aviao-papel\" />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t<span class=\"fw-bold text-secondary\">{{ secondsLeft }} {{ secondsLeft == 1 ? 'segundo' : 'segundos' }} para obter novo c\u00F3digo</span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t<form [formGroup]=\"formFgtPsw\" class=\"form-position\">\n\t\t\t\t\t\t<div class=\"row mb-3\">\n\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t<div class=\"input-group input-group\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"predio\" /></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" id=\"dominioFgtPssInput\" placeholder=\"Dom\u00EDnio\" formControlName=\"dominioFgtPsw\"\n\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('dominioFgtPsw'))\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('dominioFgtPsw')\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"row mb-3\">\n\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t<div class=\"input-group input-group\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"usuario-quadro\" /></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" id=\"usuarioFgtPssInput\" placeholder=\"Usu\u00E1rio\" formControlName=\"usuarioFgtPsw\"\n\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('usuarioFgtPsw'))\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('usuarioFgtPsw')\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t\t@if(formFgtPsw.get('usuarioFgtPsw')?.value === 'admin' || formFgtPsw.get('usuarioFgtPsw')?.value === 'CRMadmin'){\n <p class=\"texto-admin\">N\u00E3o \u00E9 poss\u00EDvel alterar a senha do usu\u00E1rio 'admin'</p>\n }@else{\n <button [libLoading]=\"isLoadingForgottenPassword\" loadingText=\"Enviando...\" class=\"btn btn-primary btn-heigth-48\" [disabled]=\"isLoadingForgottenPassword\" (click)=\"sendForgottenPassword()\">\n Enviar e-mail <lib-icon iconName=\"aviao-papel\" />\n </button>\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t\t<a type=\"button\" (click)=\"situacaoLogin = 0\" class=\"fw-bold text-decoration-none text-secondary\" tooltip=\"Retornar para o login.\"> <lib-icon iconName=\"seta-esquerda\" /> Voltar para o login </a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t<div class=\"footer-position\">\n\t\t\t\t\t<footer>\n\t\t\t\t\t\t<div class=\"d-flex flex-row align-items-center justify-content-center gap-2\">\n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/JmGeNlJdw/1/poli%CC%81tica-de-privacidade/pt_BR?s=1685731510066\" target=\"_blank\" class=\"text-primary text-decoration-none fw-bold\"> POL\u00CDTICA DE PRIVACIDADE </a>\n\t\t\t\t\t\t\t<span> | </span>\n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/Rork35NN2/2/poli%CC%81tica-de-cookies/pt_BR?s=1685731551976\" target=\"_blank\" class=\"text-primary text-decoration-none fw-bold\"> POL\u00CDTICA DE COOKIES </a>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p class=\"text-secondary\">\n\t\t\t\t\t\t\tDesenvolvido por <a href=\"https://www.sispro.com.br/\" target=\"_blank\" class=\"text-primary text-decoration-none fw-bold\"> SISPRO </a> \u00A9 {{ year }} Todos os direitos reservados\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t<a href=\"https://pt-br.facebook.com/SisproERP/\" target=\"_blank\"> <lib-icon class=\"text-primary\" iconName=\"facebook\" iconSize=\"medium-small\"/> </a>\n\t\t\t\t\t\t\t<a href=\"https://www.instagram.com/accounts/login/?next=/sispro_software/\" target=\"_blank\"> <lib-icon class=\"text-primary\" iconName=\"instagram\" iconSize=\"medium-small\"/> </a>\n\t\t\t\t\t\t\t<a href=\"https://br.linkedin.com/company/sispro\" target=\"_blank\"> <lib-icon class=\"text-primary\" iconName=\"linkedin\" iconSize=\"medium-small\"/> </a>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class=\"text-center\">\n\t\t\t\t\t\t\t<a class=\"text-primary fw-bold text-decoration-none glb-font-size-12\" [href]=\"geturlErpConfig()\"> Configurar ERP </a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</footer>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n", styles: ["@charset \"UTF-8\";#login .background{display:grid;height:100vh;align-content:center;background-size:cover;color:#f5f5f5;align-items:center;justify-content:center}#login .div-size{display:flex;flex-direction:column;justify-content:space-around;width:100%;height:100vh;align-items:center;background-color:#f5f5f5;box-shadow:0 0 15px #333}#login .title{font-size:3.5vw;text-transform:uppercase;font-weight:700}#login .subtitle{font-size:21px}#login .logotipo{display:flex;justify-content:center;margin-top:10%}#login .form-position{display:flex;flex-direction:column;align-content:center;width:378px}#login .form-item{margin-bottom:16px}#login .footer{display:flex;justify-content:center}#login .footer-position{font-size:14px;display:flex;justify-content:center;align-items:flex-end}#login .icons{display:flex;justify-content:center;align-items:center;margin-top:16px}#login .icons a{padding:4px}#login .icon-item{margin-left:24px;color:#007bff}#login .col-md-7,#login .col-md-5{padding:0}#login .btn-acessar{height:48px;outline-style:none}#login .texto-apresentacao{align-items:start}#login .separator{margin-left:5px}#login #ou-text{display:flex;flex-direction:row;align-items:center;justify-content:space-between}#login #ou-text:before{content:\"\";display:block;width:100%;height:1px;border-bottom:1px solid rgb(108,117,125);margin-right:12px}#login #ou-text:after{content:\"\";display:block;width:100%;height:1px;border-bottom:1px solid rgb(108,117,125);margin-left:12px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.FieldErrorMessageComponent, selector: "app-field-error-message, lib-error-message", inputs: ["customMessage", "control", "label"] }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "directive", type: i3.LoadingBtnDirective, selector: "button[libLoading], a[libLoading]", inputs: ["loadingText", "loadingType", "libLoading"] }, { kind: "ngmodule", type: CommonModule }], preserveWhitespaces: true }); }
|
|
2027
|
+
}
|
|
2028
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginComponent, decorators: [{
|
|
2029
|
+
type: Component,
|
|
2030
|
+
args: [{ selector: 'app-login', imports: [
|
|
2031
|
+
ReactiveFormsModule,
|
|
2032
|
+
InfraModule,
|
|
2033
|
+
CommonModule,
|
|
2034
|
+
NgIf
|
|
2035
|
+
], preserveWhitespaces: true, template: "<div id=\"login\" class=\"container-fluid\">\n\t<div class=\"row\">\n\t\t<!-- Conte\u00FAdo da DIV do background -->\n\t\t<div class=\"col-md-6 px-0\">\n\t\t\t<div class=\"background\" style=\"background-image: linear-gradient(to bottom, rgba(10, 44, 81, 0.9), rgba(10, 44, 81, 0.9)), url({{_customLoginService.loginBackground}})\">\n\t\t\t\t<div class=\"text-position texto-apresentacao ps-5\">\n\t\t\t\t\t<h1 class=\"title\" id=\"title\"></h1>\n\t\t\t\t\t<p class=\"subtitle\" id=\"subtitle\"></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- Conte\u00FAdo da DIV de Login -->\n\t\t<div class=\"col-md-6 px-0\">\n\n\t\t\t<div class=\"div-size\">\n\t\t\t\t<div class=\"logotipo\">\n\t\t\t\t\t<img style=\"height: 95px;\" src=\"{{ this._customLoginService.loginLogotipo }}\" alt=\"{{ this._customLoginService.loginAltLogotipo }}\" />\n\t\t\t\t</div>\n\n\t\t\t\t@if (situacaoLogin !== 2) {\n\t\t\t\t\t@if (!showParmsAuthentication2Fa) {\n\t\t\t\t\t\t@switch (loginProgress) {\n\t\t\t\t\t\t\t@case(1) {\n\t\t\t\t\t\t\t\t<form [formGroup]=\"formDomain\" class=\"form-position\">\n\t\t\t\t\t\t\t\t\t<div class=\"col mb-3\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"predio\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" placeholder=\"Dom\u00EDnio\" formControlName=\"dominio\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formDomain.get('dominio'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formDomain.get('dominio')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingDomain\" loadingText=\"Acessando...\" class=\"btn btn-primary\" [disabled]=\"isLoadingDomain\" (click)=\"getAuthentication()\">\n\t\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t@case(2) {\n\t\t\t\t\t\t\t\t<form [formGroup]=\"formLogin\" class=\"form-position\">\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"usuario-quadro\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control px-3\" formControlName=\"usuario\" placeholder=\"Usu\u00E1rio\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formLogin.get('usuario'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formLogin.get('usuario')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-lock-text\"><lib-icon iconName=\"chave\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"password\" class=\"form-control px-3\" formControlName=\"senha\" placeholder=\"Senha\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formLogin.get('senha'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formLogin.get('senha')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button (click)=\"returnDomain()\" type=\"button\" class=\"btn btn-outline-secondary w-100\">\n\t\t\t\t\t\t\t\t\t\t\t\tVoltar\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingLogin\" loadingText=\"Acessando...\" class=\"btn btn-primary btn-heigth-48 w-100\" [disabled]=\"isLoadingLogin\" (click)=\"logOn()\">\n\t\t\t\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\n\t\t\t\t\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t\t\t\t\t<a type=\"button\" (click)=\"situacaoLogin = 2\" class=\"fw-bold text-decoration-none text-secondary\"\n\t\t\t\t\t\t\t\t\t\t\ttooltip=\"N\u00E3o se preocupe, clique aqui e informe o dom\u00EDnio e o usu\u00E1rio desejados que enviaremos um e-mail com maiores informa\u00E7\u00F5es.\">\n\t\t\t\t\t\t\t\t\t\t\tEsqueceu sua senha? </a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t@case(3) {\n\t\t\t\t\t\t\t\t<form [formGroup]=\"formAzure\" class=\"form-position formAzure\">\n\t\t\t\t\t\t\t\t\t<div class=\"w-100 mb-3\">\n\t\t\t\t\t\t\t\t\t\t<button type=\"button\" loadingText=\"Acessando...\" class=\"btn btn-primary p-2 mb-3 w-100 d-flex align-items-center justify-content-center gap-2\" (click)=\"logOnAzure()\">\n\t\t\t\t\t\t\t\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" heigth=\"14\" width=\"14\" viewBox=\"0 0 23 23\"><path fill=\"transparent\" d=\"M0 0h23v23H0z\"/><path fill=\"#f35325\" d=\"M1 1h10v10H1z\"/><path fill=\"#81bc06\" d=\"M12 1h10v10H12z\"/><path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\"/><path fill=\"#ffba08\" d=\"M12 12h10v10H12z\"/></svg>\n\t\t\t\t\t\t\t\t\t\t\tMicrosoft\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<div class=\"w-100 text-center text-secondary\">\n\t\t\t\t\t\t\t\t\t\t\t<span id=\"ou-text\"> ou </span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"usuario-quadro\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control px-3\" formControlName=\"usuario\" placeholder=\"Usu\u00E1rio\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAzure.get('usuario'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAzure.get('usuario')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-lock-text\"><lib-icon iconName=\"chave\" /></span>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"password\" class=\"form-control px-3\" formControlName=\"senha\" placeholder=\"Senha\"\n\t\t\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAzure.get('senha'))\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAzure.get('senha')\" />\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button (click)=\"returnDomain()\" type=\"button\" class=\"btn btn-outline-secondary w-100\">\n\t\t\t\t\t\t\t\t\t\t\t\t<lib-icon iconName=\"seta-esquerda\" /> VOLTAR\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingAzure\" loadingText=\"Acessando...\" class=\"btn btn-primary btn-heigth-48 w-100\" [disabled]=\"isLoadingAzure\" (click)=\"logOnAdmin()\">\n\t\t\t\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@else {\n\t\t\t\t\t\t<form [formGroup]=\"formAuthentication2Fa\" class=\"form-position\">\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<div class=\"input-group input-group mb-3\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><img src=\"assets/icons/lock.svg\" alt=\"lock-icon\" /></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" formControlName=\"code\" id=\"code\" placeholder=\"C\u00F3digo de 2 fatores\"\n\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formAuthentication2Fa.get('code'))\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formAuthentication2Fa.get('code')\" />\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"d-flex flex-row align-items-center gap-3 mb-3\">\n\t\t\t\t\t\t\t\t<button (click)=\"voltar()\" type=\"button\" class=\"btn btn-outline-secondary col\"> <lib-icon iconName=\"seta-esquerda\" /> VOLTAR </button>\n\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingSendAuthentication2Fa\" [disabled]=\"isLoadingSendAuthentication2Fa\" (click)=\"sendCode()\" type=\"button\" class=\"btn btn-primary col\">\n\t\t\t\t\t\t\t\t\tACESSAR <lib-icon iconName=\"login\" />\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"d-flex flex-row align-items-center justify-content-center\">\n\t\t\t\t\t\t\t\t@if (secondsLeft === 0) {\n\t\t\t\t\t\t\t\t\t<button [libLoading]=\"isLoadingForgottenPassword\" loadingText=\"Enviando...\" [disabled]=\"isLoadingForgottenPassword\" (click)=\"getNewCode()\" type=\"button\" class=\"btn btn-outline-primary col\">\n\t\t\t\t\t\t\t\t\t\tEnviar novo c\u00F3digo <lib-icon iconName=\"aviao-papel\" />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t<span class=\"fw-bold text-secondary\">{{ secondsLeft }} {{ secondsLeft == 1 ? 'segundo' : 'segundos' }} para obter novo c\u00F3digo</span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t<form [formGroup]=\"formFgtPsw\" class=\"form-position\">\n\t\t\t\t\t\t<div class=\"row mb-3\">\n\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t<div class=\"input-group input-group\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"predio\" /></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" id=\"dominioFgtPssInput\" placeholder=\"Dom\u00EDnio\" formControlName=\"dominioFgtPsw\"\n\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('dominioFgtPsw'))\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('dominioFgtPsw')\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"row mb-3\">\n\t\t\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t\t\t<div class=\"input-group input-group\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\" id=\"input-at-sign-text\"><lib-icon iconName=\"usuario-quadro\" /></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" id=\"usuarioFgtPssInput\" placeholder=\"Usu\u00E1rio\" formControlName=\"usuarioFgtPsw\"\n\t\t\t\t\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(formFgtPsw.get('usuarioFgtPsw'))\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<app-field-error-message [control]=\"formFgtPsw.get('usuarioFgtPsw')\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t\t@if(formFgtPsw.get('usuarioFgtPsw')?.value === 'admin' || formFgtPsw.get('usuarioFgtPsw')?.value === 'CRMadmin'){\n <p class=\"texto-admin\">N\u00E3o \u00E9 poss\u00EDvel alterar a senha do usu\u00E1rio 'admin'</p>\n }@else{\n <button [libLoading]=\"isLoadingForgottenPassword\" loadingText=\"Enviando...\" class=\"btn btn-primary btn-heigth-48\" [disabled]=\"isLoadingForgottenPassword\" (click)=\"sendForgottenPassword()\">\n Enviar e-mail <lib-icon iconName=\"aviao-papel\" />\n </button>\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t\t<a type=\"button\" (click)=\"situacaoLogin = 0\" class=\"fw-bold text-decoration-none text-secondary\" tooltip=\"Retornar para o login.\"> <lib-icon iconName=\"seta-esquerda\" /> Voltar para o login </a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t<div class=\"footer-position\">\n\t\t\t\t\t<footer>\n\t\t\t\t\t\t<div class=\"d-flex flex-row align-items-center justify-content-center gap-2\">\n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/JmGeNlJdw/1/poli%CC%81tica-de-privacidade/pt_BR?s=1685731510066\" target=\"_blank\" class=\"text-primary text-decoration-none fw-bold\"> POL\u00CDTICA DE PRIVACIDADE </a>\n\t\t\t\t\t\t\t<span> | </span>\n\t\t\t\t\t\t\t<a href=\"https://dpo.privacytools.com.br/policy-view/Rork35NN2/2/poli%CC%81tica-de-cookies/pt_BR?s=1685731551976\" target=\"_blank\" class=\"text-primary text-decoration-none fw-bold\"> POL\u00CDTICA DE COOKIES </a>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p class=\"text-secondary\">\n\t\t\t\t\t\t\tDesenvolvido por <a href=\"https://www.sispro.com.br/\" target=\"_blank\" class=\"text-primary text-decoration-none fw-bold\"> SISPRO </a> \u00A9 {{ year }} Todos os direitos reservados\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t<a href=\"https://pt-br.facebook.com/SisproERP/\" target=\"_blank\"> <lib-icon class=\"text-primary\" iconName=\"facebook\" iconSize=\"medium-small\"/> </a>\n\t\t\t\t\t\t\t<a href=\"https://www.instagram.com/accounts/login/?next=/sispro_software/\" target=\"_blank\"> <lib-icon class=\"text-primary\" iconName=\"instagram\" iconSize=\"medium-small\"/> </a>\n\t\t\t\t\t\t\t<a href=\"https://br.linkedin.com/company/sispro\" target=\"_blank\"> <lib-icon class=\"text-primary\" iconName=\"linkedin\" iconSize=\"medium-small\"/> </a>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class=\"text-center\">\n\t\t\t\t\t\t\t<a class=\"text-primary fw-bold text-decoration-none glb-font-size-12\" [href]=\"geturlErpConfig()\"> Configurar ERP </a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</footer>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n", styles: ["@charset \"UTF-8\";#login .background{display:grid;height:100vh;align-content:center;background-size:cover;color:#f5f5f5;align-items:center;justify-content:center}#login .div-size{display:flex;flex-direction:column;justify-content:space-around;width:100%;height:100vh;align-items:center;background-color:#f5f5f5;box-shadow:0 0 15px #333}#login .title{font-size:3.5vw;text-transform:uppercase;font-weight:700}#login .subtitle{font-size:21px}#login .logotipo{display:flex;justify-content:center;margin-top:10%}#login .form-position{display:flex;flex-direction:column;align-content:center;width:378px}#login .form-item{margin-bottom:16px}#login .footer{display:flex;justify-content:center}#login .footer-position{font-size:14px;display:flex;justify-content:center;align-items:flex-end}#login .icons{display:flex;justify-content:center;align-items:center;margin-top:16px}#login .icons a{padding:4px}#login .icon-item{margin-left:24px;color:#007bff}#login .col-md-7,#login .col-md-5{padding:0}#login .btn-acessar{height:48px;outline-style:none}#login .texto-apresentacao{align-items:start}#login .separator{margin-left:5px}#login #ou-text{display:flex;flex-direction:row;align-items:center;justify-content:space-between}#login #ou-text:before{content:\"\";display:block;width:100%;height:1px;border-bottom:1px solid rgb(108,117,125);margin-right:12px}#login #ou-text:after{content:\"\";display:block;width:100%;height:1px;border-bottom:1px solid rgb(108,117,125);margin-left:12px}\n"] }]
|
|
2036
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2037
|
+
type: Inject,
|
|
2038
|
+
args: [MSAL_GUARD_CONFIG]
|
|
2039
|
+
}] }, { type: i1$2.MsalService }, { type: LibCustomLoginService }, { type: i3$1.FormBuilder }, { type: ProjectUtilservice }, { type: AuthService }, { type: EnvironmentService }, { type: AuthStorageService }, { type: i8.Title }, { type: i1$1.Router }, { type: i10.ToastrService }, { type: i3.MessageService }] });
|
|
2040
|
+
|
|
2041
|
+
class LoginOSModel {
|
|
2042
|
+
// Sugestão do GPT: "Pra facilitar instanciar a partir de objetos."
|
|
2043
|
+
constructor(init) {
|
|
2044
|
+
this.dominio = "";
|
|
2045
|
+
this.usuario = "";
|
|
2046
|
+
this.redirectUrl = "";
|
|
2047
|
+
this.serialV6 = "";
|
|
2048
|
+
Object.assign(this, init);
|
|
1453
2049
|
}
|
|
1454
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1455
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuConfigService, providedIn: 'root' }); }
|
|
1456
2050
|
}
|
|
1457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuConfigService, decorators: [{
|
|
1458
|
-
type: Injectable,
|
|
1459
|
-
args: [{ providedIn: 'root' }]
|
|
1460
|
-
}] });
|
|
1461
2051
|
|
|
1462
|
-
class
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
2052
|
+
class LoginOSComponent {
|
|
2053
|
+
// #endregion PUBLIC
|
|
2054
|
+
// #endregion ==========> PROPERTIES <==========
|
|
2055
|
+
// #region ==========> INITIALIZATION <==========
|
|
2056
|
+
constructor(_authService, _projectUtilservice, _route, _router, _storageService) {
|
|
2057
|
+
this._authService = _authService;
|
|
2058
|
+
this._projectUtilservice = _projectUtilservice;
|
|
2059
|
+
this._route = _route;
|
|
2060
|
+
this._router = _router;
|
|
2061
|
+
this._storageService = _storageService;
|
|
2062
|
+
// #endregion PRIVATE
|
|
2063
|
+
// #region PUBLIC
|
|
2064
|
+
this.loginStatus = "loading";
|
|
2065
|
+
this.timer = 3;
|
|
1466
2066
|
}
|
|
1467
|
-
|
|
1468
|
-
this.
|
|
2067
|
+
ngOnInit() {
|
|
2068
|
+
this.getParams();
|
|
2069
|
+
this.logOn();
|
|
1469
2070
|
}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
this.
|
|
1475
|
-
|
|
1476
|
-
this.
|
|
1477
|
-
this.
|
|
1478
|
-
this.
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
2071
|
+
// #endregion ==========> INITIALIZATION <==========
|
|
2072
|
+
// #region ==========> API METHODS <==========
|
|
2073
|
+
// #region LOGIN
|
|
2074
|
+
logOn() {
|
|
2075
|
+
this.loginStatus = "loading";
|
|
2076
|
+
let status = "none";
|
|
2077
|
+
const currDominio = this._storageService.dominio ?? undefined;
|
|
2078
|
+
const currUsuario = this._storageService.user ?? undefined;
|
|
2079
|
+
this._authService.getAuthentication(this._loginOSModel.dominio).subscribe({
|
|
2080
|
+
next: () => {
|
|
2081
|
+
if (currDominio === this._loginOSModel.dominio && currUsuario === this._loginOSModel.usuario) {
|
|
2082
|
+
status = "keep";
|
|
2083
|
+
this.redirect();
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
status = (!currDominio || !currUsuario) ? "none" : "updated";
|
|
2087
|
+
this._authService.loginOS(this._parmsLogin, this._loginOSModel.serialV6).subscribe({
|
|
2088
|
+
next: () => {
|
|
2089
|
+
if (status === "none") {
|
|
2090
|
+
this.startTimer();
|
|
2091
|
+
this.loginStatus = "success";
|
|
2092
|
+
}
|
|
2093
|
+
else {
|
|
2094
|
+
this.startTimer();
|
|
2095
|
+
this.loginStatus = "updated";
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
error: (error) => {
|
|
2099
|
+
this.loginStatus = "error";
|
|
2100
|
+
this._projectUtilservice.showHttpError(error);
|
|
2101
|
+
},
|
|
2102
|
+
});
|
|
2103
|
+
},
|
|
2104
|
+
error: (error) => {
|
|
2105
|
+
this.loginStatus = "error";
|
|
2106
|
+
this._projectUtilservice.showHttpError(error);
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
1494
2109
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
this.
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
2110
|
+
// #endregion LOGIN
|
|
2111
|
+
// #endregion ==========> API METHODS <==========
|
|
2112
|
+
// #region ==========> UTILS <==========
|
|
2113
|
+
redirect() {
|
|
2114
|
+
let hostname = window.location.host == "localhost" ? "siscandesv6.sispro.com.br" : window.location.host;
|
|
2115
|
+
let baseURL = `https://${hostname}/SisproErpCloud`;
|
|
2116
|
+
if (!this._loginOSModel.redirectUrl)
|
|
2117
|
+
this._router.navigateByUrl("/home");
|
|
2118
|
+
else
|
|
2119
|
+
window.location.replace(`${baseURL}${this._loginOSModel.redirectUrl}`);
|
|
2120
|
+
}
|
|
2121
|
+
startTimer() {
|
|
2122
|
+
this._timerSubscription = timer(0, 1000)
|
|
2123
|
+
.pipe(take(this.timer + 1))
|
|
2124
|
+
.subscribe(count => {
|
|
2125
|
+
this.timer = this.timer - count;
|
|
2126
|
+
if (this.timer === 0)
|
|
2127
|
+
this.redirect();
|
|
2128
|
+
});
|
|
1506
2129
|
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
2130
|
+
getParams() {
|
|
2131
|
+
const payloadString = this._route.snapshot.queryParamMap.get('payload');
|
|
2132
|
+
if (!payloadString) {
|
|
2133
|
+
console.warn('Payload não encontrado na URL.');
|
|
2134
|
+
this.loginStatus = "error";
|
|
2135
|
+
throw new Error('Payload não encontrado na URL.');
|
|
1513
2136
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
2137
|
+
try {
|
|
2138
|
+
const payloadJson = JSON.parse(atob(payloadString));
|
|
2139
|
+
this._loginOSModel = new LoginOSModel({
|
|
2140
|
+
dominio: payloadJson.dominio ?? '',
|
|
2141
|
+
usuario: payloadJson.usuario ?? '',
|
|
2142
|
+
redirectUrl: payloadJson.redirectUrl ?? '',
|
|
2143
|
+
serialV6: payloadJson.serialV6 ?? ''
|
|
2144
|
+
});
|
|
2145
|
+
this._parmsLogin = {
|
|
2146
|
+
dominio: payloadJson.dominio,
|
|
2147
|
+
usuario: payloadJson.usuario,
|
|
2148
|
+
senha: ""
|
|
2149
|
+
};
|
|
1520
2150
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
menuopenExpansibleMenu(ref) {
|
|
1525
|
-
if (this.storedMenuopenExpansibleMenu) {
|
|
1526
|
-
this.storedMenuopenExpansibleMenu(ref);
|
|
2151
|
+
catch (error) {
|
|
2152
|
+
console.error('Erro ao fazer parse do payload:', error);
|
|
2153
|
+
throw error;
|
|
1527
2154
|
}
|
|
1528
2155
|
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
this.
|
|
1532
|
-
estabelecimentoID: this._authStorageService.infraEstabId,
|
|
1533
|
-
empresaID: this._authStorageService.infraEmpresaId
|
|
1534
|
-
});
|
|
2156
|
+
// #endregion ==========> UTILS <==========
|
|
2157
|
+
ngOnDestroy() {
|
|
2158
|
+
this._timerSubscription?.unsubscribe();
|
|
1535
2159
|
}
|
|
1536
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1537
|
-
static { this.ɵ
|
|
2160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginOSComponent, deps: [{ token: AuthService }, { token: ProjectUtilservice }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: AuthStorageService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2161
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: LoginOSComponent, isStandalone: true, selector: "login-os", ngImport: i0, template: `
|
|
2162
|
+
<div class="d-flex flex-column justify-content-center align-items-center h-100 w-100 bg-light" >
|
|
2163
|
+
|
|
2164
|
+
@switch (loginStatus) {
|
|
2165
|
+
@case ("loading") {
|
|
2166
|
+
<div class="text-center">
|
|
2167
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2168
|
+
<h2 class="fw-bold">Carregando Informações...</h2>
|
|
2169
|
+
<p class="text-muted">Por favor, aguarde enquanto os dados são carregados.</p>
|
|
2170
|
+
</div>
|
|
2171
|
+
<div class="spinner-border text-primary" role="status"></div>
|
|
2172
|
+
}
|
|
2173
|
+
@case ("success") {
|
|
2174
|
+
<div class="text-center">
|
|
2175
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2176
|
+
<h2 class="fw-bold">Login efetuado com sucesso</h2>
|
|
2177
|
+
<h2 class="fw-bold">Bem-vindo à V6!</h2>
|
|
2178
|
+
@if (timer > 0) { <span class="text-muted">Redirecionando você em {{ timer }} segundos...</span> }
|
|
2179
|
+
@else { <span class="text-muted">Se você não foi redirecionado automaticamente, <b class="text-primary glb-cursor-pointer" (click)="redirect()">clique aqui</b></span> }
|
|
2180
|
+
<div><lib-icon iconName="p-check" iconColor="green" [iconSize]="50" /></div>
|
|
2181
|
+
</div>
|
|
2182
|
+
}
|
|
2183
|
+
@case ("error") {
|
|
2184
|
+
<div class="text-center">
|
|
2185
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2186
|
+
<h2 class="text-danger fw-bold">Não foi possível efetuar o login</h2>
|
|
2187
|
+
<span class="text-muted">Verifique os parâmetros enviados e tente novamente.</span>
|
|
2188
|
+
<div><lib-icon iconName="p-pare" iconColor="red" [iconSize]="50" /></div>
|
|
2189
|
+
</div>
|
|
2190
|
+
}
|
|
2191
|
+
@case ("updated") {
|
|
2192
|
+
<div class="text-center">
|
|
2193
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2194
|
+
<h2 class="fw-bold">Sessão atualizada com sucesso</h2>
|
|
2195
|
+
@if (timer > 0) { <span class="text-muted">Redirecionando você em {{ timer }} segundos...</span> }
|
|
2196
|
+
@else { <span class="text-muted">Se você não foi redirecionado automaticamente, <b class="text-primary glb-cursor-pointer" (click)="redirect()">clique aqui</b></span> }
|
|
2197
|
+
<div><lib-icon iconName="p-check" iconColor="green" [iconSize]="50" /></div>
|
|
2198
|
+
</div>
|
|
2199
|
+
}
|
|
2200
|
+
@default {
|
|
2201
|
+
<div class="text-center">
|
|
2202
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2203
|
+
<h2 class="fw-bold">Carregando Informações...</h2>
|
|
2204
|
+
<p class="text-muted">Por favor, aguarde enquanto os dados são carregados.</p>
|
|
2205
|
+
</div>
|
|
2206
|
+
<div class="spinner-border text-primary" role="status"></div>
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
</div>
|
|
2211
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }] }); }
|
|
1538
2212
|
}
|
|
1539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1540
|
-
type:
|
|
1541
|
-
args: [{
|
|
1542
|
-
|
|
2213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginOSComponent, decorators: [{
|
|
2214
|
+
type: Component,
|
|
2215
|
+
args: [{ selector: 'login-os', standalone: true, imports: [
|
|
2216
|
+
InfraModule
|
|
2217
|
+
], template: `
|
|
2218
|
+
<div class="d-flex flex-column justify-content-center align-items-center h-100 w-100 bg-light" >
|
|
2219
|
+
|
|
2220
|
+
@switch (loginStatus) {
|
|
2221
|
+
@case ("loading") {
|
|
2222
|
+
<div class="text-center">
|
|
2223
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2224
|
+
<h2 class="fw-bold">Carregando Informações...</h2>
|
|
2225
|
+
<p class="text-muted">Por favor, aguarde enquanto os dados são carregados.</p>
|
|
2226
|
+
</div>
|
|
2227
|
+
<div class="spinner-border text-primary" role="status"></div>
|
|
2228
|
+
}
|
|
2229
|
+
@case ("success") {
|
|
2230
|
+
<div class="text-center">
|
|
2231
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2232
|
+
<h2 class="fw-bold">Login efetuado com sucesso</h2>
|
|
2233
|
+
<h2 class="fw-bold">Bem-vindo à V6!</h2>
|
|
2234
|
+
@if (timer > 0) { <span class="text-muted">Redirecionando você em {{ timer }} segundos...</span> }
|
|
2235
|
+
@else { <span class="text-muted">Se você não foi redirecionado automaticamente, <b class="text-primary glb-cursor-pointer" (click)="redirect()">clique aqui</b></span> }
|
|
2236
|
+
<div><lib-icon iconName="p-check" iconColor="green" [iconSize]="50" /></div>
|
|
2237
|
+
</div>
|
|
2238
|
+
}
|
|
2239
|
+
@case ("error") {
|
|
2240
|
+
<div class="text-center">
|
|
2241
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2242
|
+
<h2 class="text-danger fw-bold">Não foi possível efetuar o login</h2>
|
|
2243
|
+
<span class="text-muted">Verifique os parâmetros enviados e tente novamente.</span>
|
|
2244
|
+
<div><lib-icon iconName="p-pare" iconColor="red" [iconSize]="50" /></div>
|
|
2245
|
+
</div>
|
|
2246
|
+
}
|
|
2247
|
+
@case ("updated") {
|
|
2248
|
+
<div class="text-center">
|
|
2249
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2250
|
+
<h2 class="fw-bold">Sessão atualizada com sucesso</h2>
|
|
2251
|
+
@if (timer > 0) { <span class="text-muted">Redirecionando você em {{ timer }} segundos...</span> }
|
|
2252
|
+
@else { <span class="text-muted">Se você não foi redirecionado automaticamente, <b class="text-primary glb-cursor-pointer" (click)="redirect()">clique aqui</b></span> }
|
|
2253
|
+
<div><lib-icon iconName="p-check" iconColor="green" [iconSize]="50" /></div>
|
|
2254
|
+
</div>
|
|
2255
|
+
}
|
|
2256
|
+
@default {
|
|
2257
|
+
<div class="text-center">
|
|
2258
|
+
<img src="assets/imgs/logo.png" alt="Loading Logo" class="mb-3" style="max-width: 150px;">
|
|
2259
|
+
<h2 class="fw-bold">Carregando Informações...</h2>
|
|
2260
|
+
<p class="text-muted">Por favor, aguarde enquanto os dados são carregados.</p>
|
|
2261
|
+
</div>
|
|
2262
|
+
<div class="spinner-border text-primary" role="status"></div>
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
</div>
|
|
2267
|
+
` }]
|
|
2268
|
+
}], ctorParameters: () => [{ type: AuthService }, { type: ProjectUtilservice }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AuthStorageService }] });
|
|
1543
2269
|
|
|
1544
|
-
//import { environment } from '../../../../environments/environments';
|
|
1545
|
-
// import { ProjectUtilservice } from 'src/app/project/utils/project-utils.service';
|
|
1546
2270
|
class SecondaryDropdownComponent {
|
|
1547
|
-
constructor() {
|
|
2271
|
+
constructor(_projectUtilservice) {
|
|
2272
|
+
this._projectUtilservice = _projectUtilservice;
|
|
1548
2273
|
this.modulo = { id: null, icon: null, label: null, URL: null, secondary_level: null };
|
|
1549
2274
|
this.backPrimaryDropdown = new EventEmitter();
|
|
1550
2275
|
}
|
|
@@ -1554,33 +2279,35 @@ class SecondaryDropdownComponent {
|
|
|
1554
2279
|
this.backPrimaryDropdown.emit(true);
|
|
1555
2280
|
}
|
|
1556
2281
|
redirectToModulo(modulo) {
|
|
1557
|
-
const url =
|
|
2282
|
+
const url = `${this._projectUtilservice.getHostName()}/SisproErpCloud/${modulo}`;
|
|
1558
2283
|
window.open(url, '_blank');
|
|
1559
2284
|
}
|
|
1560
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SecondaryDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1561
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SecondaryDropdownComponent, isStandalone: true, selector: "app-secondary-dropdown", inputs: { modulo: "modulo" }, outputs: { backPrimaryDropdown: "backPrimaryDropdown" }, ngImport: i0, template: "<div class=\"d-flex flex-row\">\n <button class=\"chevron d-flex m-0 p-0 align-items-start\" (click)=\"backToPrimary()\"> \n <lib-icon iconName=\"seta-esquerda\" iconSize=\"small\"/>\n </button>\n\n <div class=\"d-flex flex-column flex-row\">\n <li *ngIf=\"modulo != null\">\n <img class=\"ms-1 mb-2\" src=\"{{ modulo.icon }}\" alt=\"{{ modulo.label }}\">\n <span>{{ modulo.label }}</span>\n </li>\n <div *ngIf=\"modulo && modulo.secondary_level != null\">\n <li *ngFor=\"let moduloItem of modulo.secondary_level;\" (click)=\"redirectToModulo(moduloItem.URL)\">\n <a class=\"dropdown-item mb-2 ms-2\">\n <img src=\"{{ moduloItem.icon }}\" alt=\"{{ moduloItem.label }}\">\n {{ moduloItem.label }}\n </a>\n <li>\n </div>\n </div>\n</div>", styles: ["*{padding:0;margin:0}.chevron{margin-bottom:16px;margin-left:14px}li img{margin-left:8px;margin-right:4px}li span{font-weight:700}li a:hover{font-weight:700;background-color:transparent}.dropdown-item{margin-left:32px}button{background-color:transparent;border:none}\n"], dependencies: [{ kind: "ngmodule", type: InfraModule }, { kind: "component", type:
|
|
2285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SecondaryDropdownComponent, deps: [{ token: ProjectUtilservice }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2286
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SecondaryDropdownComponent, isStandalone: true, selector: "app-secondary-dropdown", inputs: { modulo: "modulo" }, outputs: { backPrimaryDropdown: "backPrimaryDropdown" }, ngImport: i0, template: "<div class=\"d-flex flex-row\">\n <button class=\"chevron d-flex m-0 p-0 align-items-start\" (click)=\"backToPrimary()\"> \n <lib-icon iconName=\"seta-esquerda\" iconSize=\"small\"/>\n </button>\n\n <div class=\"d-flex flex-column flex-row\">\n <li *ngIf=\"modulo != null\">\n <img class=\"ms-1 mb-2\" src=\"{{ modulo.icon }}\" alt=\"{{ modulo.label }}\">\n <span>{{ modulo.label }}</span>\n </li>\n <div *ngIf=\"modulo && modulo.secondary_level != null\">\n <li *ngFor=\"let moduloItem of modulo.secondary_level;\" (click)=\"redirectToModulo(moduloItem.URL)\">\n <a class=\"dropdown-item mb-2 ms-2\">\n <img src=\"{{ moduloItem.icon }}\" alt=\"{{ moduloItem.label }}\">\n {{ moduloItem.label }}\n </a>\n <li>\n </div>\n </div>\n</div>", styles: ["*{padding:0;margin:0}.chevron{margin-bottom:16px;margin-left:14px}li img{margin-left:8px;margin-right:4px}li span{font-weight:700}li a:hover{font-weight:700;background-color:transparent}.dropdown-item{margin-left:32px}button{background-color:transparent;border:none}\n"], dependencies: [{ kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1562
2287
|
}
|
|
1563
2288
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SecondaryDropdownComponent, decorators: [{
|
|
1564
2289
|
type: Component,
|
|
1565
|
-
args: [{ selector: 'app-secondary-dropdown', imports: [
|
|
1566
|
-
|
|
2290
|
+
args: [{ selector: 'app-secondary-dropdown', imports: [
|
|
2291
|
+
InfraModule,
|
|
2292
|
+
CommonModule
|
|
2293
|
+
], template: "<div class=\"d-flex flex-row\">\n <button class=\"chevron d-flex m-0 p-0 align-items-start\" (click)=\"backToPrimary()\"> \n <lib-icon iconName=\"seta-esquerda\" iconSize=\"small\"/>\n </button>\n\n <div class=\"d-flex flex-column flex-row\">\n <li *ngIf=\"modulo != null\">\n <img class=\"ms-1 mb-2\" src=\"{{ modulo.icon }}\" alt=\"{{ modulo.label }}\">\n <span>{{ modulo.label }}</span>\n </li>\n <div *ngIf=\"modulo && modulo.secondary_level != null\">\n <li *ngFor=\"let moduloItem of modulo.secondary_level;\" (click)=\"redirectToModulo(moduloItem.URL)\">\n <a class=\"dropdown-item mb-2 ms-2\">\n <img src=\"{{ moduloItem.icon }}\" alt=\"{{ moduloItem.label }}\">\n {{ moduloItem.label }}\n </a>\n <li>\n </div>\n </div>\n</div>", styles: ["*{padding:0;margin:0}.chevron{margin-bottom:16px;margin-left:14px}li img{margin-left:8px;margin-right:4px}li span{font-weight:700}li a:hover{font-weight:700;background-color:transparent}.dropdown-item{margin-left:32px}button{background-color:transparent;border:none}\n"] }]
|
|
2294
|
+
}], ctorParameters: () => [{ type: ProjectUtilservice }], propDecorators: { modulo: [{
|
|
1567
2295
|
type: Input
|
|
1568
2296
|
}], backPrimaryDropdown: [{
|
|
1569
2297
|
type: Output
|
|
1570
2298
|
}] } });
|
|
1571
2299
|
|
|
1572
|
-
//import { ProjectUtilservice } from 'src/app/project/utils/project-utils.service';
|
|
1573
|
-
//import { environment } from '../../../../environments/environments';
|
|
1574
2300
|
class PrimaryDropdownComponent {
|
|
1575
|
-
constructor(_customMenuService) {
|
|
2301
|
+
constructor(_customMenuService, _projectUtilservice) {
|
|
1576
2302
|
this._customMenuService = _customMenuService;
|
|
1577
|
-
this.
|
|
2303
|
+
this._projectUtilservice = _projectUtilservice;
|
|
2304
|
+
this.selectDataState = false;
|
|
1578
2305
|
this.primaryDropdown = [];
|
|
1579
2306
|
}
|
|
1580
2307
|
ngOnInit() {
|
|
1581
2308
|
this.buttonWasClicked.subscribe(() => { this.selectDataState = true; });
|
|
1582
2309
|
// Resolver colisão de eventos
|
|
1583
|
-
if (this._customMenuService.menuDynamic) {
|
|
2310
|
+
if (this._customMenuService.menuDynamic || this._customMenuService.menuDynamicCustom) {
|
|
1584
2311
|
if (!this._customMenuService.menuConfig) {
|
|
1585
2312
|
setTimeout(() => {
|
|
1586
2313
|
this.primaryDropdown = this._customMenuService.menuConfig.initializeMenuDropdown(this.primaryDropdown);
|
|
@@ -1612,26 +2339,30 @@ class PrimaryDropdownComponent {
|
|
|
1612
2339
|
this.selectDataState = true;
|
|
1613
2340
|
}
|
|
1614
2341
|
redirectToPrePortal() {
|
|
1615
|
-
const url =
|
|
2342
|
+
const url = `${this._projectUtilservice.getHostName()}/SisproErpCloud/PrePortal`;
|
|
1616
2343
|
window.open(url, '_blank');
|
|
1617
2344
|
}
|
|
1618
2345
|
redirectToModulo(modulo) {
|
|
1619
|
-
const url =
|
|
2346
|
+
const url = `${this._projectUtilservice.getHostName()}/SisproErpCloud/${modulo}`;
|
|
1620
2347
|
window.open(url, '_blank');
|
|
1621
2348
|
}
|
|
1622
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PrimaryDropdownComponent, deps: [{ token: LibCustomMenuService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1623
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: PrimaryDropdownComponent, isStandalone: true, selector: "app-primary-dropdown", inputs: { buttonWasClicked: "buttonWasClicked" }, ngImport: i0, template: "<div class=\"p-2\">\n <div *ngIf=\"selectDataState; else secondary_dropdown\" class=\"mb-2 w-100\">\n <li *ngFor=\"let modulo of primaryDropdown\" (click)=\"(modulo.secondary_level != null ? openDropdown(modulo, secondary_dropdown) : redirectToModulo(modulo.URL))\">\n <a class=\"dropdown-item mb-2\">\n <img src=\"{{ modulo.icon }}\" alt=\"{{ modulo.label }}\">\n {{ modulo.label }}\n </a>\n </li>\n <hr class=\"dropdown-divider\">\n <li>\n <a class=\"dropdown-item link-portal mt-2\" (click)=\"redirectToPrePortal()\" target=\"_blank\">Portal Sispro</a>\n </li>\n </div>\n\n <ng-template #secondary_dropdown>\n <div #secondary_ref (clickOutside)=\"onClickedOutside($event, secondary_ref)\">\n <app-secondary-dropdown [modulo]=\"modulo\" (backPrimaryDropdown)=\"backToPrimary($event)\"></app-secondary-dropdown>\n </div>\n </ng-template>\n</div>", styles: ["*{padding:0;margin:0}li a{font-size:14px}li a img{margin-right:4px}li a:hover{font-weight:700;background-color:transparent}.dropdown-divider{height:0}.link-portal{color:#2847a0;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}\n"], dependencies: [{ kind: "component", type: SecondaryDropdownComponent, selector: "app-secondary-dropdown", inputs: ["modulo"], outputs: ["backPrimaryDropdown"] }, { kind: "directive", type:
|
|
2349
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PrimaryDropdownComponent, deps: [{ token: LibCustomMenuService }, { token: ProjectUtilservice }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2350
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: PrimaryDropdownComponent, isStandalone: true, selector: "app-primary-dropdown", inputs: { buttonWasClicked: "buttonWasClicked" }, ngImport: i0, template: "<div class=\"p-2\">\n <div *ngIf=\"selectDataState; else secondary_dropdown\" class=\"mb-2 w-100\">\n <li *ngFor=\"let modulo of primaryDropdown\" (click)=\"(modulo.secondary_level != null ? openDropdown(modulo, secondary_dropdown) : redirectToModulo(modulo.URL))\">\n <a class=\"dropdown-item mb-2\">\n <img src=\"{{ modulo.icon }}\" alt=\"{{ modulo.label }}\">\n {{ modulo.label }}\n </a>\n </li>\n <hr class=\"dropdown-divider\">\n <li>\n <a class=\"dropdown-item link-portal mt-2\" (click)=\"redirectToPrePortal()\" target=\"_blank\">Portal Sispro</a>\n </li>\n </div>\n\n <ng-template #secondary_dropdown>\n <div #secondary_ref (clickOutside)=\"onClickedOutside($event, secondary_ref)\">\n <app-secondary-dropdown [modulo]=\"this.modulo\" (backPrimaryDropdown)=\"backToPrimary($event)\"></app-secondary-dropdown>\n </div>\n </ng-template>\n</div>", styles: ["*{padding:0;margin:0}li a{font-size:14px}li a img{margin-right:4px}li a:hover{font-weight:700;background-color:transparent}.dropdown-divider{height:0}.link-portal{color:#2847a0;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}\n"], dependencies: [{ kind: "component", type: SecondaryDropdownComponent, selector: "app-secondary-dropdown", inputs: ["modulo"], outputs: ["backPrimaryDropdown"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1624
2351
|
}
|
|
1625
2352
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PrimaryDropdownComponent, decorators: [{
|
|
1626
2353
|
type: Component,
|
|
1627
|
-
args: [{ selector: 'app-primary-dropdown', imports: [
|
|
1628
|
-
|
|
2354
|
+
args: [{ selector: 'app-primary-dropdown', imports: [
|
|
2355
|
+
SecondaryDropdownComponent,
|
|
2356
|
+
CommonModule
|
|
2357
|
+
], template: "<div class=\"p-2\">\n <div *ngIf=\"selectDataState; else secondary_dropdown\" class=\"mb-2 w-100\">\n <li *ngFor=\"let modulo of primaryDropdown\" (click)=\"(modulo.secondary_level != null ? openDropdown(modulo, secondary_dropdown) : redirectToModulo(modulo.URL))\">\n <a class=\"dropdown-item mb-2\">\n <img src=\"{{ modulo.icon }}\" alt=\"{{ modulo.label }}\">\n {{ modulo.label }}\n </a>\n </li>\n <hr class=\"dropdown-divider\">\n <li>\n <a class=\"dropdown-item link-portal mt-2\" (click)=\"redirectToPrePortal()\" target=\"_blank\">Portal Sispro</a>\n </li>\n </div>\n\n <ng-template #secondary_dropdown>\n <div #secondary_ref (clickOutside)=\"onClickedOutside($event, secondary_ref)\">\n <app-secondary-dropdown [modulo]=\"this.modulo\" (backPrimaryDropdown)=\"backToPrimary($event)\"></app-secondary-dropdown>\n </div>\n </ng-template>\n</div>", styles: ["*{padding:0;margin:0}li a{font-size:14px}li a img{margin-right:4px}li a:hover{font-weight:700;background-color:transparent}.dropdown-divider{height:0}.link-portal{color:#2847a0;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}\n"] }]
|
|
2358
|
+
}], ctorParameters: () => [{ type: LibCustomMenuService }, { type: ProjectUtilservice }], propDecorators: { buttonWasClicked: [{
|
|
1629
2359
|
type: Input
|
|
1630
2360
|
}] } });
|
|
1631
2361
|
|
|
1632
2362
|
class DynamicMenuComponent {
|
|
1633
|
-
constructor(router) {
|
|
2363
|
+
constructor(router, _projectUtilService) {
|
|
1634
2364
|
this.router = router;
|
|
2365
|
+
this._projectUtilService = _projectUtilService;
|
|
1635
2366
|
this.selectTemplate = new EventEmitter;
|
|
1636
2367
|
this.titleSubmenu = "";
|
|
1637
2368
|
this.submenuList = [];
|
|
@@ -1656,15 +2387,21 @@ class DynamicMenuComponent {
|
|
|
1656
2387
|
ref.classList.toggle("yellow-star");
|
|
1657
2388
|
}
|
|
1658
2389
|
getExternalUrl(url) {
|
|
1659
|
-
return
|
|
2390
|
+
return `${this._projectUtilService.getHostName()}/${url}`;
|
|
1660
2391
|
}
|
|
1661
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicMenuComponent, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1662
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DynamicMenuComponent, isStandalone: true, selector: "app-dynamic-menu", inputs: { submenuRef: "submenuRef", recebeParam: "recebeParam", titleSubmenu: "titleSubmenu", submenuList: "submenuList" }, outputs: { selectTemplate: "selectTemplate" }, queries: [{ propertyName: "desiredContent", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: "<div #submenu class=\"header-submenu\">\n <h1 class=\"titulo pb-3 pt-4\">{{ titleSubmenu }}</h1>\n <div class=\"itens-list\">\n <ul style=\"width: 100%\">\n \n <li *ngFor=\"let itemList of submenuList; let i = index\" [id]=\"itemList!.id\" \n class=\"d-flex justify-content-between align-items-center\"\n [class]=\"i == 0 ? 'mt-1' : ''\">\n \n <a *ngIf=\"!itemList.isExternal; else externalMenu\"\n [routerLink]=\"itemList!.route != null ? ['/' + itemList!.route] : null\" \n (click)=\"recebeParam($event, submenuRef)\">\n <span>{{ itemList!.label }}</span>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(itemList.route)\"\n target=\"_blank\" \n (click)=\"recebeParam($event, submenuRef)\">\n <span>{{ itemList!.label }}</span>\n </a>\n </ng-template>\n\n <!-- <button class=\"star favoritos\" #star (click)=\"changeStar(star, itemList)\"></button> -->\n </li>\n\n </ul>\n </div>\n</div>", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;color:#fff}ul{list-style:none;padding-left:0;display:inline;white-space:nowrap}.titulo{font-size:20px;font-weight:700;display:flex;justify-content:center;border-bottom:1px solid #2847a0}ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}ul li{font-size:16px;padding-bottom:18px}ul li span:hover{font-weight:700}a{text-decoration:none}.itens-list{display:flex;align-items:center}.itens-list .favoritos,.itens-list span{cursor:pointer}.footer-menu{display:flex;flex-direction:column;justify-content:center;padding-bottom:16px}.footer-menu .footer-components{border-top:1px solid #3265ee;padding-top:16px;padding-left:17px;white-space:nowrap}.footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0 15px 0 0}.footer-components{display:flex;justify-content:center;align-items:center}button{position:relative;border:none;background-color:transparent}.photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.star{width:24px;height:24px;background-repeat:no-repeat}.yellow-star{width:26px;height:24px;background-repeat:no-repeat}\n"], dependencies: [{ kind: "ngmodule", type:
|
|
2392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicMenuComponent, deps: [{ token: i1$1.Router }, { token: ProjectUtilservice }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2393
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DynamicMenuComponent, isStandalone: true, selector: "app-dynamic-menu", inputs: { submenuRef: "submenuRef", recebeParam: "recebeParam", titleSubmenu: "titleSubmenu", submenuList: "submenuList" }, outputs: { selectTemplate: "selectTemplate" }, queries: [{ propertyName: "desiredContent", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: "<div #submenu class=\"header-submenu\">\n <h1 class=\"titulo pb-3 pt-4\">{{ titleSubmenu }}</h1>\n <div class=\"itens-list\">\n <ul style=\"width: 100%\">\n \n <li *ngFor=\"let itemList of submenuList; let i = index\" [id]=\"itemList!.id\" \n class=\"d-flex justify-content-between align-items-center\"\n [class]=\"i == 0 ? 'mt-1' : ''\">\n \n <a *ngIf=\"!itemList.isExternal; else externalMenu\"\n [routerLink]=\"itemList!.route != null ? ['/' + itemList!.route] : null\" \n (click)=\"recebeParam($event, submenuRef)\">\n <span>{{ itemList!.label }}</span>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(itemList.route)\"\n target=\"_blank\" \n (click)=\"recebeParam($event, submenuRef)\">\n <span>{{ itemList!.label }}</span>\n </a>\n </ng-template>\n\n <!-- <button class=\"star favoritos\" #star (click)=\"changeStar(star, itemList)\"></button> -->\n </li>\n\n </ul>\n </div>\n</div>", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;color:#fff}ul{list-style:none;padding-left:0;display:inline;white-space:nowrap}.titulo{font-size:20px;font-weight:700;display:flex;justify-content:center;border-bottom:1px solid #2847a0}ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}ul li{font-size:16px;padding-bottom:18px}ul li span:hover{font-weight:700}a{text-decoration:none}.itens-list{display:flex;align-items:center}.itens-list .favoritos,.itens-list span{cursor:pointer}.footer-menu{display:flex;flex-direction:column;justify-content:center;padding-bottom:16px}.footer-menu .footer-components{border-top:1px solid #3265ee;padding-top:16px;padding-left:17px;white-space:nowrap}.footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0 15px 0 0}.footer-components{display:flex;justify-content:center;align-items:center}button{position:relative;border:none;background-color:transparent}.photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.star{width:24px;height:24px;background-repeat:no-repeat}.yellow-star{width:26px;height:24px;background-repeat:no-repeat}\n"], dependencies: [{ kind: "ngmodule", type:
|
|
2394
|
+
// AuthRoutingModule,
|
|
2395
|
+
CommonModule }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] }); }
|
|
1663
2396
|
}
|
|
1664
2397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicMenuComponent, decorators: [{
|
|
1665
2398
|
type: Component,
|
|
1666
|
-
args: [{ selector: 'app-dynamic-menu', imports: [
|
|
1667
|
-
|
|
2399
|
+
args: [{ selector: 'app-dynamic-menu', imports: [
|
|
2400
|
+
// AuthRoutingModule,
|
|
2401
|
+
CommonModule,
|
|
2402
|
+
RouterLink
|
|
2403
|
+
], template: "<div #submenu class=\"header-submenu\">\n <h1 class=\"titulo pb-3 pt-4\">{{ titleSubmenu }}</h1>\n <div class=\"itens-list\">\n <ul style=\"width: 100%\">\n \n <li *ngFor=\"let itemList of submenuList; let i = index\" [id]=\"itemList!.id\" \n class=\"d-flex justify-content-between align-items-center\"\n [class]=\"i == 0 ? 'mt-1' : ''\">\n \n <a *ngIf=\"!itemList.isExternal; else externalMenu\"\n [routerLink]=\"itemList!.route != null ? ['/' + itemList!.route] : null\" \n (click)=\"recebeParam($event, submenuRef)\">\n <span>{{ itemList!.label }}</span>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(itemList.route)\"\n target=\"_blank\" \n (click)=\"recebeParam($event, submenuRef)\">\n <span>{{ itemList!.label }}</span>\n </a>\n </ng-template>\n\n <!-- <button class=\"star favoritos\" #star (click)=\"changeStar(star, itemList)\"></button> -->\n </li>\n\n </ul>\n </div>\n</div>", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;color:#fff}ul{list-style:none;padding-left:0;display:inline;white-space:nowrap}.titulo{font-size:20px;font-weight:700;display:flex;justify-content:center;border-bottom:1px solid #2847a0}ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}ul li{font-size:16px;padding-bottom:18px}ul li span:hover{font-weight:700}a{text-decoration:none}.itens-list{display:flex;align-items:center}.itens-list .favoritos,.itens-list span{cursor:pointer}.footer-menu{display:flex;flex-direction:column;justify-content:center;padding-bottom:16px}.footer-menu .footer-components{border-top:1px solid #3265ee;padding-top:16px;padding-left:17px;white-space:nowrap}.footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0 15px 0 0}.footer-components{display:flex;justify-content:center;align-items:center}button{position:relative;border:none;background-color:transparent}.photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.star{width:24px;height:24px;background-repeat:no-repeat}.yellow-star{width:26px;height:24px;background-repeat:no-repeat}\n"] }]
|
|
2404
|
+
}], ctorParameters: () => [{ type: i1$1.Router }, { type: ProjectUtilservice }], propDecorators: { selectTemplate: [{
|
|
1668
2405
|
type: Output
|
|
1669
2406
|
}], submenuRef: [{
|
|
1670
2407
|
type: Input
|
|
@@ -1688,16 +2425,17 @@ class NotifSubmenuComponent {
|
|
|
1688
2425
|
}
|
|
1689
2426
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NotifSubmenuComponent, decorators: [{
|
|
1690
2427
|
type: Component,
|
|
1691
|
-
args: [{ selector: 'app-notif-submenu', template: "<div class=\"header-submenu\">\n <h1 class=\"titulo pb-3 pt-4\">Notifica\u00E7\u00F5es</h1>\n</div>\n<div class=\"body-notif\">\n <div class=\"new-notif\">\n <div class=\"session-header p-2\">\n <p class=\"session-h-item\">Novas (2)</p><p>Marcar todas como Lidas</p>\n </div>\n <div class=\"scroll\">\n <div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"read-notif\">\n <div class=\"session-header p-2\">\n <p class=\"session-h-item\">Lidas</p>\n </div>\n <div class=\"scroll-second\">\n <div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;color:#fff}ul{list-style:none;padding-left:0;display:inline;white-space:nowrap}::-webkit-scrollbar{width:4px;background:transparent}::-webkit-scrollbar-thumb{background:#fff;border-radius:16px}.titulo{font-size:20px;font-weight:700;display:flex;justify-content:center;border-bottom:1px solid #2847a0}ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}ul li{font-size:20px;font-weight:600;line-height:22px;padding-bottom:18px}button{position:relative;border:none;background-color:transparent}.session-header{display:flex;justify-content:space-between;background-color:#2847a0}.session-header .session-h-item{font-weight:700}.session{border-bottom:1px solid #fff;overflow:auto;height:100%}.session:last-child{border-bottom:none}.session-start{display:flex}.item-end{display:flex;justify-content:space-between}.scroll{margin-right:2px;overflow:auto;max-height:300px}.scroll-second{margin-right:2px;overflow:auto;max-height:481px}\n"] }]
|
|
2428
|
+
args: [{ selector: 'app-notif-submenu', imports: [], template: "<div class=\"header-submenu\">\n <h1 class=\"titulo pb-3 pt-4\">Notifica\u00E7\u00F5es</h1>\n</div>\n<div class=\"body-notif\">\n <div class=\"new-notif\">\n <div class=\"session-header p-2\">\n <p class=\"session-h-item\">Novas (2)</p><p>Marcar todas como Lidas</p>\n </div>\n <div class=\"scroll\">\n <div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"read-notif\">\n <div class=\"session-header p-2\">\n <p class=\"session-h-item\">Lidas</p>\n </div>\n <div class=\"scroll-second\">\n <div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n <div class=\"session mb-3 pb-3\">\n <div class=\"session-start mt-3 ms-3\">\n <img src=\"assets/icons/file-text.svg\" alt=\"\"><p>Contratos</p>\n </div>\n <div class=\"m-4\">\n <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has </p>\n </div>\n <div class=\"item-end ms-4 mx-4\">\n <button>Marcar como lida</button>\n <p>2h atr\u00E1s</p>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;color:#fff}ul{list-style:none;padding-left:0;display:inline;white-space:nowrap}::-webkit-scrollbar{width:4px;background:transparent}::-webkit-scrollbar-thumb{background:#fff;border-radius:16px}.titulo{font-size:20px;font-weight:700;display:flex;justify-content:center;border-bottom:1px solid #2847a0}ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}ul li{font-size:20px;font-weight:600;line-height:22px;padding-bottom:18px}button{position:relative;border:none;background-color:transparent}.session-header{display:flex;justify-content:space-between;background-color:#2847a0}.session-header .session-h-item{font-weight:700}.session{border-bottom:1px solid #fff;overflow:auto;height:100%}.session:last-child{border-bottom:none}.session-start{display:flex}.item-end{display:flex;justify-content:space-between}.scroll{margin-right:2px;overflow:auto;max-height:300px}.scroll-second{margin-right:2px;overflow:auto;max-height:481px}\n"] }]
|
|
1692
2429
|
}], ctorParameters: () => [] });
|
|
1693
2430
|
|
|
1694
2431
|
class SelecaoEstabelecimentosModalComponent {
|
|
1695
|
-
constructor(_authStorageService, _bsModalService, _customMenuService, _menuServicesService, _messageService) {
|
|
2432
|
+
constructor(_authStorageService, _bsModalService, _customMenuService, _menuServicesService, _messageService, _projectUtilService) {
|
|
1696
2433
|
this._authStorageService = _authStorageService;
|
|
1697
2434
|
this._bsModalService = _bsModalService;
|
|
1698
2435
|
this._customMenuService = _customMenuService;
|
|
1699
2436
|
this._menuServicesService = _menuServicesService;
|
|
1700
2437
|
this._messageService = _messageService;
|
|
2438
|
+
this._projectUtilService = _projectUtilService;
|
|
1701
2439
|
// #region ==========> PROPERTIES <==========
|
|
1702
2440
|
// #region PRIVATE
|
|
1703
2441
|
// [...]
|
|
@@ -1705,7 +2443,6 @@ class SelecaoEstabelecimentosModalComponent {
|
|
|
1705
2443
|
// #region PUBLIC
|
|
1706
2444
|
this.onClose = new EventEmitter();
|
|
1707
2445
|
this.onSelected = new EventEmitter();
|
|
1708
|
-
this.$estabelecimentosList = [];
|
|
1709
2446
|
this.page = 1;
|
|
1710
2447
|
this.itemsPerPage = 10;
|
|
1711
2448
|
this.response_messages = {
|
|
@@ -1741,9 +2478,7 @@ class SelecaoEstabelecimentosModalComponent {
|
|
|
1741
2478
|
}
|
|
1742
2479
|
},
|
|
1743
2480
|
error: error => {
|
|
1744
|
-
|
|
1745
|
-
this._messageService.showAlertDanger(error);
|
|
1746
|
-
throw new Error(error);
|
|
2481
|
+
this._projectUtilService.showHttpError(error);
|
|
1747
2482
|
this.$estabelecimentosList = [];
|
|
1748
2483
|
}
|
|
1749
2484
|
});
|
|
@@ -1767,9 +2502,7 @@ class SelecaoEstabelecimentosModalComponent {
|
|
|
1767
2502
|
: this._messageService.showAlertSuccess('Estabelecimento padrão removido para o usuário');
|
|
1768
2503
|
},
|
|
1769
2504
|
error: error => {
|
|
1770
|
-
|
|
1771
|
-
this._messageService.showAlertDanger(error);
|
|
1772
|
-
throw new Error(error);
|
|
2505
|
+
this._projectUtilService.showHttpError(error);
|
|
1773
2506
|
}
|
|
1774
2507
|
});
|
|
1775
2508
|
}
|
|
@@ -1868,29 +2601,42 @@ class SelecaoEstabelecimentosModalComponent {
|
|
|
1868
2601
|
closeSelf() {
|
|
1869
2602
|
this.onClose.emit();
|
|
1870
2603
|
}
|
|
1871
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelecaoEstabelecimentosModalComponent, deps: [{ token: AuthStorageService }, { token:
|
|
1872
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SelecaoEstabelecimentosModalComponent, isStandalone: true, selector: "selecao-estabelecimentos-modal", outputs: { onClose: "onClose", onSelected: "onSelected" }, ngImport: i0, template: "<div class=\"main-container\">\n <div class=\"modal-header modal-style modal-dialog-centered\">\n <h4 class=\"modal-title pull-left color-modal\" style=\"font-size: 20px; font-weight: bold;\"> Selecione um\n estabelecimento </h4>\n <button (click)=\"closeSelf()\" type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"modal-message\">\n <div class=\"search-and-filters d-flex flex-row align-items-center justify-content-between\">\n <div class=\"d-flex flex-row w-100\">\n <div class=\"input-group\">\n <span class=\"input-group-text px-2\" id=\"basic-addon1\"\n style=\"background-color: transparent; border-right: none;\">\n <lib-icon iconName=\"lupa\" iconColor=\"gray\"/>\n </span>\n <input type=\"text\" class=\"form-control border-start-0 ps-0\" id=\"pesquisaInput\" #pesquisa\n placeholder=\"Digite o C\u00F3digo\" (keyup.enter)=\"refreshList(pesquisa.value)\">\n </div>\n </div>\n\n <div class=\"filters d-flex align-items-center justify-content-between ms-3\">\n <div class=\"search-buttons d-flex flex-row align-items-center my-0 mx-0\">\n <button id=\"clearFilterBtn\" class=\"btn btn-outline-primary ms-0 no-hover-btn me-2\"\n (click)=\"pesquisa.value = ''; refreshList(pesquisa.value)\"> Limpar </button>\n <button id=\"searchFilterBtn\" class=\"btn btn-primary me-0\" (click)=\"refreshList(pesquisa.value)\"> Pesquisar\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"table-list w-100 mt-3\" *ngIf=\"$estabelecimentosList; else loading\">\n <table class=\"table table-bordered table-hover mb-0\">\n <thead class=\"fs-6\">\n <tr>\n <th scope=\"col\" class=\"col-11 align-middle th\">Estabelecimento <span\n class=\"text-primary fst-italic\">(duplo-clique para selecionar)</span></th>\n <th scope=\"col\" class=\"col-1 align-middle text-center th\">A\u00E7\u00F5es</th>\n </tr>\n </thead>\n\n <tbody *ngIf=\"$estabelecimentosList.length > 0; else emptyList\">\n <tr\n *ngFor=\"let estabelecimento of $estabelecimentosList | paginate: { itemsPerPage: itemsPerPage, currentPage: page }\"\n (dblclick)=\"selectEstabelecimento(estabelecimento.ID, estabelecimento.NOMEEXIBICAO)\" role=\"button\">\n <td><span class=\"row-name\"> {{ estabelecimento.CODIGO }} - {{ estabelecimento.NOMEEXIBICAO }} </span>\n <span class=\"subname\"> {{ estabelecimento.IS_MATRIZ ? \"Matriz \" : null }} CNPJ: {{ estabelecimento.CNPJ\n }} </span></td>\n <td class=\"text-center align-middle\">\n <div class=\"action-icons d-flex flex-row align-items-center justify-content-around\">\n <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckChecked\"\n tooltip=\"Estabelecimento padr\u00E3o\" [checked]=\"estabelecimento.IS_DEFAULT\"\n style=\"transform: translateY(3px); height: 1rem; width: 28px;\" #isDefaultRow\n (click)=\"estabelecimento.IS_DEFAULT = !estabelecimento.IS_DEFAULT; defineDefaultEstabelecimento(estabelecimento.ID, estabelecimento.IS_DEFAULT)\">\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n\n <!-- #region EMPTY LIST CELL -->\n <ng-template #emptyList>\n <tbody>\n <tr>\n <td colspan=\"2\" class=\"align-middle\"><span class=\"row-name fw-light fst-italic text-center\"> {{\n response_messages.emptyMessage }} </span></td>\n </tr>\n </tbody>\n </ng-template>\n <!-- #endregion EMPTY LIST CELL -->\n </table>\n\n <!-- #region PAGINATION -->\n <div class=\"d-flex justify-content-end mt-2\" *ngIf=\"$estabelecimentosList.length > 0\">\n <div class=\"d-flex align-items-center\">\n <label class=\"me-2\" style=\"white-space: nowrap;\">Itens por p\u00E1gina</label>\n <select class=\"form-select select-search\" (change)=\"onSelectChange($event)\">\n <option class=\"selected\" value=\"10\" selected>10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n </select>\n </div>\n\n <pagination-controls class=\"sp-pagination mt-3\" (pageChange)=\"page = $event\"\n previousLabel=\"\u00AB \" nextLabel=\" \u00BB\" [maxSize]=\"5\">\n </pagination-controls>\n </div>\n <!-- #endregion PAGINATION -->\n \n </div>\n\n <!-- <div class=\"d-flex justify-content-between align-items-center mt-3\">\n <span style=\"color: #6C757D\"> Registros {{$estabelecimentosList.length}} de {{$estabelecimentosList.length}} </span>\n <nav aria-label=\"...\">\n <ul class=\"pagination mb-0\">\n <li class=\"page-item disabled\"> <a class=\"page-link\" href=\"#\" tabindex=\"-1\">Anterior</a> </li>\n <li class=\"page-item active\"> <a class=\"page-link\" href=\"#\">1</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">2</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">3</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">Pr\u00F3ximo</a> </li>\n </ul>\n </nav>\n </div> -->\n\n\n <ng-template #loading>\n <lib-spinner></lib-spinner>\n </ng-template>\n </div>\n </div>\n</div>", styles: [".table-list table thead{height:50px;font-size:1rem;background-color:#e9ecef}.table-list table thead .status-header{width:5%}.table-list table thead th:first-child{width:50px;height:50px}.table-list table thead th{font-size:16px}.table-list table .center-content{text-align:center}.table-list table tbody{font-size:.875rem}.table-list table tbody>tr:hover{background-color:#cce5ff}.table-list table tbody span.row-name{display:block;width:100%;font-weight:700}.table-list table tbody span.subname{color:#0f0f0f80}.table-list table tbody .action-icons{color:#007bff}.table-list table tbody .action-icons a{margin:0 .75rem}.table-list table tbody .status{width:13px;height:13px;border-radius:50%}.table-list table tbody .active{background-color:#28a745}.table-list table tbody .inactive{background-color:#a72828}.name-estab{font-size:14px;font-weight:700;text-transform:uppercase;color:#212529}.subname-estab{font-size:12px;color:#212529}#clearFilterBtn,#searchFilterBtn{padding:6px 12px}\n"], dependencies: [{ kind: "ngmodule", type:
|
|
2604
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelecaoEstabelecimentosModalComponent, deps: [{ token: AuthStorageService }, { token: i2.BsModalService }, { token: LibCustomMenuService }, { token: MenuServicesService }, { token: i3.MessageService }, { token: ProjectUtilservice }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2605
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SelecaoEstabelecimentosModalComponent, isStandalone: true, selector: "selecao-estabelecimentos-modal", outputs: { onClose: "onClose", onSelected: "onSelected" }, ngImport: i0, template: "<div class=\"main-container\">\n <div class=\"modal-header modal-style modal-dialog-centered\">\n <h4 class=\"modal-title pull-left color-modal\" style=\"font-size: 20px; font-weight: bold;\"> Selecione um\n estabelecimento </h4>\n <button (click)=\"closeSelf()\" type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"modal-message\">\n <div class=\"search-and-filters d-flex flex-row align-items-center justify-content-between\">\n <div class=\"d-flex flex-row w-100\">\n <div class=\"input-group\">\n <span class=\"input-group-text px-2\" id=\"basic-addon1\"\n style=\"background-color: transparent; border-right: none;\">\n <lib-icon iconName=\"lupa\" iconColor=\"gray\"/>\n </span>\n <input type=\"text\" class=\"form-control border-start-0 ps-0\" id=\"pesquisaInput\" #pesquisa\n placeholder=\"Digite o C\u00F3digo\" (keyup.enter)=\"refreshList(pesquisa.value)\">\n </div>\n </div>\n\n <div class=\"filters d-flex align-items-center justify-content-between ms-3\">\n <div class=\"search-buttons d-flex flex-row align-items-center my-0 mx-0\">\n <button id=\"clearFilterBtn\" class=\"btn btn-outline-primary ms-0 no-hover-btn me-2\"\n (click)=\"pesquisa.value = ''; refreshList(pesquisa.value)\"> Limpar </button>\n <button id=\"searchFilterBtn\" class=\"btn btn-primary me-0\" (click)=\"refreshList(pesquisa.value)\"> Pesquisar\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"table-list w-100 mt-3\" *ngIf=\"$estabelecimentosList; else loading\">\n <table class=\"table table-bordered table-hover mb-0\">\n <thead class=\"fs-6\">\n <tr>\n <th scope=\"col\" class=\"col-11 align-middle th\">Estabelecimento <span\n class=\"text-primary fst-italic\">(duplo-clique para selecionar)</span></th>\n <th scope=\"col\" class=\"col-1 align-middle text-center th\">A\u00E7\u00F5es</th>\n </tr>\n </thead>\n\n <tbody *ngIf=\"$estabelecimentosList.length > 0; else emptyList\">\n <tr\n *ngFor=\"let estabelecimento of $estabelecimentosList | paginate: { itemsPerPage: itemsPerPage, currentPage: page }\"\n (dblclick)=\"selectEstabelecimento(estabelecimento.ID, estabelecimento.NOMEEXIBICAO)\" role=\"button\">\n <td><span class=\"row-name\"> {{ estabelecimento.CODIGO }} - {{ estabelecimento.NOMEEXIBICAO }} </span>\n <span class=\"subname\"> {{ estabelecimento.IS_MATRIZ ? \"Matriz \" : null }} CNPJ: {{ estabelecimento.CNPJ\n }} </span></td>\n <td class=\"text-center align-middle\">\n <div class=\"action-icons d-flex flex-row align-items-center justify-content-around\">\n <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckChecked\"\n tooltip=\"Estabelecimento padr\u00E3o\" [checked]=\"estabelecimento.IS_DEFAULT\"\n style=\"transform: translateY(3px); height: 1rem; width: 28px;\" #isDefaultRow\n (click)=\"estabelecimento.IS_DEFAULT = !estabelecimento.IS_DEFAULT; defineDefaultEstabelecimento(estabelecimento.ID, estabelecimento.IS_DEFAULT)\">\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n\n <!-- #region EMPTY LIST CELL -->\n <ng-template #emptyList>\n <tbody>\n <tr>\n <td colspan=\"2\" class=\"align-middle\"><span class=\"row-name fw-light fst-italic text-center\"> {{\n response_messages.emptyMessage }} </span></td>\n </tr>\n </tbody>\n </ng-template>\n <!-- #endregion EMPTY LIST CELL -->\n </table>\n\n <!-- #region PAGINATION -->\n <div class=\"d-flex justify-content-end mt-2\" *ngIf=\"$estabelecimentosList.length > 0\">\n <div class=\"d-flex align-items-center\">\n <label class=\"me-2\" style=\"white-space: nowrap;\">Itens por p\u00E1gina</label>\n <select class=\"form-select select-search\" (change)=\"onSelectChange($event)\">\n <option class=\"selected\" value=\"10\" selected>10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n </select>\n </div>\n\n <pagination-controls class=\"sp-pagination mt-3\" (pageChange)=\"page = $event\"\n previousLabel=\"\u00AB \" nextLabel=\" \u00BB\" [maxSize]=\"5\">\n </pagination-controls>\n </div>\n <!-- #endregion PAGINATION -->\n \n </div>\n\n <!-- <div class=\"d-flex justify-content-between align-items-center mt-3\">\n <span style=\"color: #6C757D\"> Registros {{$estabelecimentosList.length}} de {{$estabelecimentosList.length}} </span>\n <nav aria-label=\"...\">\n <ul class=\"pagination mb-0\">\n <li class=\"page-item disabled\"> <a class=\"page-link\" href=\"#\" tabindex=\"-1\">Anterior</a> </li>\n <li class=\"page-item active\"> <a class=\"page-link\" href=\"#\">1</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">2</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">3</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">Pr\u00F3ximo</a> </li>\n </ul>\n </nav>\n </div> -->\n\n\n <ng-template #loading>\n <lib-spinner></lib-spinner>\n </ng-template>\n </div>\n </div>\n</div>", styles: [".table-list table thead{height:50px;font-size:1rem;background-color:#e9ecef}.table-list table thead .status-header{width:5%}.table-list table thead th:first-child{width:50px;height:50px}.table-list table thead th{font-size:16px}.table-list table .center-content{text-align:center}.table-list table tbody{font-size:.875rem}.table-list table tbody>tr:hover{background-color:#cce5ff}.table-list table tbody span.row-name{display:block;width:100%;font-weight:700}.table-list table tbody span.subname{color:#0f0f0f80}.table-list table tbody .action-icons{color:#007bff}.table-list table tbody .action-icons a{margin:0 .75rem}.table-list table tbody .status{width:13px;height:13px;border-radius:50%}.table-list table tbody .active{background-color:#28a745}.table-list table tbody .inactive{background-color:#a72828}.name-estab{font-size:14px;font-weight:700;text-transform:uppercase;color:#212529}.subname-estab{font-size:12px;color:#212529}#clearFilterBtn,#searchFilterBtn{padding:6px 12px}\n"], dependencies: [{ kind: "ngmodule", type: NgxPaginationModule }, { kind: "pipe", type: i7.PaginatePipe, name: "paginate" }, { kind: "component", type: i7.PaginationControlsComponent, selector: "pagination-controls", inputs: ["id", "maxSize", "directionLinks", "autoHide", "responsive", "previousLabel", "nextLabel", "screenReaderPaginationLabel", "screenReaderPageLabel", "screenReaderCurrentLabel"], outputs: ["pageChange", "pageBoundsCorrection"] }, { kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "component", type: i3.LibSpinnerComponent, selector: "lib-spinner", inputs: ["type", "theme", "size", "helperText"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1873
2606
|
}
|
|
1874
2607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelecaoEstabelecimentosModalComponent, decorators: [{
|
|
1875
2608
|
type: Component,
|
|
1876
|
-
args: [{ selector: 'selecao-estabelecimentos-modal', imports: [
|
|
1877
|
-
|
|
2609
|
+
args: [{ selector: 'selecao-estabelecimentos-modal', imports: [
|
|
2610
|
+
NgxPaginationModule,
|
|
2611
|
+
InfraModule,
|
|
2612
|
+
CommonModule
|
|
2613
|
+
], template: "<div class=\"main-container\">\n <div class=\"modal-header modal-style modal-dialog-centered\">\n <h4 class=\"modal-title pull-left color-modal\" style=\"font-size: 20px; font-weight: bold;\"> Selecione um\n estabelecimento </h4>\n <button (click)=\"closeSelf()\" type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"modal-message\">\n <div class=\"search-and-filters d-flex flex-row align-items-center justify-content-between\">\n <div class=\"d-flex flex-row w-100\">\n <div class=\"input-group\">\n <span class=\"input-group-text px-2\" id=\"basic-addon1\"\n style=\"background-color: transparent; border-right: none;\">\n <lib-icon iconName=\"lupa\" iconColor=\"gray\"/>\n </span>\n <input type=\"text\" class=\"form-control border-start-0 ps-0\" id=\"pesquisaInput\" #pesquisa\n placeholder=\"Digite o C\u00F3digo\" (keyup.enter)=\"refreshList(pesquisa.value)\">\n </div>\n </div>\n\n <div class=\"filters d-flex align-items-center justify-content-between ms-3\">\n <div class=\"search-buttons d-flex flex-row align-items-center my-0 mx-0\">\n <button id=\"clearFilterBtn\" class=\"btn btn-outline-primary ms-0 no-hover-btn me-2\"\n (click)=\"pesquisa.value = ''; refreshList(pesquisa.value)\"> Limpar </button>\n <button id=\"searchFilterBtn\" class=\"btn btn-primary me-0\" (click)=\"refreshList(pesquisa.value)\"> Pesquisar\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"table-list w-100 mt-3\" *ngIf=\"$estabelecimentosList; else loading\">\n <table class=\"table table-bordered table-hover mb-0\">\n <thead class=\"fs-6\">\n <tr>\n <th scope=\"col\" class=\"col-11 align-middle th\">Estabelecimento <span\n class=\"text-primary fst-italic\">(duplo-clique para selecionar)</span></th>\n <th scope=\"col\" class=\"col-1 align-middle text-center th\">A\u00E7\u00F5es</th>\n </tr>\n </thead>\n\n <tbody *ngIf=\"$estabelecimentosList.length > 0; else emptyList\">\n <tr\n *ngFor=\"let estabelecimento of $estabelecimentosList | paginate: { itemsPerPage: itemsPerPage, currentPage: page }\"\n (dblclick)=\"selectEstabelecimento(estabelecimento.ID, estabelecimento.NOMEEXIBICAO)\" role=\"button\">\n <td><span class=\"row-name\"> {{ estabelecimento.CODIGO }} - {{ estabelecimento.NOMEEXIBICAO }} </span>\n <span class=\"subname\"> {{ estabelecimento.IS_MATRIZ ? \"Matriz \" : null }} CNPJ: {{ estabelecimento.CNPJ\n }} </span></td>\n <td class=\"text-center align-middle\">\n <div class=\"action-icons d-flex flex-row align-items-center justify-content-around\">\n <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckChecked\"\n tooltip=\"Estabelecimento padr\u00E3o\" [checked]=\"estabelecimento.IS_DEFAULT\"\n style=\"transform: translateY(3px); height: 1rem; width: 28px;\" #isDefaultRow\n (click)=\"estabelecimento.IS_DEFAULT = !estabelecimento.IS_DEFAULT; defineDefaultEstabelecimento(estabelecimento.ID, estabelecimento.IS_DEFAULT)\">\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n\n <!-- #region EMPTY LIST CELL -->\n <ng-template #emptyList>\n <tbody>\n <tr>\n <td colspan=\"2\" class=\"align-middle\"><span class=\"row-name fw-light fst-italic text-center\"> {{\n response_messages.emptyMessage }} </span></td>\n </tr>\n </tbody>\n </ng-template>\n <!-- #endregion EMPTY LIST CELL -->\n </table>\n\n <!-- #region PAGINATION -->\n <div class=\"d-flex justify-content-end mt-2\" *ngIf=\"$estabelecimentosList.length > 0\">\n <div class=\"d-flex align-items-center\">\n <label class=\"me-2\" style=\"white-space: nowrap;\">Itens por p\u00E1gina</label>\n <select class=\"form-select select-search\" (change)=\"onSelectChange($event)\">\n <option class=\"selected\" value=\"10\" selected>10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n </select>\n </div>\n\n <pagination-controls class=\"sp-pagination mt-3\" (pageChange)=\"page = $event\"\n previousLabel=\"\u00AB \" nextLabel=\" \u00BB\" [maxSize]=\"5\">\n </pagination-controls>\n </div>\n <!-- #endregion PAGINATION -->\n \n </div>\n\n <!-- <div class=\"d-flex justify-content-between align-items-center mt-3\">\n <span style=\"color: #6C757D\"> Registros {{$estabelecimentosList.length}} de {{$estabelecimentosList.length}} </span>\n <nav aria-label=\"...\">\n <ul class=\"pagination mb-0\">\n <li class=\"page-item disabled\"> <a class=\"page-link\" href=\"#\" tabindex=\"-1\">Anterior</a> </li>\n <li class=\"page-item active\"> <a class=\"page-link\" href=\"#\">1</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">2</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">3</a> </li>\n <li class=\"page-item\"> <a class=\"page-link\" href=\"#\">Pr\u00F3ximo</a> </li>\n </ul>\n </nav>\n </div> -->\n\n\n <ng-template #loading>\n <lib-spinner></lib-spinner>\n </ng-template>\n </div>\n </div>\n</div>", styles: [".table-list table thead{height:50px;font-size:1rem;background-color:#e9ecef}.table-list table thead .status-header{width:5%}.table-list table thead th:first-child{width:50px;height:50px}.table-list table thead th{font-size:16px}.table-list table .center-content{text-align:center}.table-list table tbody{font-size:.875rem}.table-list table tbody>tr:hover{background-color:#cce5ff}.table-list table tbody span.row-name{display:block;width:100%;font-weight:700}.table-list table tbody span.subname{color:#0f0f0f80}.table-list table tbody .action-icons{color:#007bff}.table-list table tbody .action-icons a{margin:0 .75rem}.table-list table tbody .status{width:13px;height:13px;border-radius:50%}.table-list table tbody .active{background-color:#28a745}.table-list table tbody .inactive{background-color:#a72828}.name-estab{font-size:14px;font-weight:700;text-transform:uppercase;color:#212529}.subname-estab{font-size:12px;color:#212529}#clearFilterBtn,#searchFilterBtn{padding:6px 12px}\n"] }]
|
|
2614
|
+
}], ctorParameters: () => [{ type: AuthStorageService }, { type: i2.BsModalService }, { type: LibCustomMenuService }, { type: MenuServicesService }, { type: i3.MessageService }, { type: ProjectUtilservice }], propDecorators: { onClose: [{
|
|
1878
2615
|
type: Output
|
|
1879
2616
|
}], onSelected: [{
|
|
1880
2617
|
type: Output
|
|
1881
2618
|
}] } });
|
|
1882
2619
|
|
|
1883
2620
|
class MenuLateralComponent {
|
|
1884
|
-
constructor(_customMenuService, _authStorageService, _bsModalService, _menuServices, _messageService,
|
|
1885
|
-
|
|
1886
|
-
|
|
2621
|
+
constructor(_msalGuardConfiguration, _msalService, _toastrService, _customMenuService, _authStorageService, _bsModalService, _menuServices, _messageService, _projectUtilService, _router, _authService, _environmentService) {
|
|
2622
|
+
this._msalGuardConfiguration = _msalGuardConfiguration;
|
|
2623
|
+
this._msalService = _msalService;
|
|
2624
|
+
this._toastrService = _toastrService;
|
|
1887
2625
|
this._customMenuService = _customMenuService;
|
|
1888
2626
|
this._authStorageService = _authStorageService;
|
|
1889
2627
|
this._bsModalService = _bsModalService;
|
|
1890
2628
|
this._menuServices = _menuServices;
|
|
1891
2629
|
this._messageService = _messageService;
|
|
2630
|
+
this._projectUtilService = _projectUtilService;
|
|
1892
2631
|
this._router = _router;
|
|
1893
2632
|
this._authService = _authService;
|
|
2633
|
+
this._environmentService = _environmentService;
|
|
2634
|
+
this.handleKeyboardShortcut = (event) => {
|
|
2635
|
+
if (event.ctrlKey && event.key.toLowerCase() === 'b') {
|
|
2636
|
+
event.preventDefault(); // Prevents any default behavior (like bold in text editors)
|
|
2637
|
+
this.openExpansibleMenu(this.sidebar.nativeElement);
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
1894
2640
|
this.MODAL_ESTABELECIMENTO = 1;
|
|
1895
2641
|
this.nomeEstabelecimento = 'Estabelecimento padrão';
|
|
1896
2642
|
this.titleSubmenu = "";
|
|
@@ -1912,31 +2658,47 @@ class MenuLateralComponent {
|
|
|
1912
2658
|
this.footerUserName = "Usuário";
|
|
1913
2659
|
this.isPopoverVisible = false;
|
|
1914
2660
|
this.showBalloon = false;
|
|
1915
|
-
// propriedades iniciadas quando passar o CustomMenuService
|
|
1916
|
-
this.menuDynamic = false;
|
|
1917
|
-
this.menuConfig = new MenuConfigService;
|
|
1918
2661
|
// Implementação que verifica eventos acionados na classe de service.
|
|
1919
2662
|
this._menuServices.getNewUserImageEvent().subscribe(() => { this.getMenuUserImg(); });
|
|
1920
2663
|
}
|
|
1921
|
-
ngOnInit() {
|
|
2664
|
+
async ngOnInit() {
|
|
2665
|
+
document.addEventListener('keydown', this.handleKeyboardShortcut);
|
|
1922
2666
|
// Inscreva-se no evento NavigationEnd para receber notificações quando a rota mudar, serve para atualizar a seleção do menu corretamente
|
|
1923
|
-
this._router.events.pipe().subscribe((event) => {
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
if (!this._customMenuService.menuDynamic) {
|
|
1927
|
-
this._customMenuService.menuConfig.setMenuStatic(true);
|
|
2667
|
+
this._router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((event) => { this._customMenuService.menuItems = this._customMenuService.menuConfig.updateRouteSelection(this._router.url, this._customMenuService.menuItems); });
|
|
2668
|
+
if (!this._customMenuService.menuDynamic && !this._customMenuService.menuDynamicCustom) {
|
|
2669
|
+
this._customMenuService.menuConfig.setMenuType(true);
|
|
1928
2670
|
this._customMenuService.menuItems = this._customMenuService.menuConfig.initializeMenu(this._router.url);
|
|
1929
2671
|
// Método com customizações para inicialização do Menu Estático
|
|
1930
2672
|
this._customMenuService.menuStaticOnInit();
|
|
1931
2673
|
}
|
|
1932
2674
|
else {
|
|
1933
2675
|
// Método com customizações para inicialização do Menu Dinâmico
|
|
2676
|
+
if (this._customMenuService.menuDynamic) {
|
|
2677
|
+
this._customMenuService.menuConfig.setMenuType(false);
|
|
2678
|
+
// Método com customizações obter o Módulo para montagem do Menu Dinâmico Lateral
|
|
2679
|
+
const moduloId = this._customMenuService.menuDynamicGetModuloId();
|
|
2680
|
+
this._menuServices.getMenuLateral(moduloId).subscribe({
|
|
2681
|
+
next: response => {
|
|
2682
|
+
const menus = this.constroiRegrasDynamicMenu(response.MenuSubmenu);
|
|
2683
|
+
this._customMenuService.menuItems = this._customMenuService.menuConfig.initializeMenu(this._router.url, menus);
|
|
2684
|
+
}, error: error => {
|
|
2685
|
+
this._customMenuService.menuItems = this._customMenuService.menuConfig.initializeMenu(this._router.url);
|
|
2686
|
+
}
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
1934
2689
|
this._customMenuService.menuDynamicOnInit();
|
|
1935
2690
|
}
|
|
1936
2691
|
this.nomeEstabelecimento = this._authStorageService.infraEstabNome;
|
|
1937
2692
|
this.footerUserName = this._authStorageService.userName;
|
|
1938
2693
|
this.checkForCachedImage();
|
|
1939
2694
|
this.getUserEmail();
|
|
2695
|
+
// Tratamemto exclusivo para o método de autenticação Azure
|
|
2696
|
+
if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Azure && this._authStorageService.user.toLowerCase() != "admin") {
|
|
2697
|
+
await this.initMsal();
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
ngOnDestroy() {
|
|
2701
|
+
document.removeEventListener('keydown', this.handleKeyboardShortcut);
|
|
1940
2702
|
}
|
|
1941
2703
|
// #endregion PUBLIC
|
|
1942
2704
|
// #endregion ==========> PROPERTIES <==========
|
|
@@ -1950,30 +2712,20 @@ class MenuLateralComponent {
|
|
|
1950
2712
|
this._authStorageService.infraEmpresaNome = response.InfraEmpresaNome;
|
|
1951
2713
|
},
|
|
1952
2714
|
error: error => {
|
|
1953
|
-
|
|
1954
|
-
this._messageService.showAlertDanger(error);
|
|
1955
|
-
throw new Error(error);
|
|
2715
|
+
this._projectUtilService.showHttpError(error);
|
|
1956
2716
|
}
|
|
1957
2717
|
});
|
|
1958
2718
|
}
|
|
1959
2719
|
getMenuUserImg() {
|
|
1960
2720
|
this._menuServices.getImagemMenu().subscribe({
|
|
1961
|
-
next: response => { this.footerUserImgSrc = response.InfraUsuarioImg.
|
|
1962
|
-
error: error => {
|
|
1963
|
-
//this._projectUtilService.showHttpError(error);
|
|
1964
|
-
this._messageService.showAlertDanger(error);
|
|
1965
|
-
throw new Error(error);
|
|
1966
|
-
}
|
|
2721
|
+
next: response => { this.footerUserImgSrc = response.InfraUsuarioImg.IMAGEM; },
|
|
2722
|
+
error: error => { this._projectUtilService.showHttpError(error); }
|
|
1967
2723
|
});
|
|
1968
2724
|
}
|
|
1969
2725
|
getUserEmail() {
|
|
1970
2726
|
this._menuServices.getUsuarioEmail().subscribe({
|
|
1971
2727
|
next: response => { this.footerUserEmail = response.Email; },
|
|
1972
|
-
error: error => {
|
|
1973
|
-
//this._projectUtilService.showHttpError(error);
|
|
1974
|
-
this._messageService.showAlertDanger(error);
|
|
1975
|
-
throw new Error(error);
|
|
1976
|
-
}
|
|
2728
|
+
error: error => { this._projectUtilService.showHttpError(error); }
|
|
1977
2729
|
});
|
|
1978
2730
|
}
|
|
1979
2731
|
// #endregion GET
|
|
@@ -2001,7 +2753,7 @@ class MenuLateralComponent {
|
|
|
2001
2753
|
this._customMenuService.menuopenExpansibleMenu(ref);
|
|
2002
2754
|
}
|
|
2003
2755
|
openSubmenu(menu, ref, desiredMenu) {
|
|
2004
|
-
if (menu.children && menu.children.length > 0) {
|
|
2756
|
+
if (menu.children && menu.children.length > 0 && menu.route == "") {
|
|
2005
2757
|
this.titleSubmenu = menu.label;
|
|
2006
2758
|
this.desiredContent = desiredMenu;
|
|
2007
2759
|
ref.classList.remove("opened-notif-sub");
|
|
@@ -2019,18 +2771,9 @@ class MenuLateralComponent {
|
|
|
2019
2771
|
this.onClickedOutside(new Event(""), ref);
|
|
2020
2772
|
}
|
|
2021
2773
|
}
|
|
2022
|
-
// public onClickedOutside(e: Event, ref: HTMLDivElement): void {
|
|
2023
|
-
// ref.classList.remove("opened-sub");
|
|
2024
|
-
// this.submenuList = [];
|
|
2025
|
-
// }
|
|
2026
2774
|
onClickedOutside(e, ref) {
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
this.submenuList = [];
|
|
2030
|
-
}
|
|
2031
|
-
else {
|
|
2032
|
-
console.warn('ref is undefined or null');
|
|
2033
|
-
}
|
|
2775
|
+
ref.classList.remove("opened-sub");
|
|
2776
|
+
this.submenuList = [];
|
|
2034
2777
|
}
|
|
2035
2778
|
// #region MENU FOOTER USER IMAGE
|
|
2036
2779
|
validateCachedImg(footerImg) {
|
|
@@ -2052,12 +2795,65 @@ class MenuLateralComponent {
|
|
|
2052
2795
|
}
|
|
2053
2796
|
// #endregion MENU FOOTER USER IMAGE
|
|
2054
2797
|
logout() {
|
|
2798
|
+
// Verifica se é Login Azure
|
|
2799
|
+
if (this._authStorageService.infraInAuthTypeId == InfraInAuthTypeId.Azure && this._authStorageService.user.toLowerCase() != "admin") {
|
|
2800
|
+
const hostAuthLogin = !this._environmentService.production ? "http://localhost:4200/auth/login" : `${this._environmentService.hostName}/SisproErpCloud/${this._environmentService.product}/auth/login`;
|
|
2801
|
+
this._msalService.logoutRedirect({
|
|
2802
|
+
postLogoutRedirectUri: hostAuthLogin
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2055
2805
|
this._authService.logout();
|
|
2056
2806
|
}
|
|
2057
2807
|
getExternalUrl(url) {
|
|
2058
|
-
return
|
|
2808
|
+
return `${this._projectUtilService.getHostName()}/${url}`;
|
|
2809
|
+
}
|
|
2810
|
+
constroiRegrasDynamicMenu(menus) {
|
|
2811
|
+
const home = { id: 1, label: "Início", descricao: "Tela inicial", icon: "casa", route: "home", isExternal: false, isSelected: this._router.url.includes("home"), };
|
|
2812
|
+
menus.unshift(home);
|
|
2813
|
+
return menus;
|
|
2059
2814
|
}
|
|
2060
2815
|
// #endregion ==========> UTILITIES <==========
|
|
2816
|
+
// #region Azure
|
|
2817
|
+
async configMsal() {
|
|
2818
|
+
const isIE = window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1;
|
|
2819
|
+
const hostAuthLogin = !this._environmentService.production ? "http://localhost:4200/auth/login" : `${this._environmentService.hostName}/SisproErpCloud/${this._environmentService.product}/auth/login`;
|
|
2820
|
+
this._msalService.instance = new PublicClientApplication({
|
|
2821
|
+
auth: {
|
|
2822
|
+
clientId: `${this._authStorageService.azureClientId}`,
|
|
2823
|
+
authority: `https://login.microsoftonline.com/${this._authStorageService.azureTenantId}`,
|
|
2824
|
+
redirectUri: hostAuthLogin + "/",
|
|
2825
|
+
postLogoutRedirectUri: hostAuthLogin,
|
|
2826
|
+
navigateToLoginRequestUrl: true
|
|
2827
|
+
},
|
|
2828
|
+
cache: {
|
|
2829
|
+
cacheLocation: "localStorage",
|
|
2830
|
+
storeAuthStateInCookie: isIE
|
|
2831
|
+
},
|
|
2832
|
+
system: {
|
|
2833
|
+
loggerOptions: {
|
|
2834
|
+
loggerCallback: (logLevel, message, containsPii) => {
|
|
2835
|
+
console.log(message);
|
|
2836
|
+
},
|
|
2837
|
+
logLevel: LogLevel.Error,
|
|
2838
|
+
piiLoggingEnabled: false
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
});
|
|
2842
|
+
}
|
|
2843
|
+
async initMsal() {
|
|
2844
|
+
await this.configMsal().then(() => {
|
|
2845
|
+
this._msalService.handleRedirectObservable().subscribe({
|
|
2846
|
+
next: (result) => {
|
|
2847
|
+
if (!this._msalService.instance.getActiveAccount() && this._msalService.instance.getAllAccounts().length > 0) {
|
|
2848
|
+
this._msalService.instance.setActiveAccount(result.account);
|
|
2849
|
+
}
|
|
2850
|
+
},
|
|
2851
|
+
error: (error) => {
|
|
2852
|
+
this._toastrService.warning(`Erro na inicialização dos parâmetros de configuração do 'Azure': ${error}`, '', { timeOut: 3000, extendedTimeOut: 2000 });
|
|
2853
|
+
}
|
|
2854
|
+
});
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2061
2857
|
// #region ==========> MODALS <==========
|
|
2062
2858
|
/** Função simples com o objetivo de abrir os modais no centro da tela.
|
|
2063
2859
|
* @param template Template HTML do modal que será aberto.
|
|
@@ -2077,13 +2873,31 @@ class MenuLateralComponent {
|
|
|
2077
2873
|
closeModal(modalID) {
|
|
2078
2874
|
this._bsModalService.hide(modalID);
|
|
2079
2875
|
}
|
|
2080
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuLateralComponent, deps: [{ token: LibCustomMenuService }, { token: AuthStorageService }, { token:
|
|
2081
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: MenuLateralComponent, isStandalone: true, selector: "app-menu-lateral", queries: [{ propertyName: "desiredContent", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "notif_template", first: true, predicate: ["notif_menu"], descendants: true }, { propertyName: "menuLink", first: true, predicate: ["menuLink"], descendants: true }], ngImport: i0, template: "<!-- #region MAIN CONTENT -->\n<div class=\"main col-12\">\n\n <div style=\"height: 100vh; z-index: 3;\" class=\"sidebar-control position-relative d-flex flex-row\" \n (clickOutside)=\"closeMenu == true ? onClickedOutside($event, submenu_ref) : closeMenu = true\">\n <div class=\"sidebar {{_customMenuService.themeColor}} closed\" #sidebar>\n <div class=\"menu-header\">\n <ul>\n <li class=\"mb-3\">\n <div class=\"logo-hamburguer\">\n <img src=\"assets/icons/logotipo-sispro.svg\" alt=\"logo-sispro\" class=\"logo-sispro\" title=\"logo\" width=\"136px\" height=\"48px\">\n <button class=\"button-hamburguer\" (click)=\"openExpansibleMenu(sidebar)\">\n <img src=\"assets/icons/menu.svg\" alt=\"menu hamburguer\">\n </button>\n </div>\n </li>\n\n <!-- #region M\u00D3DULOS -->\n <li class=\"mb-3\" style=\"margin-left: 8px; margin-right: 8px\">\n <div class=\"btn-group\">\n <button (click)=\"dropdownWasOpened(true)\" type=\"button\" class=\"dropdown-button\" data-bs-toggle=\"dropdown\"\n aria-expanded=\"false\" data-bs-auto-close=\"outside\">\n\n <ng-container>\n <img *ngIf=\"_customMenuService.moduleImg != ''; else moduleSVG\" [src]=\"_customMenuService.moduleImg\" alt=\"\">\n <span class=\"ps-2\"> {{ _customMenuService.moduleName }} <lib-icon iconName=\"seta-direita\" iconColor=\"white\" /> </span>\n\n <ng-template #moduleSVG>\n <lib-icon iconColor=\"white\" [iconName]=\"_customMenuService.moduleSvg\"/>\n </ng-template>\n </ng-container>\n\n </button>\n <ul class=\"dropdown-menu\" #dropdown_ref>\n <app-primary-dropdown [buttonWasClicked]=\"messageIfClicked\"></app-primary-dropdown>\n </ul>\n </div>\n </li>\n <!-- #endregion M\u00D3DULOS -->\n\n <!-- #region ESTABELECIMENTOS -->\n <li class=\"mx-3\" style=\"margin-bottom: 16px;\">\n <div class=\"icon-estabelecimento\">\n <button class=\"row justify-content-between bg-transparent border-0\"\n (click)=\"openModal(modalEstabelecimento, MODAL_ESTABELECIMENTO)\"\n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : nomeEstabelecimento\" placement=\"right\">\n\n <lib-icon class=\"col-1\" iconName=\"predio\" iconColor=\"white\" />\n <span *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-9 ps-2 glb-text-width-160 text-start text-truncate\"> {{ nomeEstabelecimento }} </span>\n <lib-icon *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-1\" iconName=\"seta-direita\" iconColor=\"white\" />\n </button>\n </div>\n </li>\n <!-- #endregion ESTABELECIMENTOS -->\n\n </ul>\n\n </div>\n\n <!-- #region MENUS DE NAVEGA\u00C7\u00C3O -->\n <div class=\"main-menu\">\n <div class=\"scroll\">\n <div class=\"list-menu px-2 pb-1\">\n\n <!-- #region MENU DIN\u00C2MICO -->\n <div class=\"dynamic-menu\">\n <ul #dynamic_menu_items *ngIf=\"_customMenuService.menuItems; else isLoading\">\n\n <li *ngFor=\"let menuItem of _customMenuService.menuItems; let i = index\" \n class=\"p-1 rounded\" \n (click)=\"openSubmenu(menuItem, submenu_ref, dynamic_menu)\" \n [class.selectedItem]=\"menuItem.isSelected\">\n\n <a *ngIf=\"!menuItem.isExternal; else externalMenu\"\n [routerLink]=\"menuItem.route != '' ? menuItem.route : null\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImg\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImg>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(menuItem.route)\"\n target=\"_blank\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImgExternal\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImgExternal>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n </ng-template>\n </li>\n\n </ul>\n </div>\n\n <ng-template #isLoading>\n <li class=\"spinner-border spinner-border-sm mt-2\" role=\"status\" aria-hidden=\"true\"></li>\n </ng-template>\n <!-- #endregion MENU DIN\u00C2MICO -->\n\n </div>\n </div>\n </div>\n <!-- #endregion MENUS DE NAVEGA\u00C7\u00C3O -->\n\n <!-- #region FOOTER -->\n <div class=\"footer-menu\" (mouseenter)=\"showBalloon = true\" (mouseleave)=\"showBalloon = false\"\n [popover]=\"popoverContent\" placement=\"right bottom\" [outsideClick]=\"true\" containerClass=\"width: 200px\" >\n <div class=\"footer-components ps-1 pt-2\" [class.open]=\"showBalloon\">\n <button type=\"button\" class=\"btn btn-primary\">\n <img *ngIf=\"footerUserImgSrc; else noUserImg\" class=\"photo-profile ms-1\"\n [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\">\n <ng-template #noUserImg>\n <lib-icon iconName=\"contraparte\" iconColor=\"white\"/>\n </ng-template>\n <span class=\"glb-text-width-120 w-auto fw-bold text-start text-truncate ms-1 me-1\">\n {{ footerUserName }}\n </span>\n </button>\n </div>\n </div>\n \n <ng-template #popoverContent>\n <div class=\"footer-menu\" style=\"width: 1000px;\">\n <div class=\"d-flex align-items-center\"> \n <img *ngIf=\"footerUserImgSrc; else noUserImg\" class=\"photo-profile\"\n [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\"> \n <ng-template #noUserImg>\n <lib-icon iconName=\"contraparte\" iconColor=\"white\"/>\n </ng-template>\n <div class=\"d-flex flex-column ms-1\"> \n <div [tooltip]=\"footerUserName\" class=\"dynamic-container\" style=\"white-space: nowrap; flex-grow: 1;max-width: 200px; font-size: 16px;\">{{footerUserName}}</div>\n <div [tooltip]=\"footerUserEmail\" class=\"dynamic-container\" style=\"white-space: nowrap; font-size: 12px; flex-grow: 1;max-width: 200px;\">{{footerUserEmail}}</div>\n </div>\n </div>\n </div>\n <hr class=\"mb-2 mt-2\">\n <div routerLink=\"meu-perfil\" style=\"cursor: pointer;\" (click)=\"togglePopover(); $event.stopPropagation()\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"contraparte\"/> Meu Perfil\n </div>\n <div class=\"mt-2\" (click)=\"logout()\" style=\"cursor: pointer;\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"logout\"/> Sair\n </div>\n </ng-template>\n <!-- #endregion FOOTER -->\n\n </div>\n\n <div class=\"submenu\" #submenu_ref>\n <ng-template [ngIf]=\"desiredContent !== null\">\n <ng-content *ngTemplateOutlet=\"desiredContent!; context: {$implicit: submenuList}\"></ng-content>\n </ng-template>\n </div>\n </div>\n \n <div class=\"main-content col d-flex flex-column align-content-between\" id=\"body-content\">\n <div class=\"content\" style=\"position: relative;\">\n <router-outlet></router-outlet>\n </div>\n <div app-footer></div>\n </div>\n\n</div>\n<!-- #endregion MAIN CONTENT -->\n\n<!-- #region TEMPLATES -->\n<!-- tem que perguntar pro Erick -->\n<!-- [submenuRef]=\"submenu_ref\" -->\n<ng-template #dynamic_menu let-data>\n <app-dynamic-menu \n [submenuList]=\"data\"\n [titleSubmenu]=\"titleSubmenu\"\n [submenuRef]=\"submenu_ref\"\n [recebeParam]=\"onClickedOutside.bind(this)\">\n </app-dynamic-menu>\n</ng-template>\n\n<ng-template #notif_menu>\n <app-notif-submenu></app-notif-submenu>\n</ng-template>\n\n<!-- #region MODAL SELECAO ESTABELECIMENTO -->\n<ng-template #modalEstabelecimento>\n <selecao-estabelecimentos-modal (onClose)=\"closeModal(MODAL_ESTABELECIMENTO)\"\n (onSelected)=\"closeModal(MODAL_ESTABELECIMENTO); updateLastLogEstabelecimento($event);\"></selecao-estabelecimentos-modal>\n</ng-template>\n<!-- #endregion MODAL SELECAO ESTABELECIMENTO -->\n\n<!-- #endregion TEMPLATES -->\n", styles: [".main{display:flex;width:100%;height:100%;background:#eee}::-webkit-scrollbar{width:8px;background:transparent}::-webkit-scrollbar-thumb{background:#bbb;border-radius:16px}.main-content{width:100%;z-index:0;overflow-y:auto;overflow:overlay;height:100vh}.main-content .content{padding:0 16px 16px;background-color:#eee!important}.disable-scroll{overflow-y:hidden}*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;font-size:14px}span{color:#fff}ul{list-style:none;padding-left:0;white-space:nowrap}.dropdown-button{padding:8px;border-radius:8px;background-color:#3265ee;border:none;font-size:14px;font-weight:700;width:100%;display:flex}.dropdown-button span{width:100%;display:flex;justify-content:space-between}.dropdown-menu{width:212px;border-radius:8px}.dropdown-menu li{margin:16px 8px}.dropdown-menu li a{font-size:14px}.dropdown-menu li a:hover{font-weight:700;background-color:transparent}.dropdown-menu .dropdown-divider{height:0}.link-portal{color:#213b70;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}.container{display:flex;width:max-content}.sidebar{display:flex;flex-direction:column;height:100%;grid-template-rows:min-content;box-sizing:border-box;transition:width .5s;background-color:#213b70;max-width:inherit}.sidebar .footer-menu{justify-content:flex-end}.menu-header{display:flex;flex-direction:column;white-space:nowrap;padding:32px 0 0;background-color:#213b70}.menu-header ul li{margin-left:16px;margin-right:16px}.menu-header ul>li:last-child{border-bottom:1px solid #3265ee;padding-bottom:15px;height:auto}.dropdown{margin:0}.btn-group{width:100%}.sidebar.closed .menu-header ul li{margin-left:0;margin-right:0}.sidebar.closed .menu-header{display:flex;flex-direction:column;align-items:center}.icon-estabelecimento button{display:flex;flex-direction:row;width:100%;align-items:center;justify-content:center}.icon-estabelecimento button span:hover{font-weight:700}.header-content{display:flex;flex-direction:column;justify-content:space-evenly;height:100%;margin:0 20px}.logo-hamburguer{display:flex;justify-content:space-between;margin-right:8px}.logo-hamburguer .button-hamburguer{border:none;background-color:transparent}.sidebar.closed .logo-hamburguer{justify-content:center;margin-right:0}.scroll{overflow-y:auto;overflow-x:hidden;min-height:20%;margin-right:2px}.list-menu{padding-left:16px;padding-right:8px;display:flex;flex-direction:column;justify-content:center;white-space:nowrap}.list-menu .text-closed{padding-top:15px;display:none;color:#fff}.list-menu .text-opened{color:#fff;font-size:12px;padding-top:15px;visibility:visible;white-space:nowrap}.list-menu .li-main{padding:10px 7px;border-radius:8px}.list-menu .onSelect{background-color:#3265ee}.list-menu div.static-menu>ul>li:first-child{margin-top:16px}.list-menu .span-main{font-size:14px;margin-left:8px;opacity:1;pointer-events:auto;white-space:break-spaces}.list-menu .span-main:hover,.list-menu .list-options span:hover{font-weight:700}.list-menu p{font-size:10px;font-weight:700;text-transform:uppercase;border-bottom:1px solid #3265ee;visibility:hidden}.selectedItem{background-color:#3265ee}.selectedItem span{font-weight:700;background-color:transparent}.notif{padding:2px 13px;margin-bottom:none;background-color:#000;border-radius:8px;font-weight:700}.sidebar.closed .chevron{display:none}.sidebar.closed .icon-estabelecimento{margin:0}.sidebar.closed .icon-estabelecimento button{justify-content:center}.sidebar.closed .icon-estabelecimento button img{margin:0}.align-chevron{width:100%;text-align:justify;align-items:center;display:flex;justify-content:space-between}.selected-color{background-color:#3265ee}.main-menu{display:flex;flex-direction:column;justify-content:space-between;height:100%;min-height:20%}.button-icons{border:none;background-color:transparent}.footer-menu{display:flex;flex-direction:column;padding-bottom:8px}.footer-menu .footer-components{display:flex;justify-content:space-between;border-top:1px solid #3265ee;white-space:nowrap;align-items:center}.footer-menu .footer-components .button-closed{display:none}.footer-menu button{border:none;background-color:transparent;border-radius:8px}.footer-menu .points{padding:4px 0;margin:4px 0;border-radius:8px}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.footer-menu .open-user{background-color:#3265ee}.submenu{width:341px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden;box-shadow:0 4px 8px #0000004d}.submenu ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}.submenu ul li{font-size:20px;font-weight:600;line-height:22px;padding-bottom:18px}.submenu .itens-list{display:flex;justify-content:space-between;align-items:center}.submenu .itens-list .favoritos,.submenu .itens-list span{cursor:pointer}.submenu .footer-menu{display:flex;flex-direction:row;justify-content:center;padding-bottom:16px;overflow:hidden}.submenu .footer-menu .footer-components{border-top:1px solid #3265ee;padding-top:16px;padding-left:17px;white-space:nowrap}.submenu .footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.submenu .footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu .footer-components{display:flex;justify-content:center;align-items:center}.submenu button{position:relative;left:10%;border:none;background-color:transparent}.submenu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0;box-shadow:0 4px 8px #0000004d}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.search-bar{max-width:368px;height:38px;margin-top:24px;border:1px solid #ced4da;box-sizing:border-box;border-radius:8px}.opened-notif-sub{min-width:452px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden}.sidebar.closed{max-width:73px}.sidebar.closed span{display:none}.sidebar.closed span{white-space:nowrap;overflow:hidden}.sidebar.closed .logo-sispro{display:none}.sidebar.closed .list-menu{padding:0;margin-left:0;margin-right:0;display:flex;flex-direction:column;align-items:center}.sidebar.closed .list-menu span{opacity:0;pointer-events:none}.sidebar.closed .list-menu .text-closed{padding-bottom:11px;visibility:visible;display:block}.sidebar.closed .list-menu .text-opened{display:none;font-size:8px}.sidebar.closed .list-menu .chevron,.sidebar.closed .favoritos,.sidebar.closed .footer-components .button-opened{display:none}.sidebar.closed .footer-components .button-closed{display:block}.sidebar.closed .button-icons{border:none;background-color:transparent}.sidebar.closed .footer-components{display:flex;align-items:center}.sidebar.closed button{border:none;background-color:transparent;display:block}.sidebar.closed .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.sidebar-control{height:100vh;max-width:227.667px}.sidebar-control .main-content.closed{margin-left:0}.glb-text-width-120{max-width:120px}.profile-picture{display:inline-block;position:relative;width:100px;height:100px;border-radius:50%;overflow:hidden}.profile-picture img{width:100%;height:100%;object-fit:cover;border-radius:50%;clip-path:circle(50% at 50% 50%)}.image-div{width:50px;min-width:50px;height:50px;border-radius:100%;position:relative;overflow:hidden;z-index:1}.image-div #photoUser{width:146px;height:146px;top:-1px;left:-1px;object-fit:cover;position:relative;z-index:1;border:none;border-color:transparent}.dynamic-container{display:inline-block;white-space:nowrap;overflow:hidden}.custom-popover{width:1000px}\n"], dependencies: [{ kind: "component", type: LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "component", type: PrimaryDropdownComponent, selector: "app-primary-dropdown", inputs: ["buttonWasClicked"] }, { kind: "component", type: SelecaoEstabelecimentosModalComponent, selector: "selecao-estabelecimentos-modal", outputs: ["onClose", "onSelected"] }, { kind: "component", type: NotifSubmenuComponent, selector: "app-notif-submenu" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: DynamicMenuComponent, selector: "app-dynamic-menu", inputs: ["submenuRef", "recebeParam", "titleSubmenu", "submenuList"], outputs: ["selectTemplate"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i9$1.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }] }); }
|
|
2876
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuLateralComponent, deps: [{ token: MSAL_GUARD_CONFIG }, { token: i1$2.MsalService }, { token: i10.ToastrService }, { token: LibCustomMenuService }, { token: AuthStorageService }, { token: i2.BsModalService }, { token: MenuServicesService }, { token: i3.MessageService }, { token: ProjectUtilservice }, { token: i1$1.Router }, { token: AuthService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2877
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: MenuLateralComponent, isStandalone: true, selector: "app-menu-lateral", queries: [{ propertyName: "desiredContent", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "sidebar", first: true, predicate: ["sidebar"], descendants: true, static: true }, { propertyName: "notif_template", first: true, predicate: ["notif_menu"], descendants: true }, { propertyName: "menuLink", first: true, predicate: ["menuLink"], descendants: true }], ngImport: i0, template: "<!-- #region MAIN CONTENT -->\n<div id=\"menu\" class=\"main col-12\">\n\n <div style=\"height: 100vh; z-index: 3;\" class=\"sidebar-control position-relative d-flex flex-row\" \n (clickOutside)=\"closeMenu == true ? onClickedOutside($event, submenu_ref) : closeMenu = true\">\n <div class=\"sidebar {{_customMenuService.themeColor}} closed\" #sidebar>\n <div class=\"menu-header\">\n <ul>\n <li class=\"mb-3\">\n <div class=\"logo-hamburguer\">\n <img src=\"assets/icons/logotipo-sispro.svg\" alt=\"logo-sispro\" class=\"logo-sispro\" title=\"logo\" width=\"136px\" height=\"48px\">\n <button class=\"button-hamburguer\" (click)=\"openExpansibleMenu(sidebar)\">\n <img src=\"assets/icons/menu.svg\" alt=\"menu hamburguer\">\n </button>\n </div>\n </li>\n\n <!-- #region M\u00D3DULOS -->\n <li class=\"mb-3\" style=\"margin-left: 8px; margin-right: 8px\">\n <div class=\"btn-group\">\n <button (click)=\"dropdownWasOpened(true)\" type=\"button\" class=\"dropdown-button\" data-bs-toggle=\"dropdown\"\n aria-expanded=\"false\" data-bs-auto-close=\"outside\">\n\n <ng-container>\n <img *ngIf=\"_customMenuService.moduleImg != ''; else moduleSVG\" [src]=\"_customMenuService.moduleImg\" alt=\"\">\n <span class=\"ps-2\"> {{ this._customMenuService.moduleName }} <lib-icon iconName=\"seta-direita\" iconColor=\"white\" /> </span>\n\n <ng-template #moduleSVG>\n <lib-icon iconColor=\"white\" [iconName]=\"_customMenuService.moduleSvg\"/>\n </ng-template>\n </ng-container>\n\n </button>\n <ul class=\"dropdown-menu\" #dropdown_ref>\n <app-primary-dropdown [buttonWasClicked]=\"messageIfClicked\"></app-primary-dropdown>\n </ul>\n </div>\n </li>\n <!-- #endregion M\u00D3DULOS -->\n\n <!-- #region ESTABELECIMENTOS -->\n <li class=\"mx-3\" style=\"margin-bottom: 16px;\">\n <div class=\"icon-estabelecimento\">\n <button class=\"row justify-content-between bg-transparent border-0\"\n (click)=\"openModal(modalEstabelecimento, MODAL_ESTABELECIMENTO)\"\n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : nomeEstabelecimento\" placement=\"right\">\n\n <lib-icon class=\"col-1\" iconName=\"predio\" iconColor=\"white\" />\n <span *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-9 ps-2 glb-text-width-160 text-start text-truncate\"> {{ nomeEstabelecimento }} </span>\n <lib-icon *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-1\" iconName=\"seta-direita\" iconColor=\"white\" />\n </button>\n </div>\n </li>\n <!-- #endregion ESTABELECIMENTOS -->\n\n </ul>\n\n </div>\n\n <!-- #region MENUS DE NAVEGA\u00C7\u00C3O -->\n <div class=\"main-menu\">\n <div class=\"scroll\">\n <div class=\"list-menu px-2 pb-1\">\n\n <!-- #region MENU DIN\u00C2MICO -->\n <div class=\"dynamic-menu\">\n <ul #dynamic_menu_items *ngIf=\"_customMenuService.menuItems; else isLoading\">\n\n <li *ngFor=\"let menuItem of _customMenuService.menuItems; let i = index\" \n class=\"p-1 rounded\" \n (click)=\"openSubmenu(menuItem, submenu_ref, dynamic_menu)\" \n [class.selectedItem]=\"menuItem.isSelected\">\n\n <a *ngIf=\"!menuItem.isExternal; else externalMenu\"\n [routerLink]=\"menuItem.route != '' ? menuItem.route : null\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImg\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImg>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(menuItem.route)\"\n target=\"_blank\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImgExternal\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImgExternal>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n </ng-template>\n </li>\n\n </ul>\n </div>\n\n <ng-template #isLoading>\n <li class=\"spinner-border spinner-border-sm mt-2\" role=\"status\" aria-hidden=\"true\"></li>\n </ng-template>\n <!-- #endregion MENU DIN\u00C2MICO -->\n\n </div>\n </div>\n </div>\n <!-- #endregion MENUS DE NAVEGA\u00C7\u00C3O -->\n\n <!-- #region FOOTER -->\n <div class=\"footer-menu\" (mouseenter)=\"showBalloon = true\" (mouseleave)=\"showBalloon = false\"\n [popover]=\"popoverContent\" placement=\"right bottom\" [outsideClick]=\"true\" containerClass=\"width: 200px\" >\n <div class=\"footer-components d-flex flex-row align-items-center gap-2 py-2 px-1 justify-content-center gap-2\" [class.open]=\"showBalloon\">\n @if (footerUserImgSrc) {\n <img class=\"photo-profile\" [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\">\n }\n @else {\n <lib-icon iconName=\"contraparte\" iconColor=\"white\"/>\n }\n\n <span class=\"text-truncate fw-bold text-start\" style=\"max-width: 100%;\"> {{ footerUserName }} </span>\n </div>\n </div>\n \n <ng-template #popoverContent>\n <div class=\"footer-menu\" style=\"width: 1000px;\">\n <div class=\"d-flex align-items-center\"> \n <img *ngIf=\"footerUserImgSrc; else noUserImg\" class=\"photo-profile\"\n [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\"> \n <ng-template #noUserImg>\n <lib-icon iconName=\"contraparte\" iconColor=\"currentColor\"/>\n </ng-template>\n <div class=\"d-flex flex-column ms-1\"> \n <div [tooltip]=\"footerUserName\" class=\"dynamic-container\" style=\"white-space: nowrap; flex-grow: 1;max-width: 200px; font-size: 16px;\">{{footerUserName}}</div>\n <div [tooltip]=\"footerUserEmail\" class=\"dynamic-container\" style=\"white-space: nowrap; font-size: 12px; flex-grow: 1;max-width: 200px;\">{{footerUserEmail}}</div>\n </div>\n </div>\n </div>\n <hr class=\"mb-2 mt-2\">\n <div routerLink=\"meu-perfil\" style=\"cursor: pointer;\" (click)=\"togglePopover(); $event.stopPropagation()\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"contraparte\"/> Meu Perfil\n </div>\n <div class=\"mt-2\" (click)=\"logout()\" style=\"cursor: pointer;\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"logout\"/> Sair\n </div>\n </ng-template>\n <!-- #endregion FOOTER -->\n\n </div>\n\n <div class=\"submenu\" #submenu_ref>\n <ng-template [ngIf]=\"desiredContent !== null\">\n <ng-content *ngTemplateOutlet=\"desiredContent!; context: {$implicit: submenuList}\"></ng-content>\n </ng-template>\n </div>\n </div>\n \n <div class=\"main-content col d-flex flex-column align-content-between\" id=\"body-content\">\n <div class=\"content\" style=\"position: relative;\">\n <router-outlet></router-outlet>\n </div>\n <div app-footer></div>\n </div>\n\n</div>\n<!-- #endregion MAIN CONTENT -->\n\n<!-- #region TEMPLATES -->\n<ng-template #dynamic_menu let-data>\n <app-dynamic-menu \n [submenuList]=\"data\"\n [titleSubmenu]=\"titleSubmenu\" [submenuRef]=\"submenu_ref\" [recebeParam]=\"onClickedOutside.bind(this)\">\n </app-dynamic-menu>\n</ng-template>\n\n<ng-template #notif_menu>\n <app-notif-submenu></app-notif-submenu>\n</ng-template>\n\n<!-- #region MODAL SELECAO ESTABELECIMENTO -->\n<ng-template #modalEstabelecimento>\n <selecao-estabelecimentos-modal (onClose)=\"closeModal(MODAL_ESTABELECIMENTO)\"\n (onSelected)=\"closeModal(MODAL_ESTABELECIMENTO); updateLastLogEstabelecimento($event);\"></selecao-estabelecimentos-modal>\n</ng-template>\n<!-- #endregion MODAL SELECAO ESTABELECIMENTO -->\n\n<!-- #endregion TEMPLATES -->\n", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;font-size:14px}span{color:#fff}ul{list-style:none;padding-left:0;white-space:nowrap}#menu.main{display:flex;width:100%;height:100%;background:#eee}::-webkit-scrollbar{width:8px;background:transparent}::-webkit-scrollbar-thumb{background:#bbb;border-radius:16px}.main-content{width:100%;z-index:0;overflow-y:auto;overflow:overlay;height:100vh}.main-content .content{padding:0 16px 16px;background-color:#eee!important}.disable-scroll{overflow-y:hidden}.dropdown-button{padding:8px;border-radius:8px;background-color:#3265ee;border:none;font-size:14px;font-weight:700;width:100%;display:flex}.dropdown-button span{width:100%;display:flex;justify-content:space-between}.dropdown-menu{width:212px;border-radius:8px}.dropdown-menu li{margin:16px 8px}.dropdown-menu li a{font-size:14px}.dropdown-menu li a:hover{font-weight:700;background-color:transparent}.dropdown-menu .dropdown-divider{height:0}.link-portal{color:#213b70;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}.container{display:flex;width:max-content}.sidebar{display:flex;flex-direction:column;height:100%;grid-template-rows:min-content;box-sizing:border-box;transition:width .5s;background-color:#213b70;max-width:inherit}.sidebar .footer-menu{justify-content:flex-end}.menu-header{display:flex;flex-direction:column;white-space:nowrap;padding:32px 0 0;background-color:#213b70}.menu-header ul li{margin-left:16px;margin-right:16px}.menu-header ul>li:last-child{border-bottom:1px solid #3265ee;padding-bottom:15px;height:auto}.dropdown{margin:0}.btn-group{width:100%}.sidebar.closed .menu-header ul li{margin-left:0;margin-right:0}.sidebar.closed .menu-header{display:flex;flex-direction:column;align-items:center}.icon-estabelecimento button{display:flex;flex-direction:row;width:100%;align-items:center;justify-content:center}.icon-estabelecimento button span:hover{font-weight:700}.header-content{display:flex;flex-direction:column;justify-content:space-evenly;height:100%;margin:0 20px}.logo-hamburguer{display:flex;justify-content:space-between;margin-right:8px}.logo-hamburguer .button-hamburguer{border:none;background-color:transparent}.sidebar.closed .logo-hamburguer{justify-content:center;margin-right:0}.scroll{overflow-y:auto;overflow-x:hidden;min-height:20%;margin-right:2px}.list-menu{padding-left:16px;padding-right:8px;display:flex;flex-direction:column;justify-content:center;white-space:nowrap}.list-menu .text-closed{padding-top:15px;display:none;color:#fff}.list-menu .text-opened{color:#fff;font-size:12px;padding-top:15px;visibility:visible;white-space:nowrap}.list-menu .li-main{padding:10px 7px;border-radius:8px}.list-menu .onSelect{background-color:#3265ee}.list-menu div.static-menu>ul>li:first-child{margin-top:16px}.list-menu .span-main{font-size:14px;margin-left:8px;opacity:1;pointer-events:auto;white-space:break-spaces}.list-menu .span-main:hover,.list-menu .list-options span:hover{font-weight:700}.list-menu p{font-size:10px;font-weight:700;text-transform:uppercase;border-bottom:1px solid #3265ee;visibility:hidden}.selectedItem{background-color:#3265ee}.selectedItem span{font-weight:700;background-color:transparent}.notif{padding:2px 13px;margin-bottom:none;background-color:#000;border-radius:8px;font-weight:700}.sidebar.closed .chevron{display:none}.sidebar.closed .icon-estabelecimento{margin:0}.sidebar.closed .icon-estabelecimento button{justify-content:center}.sidebar.closed .icon-estabelecimento button img{margin:0}.align-chevron{width:100%;text-align:justify;align-items:center;display:flex;justify-content:space-between}.selected-color{background-color:#3265ee}.main-menu{display:flex;flex-direction:column;justify-content:space-between;height:100%;min-height:20%}.button-icons{border:none;background-color:transparent}.footer-menu{display:flex;flex-direction:column}.footer-menu .footer-components{border-top:1px solid #3265ee}.footer-menu .footer-components .button-closed{display:none}.footer-menu button{border:none;background-color:transparent;border-radius:8px}.footer-menu .points{padding:4px 0;margin:4px 0;border-radius:8px}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.footer-menu .open-user{background-color:#3265ee}.submenu{width:341px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden;box-shadow:0 4px 8px #0000004d}.submenu ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}.submenu ul li{font-size:20px;font-weight:600;line-height:22px;padding-bottom:18px}.submenu .itens-list{display:flex;justify-content:space-between;align-items:center}.submenu .itens-list .favoritos,.submenu .itens-list span{cursor:pointer}.submenu .footer-menu{display:flex;flex-direction:row;justify-content:center;overflow:hidden}.submenu .footer-menu .footer-components{border-top:1px solid #3265ee;white-space:nowrap}.submenu .footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.submenu .footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu .footer-components{display:flex;justify-content:center;align-items:center}.submenu button{position:relative;left:10%;border:none;background-color:transparent}.submenu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0;box-shadow:0 4px 8px #0000004d}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.search-bar{max-width:368px;height:38px;margin-top:24px;border:1px solid #ced4da;box-sizing:border-box;border-radius:8px}.opened-notif-sub{min-width:452px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden}.sidebar.closed{max-width:73px}.sidebar.closed span{display:none}.sidebar.closed span{white-space:nowrap;overflow:hidden}.sidebar.closed .logo-sispro{display:none}.sidebar.closed .list-menu{padding:0;margin-left:0;margin-right:0;display:flex;flex-direction:column;align-items:center}.sidebar.closed .list-menu span{opacity:0;pointer-events:none}.sidebar.closed .list-menu .text-closed{padding-bottom:11px;visibility:visible;display:block}.sidebar.closed .list-menu .text-opened{display:none;font-size:8px}.sidebar.closed .list-menu .chevron,.sidebar.closed .favoritos,.sidebar.closed .footer-components .button-opened{display:none}.sidebar.closed .footer-components .button-closed{display:block}.sidebar.closed .button-icons{border:none;background-color:transparent}.sidebar.closed .footer-components{display:flex;align-items:center}.sidebar.closed button{border:none;background-color:transparent;display:block}.sidebar.closed .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.sidebar-control{height:100vh;max-width:227.667px}.sidebar-control .main-content.closed{margin-left:0}.glb-text-width-120{max-width:120px}.profile-picture{display:inline-block;position:relative;width:100px;height:100px;border-radius:50%;overflow:hidden}.profile-picture img{width:100%;height:100%;object-fit:cover;border-radius:50%;clip-path:circle(50% at 50% 50%)}.image-div{width:50px;min-width:50px;height:50px;border-radius:100%;position:relative;overflow:hidden;z-index:1}.image-div #photoUser{width:146px;height:146px;top:-1px;left:-1px;object-fit:cover;position:relative;z-index:1;border:none;border-color:transparent}.dynamic-container{display:inline-block;white-space:nowrap;overflow:hidden}.custom-popover{width:1000px}\n"], dependencies: [{ kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i12.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i13.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "ngmodule", type: InfraModule }, { kind: "directive", type: i3.ClickOutsideDirective, selector: "[clickOutside], [libClickOutside]", inputs: ["clickOutsideEnabled", "attachOutsideOnClick", "delayClickOutsideInit", "emitOnBlur", "exclude", "excludeBeforeClick", "clickOutsideEvents"], outputs: ["clickOutside"] }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "component", type: i3.FooterComponent, selector: "[app-footer], app-footer, lib-footer" }, { kind: "component", type: SelecaoEstabelecimentosModalComponent, selector: "selecao-estabelecimentos-modal", outputs: ["onClose", "onSelected"] }, { kind: "component", type: NotifSubmenuComponent, selector: "app-notif-submenu" }, { kind: "component", type: DynamicMenuComponent, selector: "app-dynamic-menu", inputs: ["submenuRef", "recebeParam", "titleSubmenu", "submenuList"], outputs: ["selectTemplate"] }, { kind: "component", type: PrimaryDropdownComponent, selector: "app-primary-dropdown", inputs: ["buttonWasClicked"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
|
|
2082
2878
|
}
|
|
2083
2879
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MenuLateralComponent, decorators: [{
|
|
2084
2880
|
type: Component,
|
|
2085
|
-
args: [{ selector: 'app-menu-lateral', imports: [LibIconsComponent, PrimaryDropdownComponent, SelecaoEstabelecimentosModalComponent, NotifSubmenuComponent, RouterModule, TooltipModule, DynamicMenuComponent, PopoverModule], template: "<!-- #region MAIN CONTENT -->\n<div class=\"main col-12\">\n\n <div style=\"height: 100vh; z-index: 3;\" class=\"sidebar-control position-relative d-flex flex-row\" \n (clickOutside)=\"closeMenu == true ? onClickedOutside($event, submenu_ref) : closeMenu = true\">\n <div class=\"sidebar {{_customMenuService.themeColor}} closed\" #sidebar>\n <div class=\"menu-header\">\n <ul>\n <li class=\"mb-3\">\n <div class=\"logo-hamburguer\">\n <img src=\"assets/icons/logotipo-sispro.svg\" alt=\"logo-sispro\" class=\"logo-sispro\" title=\"logo\" width=\"136px\" height=\"48px\">\n <button class=\"button-hamburguer\" (click)=\"openExpansibleMenu(sidebar)\">\n <img src=\"assets/icons/menu.svg\" alt=\"menu hamburguer\">\n </button>\n </div>\n </li>\n\n <!-- #region M\u00D3DULOS -->\n <li class=\"mb-3\" style=\"margin-left: 8px; margin-right: 8px\">\n <div class=\"btn-group\">\n <button (click)=\"dropdownWasOpened(true)\" type=\"button\" class=\"dropdown-button\" data-bs-toggle=\"dropdown\"\n aria-expanded=\"false\" data-bs-auto-close=\"outside\">\n\n <ng-container>\n <img *ngIf=\"_customMenuService.moduleImg != ''; else moduleSVG\" [src]=\"_customMenuService.moduleImg\" alt=\"\">\n <span class=\"ps-2\"> {{ _customMenuService.moduleName }} <lib-icon iconName=\"seta-direita\" iconColor=\"white\" /> </span>\n\n <ng-template #moduleSVG>\n <lib-icon iconColor=\"white\" [iconName]=\"_customMenuService.moduleSvg\"/>\n </ng-template>\n </ng-container>\n\n </button>\n <ul class=\"dropdown-menu\" #dropdown_ref>\n <app-primary-dropdown [buttonWasClicked]=\"messageIfClicked\"></app-primary-dropdown>\n </ul>\n </div>\n </li>\n <!-- #endregion M\u00D3DULOS -->\n\n <!-- #region ESTABELECIMENTOS -->\n <li class=\"mx-3\" style=\"margin-bottom: 16px;\">\n <div class=\"icon-estabelecimento\">\n <button class=\"row justify-content-between bg-transparent border-0\"\n (click)=\"openModal(modalEstabelecimento, MODAL_ESTABELECIMENTO)\"\n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : nomeEstabelecimento\" placement=\"right\">\n\n <lib-icon class=\"col-1\" iconName=\"predio\" iconColor=\"white\" />\n <span *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-9 ps-2 glb-text-width-160 text-start text-truncate\"> {{ nomeEstabelecimento }} </span>\n <lib-icon *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-1\" iconName=\"seta-direita\" iconColor=\"white\" />\n </button>\n </div>\n </li>\n <!-- #endregion ESTABELECIMENTOS -->\n\n </ul>\n\n </div>\n\n <!-- #region MENUS DE NAVEGA\u00C7\u00C3O -->\n <div class=\"main-menu\">\n <div class=\"scroll\">\n <div class=\"list-menu px-2 pb-1\">\n\n <!-- #region MENU DIN\u00C2MICO -->\n <div class=\"dynamic-menu\">\n <ul #dynamic_menu_items *ngIf=\"_customMenuService.menuItems; else isLoading\">\n\n <li *ngFor=\"let menuItem of _customMenuService.menuItems; let i = index\" \n class=\"p-1 rounded\" \n (click)=\"openSubmenu(menuItem, submenu_ref, dynamic_menu)\" \n [class.selectedItem]=\"menuItem.isSelected\">\n\n <a *ngIf=\"!menuItem.isExternal; else externalMenu\"\n [routerLink]=\"menuItem.route != '' ? menuItem.route : null\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImg\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImg>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(menuItem.route)\"\n target=\"_blank\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImgExternal\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImgExternal>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n </ng-template>\n </li>\n\n </ul>\n </div>\n\n <ng-template #isLoading>\n <li class=\"spinner-border spinner-border-sm mt-2\" role=\"status\" aria-hidden=\"true\"></li>\n </ng-template>\n <!-- #endregion MENU DIN\u00C2MICO -->\n\n </div>\n </div>\n </div>\n <!-- #endregion MENUS DE NAVEGA\u00C7\u00C3O -->\n\n <!-- #region FOOTER -->\n <div class=\"footer-menu\" (mouseenter)=\"showBalloon = true\" (mouseleave)=\"showBalloon = false\"\n [popover]=\"popoverContent\" placement=\"right bottom\" [outsideClick]=\"true\" containerClass=\"width: 200px\" >\n <div class=\"footer-components ps-1 pt-2\" [class.open]=\"showBalloon\">\n <button type=\"button\" class=\"btn btn-primary\">\n <img *ngIf=\"footerUserImgSrc; else noUserImg\" class=\"photo-profile ms-1\"\n [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\">\n <ng-template #noUserImg>\n <lib-icon iconName=\"contraparte\" iconColor=\"white\"/>\n </ng-template>\n <span class=\"glb-text-width-120 w-auto fw-bold text-start text-truncate ms-1 me-1\">\n {{ footerUserName }}\n </span>\n </button>\n </div>\n </div>\n \n <ng-template #popoverContent>\n <div class=\"footer-menu\" style=\"width: 1000px;\">\n <div class=\"d-flex align-items-center\"> \n <img *ngIf=\"footerUserImgSrc; else noUserImg\" class=\"photo-profile\"\n [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\"> \n <ng-template #noUserImg>\n <lib-icon iconName=\"contraparte\" iconColor=\"white\"/>\n </ng-template>\n <div class=\"d-flex flex-column ms-1\"> \n <div [tooltip]=\"footerUserName\" class=\"dynamic-container\" style=\"white-space: nowrap; flex-grow: 1;max-width: 200px; font-size: 16px;\">{{footerUserName}}</div>\n <div [tooltip]=\"footerUserEmail\" class=\"dynamic-container\" style=\"white-space: nowrap; font-size: 12px; flex-grow: 1;max-width: 200px;\">{{footerUserEmail}}</div>\n </div>\n </div>\n </div>\n <hr class=\"mb-2 mt-2\">\n <div routerLink=\"meu-perfil\" style=\"cursor: pointer;\" (click)=\"togglePopover(); $event.stopPropagation()\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"contraparte\"/> Meu Perfil\n </div>\n <div class=\"mt-2\" (click)=\"logout()\" style=\"cursor: pointer;\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"logout\"/> Sair\n </div>\n </ng-template>\n <!-- #endregion FOOTER -->\n\n </div>\n\n <div class=\"submenu\" #submenu_ref>\n <ng-template [ngIf]=\"desiredContent !== null\">\n <ng-content *ngTemplateOutlet=\"desiredContent!; context: {$implicit: submenuList}\"></ng-content>\n </ng-template>\n </div>\n </div>\n \n <div class=\"main-content col d-flex flex-column align-content-between\" id=\"body-content\">\n <div class=\"content\" style=\"position: relative;\">\n <router-outlet></router-outlet>\n </div>\n <div app-footer></div>\n </div>\n\n</div>\n<!-- #endregion MAIN CONTENT -->\n\n<!-- #region TEMPLATES -->\n<!-- tem que perguntar pro Erick -->\n<!-- [submenuRef]=\"submenu_ref\" -->\n<ng-template #dynamic_menu let-data>\n <app-dynamic-menu \n [submenuList]=\"data\"\n [titleSubmenu]=\"titleSubmenu\"\n [submenuRef]=\"submenu_ref\"\n [recebeParam]=\"onClickedOutside.bind(this)\">\n </app-dynamic-menu>\n</ng-template>\n\n<ng-template #notif_menu>\n <app-notif-submenu></app-notif-submenu>\n</ng-template>\n\n<!-- #region MODAL SELECAO ESTABELECIMENTO -->\n<ng-template #modalEstabelecimento>\n <selecao-estabelecimentos-modal (onClose)=\"closeModal(MODAL_ESTABELECIMENTO)\"\n (onSelected)=\"closeModal(MODAL_ESTABELECIMENTO); updateLastLogEstabelecimento($event);\"></selecao-estabelecimentos-modal>\n</ng-template>\n<!-- #endregion MODAL SELECAO ESTABELECIMENTO -->\n\n<!-- #endregion TEMPLATES -->\n", styles: [".main{display:flex;width:100%;height:100%;background:#eee}::-webkit-scrollbar{width:8px;background:transparent}::-webkit-scrollbar-thumb{background:#bbb;border-radius:16px}.main-content{width:100%;z-index:0;overflow-y:auto;overflow:overlay;height:100vh}.main-content .content{padding:0 16px 16px;background-color:#eee!important}.disable-scroll{overflow-y:hidden}*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;font-size:14px}span{color:#fff}ul{list-style:none;padding-left:0;white-space:nowrap}.dropdown-button{padding:8px;border-radius:8px;background-color:#3265ee;border:none;font-size:14px;font-weight:700;width:100%;display:flex}.dropdown-button span{width:100%;display:flex;justify-content:space-between}.dropdown-menu{width:212px;border-radius:8px}.dropdown-menu li{margin:16px 8px}.dropdown-menu li a{font-size:14px}.dropdown-menu li a:hover{font-weight:700;background-color:transparent}.dropdown-menu .dropdown-divider{height:0}.link-portal{color:#213b70;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}.container{display:flex;width:max-content}.sidebar{display:flex;flex-direction:column;height:100%;grid-template-rows:min-content;box-sizing:border-box;transition:width .5s;background-color:#213b70;max-width:inherit}.sidebar .footer-menu{justify-content:flex-end}.menu-header{display:flex;flex-direction:column;white-space:nowrap;padding:32px 0 0;background-color:#213b70}.menu-header ul li{margin-left:16px;margin-right:16px}.menu-header ul>li:last-child{border-bottom:1px solid #3265ee;padding-bottom:15px;height:auto}.dropdown{margin:0}.btn-group{width:100%}.sidebar.closed .menu-header ul li{margin-left:0;margin-right:0}.sidebar.closed .menu-header{display:flex;flex-direction:column;align-items:center}.icon-estabelecimento button{display:flex;flex-direction:row;width:100%;align-items:center;justify-content:center}.icon-estabelecimento button span:hover{font-weight:700}.header-content{display:flex;flex-direction:column;justify-content:space-evenly;height:100%;margin:0 20px}.logo-hamburguer{display:flex;justify-content:space-between;margin-right:8px}.logo-hamburguer .button-hamburguer{border:none;background-color:transparent}.sidebar.closed .logo-hamburguer{justify-content:center;margin-right:0}.scroll{overflow-y:auto;overflow-x:hidden;min-height:20%;margin-right:2px}.list-menu{padding-left:16px;padding-right:8px;display:flex;flex-direction:column;justify-content:center;white-space:nowrap}.list-menu .text-closed{padding-top:15px;display:none;color:#fff}.list-menu .text-opened{color:#fff;font-size:12px;padding-top:15px;visibility:visible;white-space:nowrap}.list-menu .li-main{padding:10px 7px;border-radius:8px}.list-menu .onSelect{background-color:#3265ee}.list-menu div.static-menu>ul>li:first-child{margin-top:16px}.list-menu .span-main{font-size:14px;margin-left:8px;opacity:1;pointer-events:auto;white-space:break-spaces}.list-menu .span-main:hover,.list-menu .list-options span:hover{font-weight:700}.list-menu p{font-size:10px;font-weight:700;text-transform:uppercase;border-bottom:1px solid #3265ee;visibility:hidden}.selectedItem{background-color:#3265ee}.selectedItem span{font-weight:700;background-color:transparent}.notif{padding:2px 13px;margin-bottom:none;background-color:#000;border-radius:8px;font-weight:700}.sidebar.closed .chevron{display:none}.sidebar.closed .icon-estabelecimento{margin:0}.sidebar.closed .icon-estabelecimento button{justify-content:center}.sidebar.closed .icon-estabelecimento button img{margin:0}.align-chevron{width:100%;text-align:justify;align-items:center;display:flex;justify-content:space-between}.selected-color{background-color:#3265ee}.main-menu{display:flex;flex-direction:column;justify-content:space-between;height:100%;min-height:20%}.button-icons{border:none;background-color:transparent}.footer-menu{display:flex;flex-direction:column;padding-bottom:8px}.footer-menu .footer-components{display:flex;justify-content:space-between;border-top:1px solid #3265ee;white-space:nowrap;align-items:center}.footer-menu .footer-components .button-closed{display:none}.footer-menu button{border:none;background-color:transparent;border-radius:8px}.footer-menu .points{padding:4px 0;margin:4px 0;border-radius:8px}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.footer-menu .open-user{background-color:#3265ee}.submenu{width:341px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden;box-shadow:0 4px 8px #0000004d}.submenu ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}.submenu ul li{font-size:20px;font-weight:600;line-height:22px;padding-bottom:18px}.submenu .itens-list{display:flex;justify-content:space-between;align-items:center}.submenu .itens-list .favoritos,.submenu .itens-list span{cursor:pointer}.submenu .footer-menu{display:flex;flex-direction:row;justify-content:center;padding-bottom:16px;overflow:hidden}.submenu .footer-menu .footer-components{border-top:1px solid #3265ee;padding-top:16px;padding-left:17px;white-space:nowrap}.submenu .footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.submenu .footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu .footer-components{display:flex;justify-content:center;align-items:center}.submenu button{position:relative;left:10%;border:none;background-color:transparent}.submenu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0;box-shadow:0 4px 8px #0000004d}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.search-bar{max-width:368px;height:38px;margin-top:24px;border:1px solid #ced4da;box-sizing:border-box;border-radius:8px}.opened-notif-sub{min-width:452px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden}.sidebar.closed{max-width:73px}.sidebar.closed span{display:none}.sidebar.closed span{white-space:nowrap;overflow:hidden}.sidebar.closed .logo-sispro{display:none}.sidebar.closed .list-menu{padding:0;margin-left:0;margin-right:0;display:flex;flex-direction:column;align-items:center}.sidebar.closed .list-menu span{opacity:0;pointer-events:none}.sidebar.closed .list-menu .text-closed{padding-bottom:11px;visibility:visible;display:block}.sidebar.closed .list-menu .text-opened{display:none;font-size:8px}.sidebar.closed .list-menu .chevron,.sidebar.closed .favoritos,.sidebar.closed .footer-components .button-opened{display:none}.sidebar.closed .footer-components .button-closed{display:block}.sidebar.closed .button-icons{border:none;background-color:transparent}.sidebar.closed .footer-components{display:flex;align-items:center}.sidebar.closed button{border:none;background-color:transparent;display:block}.sidebar.closed .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.sidebar-control{height:100vh;max-width:227.667px}.sidebar-control .main-content.closed{margin-left:0}.glb-text-width-120{max-width:120px}.profile-picture{display:inline-block;position:relative;width:100px;height:100px;border-radius:50%;overflow:hidden}.profile-picture img{width:100%;height:100%;object-fit:cover;border-radius:50%;clip-path:circle(50% at 50% 50%)}.image-div{width:50px;min-width:50px;height:50px;border-radius:100%;position:relative;overflow:hidden;z-index:1}.image-div #photoUser{width:146px;height:146px;top:-1px;left:-1px;object-fit:cover;position:relative;z-index:1;border:none;border-color:transparent}.dynamic-container{display:inline-block;white-space:nowrap;overflow:hidden}.custom-popover{width:1000px}\n"] }]
|
|
2086
|
-
|
|
2881
|
+
args: [{ selector: 'app-menu-lateral', imports: [
|
|
2882
|
+
PopoverModule,
|
|
2883
|
+
TooltipModule,
|
|
2884
|
+
InfraModule,
|
|
2885
|
+
SelecaoEstabelecimentosModalComponent,
|
|
2886
|
+
NotifSubmenuComponent,
|
|
2887
|
+
DynamicMenuComponent,
|
|
2888
|
+
PrimaryDropdownComponent,
|
|
2889
|
+
CommonModule,
|
|
2890
|
+
RouterLink,
|
|
2891
|
+
RouterOutlet,
|
|
2892
|
+
NgIf
|
|
2893
|
+
], template: "<!-- #region MAIN CONTENT -->\n<div id=\"menu\" class=\"main col-12\">\n\n <div style=\"height: 100vh; z-index: 3;\" class=\"sidebar-control position-relative d-flex flex-row\" \n (clickOutside)=\"closeMenu == true ? onClickedOutside($event, submenu_ref) : closeMenu = true\">\n <div class=\"sidebar {{_customMenuService.themeColor}} closed\" #sidebar>\n <div class=\"menu-header\">\n <ul>\n <li class=\"mb-3\">\n <div class=\"logo-hamburguer\">\n <img src=\"assets/icons/logotipo-sispro.svg\" alt=\"logo-sispro\" class=\"logo-sispro\" title=\"logo\" width=\"136px\" height=\"48px\">\n <button class=\"button-hamburguer\" (click)=\"openExpansibleMenu(sidebar)\">\n <img src=\"assets/icons/menu.svg\" alt=\"menu hamburguer\">\n </button>\n </div>\n </li>\n\n <!-- #region M\u00D3DULOS -->\n <li class=\"mb-3\" style=\"margin-left: 8px; margin-right: 8px\">\n <div class=\"btn-group\">\n <button (click)=\"dropdownWasOpened(true)\" type=\"button\" class=\"dropdown-button\" data-bs-toggle=\"dropdown\"\n aria-expanded=\"false\" data-bs-auto-close=\"outside\">\n\n <ng-container>\n <img *ngIf=\"_customMenuService.moduleImg != ''; else moduleSVG\" [src]=\"_customMenuService.moduleImg\" alt=\"\">\n <span class=\"ps-2\"> {{ this._customMenuService.moduleName }} <lib-icon iconName=\"seta-direita\" iconColor=\"white\" /> </span>\n\n <ng-template #moduleSVG>\n <lib-icon iconColor=\"white\" [iconName]=\"_customMenuService.moduleSvg\"/>\n </ng-template>\n </ng-container>\n\n </button>\n <ul class=\"dropdown-menu\" #dropdown_ref>\n <app-primary-dropdown [buttonWasClicked]=\"messageIfClicked\"></app-primary-dropdown>\n </ul>\n </div>\n </li>\n <!-- #endregion M\u00D3DULOS -->\n\n <!-- #region ESTABELECIMENTOS -->\n <li class=\"mx-3\" style=\"margin-bottom: 16px;\">\n <div class=\"icon-estabelecimento\">\n <button class=\"row justify-content-between bg-transparent border-0\"\n (click)=\"openModal(modalEstabelecimento, MODAL_ESTABELECIMENTO)\"\n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : nomeEstabelecimento\" placement=\"right\">\n\n <lib-icon class=\"col-1\" iconName=\"predio\" iconColor=\"white\" />\n <span *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-9 ps-2 glb-text-width-160 text-start text-truncate\"> {{ nomeEstabelecimento }} </span>\n <lib-icon *ngIf=\"!sidebar.classList.contains('closed')\" class=\"col-1\" iconName=\"seta-direita\" iconColor=\"white\" />\n </button>\n </div>\n </li>\n <!-- #endregion ESTABELECIMENTOS -->\n\n </ul>\n\n </div>\n\n <!-- #region MENUS DE NAVEGA\u00C7\u00C3O -->\n <div class=\"main-menu\">\n <div class=\"scroll\">\n <div class=\"list-menu px-2 pb-1\">\n\n <!-- #region MENU DIN\u00C2MICO -->\n <div class=\"dynamic-menu\">\n <ul #dynamic_menu_items *ngIf=\"_customMenuService.menuItems; else isLoading\">\n\n <li *ngFor=\"let menuItem of _customMenuService.menuItems; let i = index\" \n class=\"p-1 rounded\" \n (click)=\"openSubmenu(menuItem, submenu_ref, dynamic_menu)\" \n [class.selectedItem]=\"menuItem.isSelected\">\n\n <a *ngIf=\"!menuItem.isExternal; else externalMenu\"\n [routerLink]=\"menuItem.route != '' ? menuItem.route : null\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImg\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImg>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n \n <ng-template #externalMenu>\n <a [href]=\"getExternalUrl(menuItem.route)\"\n target=\"_blank\" \n [id]=\"'item' + menuItem.id\" \n [tooltip]=\"!sidebar.classList.contains('closed') ? '' : menuItem.label\" \n placement=\"left\" class=\"w-100 d-flex align-items-center button-icons text-decoration-none p-1 glb-cursor-pointer\" \n [class]=\"sidebar.classList.contains('closed') ? 'justify-content-center' : 'justify-content-between'\">\n\n <div class=\"container\">\n <lib-icon *ngIf=\"!menuItem.icon.includes('assets/icons'); else iconImgExternal\" [iconName]=\"menuItem.icon\" iconColor=\"white\"/>\n <span class=\"span-main\">{{ menuItem.label }}</span>\n <ng-template #iconImgExternal>\n <img [src]=\"menuItem.icon\" [alt]=\"'icone: ' + menuItem.label\">\n </ng-template>\n </div>\n <lib-icon *ngIf=\"(menuItem.children && menuItem.children.length > 0) && !sidebar.classList.contains('closed')\" \n iconName=\"seta-direita\" iconColor=\"white\"/>\n </a>\n </ng-template>\n </li>\n\n </ul>\n </div>\n\n <ng-template #isLoading>\n <li class=\"spinner-border spinner-border-sm mt-2\" role=\"status\" aria-hidden=\"true\"></li>\n </ng-template>\n <!-- #endregion MENU DIN\u00C2MICO -->\n\n </div>\n </div>\n </div>\n <!-- #endregion MENUS DE NAVEGA\u00C7\u00C3O -->\n\n <!-- #region FOOTER -->\n <div class=\"footer-menu\" (mouseenter)=\"showBalloon = true\" (mouseleave)=\"showBalloon = false\"\n [popover]=\"popoverContent\" placement=\"right bottom\" [outsideClick]=\"true\" containerClass=\"width: 200px\" >\n <div class=\"footer-components d-flex flex-row align-items-center gap-2 py-2 px-1 justify-content-center gap-2\" [class.open]=\"showBalloon\">\n @if (footerUserImgSrc) {\n <img class=\"photo-profile\" [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\">\n }\n @else {\n <lib-icon iconName=\"contraparte\" iconColor=\"white\"/>\n }\n\n <span class=\"text-truncate fw-bold text-start\" style=\"max-width: 100%;\"> {{ footerUserName }} </span>\n </div>\n </div>\n \n <ng-template #popoverContent>\n <div class=\"footer-menu\" style=\"width: 1000px;\">\n <div class=\"d-flex align-items-center\"> \n <img *ngIf=\"footerUserImgSrc; else noUserImg\" class=\"photo-profile\"\n [src]=\"['data:image/jpeg;base64,' + footerUserImgSrc]\" alt=\"foto-perfil\"> \n <ng-template #noUserImg>\n <lib-icon iconName=\"contraparte\" iconColor=\"currentColor\"/>\n </ng-template>\n <div class=\"d-flex flex-column ms-1\"> \n <div [tooltip]=\"footerUserName\" class=\"dynamic-container\" style=\"white-space: nowrap; flex-grow: 1;max-width: 200px; font-size: 16px;\">{{footerUserName}}</div>\n <div [tooltip]=\"footerUserEmail\" class=\"dynamic-container\" style=\"white-space: nowrap; font-size: 12px; flex-grow: 1;max-width: 200px;\">{{footerUserEmail}}</div>\n </div>\n </div>\n </div>\n <hr class=\"mb-2 mt-2\">\n <div routerLink=\"meu-perfil\" style=\"cursor: pointer;\" (click)=\"togglePopover(); $event.stopPropagation()\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"contraparte\"/> Meu Perfil\n </div>\n <div class=\"mt-2\" (click)=\"logout()\" style=\"cursor: pointer;\">\n <lib-icon [iconSize]=\"'small'\" iconName=\"logout\"/> Sair\n </div>\n </ng-template>\n <!-- #endregion FOOTER -->\n\n </div>\n\n <div class=\"submenu\" #submenu_ref>\n <ng-template [ngIf]=\"desiredContent !== null\">\n <ng-content *ngTemplateOutlet=\"desiredContent!; context: {$implicit: submenuList}\"></ng-content>\n </ng-template>\n </div>\n </div>\n \n <div class=\"main-content col d-flex flex-column align-content-between\" id=\"body-content\">\n <div class=\"content\" style=\"position: relative;\">\n <router-outlet></router-outlet>\n </div>\n <div app-footer></div>\n </div>\n\n</div>\n<!-- #endregion MAIN CONTENT -->\n\n<!-- #region TEMPLATES -->\n<ng-template #dynamic_menu let-data>\n <app-dynamic-menu \n [submenuList]=\"data\"\n [titleSubmenu]=\"titleSubmenu\" [submenuRef]=\"submenu_ref\" [recebeParam]=\"onClickedOutside.bind(this)\">\n </app-dynamic-menu>\n</ng-template>\n\n<ng-template #notif_menu>\n <app-notif-submenu></app-notif-submenu>\n</ng-template>\n\n<!-- #region MODAL SELECAO ESTABELECIMENTO -->\n<ng-template #modalEstabelecimento>\n <selecao-estabelecimentos-modal (onClose)=\"closeModal(MODAL_ESTABELECIMENTO)\"\n (onSelected)=\"closeModal(MODAL_ESTABELECIMENTO); updateLastLogEstabelecimento($event);\"></selecao-estabelecimentos-modal>\n</ng-template>\n<!-- #endregion MODAL SELECAO ESTABELECIMENTO -->\n\n<!-- #endregion TEMPLATES -->\n", styles: ["*{padding:0;margin:0;font-family:Open sans,Arial,Helvetica,sans-serif;font-size:14px}span{color:#fff}ul{list-style:none;padding-left:0;white-space:nowrap}#menu.main{display:flex;width:100%;height:100%;background:#eee}::-webkit-scrollbar{width:8px;background:transparent}::-webkit-scrollbar-thumb{background:#bbb;border-radius:16px}.main-content{width:100%;z-index:0;overflow-y:auto;overflow:overlay;height:100vh}.main-content .content{padding:0 16px 16px;background-color:#eee!important}.disable-scroll{overflow-y:hidden}.dropdown-button{padding:8px;border-radius:8px;background-color:#3265ee;border:none;font-size:14px;font-weight:700;width:100%;display:flex}.dropdown-button span{width:100%;display:flex;justify-content:space-between}.dropdown-menu{width:212px;border-radius:8px}.dropdown-menu li{margin:16px 8px}.dropdown-menu li a{font-size:14px}.dropdown-menu li a:hover{font-weight:700;background-color:transparent}.dropdown-menu .dropdown-divider{height:0}.link-portal{color:#213b70;text-decoration:underline;text-align:center;font-weight:700;font-size:14px}.container{display:flex;width:max-content}.sidebar{display:flex;flex-direction:column;height:100%;grid-template-rows:min-content;box-sizing:border-box;transition:width .5s;background-color:#213b70;max-width:inherit}.sidebar .footer-menu{justify-content:flex-end}.menu-header{display:flex;flex-direction:column;white-space:nowrap;padding:32px 0 0;background-color:#213b70}.menu-header ul li{margin-left:16px;margin-right:16px}.menu-header ul>li:last-child{border-bottom:1px solid #3265ee;padding-bottom:15px;height:auto}.dropdown{margin:0}.btn-group{width:100%}.sidebar.closed .menu-header ul li{margin-left:0;margin-right:0}.sidebar.closed .menu-header{display:flex;flex-direction:column;align-items:center}.icon-estabelecimento button{display:flex;flex-direction:row;width:100%;align-items:center;justify-content:center}.icon-estabelecimento button span:hover{font-weight:700}.header-content{display:flex;flex-direction:column;justify-content:space-evenly;height:100%;margin:0 20px}.logo-hamburguer{display:flex;justify-content:space-between;margin-right:8px}.logo-hamburguer .button-hamburguer{border:none;background-color:transparent}.sidebar.closed .logo-hamburguer{justify-content:center;margin-right:0}.scroll{overflow-y:auto;overflow-x:hidden;min-height:20%;margin-right:2px}.list-menu{padding-left:16px;padding-right:8px;display:flex;flex-direction:column;justify-content:center;white-space:nowrap}.list-menu .text-closed{padding-top:15px;display:none;color:#fff}.list-menu .text-opened{color:#fff;font-size:12px;padding-top:15px;visibility:visible;white-space:nowrap}.list-menu .li-main{padding:10px 7px;border-radius:8px}.list-menu .onSelect{background-color:#3265ee}.list-menu div.static-menu>ul>li:first-child{margin-top:16px}.list-menu .span-main{font-size:14px;margin-left:8px;opacity:1;pointer-events:auto;white-space:break-spaces}.list-menu .span-main:hover,.list-menu .list-options span:hover{font-weight:700}.list-menu p{font-size:10px;font-weight:700;text-transform:uppercase;border-bottom:1px solid #3265ee;visibility:hidden}.selectedItem{background-color:#3265ee}.selectedItem span{font-weight:700;background-color:transparent}.notif{padding:2px 13px;margin-bottom:none;background-color:#000;border-radius:8px;font-weight:700}.sidebar.closed .chevron{display:none}.sidebar.closed .icon-estabelecimento{margin:0}.sidebar.closed .icon-estabelecimento button{justify-content:center}.sidebar.closed .icon-estabelecimento button img{margin:0}.align-chevron{width:100%;text-align:justify;align-items:center;display:flex;justify-content:space-between}.selected-color{background-color:#3265ee}.main-menu{display:flex;flex-direction:column;justify-content:space-between;height:100%;min-height:20%}.button-icons{border:none;background-color:transparent}.footer-menu{display:flex;flex-direction:column}.footer-menu .footer-components{border-top:1px solid #3265ee}.footer-menu .footer-components .button-closed{display:none}.footer-menu button{border:none;background-color:transparent;border-radius:8px}.footer-menu .points{padding:4px 0;margin:4px 0;border-radius:8px}.footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.footer-menu .open-user{background-color:#3265ee}.submenu{width:341px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden;box-shadow:0 4px 8px #0000004d}.submenu ul{display:flex;flex-direction:column;margin:25px 26px 0 24px}.submenu ul li{font-size:20px;font-weight:600;line-height:22px;padding-bottom:18px}.submenu .itens-list{display:flex;justify-content:space-between;align-items:center}.submenu .itens-list .favoritos,.submenu .itens-list span{cursor:pointer}.submenu .footer-menu{display:flex;flex-direction:row;justify-content:center;overflow:hidden}.submenu .footer-menu .footer-components{border-top:1px solid #3265ee;white-space:nowrap}.submenu .footer-menu button{position:relative;left:35%;border:none;background-color:transparent}.submenu .footer-menu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu .footer-components{display:flex;justify-content:center;align-items:center}.submenu button{position:relative;left:10%;border:none;background-color:transparent}.submenu .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.submenu.opened-sub{z-index:1;display:flex;position:absolute;left:100%;height:100vh;justify-content:space-between}.submenu-footer{display:flex;flex-direction:row;justify-content:center;align-content:center;margin-bottom:14px;border-top:1px solid #2847a0;box-shadow:0 4px 8px #0000004d}.submenu-footer .subfooter-components{padding-top:16px}.submenu-footer span{font-weight:700;padding-left:10px}.search-bar{max-width:368px;height:38px;margin-top:24px;border:1px solid #ced4da;box-sizing:border-box;border-radius:8px}.opened-notif-sub{min-width:452px;display:none;background-color:#3265ee;box-sizing:border-box;flex-direction:column;overflow:hidden}.sidebar.closed{max-width:73px}.sidebar.closed span{display:none}.sidebar.closed span{white-space:nowrap;overflow:hidden}.sidebar.closed .logo-sispro{display:none}.sidebar.closed .list-menu{padding:0;margin-left:0;margin-right:0;display:flex;flex-direction:column;align-items:center}.sidebar.closed .list-menu span{opacity:0;pointer-events:none}.sidebar.closed .list-menu .text-closed{padding-bottom:11px;visibility:visible;display:block}.sidebar.closed .list-menu .text-opened{display:none;font-size:8px}.sidebar.closed .list-menu .chevron,.sidebar.closed .favoritos,.sidebar.closed .footer-components .button-opened{display:none}.sidebar.closed .footer-components .button-closed{display:block}.sidebar.closed .button-icons{border:none;background-color:transparent}.sidebar.closed .footer-components{display:flex;align-items:center}.sidebar.closed button{border:none;background-color:transparent;display:block}.sidebar.closed .photo-profile{width:32px;height:32px;border-radius:50%;margin:0}.sidebar-control{height:100vh;max-width:227.667px}.sidebar-control .main-content.closed{margin-left:0}.glb-text-width-120{max-width:120px}.profile-picture{display:inline-block;position:relative;width:100px;height:100px;border-radius:50%;overflow:hidden}.profile-picture img{width:100%;height:100%;object-fit:cover;border-radius:50%;clip-path:circle(50% at 50% 50%)}.image-div{width:50px;min-width:50px;height:50px;border-radius:100%;position:relative;overflow:hidden;z-index:1}.image-div #photoUser{width:146px;height:146px;top:-1px;left:-1px;object-fit:cover;position:relative;z-index:1;border:none;border-color:transparent}.dynamic-container{display:inline-block;white-space:nowrap;overflow:hidden}.custom-popover{width:1000px}\n"] }]
|
|
2894
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2895
|
+
type: Inject,
|
|
2896
|
+
args: [MSAL_GUARD_CONFIG]
|
|
2897
|
+
}] }, { type: i1$2.MsalService }, { type: i10.ToastrService }, { type: LibCustomMenuService }, { type: AuthStorageService }, { type: i2.BsModalService }, { type: MenuServicesService }, { type: i3.MessageService }, { type: ProjectUtilservice }, { type: i1$1.Router }, { type: AuthService }, { type: EnvironmentService }], propDecorators: { sidebar: [{
|
|
2898
|
+
type: ViewChild,
|
|
2899
|
+
args: ['sidebar', { static: true }]
|
|
2900
|
+
}], notif_template: [{
|
|
2087
2901
|
type: ViewChild,
|
|
2088
2902
|
args: ["notif_menu"]
|
|
2089
2903
|
}], menuLink: [{
|
|
@@ -2095,10 +2909,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2095
2909
|
}] } });
|
|
2096
2910
|
|
|
2097
2911
|
class NovaSenhaComponent {
|
|
2098
|
-
constructor(_formBuilder,
|
|
2912
|
+
constructor(_formBuilder, _projectUtilservice, _messageService, _authService, _authStorageService, _title, _router, _route) {
|
|
2099
2913
|
this._formBuilder = _formBuilder;
|
|
2914
|
+
this._projectUtilservice = _projectUtilservice;
|
|
2100
2915
|
this._messageService = _messageService;
|
|
2101
|
-
this._serverService = _serverService;
|
|
2102
2916
|
this._authService = _authService;
|
|
2103
2917
|
this._authStorageService = _authStorageService;
|
|
2104
2918
|
this._title = _title;
|
|
@@ -2109,18 +2923,17 @@ class NovaSenhaComponent {
|
|
|
2109
2923
|
this.domain = "";
|
|
2110
2924
|
this.user = "";
|
|
2111
2925
|
this.createPassword = false;
|
|
2926
|
+
this.isDisabled = true;
|
|
2112
2927
|
this.esqueceuSenhaText = "Enviamos um código para o seu e-mail.<br>Insira-o abaixo para redefinir sua senha.";
|
|
2113
2928
|
this.primeiroAcessoText = "Este é o seu primeiro acesso. Por favor,<br>Insira abaixo o código enviado pare seu<br>e-mail para definir sua senha.";
|
|
2114
2929
|
this.senhaExpiradaText = "Sua senha expirou e precisa ser atualizada.<br>Enviamos um código para o seu e-mail.<br>Insira-o abaixo para definir sua senha.";
|
|
2115
|
-
this.cadeadoImg = 'assets/imgs/
|
|
2116
|
-
this.maoImg = 'assets/imgs/
|
|
2117
|
-
this.calendarioImg = 'assets/imgs/
|
|
2930
|
+
this.cadeadoImg = 'assets/imgs/cadeado.png';
|
|
2931
|
+
this.maoImg = 'assets/imgs/mao.png';
|
|
2932
|
+
this.calendarioImg = 'assets/imgs/calendario-fino.png';
|
|
2118
2933
|
// #region PRIVATE
|
|
2119
2934
|
// #region PUBLIC
|
|
2120
|
-
|
|
2121
|
-
this.form = new FormGroup({});
|
|
2935
|
+
this.isLoading = false;
|
|
2122
2936
|
this.passwordLabel = "";
|
|
2123
|
-
this.statusSenha = 0;
|
|
2124
2937
|
}
|
|
2125
2938
|
ngOnInit() {
|
|
2126
2939
|
this._title.setTitle("Nova Senha");
|
|
@@ -2176,15 +2989,13 @@ class NovaSenhaComponent {
|
|
|
2176
2989
|
/**
|
|
2177
2990
|
* Puxa o nome do servidor salvo na configuração da máquina
|
|
2178
2991
|
*/
|
|
2179
|
-
|
|
2992
|
+
getAuthentication() {
|
|
2180
2993
|
if (this.form.valid) {
|
|
2181
|
-
this.
|
|
2994
|
+
this._authService.getAuthentication(this.domain).subscribe({
|
|
2182
2995
|
next: response => {
|
|
2183
2996
|
},
|
|
2184
2997
|
error: (error) => {
|
|
2185
|
-
|
|
2186
|
-
this._messageService.showAlertDanger(error);
|
|
2187
|
-
throw new Error(error);
|
|
2998
|
+
this._projectUtilservice.showHttpError(error);
|
|
2188
2999
|
},
|
|
2189
3000
|
});
|
|
2190
3001
|
}
|
|
@@ -2197,12 +3008,14 @@ class NovaSenhaComponent {
|
|
|
2197
3008
|
// Envia requisição para recuperar de senha
|
|
2198
3009
|
sendPassword() {
|
|
2199
3010
|
if (this.form.valid) {
|
|
2200
|
-
this.
|
|
3011
|
+
this.isLoading = true;
|
|
3012
|
+
this._authService.getAuthentication(this.domain).subscribe({
|
|
2201
3013
|
next: response => {
|
|
2202
3014
|
this.updatePassword();
|
|
2203
3015
|
},
|
|
2204
3016
|
error: (error) => {
|
|
2205
|
-
|
|
3017
|
+
this.isLoading = false;
|
|
3018
|
+
this._projectUtilservice.showHttpError(error);
|
|
2206
3019
|
},
|
|
2207
3020
|
});
|
|
2208
3021
|
}
|
|
@@ -2214,28 +3027,28 @@ class NovaSenhaComponent {
|
|
|
2214
3027
|
updatePassword() {
|
|
2215
3028
|
if (this.createPassword) {
|
|
2216
3029
|
this._authService.createPassword(this.domain, this.user, this.form.value).subscribe({
|
|
2217
|
-
next: (
|
|
3030
|
+
next: () => {
|
|
3031
|
+
this.isLoading = false;
|
|
2218
3032
|
this._messageService.showAlertSuccess('Você definiu sua senha com sucesso. Preencha suas novas credenciais para acessar o sistema.');
|
|
2219
3033
|
this.cancelar();
|
|
2220
3034
|
},
|
|
2221
3035
|
error: (error) => {
|
|
2222
|
-
|
|
2223
|
-
this.
|
|
2224
|
-
|
|
2225
|
-
},
|
|
3036
|
+
this.isLoading = false;
|
|
3037
|
+
this._projectUtilservice.showHttpError(error);
|
|
3038
|
+
}
|
|
2226
3039
|
});
|
|
2227
3040
|
}
|
|
2228
3041
|
else {
|
|
2229
3042
|
this._authService.recoverPassword(this.domain, this.user, this.form.value).subscribe({
|
|
2230
|
-
next: (
|
|
3043
|
+
next: () => {
|
|
3044
|
+
this.isLoading = false;
|
|
2231
3045
|
this._messageService.showAlertSuccess('Você redefiniu sua senha com sucesso. Preencha suas novas credenciais para acessar o sistema.');
|
|
2232
3046
|
this.cancelar();
|
|
2233
3047
|
},
|
|
2234
3048
|
error: (error) => {
|
|
2235
|
-
|
|
2236
|
-
this.
|
|
2237
|
-
|
|
2238
|
-
},
|
|
3049
|
+
this.isLoading = false;
|
|
3050
|
+
this._projectUtilservice.showHttpError(error);
|
|
3051
|
+
}
|
|
2239
3052
|
});
|
|
2240
3053
|
}
|
|
2241
3054
|
}
|
|
@@ -2266,39 +3079,55 @@ class NovaSenhaComponent {
|
|
|
2266
3079
|
this._authStorageService.logout();
|
|
2267
3080
|
this._router.navigate(["/auth/login"]);
|
|
2268
3081
|
}
|
|
2269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NovaSenhaComponent, deps: [{ token: i3.FormBuilder }, { token:
|
|
2270
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: NovaSenhaComponent, isStandalone: true, selector: "app-nova-senha", ngImport: i0, template: "<body>\n
|
|
3082
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NovaSenhaComponent, deps: [{ token: i3$1.FormBuilder }, { token: ProjectUtilservice }, { token: i3.MessageService }, { token: AuthService }, { token: AuthStorageService }, { token: i8.Title }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3083
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: NovaSenhaComponent, isStandalone: true, selector: "app-nova-senha", ngImport: i0, template: "<body>\n<div id=\"main-container\">\n\t<!-- #region MAIN CONTENT -->\n\t<div class=\"glb-main-container password-container\">\n\t\t<div class=\"password-info-container\">\n\t\t\t<div class=\"img mb-3\">\n\t\t\t\t<img [src]=\"statusSenha == 2 ? calendarioImg : statusSenha == 1 ? maoImg : statusSenha == 3 ? cadeadoImg : '' \" width=\"125.69\" height=\"122\">\n\t\t\t</div>\n\t\t\t<div class=\"text\">\n\t\t\t\t<h4>{{statusSenha == 2 ? 'Senha expirada' : statusSenha == 1 ? 'Primeiro acesso' : statusSenha == 3 ? 'Esqueceu sua senha?' : ''}}</h4>\n\t\t\t\t<p [innerHTML]=\"statusSenha == 2 ? senhaExpiradaText : statusSenha == 1 ? primeiroAcessoText : statusSenha == 3 ? esqueceuSenhaText : '' \"></p>\n\t\t\t</div>\n\t\t</div>\n\t\t<form [formGroup]=\"form\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputCode\" class=\"form-label\"> C\u00F3digo de valida\u00E7\u00E3o <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"text\" placeholder=\"Insira seu c\u00F3digo aqui...\" id=\"inputCode\" class=\"form-control\" formControlName=\"code\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('code'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('code')\" label=\"C\u00F3digo de valida\u00E7\u00E3o\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputPassword\" class=\"form-label\"> Digite uma nova Senha <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Digite sua nova senha...\" id=\"inputPassword\" class=\"form-control\" formControlName=\"password\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('password'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('password')\" label=\"{{ passwordLabel }}\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputConfirmPassword\" class=\"form-label\"> Confirme sua nova Senha <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Digite a senha novamente...\" id=\"inputConfirmPassword\" class=\"form-control\" formControlName=\"confirmPassword\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('confirmPassword'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('confirmPassword')\" label=\"Confirme sua Senha\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t\t<div class=\"btns\">\n\t\t\t\t\t<button [libLoading]=\"isLoading\" loadingText=\"Redefinindo...\" [disabled]=\"isLoading\" (click)=\"sendPassword()\" type=\"button\" class=\"btn btn-primary col w-100\">\n\t\t\t\t\t\tRedefinir senha <lib-icon iconName=\"login\" />\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t<a type=\"button\" class=\"fw-bold text-decoration-none text-secondary\" (click)=\"cancelar()\">\n\t\t\t\t\t\t\t<lib-icon iconName=\"p-seta-esquerda\" /> Voltar para a tela de login </a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t</form>\n\t</div>\n\t<!-- #endregion MAIN CONTENT -->\n</div>\n</body>\n", styles: ["body{background-color:#f5f5f5;height:100%!important;margin:0!important;padding:0!important}#main-container{display:flex;align-items:center;justify-content:center;height:100%}.password-container{padding:30px;width:37%;border:none;box-shadow:0 2px -1px #0000001a}.img{width:26%}.text{display:flex;flex-direction:column;align-items:flex-start;margin-left:auto}.text h4{font-weight:700}.text p{text-align:start}.password-info-container{display:flex;gap:15px}.btns{display:flex;flex-direction:column;align-items:center;width:100%}input::placeholder{color:#8d8d8d;font-size:15px}.icon{margin-right:5px;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.FieldErrorMessageComponent, selector: "app-field-error-message, lib-error-message", inputs: ["customMessage", "control", "label"] }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "directive", type: i3.LoadingBtnDirective, selector: "button[libLoading], a[libLoading]", inputs: ["loadingText", "loadingType", "libLoading"] }], preserveWhitespaces: true }); }
|
|
2271
3084
|
}
|
|
2272
3085
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NovaSenhaComponent, decorators: [{
|
|
2273
3086
|
type: Component,
|
|
2274
|
-
args: [{ selector: 'app-nova-senha',
|
|
2275
|
-
|
|
3087
|
+
args: [{ selector: 'app-nova-senha', imports: [
|
|
3088
|
+
ReactiveFormsModule,
|
|
3089
|
+
InfraModule,
|
|
3090
|
+
], preserveWhitespaces: true, template: "<body>\n<div id=\"main-container\">\n\t<!-- #region MAIN CONTENT -->\n\t<div class=\"glb-main-container password-container\">\n\t\t<div class=\"password-info-container\">\n\t\t\t<div class=\"img mb-3\">\n\t\t\t\t<img [src]=\"statusSenha == 2 ? calendarioImg : statusSenha == 1 ? maoImg : statusSenha == 3 ? cadeadoImg : '' \" width=\"125.69\" height=\"122\">\n\t\t\t</div>\n\t\t\t<div class=\"text\">\n\t\t\t\t<h4>{{statusSenha == 2 ? 'Senha expirada' : statusSenha == 1 ? 'Primeiro acesso' : statusSenha == 3 ? 'Esqueceu sua senha?' : ''}}</h4>\n\t\t\t\t<p [innerHTML]=\"statusSenha == 2 ? senhaExpiradaText : statusSenha == 1 ? primeiroAcessoText : statusSenha == 3 ? esqueceuSenhaText : '' \"></p>\n\t\t\t</div>\n\t\t</div>\n\t\t<form [formGroup]=\"form\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputCode\" class=\"form-label\"> C\u00F3digo de valida\u00E7\u00E3o <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"text\" placeholder=\"Insira seu c\u00F3digo aqui...\" id=\"inputCode\" class=\"form-control\" formControlName=\"code\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('code'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('code')\" label=\"C\u00F3digo de valida\u00E7\u00E3o\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputPassword\" class=\"form-label\"> Digite uma nova Senha <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Digite sua nova senha...\" id=\"inputPassword\" class=\"form-control\" formControlName=\"password\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('password'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('password')\" label=\"{{ passwordLabel }}\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-12 mb-3\">\n\t\t\t\t\t<label for=\"inputConfirmPassword\" class=\"form-label\"> Confirme sua nova Senha <span class=\"text-danger\">*</span></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Digite a senha novamente...\" id=\"inputConfirmPassword\" class=\"form-control\" formControlName=\"confirmPassword\"\n\t\t\t\t\t\t[class.is-invalid]=\"FormUtils.isInvalidField(form.get('confirmPassword'))\">\n\t\t\t\t\t<app-field-error-message [control]=\"form.get('confirmPassword')\" label=\"Confirme sua Senha\"></app-field-error-message>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t\t<div class=\"btns\">\n\t\t\t\t\t<button [libLoading]=\"isLoading\" loadingText=\"Redefinindo...\" [disabled]=\"isLoading\" (click)=\"sendPassword()\" type=\"button\" class=\"btn btn-primary col w-100\">\n\t\t\t\t\t\tRedefinir senha <lib-icon iconName=\"login\" />\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<div class=\"mt-3 text-center\">\n\t\t\t\t\t\t<a type=\"button\" class=\"fw-bold text-decoration-none text-secondary\" (click)=\"cancelar()\">\n\t\t\t\t\t\t\t<lib-icon iconName=\"p-seta-esquerda\" /> Voltar para a tela de login </a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t</form>\n\t</div>\n\t<!-- #endregion MAIN CONTENT -->\n</div>\n</body>\n", styles: ["body{background-color:#f5f5f5;height:100%!important;margin:0!important;padding:0!important}#main-container{display:flex;align-items:center;justify-content:center;height:100%}.password-container{padding:30px;width:37%;border:none;box-shadow:0 2px -1px #0000001a}.img{width:26%}.text{display:flex;flex-direction:column;align-items:flex-start;margin-left:auto}.text h4{font-weight:700}.text p{text-align:start}.password-info-container{display:flex;gap:15px}.btns{display:flex;flex-direction:column;align-items:center;width:100%}input::placeholder{color:#8d8d8d;font-size:15px}.icon{margin-right:5px;font-weight:700}\n"] }]
|
|
3091
|
+
}], ctorParameters: () => [{ type: i3$1.FormBuilder }, { type: ProjectUtilservice }, { type: i3.MessageService }, { type: AuthService }, { type: AuthStorageService }, { type: i8.Title }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }] });
|
|
2276
3092
|
|
|
2277
3093
|
class IMenu {
|
|
2278
3094
|
constructor() {
|
|
3095
|
+
this.ID = 0;
|
|
3096
|
+
this.UNICOID = 0;
|
|
2279
3097
|
this.LABEL = "";
|
|
2280
3098
|
this.DESCRICAO = "";
|
|
2281
3099
|
this.URL = "";
|
|
2282
3100
|
this.CLASS_ICON = "";
|
|
3101
|
+
this.IS_EXIBEMENU = false;
|
|
2283
3102
|
this.URL_DASHBOARD = "";
|
|
2284
3103
|
this.TAG = "";
|
|
2285
|
-
this.
|
|
3104
|
+
this.FK = 0;
|
|
2286
3105
|
}
|
|
2287
3106
|
}
|
|
2288
3107
|
|
|
2289
3108
|
class InfraUsuarioImg {
|
|
2290
3109
|
constructor() {
|
|
2291
|
-
this.
|
|
2292
|
-
this.
|
|
2293
|
-
this.
|
|
2294
|
-
this.
|
|
2295
|
-
this.
|
|
2296
|
-
this.
|
|
2297
|
-
this.
|
|
3110
|
+
this.TENANT_ID = 0;
|
|
3111
|
+
this.ID = 0;
|
|
3112
|
+
this.IMAGEM = "";
|
|
3113
|
+
this.FILENAME = "";
|
|
3114
|
+
this.DATACRIACAO = new Date();
|
|
3115
|
+
this.IS_ACTIVE = false;
|
|
3116
|
+
this.USUARIOID = "";
|
|
2298
3117
|
}
|
|
2299
3118
|
}
|
|
2300
3119
|
|
|
2301
|
-
class
|
|
3120
|
+
class RetNavSubMenu {
|
|
3121
|
+
constructor() {
|
|
3122
|
+
this.Error = false;
|
|
3123
|
+
this.ErrorMessage = "";
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
class RetSubmenuWithCards {
|
|
3127
|
+
constructor() {
|
|
3128
|
+
this.Error = false;
|
|
3129
|
+
this.ErrorMessage = "";
|
|
3130
|
+
}
|
|
2302
3131
|
}
|
|
2303
3132
|
|
|
2304
3133
|
class AuthGuard {
|
|
@@ -2331,11 +3160,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2331
3160
|
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthStorageService }] });
|
|
2332
3161
|
|
|
2333
3162
|
class ExternaLoginlGuard {
|
|
2334
|
-
constructor(router, authService, authStorageService
|
|
3163
|
+
constructor(router, authService, authStorageService) {
|
|
2335
3164
|
this.router = router;
|
|
2336
3165
|
this.authService = authService;
|
|
2337
3166
|
this.authStorageService = authStorageService;
|
|
2338
|
-
this.serverService = serverService;
|
|
2339
3167
|
}
|
|
2340
3168
|
canActivate(_route, _state) {
|
|
2341
3169
|
let param = atob(_route.paramMap.get('param'));
|
|
@@ -2364,7 +3192,7 @@ class ExternaLoginlGuard {
|
|
|
2364
3192
|
}
|
|
2365
3193
|
// Executa o Login Externo
|
|
2366
3194
|
async logOnExternal(domain, user, password) {
|
|
2367
|
-
const retConfig = await this.
|
|
3195
|
+
const retConfig = await this.handleGetAuthentication(domain);
|
|
2368
3196
|
if (!retConfig) {
|
|
2369
3197
|
return this.navigateToError();
|
|
2370
3198
|
}
|
|
@@ -2380,9 +3208,9 @@ class ExternaLoginlGuard {
|
|
|
2380
3208
|
}
|
|
2381
3209
|
}
|
|
2382
3210
|
// Retorna os parâmetros de configuração.
|
|
2383
|
-
|
|
3211
|
+
getAuthentication(domain) {
|
|
2384
3212
|
return new Promise((resolve, reject) => {
|
|
2385
|
-
this.
|
|
3213
|
+
this.authService.getAuthentication(domain).subscribe({
|
|
2386
3214
|
next: response => {
|
|
2387
3215
|
resolve(true);
|
|
2388
3216
|
},
|
|
@@ -2393,22 +3221,22 @@ class ExternaLoginlGuard {
|
|
|
2393
3221
|
});
|
|
2394
3222
|
}
|
|
2395
3223
|
// Handle para busca dos parâmetros de configuração.
|
|
2396
|
-
async
|
|
3224
|
+
async handleGetAuthentication(domain) {
|
|
2397
3225
|
try {
|
|
2398
|
-
const response = await this.
|
|
3226
|
+
const response = await this.getAuthentication(domain);
|
|
2399
3227
|
return true;
|
|
2400
3228
|
}
|
|
2401
3229
|
catch (error) {
|
|
2402
3230
|
return false;
|
|
2403
3231
|
}
|
|
2404
3232
|
}
|
|
2405
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExternaLoginlGuard, deps: [{ token: i1$1.Router }, { token: AuthService }, { token: AuthStorageService }
|
|
3233
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExternaLoginlGuard, deps: [{ token: i1$1.Router }, { token: AuthService }, { token: AuthStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2406
3234
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExternaLoginlGuard, providedIn: 'root' }); }
|
|
2407
3235
|
}
|
|
2408
3236
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExternaLoginlGuard, decorators: [{
|
|
2409
3237
|
type: Injectable,
|
|
2410
3238
|
args: [{ providedIn: 'root' }]
|
|
2411
|
-
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthService }, { type: AuthStorageService }
|
|
3239
|
+
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthService }, { type: AuthStorageService }] });
|
|
2412
3240
|
|
|
2413
3241
|
/**
|
|
2414
3242
|
* Protege a página de login de ser carregada quando o usuário já está logado,
|
|
@@ -2441,6 +3269,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2441
3269
|
args: [{ providedIn: 'root' }]
|
|
2442
3270
|
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthStorageService }] });
|
|
2443
3271
|
|
|
3272
|
+
/** Protege a página de processamento de login integrado OS, só permite acessá-la se o payload for informado corretamente. */
|
|
3273
|
+
class LoginOSGuard {
|
|
3274
|
+
constructor(_router, _loginOSService) {
|
|
3275
|
+
this._router = _router;
|
|
3276
|
+
this._loginOSService = _loginOSService;
|
|
3277
|
+
}
|
|
3278
|
+
canActivate(route, state) {
|
|
3279
|
+
const payload = route.queryParamMap.get('payload');
|
|
3280
|
+
if (payload && payload.trim().length > 0) {
|
|
3281
|
+
return true;
|
|
3282
|
+
}
|
|
3283
|
+
else {
|
|
3284
|
+
this._loginOSService.setPendingWarning('Login integrado falhou: o parâmetro "payload" está inválido ou ausente');
|
|
3285
|
+
return this._router.parseUrl('/auth/login');
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginOSGuard, deps: [{ token: i1$1.Router }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3289
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginOSGuard, providedIn: 'root' }); }
|
|
3290
|
+
}
|
|
3291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LoginOSGuard, decorators: [{
|
|
3292
|
+
type: Injectable,
|
|
3293
|
+
args: [{ providedIn: 'root' }]
|
|
3294
|
+
}], ctorParameters: () => [{ type: i1$1.Router }, { type: AuthService }] });
|
|
3295
|
+
;
|
|
3296
|
+
|
|
2444
3297
|
/**
|
|
2445
3298
|
* \brief Intercepta uma chamada HTTP para inserir o usuário logado no header em conjunto
|
|
2446
3299
|
* com o login para uso da API.
|
|
@@ -2448,10 +3301,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2448
3301
|
* Depende do serviço de autenticação.
|
|
2449
3302
|
*/
|
|
2450
3303
|
class AuthAplicInterceptor {
|
|
2451
|
-
constructor(authCheckService,
|
|
3304
|
+
constructor(authCheckService, token, _environmentService) {
|
|
2452
3305
|
this.authCheckService = authCheckService;
|
|
2453
|
-
this._environmentService = _environmentService;
|
|
2454
3306
|
this.token = token;
|
|
3307
|
+
this._environmentService = _environmentService;
|
|
2455
3308
|
}
|
|
2456
3309
|
intercept(req, next) {
|
|
2457
3310
|
// convert promise to observable using 'from' operator
|
|
@@ -2468,13 +3321,13 @@ class AuthAplicInterceptor {
|
|
|
2468
3321
|
}
|
|
2469
3322
|
return await lastValueFrom(next.handle(changedReq));
|
|
2470
3323
|
}
|
|
2471
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthAplicInterceptor, deps: [{ token:
|
|
3324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthAplicInterceptor, deps: [{ token: i3.CheckUrlAndMethodService }, { token: AuthStorageService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2472
3325
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthAplicInterceptor, providedIn: 'root' }); }
|
|
2473
3326
|
}
|
|
2474
3327
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthAplicInterceptor, decorators: [{
|
|
2475
3328
|
type: Injectable,
|
|
2476
3329
|
args: [{ providedIn: 'root' }]
|
|
2477
|
-
}], ctorParameters: () => [{ type:
|
|
3330
|
+
}], ctorParameters: () => [{ type: i3.CheckUrlAndMethodService }, { type: AuthStorageService }, { type: EnvironmentService }] });
|
|
2478
3331
|
|
|
2479
3332
|
/**
|
|
2480
3333
|
* \brief Intercepta uma chamada HTTP para inserir a autenticação da Sispro.
|
|
@@ -2494,17 +3347,22 @@ class AuthInfraInterceptor {
|
|
|
2494
3347
|
}
|
|
2495
3348
|
return next.handle(changedReq);
|
|
2496
3349
|
}
|
|
2497
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthInfraInterceptor, deps: [{ token:
|
|
3350
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthInfraInterceptor, deps: [{ token: i3.CheckUrlAndMethodService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2498
3351
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthInfraInterceptor, providedIn: 'root' }); }
|
|
2499
3352
|
}
|
|
2500
3353
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthInfraInterceptor, decorators: [{
|
|
2501
3354
|
type: Injectable,
|
|
2502
3355
|
args: [{ providedIn: 'root' }]
|
|
2503
|
-
}], ctorParameters: () => [{ type:
|
|
3356
|
+
}], ctorParameters: () => [{ type: i3.CheckUrlAndMethodService }, { type: EnvironmentService }] });
|
|
3357
|
+
|
|
3358
|
+
const AUTH_ROUTES = [
|
|
3359
|
+
{ path: '', component: LoginComponent, data: { title: "SisproERP | Meu portal" } },
|
|
3360
|
+
{ path: 'novaSenha/:param', component: NovaSenhaComponent, data: { title: "Nova Senha" } }
|
|
3361
|
+
];
|
|
2504
3362
|
|
|
2505
3363
|
/**
|
|
2506
3364
|
* Generated bundle index. Do not edit.
|
|
2507
3365
|
*/
|
|
2508
3366
|
|
|
2509
|
-
export { AuthAplicInterceptor, AuthGuard, AuthInfraInterceptor, AuthModule, AuthService, AuthStorageService,
|
|
3367
|
+
export { AUTH_ROUTES, AuthAplicInterceptor, AuthGuard, AuthInfraInterceptor, AuthModule, AuthService, AuthStorageService, DynamicMenuComponent, EnvironmentService, ExternaLoginlGuard, IMenu, InfraUsuarioImg, LibCustomLoginService, LibCustomMenuService, LibCustomStorageService, LibMenuConfigService, LoginComponent, LoginGuard, LoginOSComponent, LoginOSGuard, LoginProgress, MenuLateralComponent, MenuServicesService, NotifSubmenuComponent, NovaSenhaComponent, PrimaryDropdownComponent, RetNavSubMenu, RetSubmenuWithCards, SecondaryDropdownComponent, SelecaoEstabelecimentosModalComponent, SituacaoLogin };
|
|
2510
3368
|
//# sourceMappingURL=ngx-sp-auth.mjs.map
|