gamma-app-controller 2.0.1 → 2.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.
@@ -8122,11 +8122,10 @@ class BreadCrumbsComponent {
8122
8122
  return;
8123
8123
  }
8124
8124
  else {
8125
- let relativePath = 'rakpiBrowser';
8126
- this.getKpiName(value, relativePath);
8127
- setTimeout(() => {
8128
- this.loadBreadCrumbs();
8129
- }, 500);
8125
+ debugger;
8126
+ this.kpiListData = value;
8127
+ this.getBreadCrumbsData(value);
8128
+ this.loadBreadCrumbs();
8130
8129
  this.isBreadCrumbs = true;
8131
8130
  }
8132
8131
  }
@@ -8163,75 +8162,72 @@ class BreadCrumbsComponent {
8163
8162
  let structures = {};
8164
8163
  data.forEach(result => {
8165
8164
  const item = {};
8166
- item["relativePath"] = result.relativePath;
8167
- item["name"] = result["name"];
8168
- item["pageId"] = result["pageId"];
8169
- item["tid"] = result["tid"].trim();
8170
- if (result["nodes"] !== undefined) {
8171
- item["nodes"] = this.getBreadCrumbsData(result["nodes"]);
8172
- }
8165
+ item["name"] = result["kpiName"];
8166
+ item["pageId"] = result.tagType == 'child' ? result["pageId"] : null;
8167
+ item["tid"] = result.tagType == 'child' ? result["childTid"].trim() : result["parentTid"].trim();
8173
8168
  this.kpi_names[result["pageId"]] = item["tid"];
8174
- structures[result["tid"]] = item;
8175
- this.kpi_structures[result["tid"]] = item;
8169
+ structures[result["childTid"]] = item;
8170
+ this.kpi_structures[result["childTid"]] = item;
8176
8171
  });
8177
8172
  return structures;
8178
8173
  }
8179
8174
  loadBreadCrumbs() {
8180
- let kpiRoot = this.kpiBrowserName ? "fmskpi" : "rakpi";
8181
- let kpiContainer;
8182
- if (this.kpiListData.length > 0 || this.kpiListData != undefined) {
8183
- kpiContainer = this.getBreadCrumbsData(this.kpiListData);
8184
- }
8185
- else {
8186
- kpiContainer = this.getBreadCrumbsData(this.commonService.allKpibrowserDetailContainer);
8187
- }
8188
- const kpiId = this.activatedRoute.snapshot.queryParams['pageId'];
8189
- const kpiTid = this.kpi_names[kpiId];
8175
+ debugger;
8176
+ const pageId = this.activatedRoute.snapshot.queryParams['pageId'];
8177
+ const kpiTid = this.kpi_names[pageId];
8190
8178
  const props = this.kpi_structures[kpiTid];
8191
- const propsList = props["relativePath"] + "/" + props["name"];
8179
+ const propsList = this.buildKpiPath(this.kpiListData, props["tid"]);
8192
8180
  this.breadcrumbList = propsList.split("/");
8193
8181
  if (this.location.path() !== "") {
8194
8182
  let link = {};
8195
8183
  this.breadcrumbLinksList = [];
8184
+ this.breadcrumbLinksList.unshift({
8185
+ name: "RA KPI Browser",
8186
+ url: "/apps/raKpi/rakpiBrowser",
8187
+ kpiName: "RA KPI Browser"
8188
+ });
8196
8189
  for (let i = 0; i < this.breadcrumbList.length; i++) {
8197
- if (i == 0) {
8198
- if (!this.kpiBrowserName) {
8199
- link = {
8200
- name: this.breadcrumbList[i],
8201
- url: "/apps/raKpi/rakpiBrowser",
8202
- kpiName: "RA KPI Browser",
8203
- };
8190
+ let returnId = "";
8191
+ for (let j = 0; j <= i; j++) {
8192
+ if (j != 0) {
8193
+ returnId += "/";
8204
8194
  }
8205
- else {
8206
- link = {
8207
- name: this.breadcrumbList[i],
8208
- url: "/apps/fmsKpi",
8209
- kpiName: "FMS KPI Browser",
8210
- };
8211
- }
8212
- }
8213
- else {
8214
- let returnId = "";
8215
- for (let j = 0; j <= i; j++) {
8216
- if (j != 0) {
8217
- returnId += "/";
8218
- }
8219
- returnId += this.breadcrumbList[j];
8220
- }
8221
- link = {
8222
- name: this.breadcrumbList[i],
8223
- url: this.breadcrumbLinksList[i - 1]["url"],
8224
- id: this.breadcrumbList[i],
8225
- kpiName: this.breadcrumbList[i],
8226
- returnId: returnId,
8227
- };
8228
- this.commonService.global_kpi_name = this.breadcrumbList[i];
8229
- }
8195
+ returnId += this.breadcrumbList[j];
8196
+ }
8197
+ link = {
8198
+ name: this.breadcrumbList[i],
8199
+ url: this.breadcrumbLinksList[i]["url"],
8200
+ id: this.breadcrumbList[i],
8201
+ kpiName: this.breadcrumbList[i],
8202
+ returnId: returnId,
8203
+ };
8204
+ this.commonService.global_kpi_name = this.breadcrumbList[i];
8230
8205
  this.breadcrumbLinksList.push(link);
8231
8206
  }
8232
8207
  this.count = this.breadcrumbList.length;
8233
8208
  }
8234
8209
  }
8210
+ buildKpiPath(kpiListData, startTid) {
8211
+ const path = [];
8212
+ const tidArray = this.buildTidArray(startTid);
8213
+ tidArray.forEach((tid, index) => {
8214
+ const kpi = kpiListData.find(kpi => index === 0
8215
+ ? kpi.parentTid === tid
8216
+ : kpi.childTid === tid);
8217
+ if (kpi) {
8218
+ path.push(kpi.kpiName);
8219
+ }
8220
+ });
8221
+ return path.join(" / ");
8222
+ }
8223
+ buildTidArray(startTid) {
8224
+ const parts = startTid.split(".");
8225
+ const result = [];
8226
+ for (let i = 0; i < parts.length; i++) {
8227
+ result.push(parts.slice(0, i + 1).join("."));
8228
+ }
8229
+ return result;
8230
+ }
8235
8231
  }
