Skip to content

Commit 8df9df4

Browse files
Merge pull request #158 from mansurskTarento/designations-builk-upload
fixing: KB-8002 :- When SPV created new organisation and mdo admin of…
2 parents 7eaeee4 + a36f80c commit 8df9df4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

project/ws/app/src/lib/routes/create-mdo/routes/designation/components/designations/designations.component.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class DesignationsComponent implements OnInit {
3939
isMdoLeader: boolean
4040
}[] = []
4141
orgId = ''
42+
orgName = ''
4243
showTopSection = false
4344
designationMaster = 'desigantion master'
4445
constructor(
@@ -61,11 +62,14 @@ export class DesignationsComponent implements OnInit {
6162
}
6263

6364
initializeDefaultValues() {
64-
this.configSvc = this.activateRoute.snapshot.data['configService']
65-
this.designationsService.setUserProfile(_.get(this.configSvc, 'userProfileV2'))
66-
// this.orgId = _.get(this.configSvc, 'userProfile.rootOrgId')
67-
this.orgId = this.activateRoute.snapshot.params.department
68-
this.designationConfig = this.activateRoute.snapshot.data['pageData'].data
65+
if (this.activateRoute.snapshot) {
66+
this.configSvc = this.activateRoute.snapshot.data['configService']
67+
this.designationsService.setUserProfile(_.get(this.configSvc, 'userProfileV2'))
68+
// this.orgId = _.get(this.configSvc, 'userProfile.rootOrgId')
69+
this.orgId = this.activateRoute.snapshot.params.department
70+
this.designationConfig = this.activateRoute.snapshot.data['pageData'].data
71+
this.orgName = _.get(this.activateRoute, 'snapshot.queryParams.orgName')
72+
}
6973

7074
this.actionMenuItem = [
7175
// {
@@ -124,7 +128,7 @@ export class DesignationsComponent implements OnInit {
124128
createFreamwork() {
125129
this.showCreateLoader = true
126130
this.loaderMsg = this.designationConfig.frameworkCreationMSg
127-
const departmentName = _.get(this.configSvc, 'userProfile.departmentName')
131+
const departmentName = this.orgName ? this.orgName : _.get(this.configSvc, 'userProfile.departmentName')
128132
const masterFrameWorkName = this.environment.ODCSMasterFramework
129133
this.designationsService.createFrameWork(masterFrameWorkName, this.orgId, departmentName).subscribe((res: any) => {
130134
if (_.get(res, 'result.framework')) {

0 commit comments

Comments
 (0)