| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 10 | Unless required by applicable law or agreed to in writing, software |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | */ |
| 18 | /** |
| 19 | * @file K8 Action Component |
| 20 | */ |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 21 | import { HttpHeaders } from '@angular/common/http'; |
| 22 | import { ChangeDetectorRef, Component, Injector } from '@angular/core'; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 23 | import { Router } from '@angular/router'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 24 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; |
| 25 | import { TranslateService } from '@ngx-translate/core'; |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 26 | import { NotifierService } from 'angular-notifier'; |
| 27 | import { ERRORDATA, GETAPIURLHEADER, MODALCLOSERESPONSEDATA } from 'CommonModel'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 28 | import { DeleteComponent } from 'DeleteComponent'; |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 29 | import { environment } from 'environment'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 30 | import { K8sAddClusterComponent } from 'K8sAddClusterComponent'; |
| 31 | import { K8sAttachProfileComponent } from 'K8sAttachProfileComponent'; |
| 32 | import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent'; |
| 33 | import { INFRACONFIGPAYLOAD, K8SCLUSTERDATADISPLAY, K8SPayload, K8SREPODATADISPLAY } from 'K8sModel'; |
| 34 | import { KSUAddComponent } from 'KSUAddComponent'; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 35 | import { NodeAddComponent } from 'NodeAddComponent'; |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 36 | import { RestService } from 'RestService'; |
| 37 | import { isNullOrUndefined, SharedService } from 'SharedService'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 38 | import { ShowInfoComponent } from 'ShowInfoComponent'; |
| 39 | /** |
| 40 | * Creating component |
| 41 | * @Component takes K8sActionComponent.html as template url |
| 42 | */ |
| 43 | @Component({ |
| 44 | selector: 'app-k8s-action', |
| 45 | templateUrl: './K8sActionComponent.html', |
| 46 | styleUrls: ['./K8sActionComponent.scss'] |
| 47 | }) |
| 48 | /** Exporting a class @exports K8sActionComponent */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 49 | export class K8sActionComponent { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 50 | /** To inject services @public */ |
| 51 | public injector: Injector; |
| 52 | |
| 53 | /** To get the value from the Users action via valuePrepareFunction default Property of ng-smarttable @public */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 54 | public value: K8SCLUSTERDATADISPLAY | K8SREPODATADISPLAY | INFRACONFIGPAYLOAD; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 55 | |
| 56 | /** handle translate @public */ |
| 57 | public translateService: TranslateService; |
| 58 | |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 59 | /** Contains K8s Type @public */ |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 60 | public getK8sType: string; |
| 61 | |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 62 | /** Check register page @public */ |
| 63 | public checkRegister = false; |
| 64 | |
| 65 | /** Contains state @public */ |
| 66 | public state: string; |
| 67 | |
| 68 | /** Check profile or not @public */ |
| 69 | public isProfile = false; |
| 70 | |
| 71 | /** Check ksu or not @public */ |
| 72 | public isKSU = false; |
| 73 | |
| 74 | /** Check cluster or not @public */ |
| 75 | public isCluster = false; |
| 76 | |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 77 | /** Check node group or not @public */ |
| 78 | public isNode = false; |
| 79 | |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 80 | /** Check the loading results for loader status @public */ |
| 81 | public isLoadingDownloadResult: boolean = false; |
| 82 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 83 | /** Instance of the modal service @private */ |
| 84 | private modalService: NgbModal; |
| 85 | |
| 86 | /** Contains all methods related to shared @private */ |
| 87 | private sharedService: SharedService; |
| 88 | |
| 89 | /** Contains instance ID @private */ |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 90 | private k8sID: string; |
| 91 | |
| 92 | /** Contains instance name @private */ |
| 93 | private k8sName: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 94 | |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 95 | /** Utilizes rest service for any CRUD operations @private */ |
| 96 | private restService: RestService; |
| 97 | |
| 98 | /** Notifier service to popup notification @private */ |
| 99 | private notifierService: NotifierService; |
| 100 | |
| 101 | /** Detect changes for the User Input */ |
| 102 | private cd: ChangeDetectorRef; |
| 103 | |
| 104 | /** Set timeout @private */ |
| 105 | // eslint-disable-next-line @typescript-eslint/no-magic-numbers |
| 106 | private timeOut: number = 1000; |
| 107 | |
| 108 | /** Controls the header form @private */ |
| 109 | private headers: HttpHeaders; |
| 110 | |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 111 | /** Holds teh instance of AuthService class of type AuthService @private */ |
| 112 | private router: Router; |
| 113 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 114 | constructor(injector: Injector) { |
| 115 | this.injector = injector; |
| 116 | this.modalService = this.injector.get(NgbModal); |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 117 | this.notifierService = this.injector.get(NotifierService); |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 118 | this.sharedService = this.injector.get(SharedService); |
| 119 | this.translateService = this.injector.get(TranslateService); |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 120 | this.restService = this.injector.get(RestService); |
| 121 | this.cd = this.injector.get(ChangeDetectorRef); |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 122 | this.router = this.injector.get(Router); |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Lifecyle Hooks the trigger before component is instantiate |
| 127 | */ |
| 128 | public ngOnInit(): void { |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 129 | this.headers = new HttpHeaders({ |
| 130 | Accept: 'application/zip, application/json', |
| 131 | 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0' |
| 132 | }); |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 133 | this.k8sID = this.value.identifier; |
| 134 | this.k8sName = this.value.name; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 135 | this.getK8sType = this.value.pageType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 136 | this.state = this.value.state; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 137 | if ((this.value.createdbyosm) === 'true') { |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 138 | this.isCluster = true; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 139 | } else if ((this.value.createdbyosm) === 'false') { |
| 140 | this.isCluster = false; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 141 | } |
| 142 | if (this.getK8sType === 'k8-ksu') { |
| 143 | this.isKSU = true; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 144 | } else { |
| 145 | this.isKSU = false; |
| 146 | } |
| 147 | |
| 148 | if (this.getK8sType === 'infra-config' || this.getK8sType === 'infra-controller' || this.getK8sType === 'app-profile' || this.getK8sType === 'resource-profile') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 149 | this.isProfile = true; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 150 | } else { |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 151 | this.isProfile = false; |
| 152 | } |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 153 | |
| 154 | if (this.value.pageType === 'node') { |
| 155 | this.isNode = true; |
| 156 | } else { |
| 157 | this.isNode = false; |
| 158 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | /** Delete User Account @public */ |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 162 | public deleteK8s(forceAction: boolean): void { |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame] | 163 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 164 | const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' }); |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 165 | modalRef.componentInstance.params = { |
| 166 | forceDeleteType: forceAction |
| 167 | }; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 168 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 169 | if (result) { |
| 170 | this.sharedService.callData(); |
| 171 | } |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame] | 172 | }).catch((): void => { |
| 173 | // Catch Navigation Error |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 174 | }); |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 175 | } |
| 176 | |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 177 | /** Details page @public */ |
| 178 | public nodeK8s(): void { |
| 179 | this.router.navigate(['/k8s/details/' + this.k8sID]).catch((): void => { |
| 180 | // Catch Navigation Error |
| 181 | }); |
| 182 | } |
| 183 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 184 | /** Shows information using modalservice @public */ |
| 185 | public infoK8s(pageType: string): void { |
| 186 | let pageName: string = ''; |
| 187 | let title: string = ''; |
| 188 | if (pageType === 'repo') { |
| 189 | pageName = 'k8s-repo'; |
| 190 | title = 'PAGE.K8S.K8SREPODETAILS'; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 191 | } else if (pageType === 'node') { |
| 192 | pageName = 'k8s-node'; |
| 193 | title = 'Node Details'; |
| 194 | } else if (pageType === 'k8-ksu') { |
| 195 | pageName = 'k8s-ksu'; |
| 196 | title = 'KSU Details'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 197 | } else { |
| 198 | pageName = 'k8s-cluster'; |
| 199 | title = 'PAGE.K8S.K8SCLUSTERDETAILS'; |
| 200 | } |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame] | 201 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 202 | this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = { |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 203 | id: this.k8sID, |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 204 | page: pageName, |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 205 | titleName: title, |
| 206 | createdbyosm: this.value.createdbyosm, |
| 207 | bootstrap: this.value.bootstrap, |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 208 | key: this.value.key, |
| 209 | cluster_mode: this.value.cluster_mode, |
| 210 | cluster_id: this.value.cluster_id |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 211 | }; |
| 212 | } |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 213 | /** Edit profile @public */ |
| 214 | public editProfile(editType: string): void { |
| 215 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 216 | const modalRef: NgbModalRef = this.modalService.open(K8sInfraConfigAddComponent, { backdrop: 'static' }); |
| 217 | modalRef.componentInstance.profileID = this.value.identifier; |
| 218 | modalRef.componentInstance.profileType = editType; |
| 219 | modalRef.componentInstance.profileName = this.value.name; |
| 220 | modalRef.componentInstance.profileDescription = this.value.description; |
| 221 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 222 | if (result) { |
| 223 | this.sharedService.callData(); |
| 224 | } |
| 225 | }).catch((): void => { |
| 226 | // Catch Navigation Error |
| 227 | }); |
| 228 | } |
| 229 | |
| 230 | /** Edit cluster @public */ |
| 231 | public editCluster(editType: string): void { |
| 232 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 233 | const modalRef: NgbModalRef = this.modalService.open(K8sAddClusterComponent, { backdrop: 'static' }); |
| 234 | modalRef.componentInstance.profileID = this.value.identifier; |
| 235 | modalRef.componentInstance.profileType = editType; |
| 236 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 237 | if (result) { |
| 238 | this.sharedService.callData(); |
| 239 | } |
| 240 | }).catch((): void => { |
| 241 | // Catch Navigation Error |
| 242 | }); |
| 243 | } |
| 244 | |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 245 | /** Handle Scaling @public */ |
| 246 | public scaling(editType: string): void { |
| 247 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 248 | const modalRef: NgbModalRef = this.modalService.open(NodeAddComponent, { backdrop: 'static' }); |
| 249 | modalRef.componentInstance.profileID = this.value.identifier; |
| 250 | modalRef.componentInstance.clusterId = this.value.cluster_id; |
| 251 | modalRef.componentInstance.profileType = editType; |
| 252 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 253 | if (result) { |
| 254 | this.sharedService.callData(); |
| 255 | } |
| 256 | }).catch((): void => { |
| 257 | // Catch Navigation Error |
| 258 | }); |
| 259 | } |
| 260 | |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 261 | |
| 262 | /** Edit profile under cluster @public */ |
| 263 | public editClusterProfile(editType: string): void { |
| 264 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 265 | const modalRef: NgbModalRef = this.modalService.open(K8sAttachProfileComponent, { backdrop: 'static' }); |
| 266 | modalRef.componentInstance.profileID = this.value.identifier; |
| 267 | modalRef.componentInstance.profileType = editType; |
| 268 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 269 | if (result) { |
| 270 | this.sharedService.callData(); |
| 271 | } |
| 272 | }).catch((): void => { |
| 273 | // Catch Navigation Error |
| 274 | }); |
| 275 | } |
| 276 | |
| 277 | /** Move KSU @public */ |
| 278 | public moveKsu(): void { |
| 279 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 280 | const modalRef: NgbModalRef = this.modalService.open(KSUAddComponent, { backdrop: 'static' }); |
| 281 | modalRef.componentInstance.profileID = this.value.identifier; |
| 282 | modalRef.componentInstance.profileType = 'move'; |
| 283 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 284 | if (result) { |
| 285 | this.sharedService.callData(); |
| 286 | } |
| 287 | }).catch((): void => { |
| 288 | // Catch Navigation Error |
| 289 | }); |
| 290 | } |
| 291 | |
| 292 | /** Edit KSU @public */ |
| 293 | public editKsu(): void { |
| 294 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 295 | const modalRef: NgbModalRef = this.modalService.open(KSUAddComponent, { backdrop: 'static' }); |
| 296 | modalRef.componentInstance.profileID = this.value.identifier; |
| 297 | modalRef.componentInstance.profileType = 'edit'; |
| 298 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 299 | if (result) { |
| 300 | this.sharedService.callData(); |
| 301 | } |
| 302 | }).catch((): void => { |
| 303 | // Catch Navigation Error |
| 304 | }); |
| 305 | } |
| 306 | |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 307 | /** Download credentials @public */ |
| 308 | public getCredentials(): void { |
| 309 | this.isLoadingDownloadResult = true; |
| 310 | const httpOptions: GETAPIURLHEADER = { |
| 311 | headers: this.headers, |
| 312 | responseType: 'blob' |
| 313 | }; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 314 | this.restService.getResource(environment.K8SCREATECLUSTER_URL + '/' + this.k8sID + '/get_creds') |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 315 | .subscribe((res: { op_id: string }) => { |
| 316 | if (!isNullOrUndefined(res.op_id)) { |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 317 | this.restService.getResource(environment.K8SCREATECLUSTER_URL + '/' + this.k8sID + '/get_creds_file' + '/' + res.op_id, httpOptions) |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 318 | .subscribe((response: Blob) => { |
| 319 | this.isLoadingDownloadResult = true; |
| 320 | if (!isNullOrUndefined(response)) { |
| 321 | this.isLoadingDownloadResult = false; |
| 322 | const binaryData: Blob[] = []; |
| 323 | binaryData.push(response); |
| 324 | this.sharedService.downloadFiles(this.value.name, binaryData, response.type); |
| 325 | this.isLoadingDownloadResult = false; |
| 326 | this.changeDetactionforDownload(); |
| 327 | } |
| 328 | }, (error: ERRORDATA) => { |
| 329 | this.isLoadingDownloadResult = false; |
| 330 | this.notifierService.notify('error', this.translateService.instant('ERROR')); |
| 331 | this.changeDetactionforDownload(); |
| 332 | if (typeof error.error === 'object') { |
| 333 | error.error.text().then((data: string): void => { |
| 334 | error.error = JSON.parse(data); |
| 335 | this.restService.handleError(error, 'getBlob'); |
| 336 | }); |
| 337 | } |
| 338 | }); |
| 339 | } |
| 340 | }, (error: ERRORDATA) => { |
| 341 | this.isLoadingDownloadResult = false; |
| 342 | this.restService.handleError(error, 'get'); |
| 343 | }); |
| 344 | } |
| 345 | |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 346 | /** Clone KSU @public */ |
| 347 | public cloneKsu(): void { |
| 348 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| 349 | const modalRef: NgbModalRef = this.modalService.open(KSUAddComponent, { backdrop: 'static' }); |
| 350 | modalRef.componentInstance.profileID = this.value.identifier; |
| 351 | modalRef.componentInstance.profileType = 'clone'; |
| 352 | modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { |
| 353 | if (result) { |
| 354 | this.sharedService.callData(); |
| 355 | } |
| 356 | }).catch((): void => { |
| 357 | // Catch Navigation Error |
| 358 | }); |
| 359 | } |
| SANDHYA.JS | b534715 | 2024-10-15 11:41:45 +0530 | [diff] [blame] | 360 | |
| 361 | /** Change the detaction @public */ |
| 362 | public changeDetactionforDownload(): void { |
| 363 | setTimeout(() => { |
| 364 | this.cd.detectChanges(); |
| 365 | }, this.timeOut); |
| 366 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 367 | } |