exceladdincbms-v2 5.12.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/exceladdincbms.mjs +5 -0
- package/esm2022/lib/auth.service.mjs +56 -61
- package/esm2022/lib/base-app.service.mjs +41 -41
- package/esm2022/lib/bulk-tool.component.mjs +19 -19
- package/esm2022/lib/bulk-tool.module.mjs +51 -52
- package/esm2022/lib/constant.enum.mjs +5 -5
- package/esm2022/lib/environmentsModel.info.mjs +3 -2
- package/esm2022/lib/http-interceptor.mjs +25 -25
- package/esm2022/lib/login/login.component.mjs +111 -158
- package/esm2022/lib/materils/materils.module.mjs +177 -178
- package/esm2022/lib/menu/menu.component.mjs +187 -293
- package/esm2022/public_api.mjs +9 -9
- package/fesm2022/exceladdincbms.mjs +646 -0
- package/fesm2022/exceladdincbms.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/auth.service.d.ts +18 -20
- package/lib/base-app.service.d.ts +16 -16
- package/lib/bulk-tool.component.d.ts +8 -8
- package/lib/bulk-tool.module.d.ts +17 -17
- package/lib/constant.enum.d.ts +5 -5
- package/lib/environmentsModel.info.d.ts +9 -5
- package/lib/http-interceptor.d.ts +8 -8
- package/lib/login/login.component.d.ts +32 -32
- package/lib/materils/materils.module.d.ts +46 -46
- package/lib/menu/menu.component.d.ts +49 -51
- package/package.json +7 -7
- package/public_api.d.ts +6 -6
- package/src/styles.css +44 -0
- package/esm2022/exceladdincbms-v1.mjs +0 -5
- package/fesm2022/exceladdincbms-v1.mjs +0 -806
- package/fesm2022/exceladdincbms-v1.mjs.map +0 -1
|
@@ -1,806 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, Inject, Input, NgModule } from '@angular/core';
|
|
3
|
-
import * as i3 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i2 from '@angular/router';
|
|
6
|
-
import { RouterModule } from '@angular/router';
|
|
7
|
-
import * as i1$1 from '@angular/forms';
|
|
8
|
-
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import { first } from 'rxjs/operators';
|
|
10
|
-
import * as i1 from '@angular/common/http';
|
|
11
|
-
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
|
12
|
-
import { map } from 'rxjs';
|
|
13
|
-
import * as i6 from '@angular/material/button';
|
|
14
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
15
|
-
import * as i7 from '@angular/material/icon';
|
|
16
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
17
|
-
import * as i8 from '@angular/material/form-field';
|
|
18
|
-
import * as i9 from '@angular/material/input';
|
|
19
|
-
import { MatInputModule } from '@angular/material/input';
|
|
20
|
-
import * as i10 from '@angular/material/progress-spinner';
|
|
21
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
22
|
-
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
23
|
-
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
24
|
-
import { CdkTableModule } from '@angular/cdk/table';
|
|
25
|
-
import { CdkTreeModule } from '@angular/cdk/tree';
|
|
26
|
-
import { A11yModule } from '@angular/cdk/a11y';
|
|
27
|
-
import { OverlayModule } from '@angular/cdk/overlay';
|
|
28
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
29
|
-
import { MatBadgeModule } from '@angular/material/badge';
|
|
30
|
-
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
|
31
|
-
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
32
|
-
import { MatCardModule } from '@angular/material/card';
|
|
33
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
34
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
35
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
36
|
-
import { MatDialogModule } from '@angular/material/dialog';
|
|
37
|
-
import { MatDividerModule } from '@angular/material/divider';
|
|
38
|
-
import { MatExpansionModule } from '@angular/material/expansion';
|
|
39
|
-
import { MatGridListModule } from '@angular/material/grid-list';
|
|
40
|
-
import { MatListModule } from '@angular/material/list';
|
|
41
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
42
|
-
import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
|
|
43
|
-
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
44
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
45
|
-
import { MatRadioModule } from '@angular/material/radio';
|
|
46
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
47
|
-
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
48
|
-
import { MatSliderModule } from '@angular/material/slider';
|
|
49
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
50
|
-
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
51
|
-
import { MatSortModule } from '@angular/material/sort';
|
|
52
|
-
import { MatStepperModule } from '@angular/material/stepper';
|
|
53
|
-
import { MatTableModule } from '@angular/material/table';
|
|
54
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
55
|
-
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
56
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
57
|
-
import { MatTreeModule } from '@angular/material/tree';
|
|
58
|
-
|
|
59
|
-
class BaseAppService {
|
|
60
|
-
userInfo;
|
|
61
|
-
userMenus;
|
|
62
|
-
menuName;
|
|
63
|
-
getUserInfo() {
|
|
64
|
-
return this.userInfo;
|
|
65
|
-
}
|
|
66
|
-
setUserInfo(value) {
|
|
67
|
-
this.userInfo = value;
|
|
68
|
-
}
|
|
69
|
-
removeUserInfo() {
|
|
70
|
-
this.userInfo = null;
|
|
71
|
-
}
|
|
72
|
-
setUserMenus(data) {
|
|
73
|
-
this.userMenus = data;
|
|
74
|
-
}
|
|
75
|
-
getUserMenus() {
|
|
76
|
-
return this.userMenus;
|
|
77
|
-
}
|
|
78
|
-
clearData() {
|
|
79
|
-
this.userInfo = undefined;
|
|
80
|
-
this.userMenus = undefined;
|
|
81
|
-
}
|
|
82
|
-
setmenuNameFromBudget(name) {
|
|
83
|
-
this.menuName = name;
|
|
84
|
-
}
|
|
85
|
-
getmenuNameFromBudget() {
|
|
86
|
-
return this.menuName;
|
|
87
|
-
}
|
|
88
|
-
/** @nocollapse */ static ɵfac = function BaseAppService_Factory(t) { return new (t || BaseAppService)(); };
|
|
89
|
-
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: BaseAppService, factory: BaseAppService.ɵfac, providedIn: 'root' });
|
|
90
|
-
}
|
|
91
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseAppService, [{
|
|
92
|
-
type: Injectable,
|
|
93
|
-
args: [{
|
|
94
|
-
providedIn: 'root'
|
|
95
|
-
}]
|
|
96
|
-
}], null, null); })();
|
|
97
|
-
|
|
98
|
-
class BulkToolComponent {
|
|
99
|
-
constructor() { }
|
|
100
|
-
ngOnInit() {
|
|
101
|
-
}
|
|
102
|
-
/** @nocollapse */ static ɵfac = function BulkToolComponent_Factory(t) { return new (t || BulkToolComponent)(); };
|
|
103
|
-
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BulkToolComponent, selectors: [["lib-BulkTool"]], decls: 2, vars: 0, template: function BulkToolComponent_Template(rf, ctx) { if (rf & 1) {
|
|
104
|
-
i0.ɵɵelementStart(0, "p");
|
|
105
|
-
i0.ɵɵtext(1, " bulk-tool works! ");
|
|
106
|
-
i0.ɵɵelementEnd();
|
|
107
|
-
} }, encapsulation: 2 });
|
|
108
|
-
}
|
|
109
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BulkToolComponent, [{
|
|
110
|
-
type: Component,
|
|
111
|
-
args: [{ selector: 'lib-BulkTool', template: `
|
|
112
|
-
<p>
|
|
113
|
-
bulk-tool works!
|
|
114
|
-
</p>
|
|
115
|
-
` }]
|
|
116
|
-
}], function () { return []; }, null); })();
|
|
117
|
-
|
|
118
|
-
const Constant = {
|
|
119
|
-
APPSERVICEURL: 'https://localhost:44348/api',
|
|
120
|
-
APPSERVICEPRODURL: 'https://tk4addin.dev.summitenergy.com/appservices/api',
|
|
121
|
-
INVALID: "Invalid Username or Password"
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
class AuthService {
|
|
125
|
-
config;
|
|
126
|
-
http;
|
|
127
|
-
injector;
|
|
128
|
-
baseAppService;
|
|
129
|
-
API_ENDPOINT;
|
|
130
|
-
menuName;
|
|
131
|
-
//private RM_ENDPOINT = this.injector.get("config").apiBaseUrl;
|
|
132
|
-
//private headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' });
|
|
133
|
-
constructor(config, http, injector, baseAppService) {
|
|
134
|
-
this.config = config;
|
|
135
|
-
this.http = http;
|
|
136
|
-
this.injector = injector;
|
|
137
|
-
this.baseAppService = baseAppService;
|
|
138
|
-
this.API_ENDPOINT = config.baseAppApiUrl;
|
|
139
|
-
this.menuName = config.moduleName;
|
|
140
|
-
}
|
|
141
|
-
//private postheaders = new Headers({'Content-Type': 'application/json'});
|
|
142
|
-
login(username, password) {
|
|
143
|
-
return this.http.post(this.API_ENDPOINT + "/Login", { username, password })
|
|
144
|
-
.pipe(map(user => {
|
|
145
|
-
if (user.status != "Invalid") {
|
|
146
|
-
console.log(user);
|
|
147
|
-
localStorage.clear();
|
|
148
|
-
localStorage.setItem('UserInfo', JSON.stringify(user));
|
|
149
|
-
this.baseAppService.setUserInfo(user);
|
|
150
|
-
}
|
|
151
|
-
return user;
|
|
152
|
-
}));
|
|
153
|
-
}
|
|
154
|
-
logout() {
|
|
155
|
-
this.baseAppService.clearData();
|
|
156
|
-
localStorage.clear();
|
|
157
|
-
}
|
|
158
|
-
GetMenu(userId) {
|
|
159
|
-
return this.http.get(this.API_ENDPOINT + '/userMenus?userId=' + userId + '&menu=' + this.menuName)
|
|
160
|
-
.pipe(map(res => {
|
|
161
|
-
this.baseAppService.setUserMenus(res);
|
|
162
|
-
return res;
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
/** @nocollapse */ static ɵfac = function AuthService_Factory(t) { return new (t || AuthService)(i0.ɵɵinject('config'), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(BaseAppService)); };
|
|
166
|
-
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: AuthService, factory: AuthService.ɵfac, providedIn: 'root' });
|
|
167
|
-
}
|
|
168
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthService, [{
|
|
169
|
-
type: Injectable,
|
|
170
|
-
args: [{
|
|
171
|
-
providedIn: 'root'
|
|
172
|
-
}]
|
|
173
|
-
}], function () { return [{ type: undefined, decorators: [{
|
|
174
|
-
type: Inject,
|
|
175
|
-
args: ['config']
|
|
176
|
-
}] }, { type: i1.HttpClient }, { type: i0.Injector }, { type: BaseAppService }]; }, null); })();
|
|
177
|
-
|
|
178
|
-
function LoginComponent_div_20_Template(rf, ctx) { if (rf & 1) {
|
|
179
|
-
i0.ɵɵelementStart(0, "div", 13);
|
|
180
|
-
i0.ɵɵtext(1);
|
|
181
|
-
i0.ɵɵelementEnd();
|
|
182
|
-
} if (rf & 2) {
|
|
183
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
184
|
-
i0.ɵɵadvance(1);
|
|
185
|
-
i0.ɵɵtextInterpolate(ctx_r0.error);
|
|
186
|
-
} }
|
|
187
|
-
function LoginComponent_section_21_Template(rf, ctx) { if (rf & 1) {
|
|
188
|
-
i0.ɵɵelementStart(0, "section", 14);
|
|
189
|
-
i0.ɵɵelement(1, "mat-spinner", 15);
|
|
190
|
-
i0.ɵɵelementStart(2, "span");
|
|
191
|
-
i0.ɵɵtext(3, " Logging... ");
|
|
192
|
-
i0.ɵɵelementEnd()();
|
|
193
|
-
} if (rf & 2) {
|
|
194
|
-
i0.ɵɵadvance(1);
|
|
195
|
-
i0.ɵɵproperty("diameter", 60);
|
|
196
|
-
} }
|
|
197
|
-
class LoginComponent {
|
|
198
|
-
formBuilder;
|
|
199
|
-
route;
|
|
200
|
-
router;
|
|
201
|
-
location;
|
|
202
|
-
authenticationService;
|
|
203
|
-
baseAppService;
|
|
204
|
-
isLoading = false;
|
|
205
|
-
routeUrl;
|
|
206
|
-
loginForm;
|
|
207
|
-
submitted = false;
|
|
208
|
-
returnUrl;
|
|
209
|
-
error = '';
|
|
210
|
-
userInfo;
|
|
211
|
-
constructor(formBuilder, route, router, location, authenticationService, baseAppService) {
|
|
212
|
-
this.formBuilder = formBuilder;
|
|
213
|
-
this.route = route;
|
|
214
|
-
this.router = router;
|
|
215
|
-
this.location = location;
|
|
216
|
-
this.authenticationService = authenticationService;
|
|
217
|
-
this.baseAppService = baseAppService;
|
|
218
|
-
let userObject = localStorage.getItem("UserInfo");
|
|
219
|
-
this.userInfo = JSON.parse(userObject);
|
|
220
|
-
this.baseAppService.setUserInfo(this.userInfo);
|
|
221
|
-
}
|
|
222
|
-
isvalidUser = true;
|
|
223
|
-
ngOnInit() {
|
|
224
|
-
this.loginForm = this.formBuilder.group({
|
|
225
|
-
username: ['', Validators.required],
|
|
226
|
-
password: ['', Validators.required]
|
|
227
|
-
});
|
|
228
|
-
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || this.routeUrl;
|
|
229
|
-
//Checking User already logged in or not
|
|
230
|
-
let isNavigate = localStorage.getItem("IsNavigate");
|
|
231
|
-
if (this.location.path() !== '' && this.location.path().indexOf('UserId') !== -1) {
|
|
232
|
-
let userId = this.location.path().split('?')[1].split('UserId=')[1];
|
|
233
|
-
if (userId == this.userInfo.userInfoId) {
|
|
234
|
-
this.router.navigate([this.returnUrl]);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else if (JSON.parse(isNavigate) == true) {
|
|
239
|
-
if (this.userInfo) {
|
|
240
|
-
console.log("Login After naviagtion-", this.returnUrl);
|
|
241
|
-
localStorage.removeItem("IsNavigate");
|
|
242
|
-
this.router.navigate([this.returnUrl]);
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
get formsData() { return this.loginForm.controls; }
|
|
248
|
-
onLogin() {
|
|
249
|
-
this.submitted = true;
|
|
250
|
-
this.isLoading = true;
|
|
251
|
-
// stop here if form is invalid
|
|
252
|
-
if (this.loginForm.invalid) {
|
|
253
|
-
this.isLoading = false;
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
//this.submitClick = true;
|
|
257
|
-
this.authenticationService.login(this.formsData.username.value, this.formsData.password.value)
|
|
258
|
-
.pipe(first())
|
|
259
|
-
.subscribe(data => {
|
|
260
|
-
console.log(data.status);
|
|
261
|
-
if (data.status === "InValid") {
|
|
262
|
-
this.isLoading = false;
|
|
263
|
-
this.isvalidUser = false;
|
|
264
|
-
this.error = Constant.INVALID;
|
|
265
|
-
this.router.navigate(["/login"]);
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
console.log("Login Success-", this.returnUrl);
|
|
269
|
-
this.isLoading = false;
|
|
270
|
-
this.router.navigate([this.returnUrl]);
|
|
271
|
-
}
|
|
272
|
-
}, error => {
|
|
273
|
-
this.isLoading = false;
|
|
274
|
-
this.error = Constant.INVALID;
|
|
275
|
-
this.router.navigate(["/login"]);
|
|
276
|
-
//this.submitClick = true;
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
/** @nocollapse */ static ɵfac = function LoginComponent_Factory(t) { return new (t || LoginComponent)(i0.ɵɵdirectiveInject(i1$1.FormBuilder), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i3.Location), i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(BaseAppService)); };
|
|
280
|
-
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: LoginComponent, selectors: [["lib-login"]], inputs: { routeUrl: "routeUrl" }, decls: 22, vars: 3, consts: [[1, "container"], [1, "loginForm"], [1, "example-sidenav-content"], [1, "loginWidget"], [3, "formGroup"], [1, "form-group"], ["color", "primary", 1, "example-full-width"], ["formControlName", "username", "type", "text", "matInput", "", "placeholder", "Enter Username ", 1, "toolbar-search"], ["matSuffix", "", 2, "font-size", "1.2em"], ["formControlName", "password", "type", "password", "matInput", "", "placeholder", "Enter Password ", 1, "toolbar-search"], ["mat-button", "", 1, "!loginForm.valid", "btn", "btn-primary", 2, "background-color", "#0888CA", "color", "#fff", 3, "click"], ["class", "alert alert-danger", 4, "ngIf"], ["class", "loade", 4, "ngIf"], [1, "alert", "alert-danger"], [1, "loade"], ["color", "black", 3, "diameter"]], template: function LoginComponent_Template(rf, ctx) { if (rf & 1) {
|
|
281
|
-
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "div", 3)(4, "form", 4)(5, "h2");
|
|
282
|
-
i0.ɵɵtext(6, "Login");
|
|
283
|
-
i0.ɵɵelementEnd();
|
|
284
|
-
i0.ɵɵelementStart(7, "div");
|
|
285
|
-
i0.ɵɵtext(8, "\u00A0");
|
|
286
|
-
i0.ɵɵelementEnd();
|
|
287
|
-
i0.ɵɵelementStart(9, "div", 5)(10, "mat-form-field", 6);
|
|
288
|
-
i0.ɵɵelement(11, "input", 7)(12, "mat-icon", 8);
|
|
289
|
-
i0.ɵɵelementEnd()();
|
|
290
|
-
i0.ɵɵelementStart(13, "div", 5)(14, "mat-form-field", 6);
|
|
291
|
-
i0.ɵɵelement(15, "input", 9)(16, "mat-icon", 8);
|
|
292
|
-
i0.ɵɵelementEnd()();
|
|
293
|
-
i0.ɵɵelementStart(17, "div", 5)(18, "button", 10);
|
|
294
|
-
i0.ɵɵlistener("click", function LoginComponent_Template_button_click_18_listener() { return ctx.onLogin(); });
|
|
295
|
-
i0.ɵɵtext(19, "Login");
|
|
296
|
-
i0.ɵɵelementEnd()();
|
|
297
|
-
i0.ɵɵtemplate(20, LoginComponent_div_20_Template, 2, 1, "div", 11);
|
|
298
|
-
i0.ɵɵelementEnd()();
|
|
299
|
-
i0.ɵɵtemplate(21, LoginComponent_section_21_Template, 4, 1, "section", 12);
|
|
300
|
-
i0.ɵɵelementEnd()()();
|
|
301
|
-
} if (rf & 2) {
|
|
302
|
-
i0.ɵɵadvance(4);
|
|
303
|
-
i0.ɵɵproperty("formGroup", ctx.loginForm);
|
|
304
|
-
i0.ɵɵadvance(16);
|
|
305
|
-
i0.ɵɵproperty("ngIf", !ctx.isvalidUser);
|
|
306
|
-
i0.ɵɵadvance(1);
|
|
307
|
-
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
308
|
-
} }, dependencies: [i6.MatButton, i7.MatIcon, i8.MatFormField, i8.MatSuffix, i9.MatInput, i10.MatSpinner, i1$1.ɵNgNoValidate, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.NgControlStatusGroup, i3.NgIf, i1$1.FormGroupDirective, i1$1.FormControlName], styles: ["body[_ngcontent-%COMP%]{background:#f4fafd}.loginForm[_ngcontent-%COMP%]{border-radius:0;background:#fff;width:90%;max-width:450px;padding:15px;text-align:left;margin:60px auto;border:#f4f4f4 solid 1px;box-shadow:4px 2px 5px -2px #c2b3c2} .mat-button, .mat-flat-button[_ngcontent-%COMP%], .mat-icon-button[_ngcontent-%COMP%], .mat-stroked-button[_ngcontent-%COMP%]{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:28px!important;padding:0 16px;border-radius:4px;overflow:visible}.nb-spinner[_ngcontent-%COMP%]{width:75pxx;height:75px;margin:0;background:transparent;border-top:4px solid #03A9F4;border-right:4px solid transparent;border-radius:50%;animation:1s spin linear infinite}.loade[_ngcontent-%COMP%]{background:rgba(255,255,255,.5);width:100%;height:100%;overflow:hidden;padding-left:67px;position:absolute;z-index:1;opacity:50;top:0;padding-top:135px}.square-spinner[_ngcontent-%COMP%]{width:55px;display:block;background-color:#03a9f4;height:55px;animation:3s flip ease-in-out infinite} .mat-spinner circle{stroke:green;stroke-width:10%}mat-form-field[_ngcontent-%COMP%]{width:100%}"] });
|
|
309
|
-
}
|
|
310
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoginComponent, [{
|
|
311
|
-
type: Component,
|
|
312
|
-
args: [{ selector: 'lib-login', template: "\r\n<div class=\"container\">\r\n <div class=\"loginForm\">\r\n <div class=\"example-sidenav-content\">\r\n <div class=\"loginWidget\">\r\n <form [formGroup]=\"loginForm\" >\r\n <h2>Login</h2>\r\n <div> </div>\r\n <div class=\"form-group\">\r\n <!-- <label for=\"username\">Username</label> -->\r\n <!-- <input type=\"text\" formControlName=\"username\" class=\"form-control\"\r\n [ngClass]=\"{ 'is-invalid': submitted && formsData.username.errors }\" /> -->\r\n <mat-form-field class=\"example-full-width\"\r\n color=\"primary\">\r\n <input class=\"toolbar-search\" formControlName=\"username\" type=\"text\" matInput placeholder=\"Enter Username \">\r\n <mat-icon matSuffix style=\"font-size: 1.2em\"></mat-icon>\r\n </mat-form-field>\r\n <!-- <div *ngIf=\"submitted && formsData.username.errors\" class=\"invalid-feedback\">\r\n <div *ngIf=\"formsData.username.errors.required\">Username is required</div>\r\n </div> -->\r\n </div>\r\n <div class=\"form-group\">\r\n <!-- <label for=\"password\">Password</label> -->\r\n <!-- <input type=\"password\" formControlName=\"password\" class=\"form-control\"\r\n [ngClass]=\"{ 'is-invalid': submitted && formsData.password.errors }\" /> -->\r\n <mat-form-field class=\"example-full-width\"\r\n color=\"primary\">\r\n <input class=\"toolbar-search\" formControlName=\"password\" type=\"password\" matInput placeholder=\"Enter Password \">\r\n <mat-icon matSuffix style=\"font-size: 1.2em\"></mat-icon>\r\n </mat-form-field>\r\n <!-- <div *ngIf=\"submitted && formsData.password.errors\" class=\"invalid-feedback\">\r\n <div *ngIf=\"formsData.password.errors.required\">Password is required</div>\r\n </div> -->\r\n </div>\r\n <div class=\"form-group\">\r\n <!-- <button [disabled]=\"submitClick\" class=\"btn btn-primary\">Login</button> -->\r\n <button style=\"background-color: #0888CA;color: #fff;\" mat-button class=\"!loginForm.valid btn btn-primary\" (click)=\"onLogin()\">Login</button>\r\n </div>\r\n <div *ngIf =\"!isvalidUser\" class=\"alert alert-danger\">{{error}}</div>\r\n </form>\r\n </div>\r\n\r\n <section class=\"loade\" *ngIf=\"isLoading\">\r\n <mat-spinner color=\"black\" [diameter]=60 ></mat-spinner>\r\n <span>\r\n Logging...\r\n </span>\r\n </section>\r\n\r\n \r\n <!-- <button type=\"button\" mat-button (click)=\"drawer.toggle()\">\r\n Toggle sidenav\r\n</button> -->\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n", styles: ["body{background:#f4fafd}.loginForm{border-radius:0;background:#fff;width:90%;max-width:450px;padding:15px;text-align:left;margin:60px auto;border:#f4f4f4 solid 1px;box-shadow:4px 2px 5px -2px #c2b3c2}::ng-deep .mat-button,.mat-flat-button,.mat-icon-button,.mat-stroked-button{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:28px!important;padding:0 16px;border-radius:4px;overflow:visible}.nb-spinner{width:75pxx;height:75px;margin:0;background:transparent;border-top:4px solid #03A9F4;border-right:4px solid transparent;border-radius:50%;animation:1s spin linear infinite}.loade{background:rgba(255,255,255,.5);width:100%;height:100%;overflow:hidden;padding-left:67px;position:absolute;z-index:1;opacity:50;top:0;padding-top:135px}.square-spinner{width:55px;display:block;background-color:#03a9f4;height:55px;animation:3s flip ease-in-out infinite}::ng-deep .mat-spinner circle{stroke:green;stroke-width:10%}mat-form-field{width:100%}\n"] }]
|
|
313
|
-
}], function () { return [{ type: i1$1.FormBuilder }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: i3.Location }, { type: AuthService }, { type: BaseAppService }]; }, { routeUrl: [{
|
|
314
|
-
type: Input
|
|
315
|
-
}] }); })();
|
|
316
|
-
|
|
317
|
-
class MaterilsModule {
|
|
318
|
-
/** @nocollapse */ static ɵfac = function MaterilsModule_Factory(t) { return new (t || MaterilsModule)(); };
|
|
319
|
-
/** @nocollapse */ static ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: MaterilsModule });
|
|
320
|
-
/** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ imports: [A11yModule,
|
|
321
|
-
CdkTableModule,
|
|
322
|
-
CdkTreeModule,
|
|
323
|
-
DragDropModule,
|
|
324
|
-
MatAutocompleteModule,
|
|
325
|
-
MatBadgeModule,
|
|
326
|
-
MatBottomSheetModule,
|
|
327
|
-
MatButtonModule,
|
|
328
|
-
MatButtonToggleModule,
|
|
329
|
-
MatCardModule,
|
|
330
|
-
MatCheckboxModule,
|
|
331
|
-
MatChipsModule,
|
|
332
|
-
MatStepperModule,
|
|
333
|
-
MatDatepickerModule,
|
|
334
|
-
MatDialogModule,
|
|
335
|
-
MatDividerModule,
|
|
336
|
-
MatExpansionModule,
|
|
337
|
-
MatGridListModule,
|
|
338
|
-
MatIconModule,
|
|
339
|
-
MatInputModule,
|
|
340
|
-
MatListModule,
|
|
341
|
-
MatMenuModule,
|
|
342
|
-
MatNativeDateModule,
|
|
343
|
-
MatPaginatorModule,
|
|
344
|
-
MatProgressBarModule,
|
|
345
|
-
MatProgressSpinnerModule,
|
|
346
|
-
MatRadioModule,
|
|
347
|
-
MatRippleModule,
|
|
348
|
-
MatSelectModule,
|
|
349
|
-
MatSidenavModule,
|
|
350
|
-
MatSliderModule,
|
|
351
|
-
MatSlideToggleModule,
|
|
352
|
-
MatSnackBarModule,
|
|
353
|
-
MatSortModule,
|
|
354
|
-
MatTableModule,
|
|
355
|
-
MatTabsModule,
|
|
356
|
-
MatToolbarModule,
|
|
357
|
-
MatTooltipModule,
|
|
358
|
-
MatTreeModule,
|
|
359
|
-
ScrollingModule,
|
|
360
|
-
OverlayModule] });
|
|
361
|
-
}
|
|
362
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MaterilsModule, [{
|
|
363
|
-
type: NgModule,
|
|
364
|
-
args: [{
|
|
365
|
-
exports: [
|
|
366
|
-
A11yModule,
|
|
367
|
-
CdkTableModule,
|
|
368
|
-
CdkTreeModule,
|
|
369
|
-
DragDropModule,
|
|
370
|
-
MatAutocompleteModule,
|
|
371
|
-
MatBadgeModule,
|
|
372
|
-
MatBottomSheetModule,
|
|
373
|
-
MatButtonModule,
|
|
374
|
-
MatButtonToggleModule,
|
|
375
|
-
MatCardModule,
|
|
376
|
-
MatCheckboxModule,
|
|
377
|
-
MatChipsModule,
|
|
378
|
-
MatStepperModule,
|
|
379
|
-
MatDatepickerModule,
|
|
380
|
-
MatDialogModule,
|
|
381
|
-
MatDividerModule,
|
|
382
|
-
MatExpansionModule,
|
|
383
|
-
MatGridListModule,
|
|
384
|
-
MatIconModule,
|
|
385
|
-
MatInputModule,
|
|
386
|
-
MatListModule,
|
|
387
|
-
MatMenuModule,
|
|
388
|
-
MatNativeDateModule,
|
|
389
|
-
MatPaginatorModule,
|
|
390
|
-
MatProgressBarModule,
|
|
391
|
-
MatProgressSpinnerModule,
|
|
392
|
-
MatRadioModule,
|
|
393
|
-
MatRippleModule,
|
|
394
|
-
MatSelectModule,
|
|
395
|
-
MatSidenavModule,
|
|
396
|
-
MatSliderModule,
|
|
397
|
-
MatSlideToggleModule,
|
|
398
|
-
MatSnackBarModule,
|
|
399
|
-
MatSortModule,
|
|
400
|
-
MatTableModule,
|
|
401
|
-
MatTabsModule,
|
|
402
|
-
MatToolbarModule,
|
|
403
|
-
MatTooltipModule,
|
|
404
|
-
MatTreeModule,
|
|
405
|
-
ScrollingModule,
|
|
406
|
-
OverlayModule
|
|
407
|
-
]
|
|
408
|
-
}]
|
|
409
|
-
}], null, null); })();
|
|
410
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MaterilsModule, { exports: [A11yModule,
|
|
411
|
-
CdkTableModule,
|
|
412
|
-
CdkTreeModule,
|
|
413
|
-
DragDropModule,
|
|
414
|
-
MatAutocompleteModule,
|
|
415
|
-
MatBadgeModule,
|
|
416
|
-
MatBottomSheetModule,
|
|
417
|
-
MatButtonModule,
|
|
418
|
-
MatButtonToggleModule,
|
|
419
|
-
MatCardModule,
|
|
420
|
-
MatCheckboxModule,
|
|
421
|
-
MatChipsModule,
|
|
422
|
-
MatStepperModule,
|
|
423
|
-
MatDatepickerModule,
|
|
424
|
-
MatDialogModule,
|
|
425
|
-
MatDividerModule,
|
|
426
|
-
MatExpansionModule,
|
|
427
|
-
MatGridListModule,
|
|
428
|
-
MatIconModule,
|
|
429
|
-
MatInputModule,
|
|
430
|
-
MatListModule,
|
|
431
|
-
MatMenuModule,
|
|
432
|
-
MatNativeDateModule,
|
|
433
|
-
MatPaginatorModule,
|
|
434
|
-
MatProgressBarModule,
|
|
435
|
-
MatProgressSpinnerModule,
|
|
436
|
-
MatRadioModule,
|
|
437
|
-
MatRippleModule,
|
|
438
|
-
MatSelectModule,
|
|
439
|
-
MatSidenavModule,
|
|
440
|
-
MatSliderModule,
|
|
441
|
-
MatSlideToggleModule,
|
|
442
|
-
MatSnackBarModule,
|
|
443
|
-
MatSortModule,
|
|
444
|
-
MatTableModule,
|
|
445
|
-
MatTabsModule,
|
|
446
|
-
MatToolbarModule,
|
|
447
|
-
MatTooltipModule,
|
|
448
|
-
MatTreeModule,
|
|
449
|
-
ScrollingModule,
|
|
450
|
-
OverlayModule] }); })();
|
|
451
|
-
|
|
452
|
-
function MenuComponent_div_7_li_1_li_4_Template(rf, ctx) { if (rf & 1) {
|
|
453
|
-
const _r10 = i0.ɵɵgetCurrentView();
|
|
454
|
-
i0.ɵɵelementStart(0, "li")(1, "a", 6);
|
|
455
|
-
i0.ɵɵlistener("click", function MenuComponent_div_7_li_1_li_4_Template_a_click_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r10); const child_r8 = restoredCtx.$implicit; const ctx_r9 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r9.listItemClick(child_r8)); });
|
|
456
|
-
i0.ɵɵtext(2);
|
|
457
|
-
i0.ɵɵelementEnd()();
|
|
458
|
-
} if (rf & 2) {
|
|
459
|
-
const child_r8 = ctx.$implicit;
|
|
460
|
-
i0.ɵɵadvance(2);
|
|
461
|
-
i0.ɵɵtextInterpolate(child_r8.displaytext);
|
|
462
|
-
} }
|
|
463
|
-
function MenuComponent_div_7_li_1_Template(rf, ctx) { if (rf & 1) {
|
|
464
|
-
i0.ɵɵelementStart(0, "li")(1, "a", 12);
|
|
465
|
-
i0.ɵɵtext(2);
|
|
466
|
-
i0.ɵɵelementEnd();
|
|
467
|
-
i0.ɵɵelementStart(3, "ul");
|
|
468
|
-
i0.ɵɵtemplate(4, MenuComponent_div_7_li_1_li_4_Template, 3, 1, "li", 5);
|
|
469
|
-
i0.ɵɵelementEnd()();
|
|
470
|
-
} if (rf & 2) {
|
|
471
|
-
const parent_r4 = i0.ɵɵnextContext().$implicit;
|
|
472
|
-
i0.ɵɵadvance(2);
|
|
473
|
-
i0.ɵɵtextInterpolate1(" ", parent_r4.displaytext, "");
|
|
474
|
-
i0.ɵɵadvance(2);
|
|
475
|
-
i0.ɵɵproperty("ngForOf", parent_r4.children);
|
|
476
|
-
} }
|
|
477
|
-
function MenuComponent_div_7_li_2_Template(rf, ctx) { if (rf & 1) {
|
|
478
|
-
const _r14 = i0.ɵɵgetCurrentView();
|
|
479
|
-
i0.ɵɵelementStart(0, "li")(1, "a", 6);
|
|
480
|
-
i0.ɵɵlistener("click", function MenuComponent_div_7_li_2_Template_a_click_1_listener() { i0.ɵɵrestoreView(_r14); const parent_r4 = i0.ɵɵnextContext().$implicit; const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.listItemClick(parent_r4)); });
|
|
481
|
-
i0.ɵɵtext(2);
|
|
482
|
-
i0.ɵɵelementEnd()();
|
|
483
|
-
} if (rf & 2) {
|
|
484
|
-
const parent_r4 = i0.ɵɵnextContext().$implicit;
|
|
485
|
-
i0.ɵɵadvance(2);
|
|
486
|
-
i0.ɵɵtextInterpolate(parent_r4.displaytext);
|
|
487
|
-
} }
|
|
488
|
-
function MenuComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
489
|
-
i0.ɵɵelementStart(0, "div");
|
|
490
|
-
i0.ɵɵtemplate(1, MenuComponent_div_7_li_1_Template, 5, 2, "li", 9);
|
|
491
|
-
i0.ɵɵtemplate(2, MenuComponent_div_7_li_2_Template, 3, 1, "li", 9);
|
|
492
|
-
i0.ɵɵelementEnd();
|
|
493
|
-
} if (rf & 2) {
|
|
494
|
-
const parent_r4 = ctx.$implicit;
|
|
495
|
-
i0.ɵɵadvance(1);
|
|
496
|
-
i0.ɵɵproperty("ngIf", parent_r4.children && parent_r4.children.length > 0);
|
|
497
|
-
i0.ɵɵadvance(1);
|
|
498
|
-
i0.ɵɵproperty("ngIf", !parent_r4.children || parent_r4.children.length === 0);
|
|
499
|
-
} }
|
|
500
|
-
function MenuComponent_div_14_Template(rf, ctx) { if (rf & 1) {
|
|
501
|
-
i0.ɵɵelementStart(0, "div");
|
|
502
|
-
i0.ɵɵtext(1, "User Does't have permission to access any of Excel applications");
|
|
503
|
-
i0.ɵɵelementEnd();
|
|
504
|
-
} }
|
|
505
|
-
function MenuComponent_div_16_Template(rf, ctx) { if (rf & 1) {
|
|
506
|
-
i0.ɵɵelementStart(0, "div", 13);
|
|
507
|
-
i0.ɵɵtext(1);
|
|
508
|
-
i0.ɵɵelementEnd();
|
|
509
|
-
} if (rf & 2) {
|
|
510
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
511
|
-
i0.ɵɵadvance(1);
|
|
512
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r2.navigateMsg, " ");
|
|
513
|
-
} }
|
|
514
|
-
function MenuComponent_section_17_Template(rf, ctx) { if (rf & 1) {
|
|
515
|
-
i0.ɵɵelementStart(0, "section", 14);
|
|
516
|
-
i0.ɵɵelement(1, "mat-spinner", 15);
|
|
517
|
-
i0.ɵɵelementStart(2, "span");
|
|
518
|
-
i0.ɵɵtext(3, " Loading... ");
|
|
519
|
-
i0.ɵɵelementEnd()();
|
|
520
|
-
} if (rf & 2) {
|
|
521
|
-
i0.ɵɵadvance(1);
|
|
522
|
-
i0.ɵɵproperty("diameter", 60);
|
|
523
|
-
} }
|
|
524
|
-
class MenuComponent {
|
|
525
|
-
config;
|
|
526
|
-
authenticationService;
|
|
527
|
-
route;
|
|
528
|
-
router;
|
|
529
|
-
injector;
|
|
530
|
-
baseAppService;
|
|
531
|
-
async;
|
|
532
|
-
MenuMode = "over";
|
|
533
|
-
message = '';
|
|
534
|
-
tooltext = "CBMS";
|
|
535
|
-
menuName;
|
|
536
|
-
childMenu;
|
|
537
|
-
isLoading = false;
|
|
538
|
-
userInfo;
|
|
539
|
-
moduleNameFromExcel;
|
|
540
|
-
IsPermissionExists = true;
|
|
541
|
-
messages = [];
|
|
542
|
-
MenuData;
|
|
543
|
-
RootUrl;
|
|
544
|
-
menuFromExcel;
|
|
545
|
-
navigateMsg;
|
|
546
|
-
result;
|
|
547
|
-
constructor(config, authenticationService, route, router, injector, baseAppService) {
|
|
548
|
-
this.config = config;
|
|
549
|
-
this.authenticationService = authenticationService;
|
|
550
|
-
this.route = route;
|
|
551
|
-
this.router = router;
|
|
552
|
-
this.injector = injector;
|
|
553
|
-
this.baseAppService = baseAppService;
|
|
554
|
-
this.RootUrl = config.rootUrl; //getting from environment file from application accessing BaseApp
|
|
555
|
-
this.menuName = config.moduleName; //getting from environment file from application accessing BaseApp
|
|
556
|
-
this.userInfo = this.baseAppService.getUserInfo();
|
|
557
|
-
this.childMenu = localStorage.getItem("childMenu");
|
|
558
|
-
if (!this.userInfo) { //incase getUserInfo service fails.
|
|
559
|
-
let userDetails = localStorage.getItem("UserInfo");
|
|
560
|
-
this.userInfo = JSON.parse(userDetails);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
ngOnInit() {
|
|
564
|
-
console.log("Url came base from application -", window.location.href);
|
|
565
|
-
this.isLoading = true;
|
|
566
|
-
this.GetCBMSMenu();
|
|
567
|
-
}
|
|
568
|
-
GetCBMSMenu() {
|
|
569
|
-
if (this.userInfo) {
|
|
570
|
-
this.authenticationService.GetMenu(this.userInfo.userInfoId).subscribe(data => {
|
|
571
|
-
this.MenuData = data;
|
|
572
|
-
this.isLoading = false;
|
|
573
|
-
if (this.MenuData) {
|
|
574
|
-
this.menuFromExcel = this.baseAppService.getmenuNameFromBudget();
|
|
575
|
-
console.log("MenuFromExcel", this.menuFromExcel);
|
|
576
|
-
if (!this.menuFromExcel) {
|
|
577
|
-
let CurrentMenu = data.find(e => e.parentMenuName == this.menuName); //Finding Which application Accessing BaseApp
|
|
578
|
-
this.tooltext = CurrentMenu ? CurrentMenu.parentMenuName : "CBMS";
|
|
579
|
-
console.log("Isdownload", this.userInfo.isDownload);
|
|
580
|
-
if (!this.userInfo.isDownload) {
|
|
581
|
-
if (CurrentMenu) {
|
|
582
|
-
if (CurrentMenu.children.length == 0) {
|
|
583
|
-
this.router.navigate([CurrentMenu.targetAction.split("app")[1]]);
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
if (this.childMenu) {
|
|
587
|
-
this.navigateToChildMenu(CurrentMenu);
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
this.router.navigate([CurrentMenu.children[0].targetAction.split("app")[1]]);
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
else {
|
|
596
|
-
console.log("Redirecting to the First application in menu Tab");
|
|
597
|
-
this.navigateToAnotherMenu(this.MenuData[0]); // Redirecting to the First application in menu Tab
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
else {
|
|
602
|
-
let menu = this.MenuData.find(e => e.displaytext == this.menuFromExcel);
|
|
603
|
-
if (menu) {
|
|
604
|
-
if (!this.childMenu) {
|
|
605
|
-
console.log("noChildMenu");
|
|
606
|
-
this.navigateToAnotherMenu(this.MenuData.find(e => e.displaytext == this.menuFromExcel));
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
console.log("childMenuThere");
|
|
610
|
-
this.navigateToChildMenu(this.MenuData.find(e => e.parentMenuName == this.menuName));
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
else {
|
|
614
|
-
this.navigateToAnotherMenu(this.MenuData[0]);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
this.IsPermissionExists = false; //Notifing User that he or she doednot have permission if menuData is empty.
|
|
620
|
-
}
|
|
621
|
-
this.isLoading = false;
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
navigateToChildMenu(CurrentMenu) {
|
|
626
|
-
localStorage.removeItem("childMenu");
|
|
627
|
-
let childrenMenu = CurrentMenu.children.filter(e => e.displaytext == this.childMenu);
|
|
628
|
-
console.log("childrenMenu", childrenMenu);
|
|
629
|
-
if (childrenMenu.length > 0) {
|
|
630
|
-
this.router.navigate([childrenMenu[0].targetAction.split("app")[1]]);
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
this.router.navigate([CurrentMenu.targetAction.split("app")[1]]);
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
listItemClick(link) {
|
|
638
|
-
this.isLoading = true;
|
|
639
|
-
if (link.parentMenuName == this.menuName) {
|
|
640
|
-
if (link.parentMenuId == 0) {
|
|
641
|
-
if (link.children.length > 0) {
|
|
642
|
-
console.log("navigationUrl", link.children[0].targetAction);
|
|
643
|
-
this.isLoading = false;
|
|
644
|
-
this.router.navigate([link.children[0].targetAction.split("app")[1]]);
|
|
645
|
-
}
|
|
646
|
-
else {
|
|
647
|
-
console.log("navigationUrl", link.targetAction);
|
|
648
|
-
this.isLoading = false;
|
|
649
|
-
this.router.navigate([link.targetAction.split("app")[1]]);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
localStorage.setItem("childMenu", link.displaytext);
|
|
654
|
-
console.log("navigationUrl", link.targetAction);
|
|
655
|
-
this.isLoading = false;
|
|
656
|
-
this.router.navigate([link.targetAction.split("app")[1]]);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
this.isLoading = false;
|
|
661
|
-
this.navigateToAnotherMenu(link);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
navigateToAnotherMenu(link) {
|
|
665
|
-
this.navigateMsg = "...Redirecting to " + link.parentMenuName;
|
|
666
|
-
let navLink = link.targetAction;
|
|
667
|
-
navLink = link.targetAction.split("app")[0] + "app";
|
|
668
|
-
if (link.parentMenuId != 0) {
|
|
669
|
-
localStorage.setItem("childMenu", link.displaytext);
|
|
670
|
-
}
|
|
671
|
-
this.isLoading = false;
|
|
672
|
-
localStorage.setItem("IsNavigate", "true");
|
|
673
|
-
let navigateUrl = this.navigateUrl(navLink);
|
|
674
|
-
console.log("navigating to", link.displaytext);
|
|
675
|
-
window.location.assign(navigateUrl);
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
navigateUrl(Url) {
|
|
679
|
-
let replacements = Url.match(/\{.*?\}/g);
|
|
680
|
-
let value = "";
|
|
681
|
-
if (replacements) {
|
|
682
|
-
replacements.forEach(element => {
|
|
683
|
-
if (element == "{userId}") {
|
|
684
|
-
value = this.userInfo.userInfoId;
|
|
685
|
-
}
|
|
686
|
-
Url = Url.replace(element, value);
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
return this.RootUrl + Url;
|
|
690
|
-
}
|
|
691
|
-
onLogOut() {
|
|
692
|
-
this.authenticationService.logout();
|
|
693
|
-
this.router.navigate(["/login"]);
|
|
694
|
-
}
|
|
695
|
-
/** @nocollapse */ static ɵfac = function MenuComponent_Factory(t) { return new (t || MenuComponent)(i0.ɵɵdirectiveInject('config'), i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(BaseAppService)); };
|
|
696
|
-
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MenuComponent, selectors: [["lib-menu"]], decls: 18, vars: 5, consts: [[1, "example-container"], [1, "nav-header"], [1, "nav"], [1, "nav-time"], [1, "fa", "fa-bars", 2, "font-size", "24px"], [4, "ngFor", "ngForOf"], [3, "click"], [1, "nav-item"], [2, "padding-top", "12px"], [4, "ngIf"], ["class", "navigateMsg", 4, "ngIf"], ["class", "loade", 4, "ngIf"], [1, "item"], [1, "navigateMsg"], [1, "loade"], ["color", "black", 3, "diameter"]], template: function MenuComponent_Template(rf, ctx) { if (rf & 1) {
|
|
697
|
-
i0.ɵɵelementStart(0, "div", 0)(1, "nav", 1)(2, "ul", 2)(3, "li", 3)(4, "a");
|
|
698
|
-
i0.ɵɵelement(5, "i", 4);
|
|
699
|
-
i0.ɵɵelementEnd();
|
|
700
|
-
i0.ɵɵelementStart(6, "ul");
|
|
701
|
-
i0.ɵɵtemplate(7, MenuComponent_div_7_Template, 3, 2, "div", 5);
|
|
702
|
-
i0.ɵɵelementStart(8, "li")(9, "a", 6);
|
|
703
|
-
i0.ɵɵlistener("click", function MenuComponent_Template_a_click_9_listener() { return ctx.onLogOut(); });
|
|
704
|
-
i0.ɵɵtext(10, "Logout");
|
|
705
|
-
i0.ɵɵelementEnd()()()();
|
|
706
|
-
i0.ɵɵelementStart(11, "li", 7)(12, "h5", 8);
|
|
707
|
-
i0.ɵɵtext(13);
|
|
708
|
-
i0.ɵɵelementEnd()()()();
|
|
709
|
-
i0.ɵɵtemplate(14, MenuComponent_div_14_Template, 2, 0, "div", 9);
|
|
710
|
-
i0.ɵɵelement(15, "router-outlet");
|
|
711
|
-
i0.ɵɵelementEnd();
|
|
712
|
-
i0.ɵɵtemplate(16, MenuComponent_div_16_Template, 2, 1, "div", 10);
|
|
713
|
-
i0.ɵɵtemplate(17, MenuComponent_section_17_Template, 4, 1, "section", 11);
|
|
714
|
-
} if (rf & 2) {
|
|
715
|
-
i0.ɵɵadvance(7);
|
|
716
|
-
i0.ɵɵproperty("ngForOf", ctx.MenuData);
|
|
717
|
-
i0.ɵɵadvance(6);
|
|
718
|
-
i0.ɵɵtextInterpolate1(" ", ctx.tooltext, "");
|
|
719
|
-
i0.ɵɵadvance(1);
|
|
720
|
-
i0.ɵɵproperty("ngIf", ctx.IsPermissionExists == false);
|
|
721
|
-
i0.ɵɵadvance(2);
|
|
722
|
-
i0.ɵɵproperty("ngIf", ctx.navigateMsg);
|
|
723
|
-
i0.ɵɵadvance(1);
|
|
724
|
-
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
725
|
-
} }, dependencies: [i10.MatSpinner, i3.NgForOf, i3.NgIf, i2.RouterOutlet], styles: [".item[_ngcontent-%COMP%]{cursor:not-allowed!important}nav[_ngcontent-%COMP%]{display:block;text-align:left}nav[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none}.nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:block;cursor:pointer;color:#000;text-decoration:none;padding:.8em 1.8em;text-transform:none;font-size:80%;letter-spacing:1px;position:relative;font-family:Roboto,Helvetica Neue,sans-serif!important}.nav[_ngcontent-%COMP%]{vertical-align:top;display:inline-block;border-radius:6px}.nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:relative}.item[_ngcontent-%COMP%]:before{content:\"\";position:absolute;height:0;width:0;top:50%;right:5px;border:5px solid transparent;border-left-color:#000}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{float:left;margin-right:1px}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{margin-bottom:1px;color:#fff;cursor:pointer}.nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover > a[_ngcontent-%COMP%]{background:rgba(0,0,0,.04)}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:first-child{border-radius:4px 0 0 4px}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:first-child > a[_ngcontent-%COMP%]{border-radius:4px 0 0}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:last-child{border-radius:0 0 4px;margin-right:0}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:last-child > a[_ngcontent-%COMP%]{border-radius:0 4px 0 0}.nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{margin-top:1px}.nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:first-child:nth-last-child(2):before{content:\"\";position:absolute;height:0;width:0;top:50%;right:5px}.nav[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{position:absolute;white-space:nowrap;background-color:#fff;z-index:11111;left:-99999em}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover > ul[_ngcontent-%COMP%]{left:auto;padding-top:5px;min-width:100%;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] li[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{border-left:1px solid #fff}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover > ul[_ngcontent-%COMP%]{left:100%;top:-1px;z-index:1;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:first-child:nth-last-child(2):before{border-top-color:#aaa}.nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover > a[_ngcontent-%COMP%]:first-child:nth-last-child(2):before{border:5px solid transparent;margin-top:-5px}.nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:first-child:nth-last-child(2):before{border-left-color:#aaa;margin-top:-5px}.nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover > a[_ngcontent-%COMP%]:first-child:nth-last-child(2):before{border:5px solid transparent;border-right-color:#2f2c2c;right:10px}.nav-header[_ngcontent-%COMP%]{background:#779cf1;width:100%}.nav-header[_ngcontent-%COMP%] > .nav[_ngcontent-%COMP%] > .nav-item[_ngcontent-%COMP%]{color:#fff}.nav-header[_ngcontent-%COMP%] > .nav[_ngcontent-%COMP%] > .nav-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#fff}.loade[_ngcontent-%COMP%]{background:rgba(255,255,255,.5);width:100%;height:100%;overflow:hidden;position:absolute;z-index:1;opacity:50;top:0;vertical-align:middle;padding:40%}.permission[_ngcontent-%COMP%]{padding:10px;color:red}.navigateMsg[_ngcontent-%COMP%]{text-align:center;margin-top:60px}"] });
|
|
726
|
-
}
|
|
727
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuComponent, [{
|
|
728
|
-
type: Component,
|
|
729
|
-
args: [{ selector: 'lib-menu', template: "\r\n<div class=\"example-container\">\r\n\r\n <nav class=\"nav-header\">\r\n <ul class=\"nav\"> \r\n <li class=\"nav-time\"> \r\n <a>\r\n <i class=\"fa fa-bars\" style=\"font-size:24px\"></i>\r\n </a>\r\n <ul>\r\n <div *ngFor=\"let parent of MenuData\">\r\n <li *ngIf=\"parent.children && parent.children.length > 0\">\r\n <a class=\"item\"> {{parent.displaytext}}</a>\r\n <ul>\r\n <li *ngFor=\"let child of parent.children\">\r\n <a (click)=\"listItemClick(child)\">{{child.displaytext}}</a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li *ngIf=\"!parent.children || parent.children.length === 0\">\r\n <a (click)=\"listItemClick(parent)\">{{parent.displaytext}}</a>\r\n </li>\r\n </div>\r\n <li> \r\n <a (click)=\"onLogOut()\">Logout</a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li class=\"nav-item\">\r\n <h5 style=\"padding-top:12px;\"> {{tooltext}}</h5>\r\n </li>\r\n </ul>\r\n </nav>\r\n <div *ngIf=\"IsPermissionExists==false\">User Does't have permission to access any of Excel applications</div>\r\n <router-outlet></router-outlet>\r\n </div>\r\n <div class=\"navigateMsg\" *ngIf=\"navigateMsg\">\r\n {{navigateMsg}}\r\n </div>\r\n <section class=\"loade\" *ngIf=\"isLoading\">\r\n <mat-spinner color=\"black\" [diameter]=60 ></mat-spinner>\r\n <span>\r\n Loading...\r\n </span>\r\n </section>\r\n ", styles: [".item{cursor:not-allowed!important}nav{display:block;text-align:left}nav ul{margin:0;padding:0;list-style:none}.nav a{display:block;cursor:pointer;color:#000;text-decoration:none;padding:.8em 1.8em;text-transform:none;font-size:80%;letter-spacing:1px;position:relative;font-family:Roboto,Helvetica Neue,sans-serif!important}.nav{vertical-align:top;display:inline-block;border-radius:6px}.nav li{position:relative}.item:before{content:\"\";position:absolute;height:0;width:0;top:50%;right:5px;border:5px solid transparent;border-left-color:#000}.nav>li{float:left;margin-right:1px}.nav>li>a{margin-bottom:1px;color:#fff;cursor:pointer}.nav li:hover>a{background:rgba(0,0,0,.04)}.nav>li:first-child{border-radius:4px 0 0 4px}.nav>li:first-child>a{border-radius:4px 0 0}.nav>li:last-child{border-radius:0 0 4px;margin-right:0}.nav>li:last-child>a{border-radius:0 4px 0 0}.nav li li a{margin-top:1px}.nav li a:first-child:nth-last-child(2):before{content:\"\";position:absolute;height:0;width:0;top:50%;right:5px}.nav ul{position:absolute;white-space:nowrap;background-color:#fff;z-index:11111;left:-99999em}.nav>li:hover>ul{left:auto;padding-top:5px;min-width:100%;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.nav>li li ul{border-left:1px solid #fff}.nav>li li:hover>ul{left:100%;top:-1px;z-index:1;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.nav>li>a:first-child:nth-last-child(2):before{border-top-color:#aaa}.nav>li:hover>a:first-child:nth-last-child(2):before{border:5px solid transparent;margin-top:-5px}.nav li li>a:first-child:nth-last-child(2):before{border-left-color:#aaa;margin-top:-5px}.nav li li:hover>a:first-child:nth-last-child(2):before{border:5px solid transparent;border-right-color:#2f2c2c;right:10px}.nav-header{background:#779cf1;width:100%}.nav-header>.nav>.nav-item{color:#fff}.nav-header>.nav>.nav-item a{color:#fff}.loade{background:rgba(255,255,255,.5);width:100%;height:100%;overflow:hidden;position:absolute;z-index:1;opacity:50;top:0;vertical-align:middle;padding:40%}.permission{padding:10px;color:red}.navigateMsg{text-align:center;margin-top:60px}\n"] }]
|
|
730
|
-
}], function () { return [{ type: undefined, decorators: [{
|
|
731
|
-
type: Inject,
|
|
732
|
-
args: ['config']
|
|
733
|
-
}] }, { type: AuthService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: i0.Injector }, { type: BaseAppService }]; }, null); })();
|
|
734
|
-
|
|
735
|
-
class HttpLibInterceptor {
|
|
736
|
-
intercept(request, newRequest) {
|
|
737
|
-
// add authorization header to request
|
|
738
|
-
//Get Token data from local storage
|
|
739
|
-
//let tokenInfo = JSON.parse(localStorage.getItem('TokenInfo'));
|
|
740
|
-
// if (tokenInfo && tokenInfo.token) {
|
|
741
|
-
// request = request.clone({
|
|
742
|
-
// setHeaders: {
|
|
743
|
-
// Authorization: `Bearer ${tokenInfo.token}`,
|
|
744
|
-
// "Content-Type": 'application/json'
|
|
745
|
-
// }
|
|
746
|
-
// });
|
|
747
|
-
// }
|
|
748
|
-
console.log(request);
|
|
749
|
-
return newRequest.handle(request);
|
|
750
|
-
}
|
|
751
|
-
/** @nocollapse */ static ɵfac = function HttpLibInterceptor_Factory(t) { return new (t || HttpLibInterceptor)(); };
|
|
752
|
-
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: HttpLibInterceptor, factory: HttpLibInterceptor.ɵfac });
|
|
753
|
-
}
|
|
754
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpLibInterceptor, [{
|
|
755
|
-
type: Injectable
|
|
756
|
-
}], null, null); })();
|
|
757
|
-
|
|
758
|
-
class BulkToolModule {
|
|
759
|
-
static forRoot(config) {
|
|
760
|
-
return {
|
|
761
|
-
ngModule: BulkToolModule,
|
|
762
|
-
providers: [{ provide: 'config', useValue: config }, BaseAppService]
|
|
763
|
-
};
|
|
764
|
-
}
|
|
765
|
-
/** @nocollapse */ static ɵfac = function BulkToolModule_Factory(t) { return new (t || BulkToolModule)(); };
|
|
766
|
-
/** @nocollapse */ static ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: BulkToolModule });
|
|
767
|
-
/** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [{ provide: HTTP_INTERCEPTORS, useClass: HttpLibInterceptor, multi: true }, AuthService, BaseAppService], imports: [MaterilsModule,
|
|
768
|
-
FormsModule,
|
|
769
|
-
CommonModule,
|
|
770
|
-
RouterModule,
|
|
771
|
-
ReactiveFormsModule,
|
|
772
|
-
HttpClientModule] });
|
|
773
|
-
}
|
|
774
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BulkToolModule, [{
|
|
775
|
-
type: NgModule,
|
|
776
|
-
args: [{
|
|
777
|
-
imports: [
|
|
778
|
-
MaterilsModule,
|
|
779
|
-
FormsModule,
|
|
780
|
-
CommonModule,
|
|
781
|
-
RouterModule,
|
|
782
|
-
ReactiveFormsModule,
|
|
783
|
-
HttpClientModule,
|
|
784
|
-
],
|
|
785
|
-
declarations: [BulkToolComponent, LoginComponent, MenuComponent],
|
|
786
|
-
exports: [BulkToolComponent, LoginComponent, MenuComponent],
|
|
787
|
-
providers: [{ provide: HTTP_INTERCEPTORS, useClass: HttpLibInterceptor, multi: true }, AuthService, BaseAppService]
|
|
788
|
-
}]
|
|
789
|
-
}], null, null); })();
|
|
790
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(BulkToolModule, { declarations: [BulkToolComponent, LoginComponent, MenuComponent], imports: [MaterilsModule,
|
|
791
|
-
FormsModule,
|
|
792
|
-
CommonModule,
|
|
793
|
-
RouterModule,
|
|
794
|
-
ReactiveFormsModule,
|
|
795
|
-
HttpClientModule], exports: [BulkToolComponent, LoginComponent, MenuComponent] }); })();
|
|
796
|
-
|
|
797
|
-
/*
|
|
798
|
-
* Public API Surface of bulk-tool
|
|
799
|
-
*/
|
|
800
|
-
|
|
801
|
-
/**
|
|
802
|
-
* Generated bundle index. Do not edit.
|
|
803
|
-
*/
|
|
804
|
-
|
|
805
|
-
export { BaseAppService, BulkToolComponent, BulkToolModule, LoginComponent, MaterilsModule, MenuComponent };
|
|
806
|
-
//# sourceMappingURL=exceladdincbms-v1.mjs.map
|