8236
8232
  BreadCrumbsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BreadCrumbsComponent, deps: [{ token: i4$2.Location }, { token: i2.Router }, { token: i1.HttpClient }, { token: i2.ActivatedRoute }, { token: CommonService }], target: i0.ɵɵFactoryTarget.Component });
8237
8233
  BreadCrumbsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BreadCrumbsComponent, selector: "gamma-bread-crumbs", inputs: { kpi_data_container: "kpi_data_container" }, ngImport: i0, template: "<nav class=\"flex mt-1\" aria-label=\"Breadcrumb\" *ngIf=\"isBreadCrumbs\">\n <ol class=\"inline-flex items-center space-x-1 md:space-x-3\">\n <li class=\"inline-flex items-center cursor-pointer\" *ngFor=\"let breadcrumbLabel of breadcrumbLinksList;\">\n <a [routerLink]=\"breadcrumbLabel.url\" [queryParams]=\"{returnId: breadcrumbLabel.returnId }\"\n class=\"inline-flex items-center text-sm font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white\">\n <svg class=\"w-6 h-6 text-gray-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\"\n d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\"\n clip-rule=\"evenodd\"></path>\n </svg>\n {{breadcrumbLabel.kpiName}}\n </a>\n </li>\n </ol>\n</nav>", styles: [".breadcrumb{padding:0!important;margin-bottom:0!important;font-weight:400;font-size:12px}\n"], dependencies: [{ kind: "directive", type: i4$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
@@ -18017,6 +18013,14 @@ class KpiWithSingleLayoutService {
18017
18013
  return response;
18018
18014
  }), catchError(this.handleError));
18019
18015
  }
18016
+ listKpiEntryConfigs() {
18017
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + this.environment.packageBasePath + '/listKpiEntryConfigs?caller=app';
18018
+ return this.http
18019
+ .get(apiUrl, { withCredentials: true })
18020
+ .pipe(map((response) => {
18021
+ return response;
18022
+ }), catchError(this.handleError));
18023
+ }
18020
18024
  }
18021
18025
  KpiWithSingleLayoutService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KpiWithSingleLayoutService, deps: [{ token: i1.HttpClient }, { token: APP_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
18022
18026
  KpiWithSingleLayoutService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KpiWithSingleLayoutService, providedIn: "root" });
@@ -18529,6 +18533,37 @@ class PermissionHelper {
18529
18533
  }
18530
18534
  return false;
18531
18535
  }
18536
+ buildMenuTree(userName, kpiData) {
18537
+ let filteredMenus = kpiData;
18538
+ const menuMap = new Map();
18539
+ const menuTree = [];
18540
+ filteredMenus.forEach(menu => {
18541
+ if (!this.getPermissionEntity(menu.permissions))
18542
+ return;
18543
+ menuMap.set(menu.childTid || menu.parentTid, {
18544
+ id: menu.kpiId,
18545
+ title: menu.kpiName,
18546
+ icon: menu.icon,
18547
+ type: menu.kpiType,
18548
+ tagType: menu.tagType,
18549
+ visibility: menu.visibility,
18550
+ ...(menu.link && { link: menu.link.replace(/^\/+/, '') }),
18551
+ children: []
18552
+ });
18553
+ });
18554
+ filteredMenus.forEach(kpi => {
18555
+ if (kpi.parentTid && kpi.childTid) {
18556
+ const parent = menuMap.get(kpi.parentTid);
18557
+ if (parent) {
18558
+ parent.children.push(menuMap.get(kpi.childTid));
18559
+ }
18560
+ }
18561
+ else {
18562
+ menuTree.push(menuMap.get(kpi.parentTid));
18563
+ }
18564
+ });
18565
+ return menuTree;
18566
+ }
18532
18567
  }
18533
18568
  PermissionHelper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PermissionHelper, deps: [{ token: APP_SECURITY_PRINCIPAL }], target: i0.ɵɵFactoryTarget.Injectable });
18534
18569
  PermissionHelper.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PermissionHelper, providedIn: 'root' });
@@ -18766,10 +18801,10 @@ class KpiWithDataSetTestComponent {
18766
18801
  this.isDefaultFilterParams = false;
18767
18802
  }
18768
18803
  ngOnInit() {
18769
- this.service.getlistKpiBrowser().subscribe({
18770
- next: ((data) => {
18771
- this.kpi_breadcrumbs_container = data;
18772
- })
18804
+ this.service.listKpiEntryConfigs().subscribe((data) => {
18805
+ this.kpi_breadcrumbs_container = data;
18806
+ }, err => {
18807
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'KPI Config');
18773
18808
  });
18774
18809
  this.loadingModal = true;
18775
18810
  this.pageId = this.activatedRoute.snapshot.queryParams['pageId'];