\\n \\n No Users available, please click \\\"ADD Users\\\" to create one\\n
\\n 0\\\">\\n \\n \\n \\n \\n \\n \\n \\n \\n {{data.Email}}\\n \\n \\n \\n \\n \\n \\n {{data.FirstName}}\\n \\n
\\n \\n Frist Name\\n \\n \\n \\n \\n {{data.LastName}}\\n \\n
\\n \\n Last Name\\n \\n \\n \\n \\n {{data.Status}}\\n \\n
\\n \\n Status\\n \\n \\n \\n \\n \\n \\n Delete\\n \\n \\n Edit\\n \\n \\n \\n \\n \\n \\n \\n\\n \\n \\n\\n\"","import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { UsersPage } from './users.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: UsersPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class UsersPageRoutingModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { UsersPageRoutingModule } from './users-routing.module';\n\nimport { UsersPage } from './users.page';\nimport{SharedModule} from '../../shared/shared.module';\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n SharedModule,\n UsersPageRoutingModule\n ],\n declarations: [UsersPage]\n})\nexport class UsersPageModule {}\n","export default \"#container {\\n text-align: center;\\n position: absolute;\\n left: 0;\\n right: 0;\\n top: 50%;\\n -webkit-transform: translateY(-50%);\\n transform: translateY(-50%);\\n}\\n\\n#container strong {\\n font-size: 20px;\\n line-height: 26px;\\n}\\n\\n#container p {\\n font-size: 16px;\\n line-height: 22px;\\n color: #8c8c8c;\\n margin: 0;\\n}\\n\\n#container a {\\n text-decoration: none;\\n}\\n\\nion-content ion-toolbar {\\n --background: translucent;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9yYWplc2hndi9Eb2N1bWVudHMvUmFqZXNoLW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kZWNvcmF0aW9uOiBub25lO1xuICB9XG4gIFxuICBpb24tY29udGVudCBpb24tdG9vbGJhciB7XG4gICAgLS1iYWNrZ3JvdW5kOiB0cmFuc2x1Y2VudDtcbiAgfSIsIiNjb250YWluZXIge1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgbGVmdDogMDtcbiAgcmlnaHQ6IDA7XG4gIHRvcDogNTAlO1xuICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoLTUwJSk7XG59XG5cbiNjb250YWluZXIgc3Ryb25nIHtcbiAgZm9udC1zaXplOiAyMHB4O1xuICBsaW5lLWhlaWdodDogMjZweDtcbn1cblxuI2NvbnRhaW5lciBwIHtcbiAgZm9udC1zaXplOiAxNnB4O1xuICBsaW5lLWhlaWdodDogMjJweDtcbiAgY29sb3I6ICM4YzhjOGM7XG4gIG1hcmdpbjogMDtcbn1cblxuI2NvbnRhaW5lciBhIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuXG5pb24tY29udGVudCBpb24tdG9vbGJhciB7XG4gIC0tYmFja2dyb3VuZDogdHJhbnNsdWNlbnQ7XG59Il19 */\"","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute } from \"@angular/router\";\nimport { CommonService } from '../../shared/common';\nimport { messages } from 'src/app/shared/constants';\nimport { GlobalsService } from '../../shared/globals';\nimport { UserService } from '../../services/user.service';\nimport { ModalController } from '@ionic/angular';\nimport { AddusersmodalPage } from '../../modals/addusersmodal/addusersmodal.page';\nimport { OrganizationService } from '../../services/organization.service';\n\n@Component({\n selector: 'app-users',\n templateUrl: './users.page.html',\n styleUrls: ['./users.page.scss'],\n})\nexport class UsersPage implements OnInit {\n public selectedOrgID = 0;\n public searchTextVal=\"\";\n public organizationData = [];\n public title = \"\";\n public usersList = [];\n public tempUsersList = [];\n public userListOriginal = [];\n dataReturned: any;\n public userData = {\n UserID: 0, FirstName: '', LastName: '', IsActive: true, Email: '', Password: '', OrganizationID: 0, IsDeleted: false,\n LoggedInEmail: this.globals.userInfo.userName, ControlItemIDs: ''\n }\n isLoggedInUserEdit = false;\n\n constructor(\n private route: ActivatedRoute,\n private commonService: CommonService,\n public globals: GlobalsService,\n private userService: UserService,\n public modalController: ModalController,\n public addUserModalPage: AddusersmodalPage,\n public OrganizationService: OrganizationService,\n ) {\n\n }\n ngOnInit() {\n this.commonService.assignGlobals();\n this.route.queryParams.subscribe(params => {\n this.title = params[\"Title\"];\n });\n this.getAllUsers();\n this.getOrganizationsData();\n }\n onEditUserclick(data) {\n if (data.UserID == this.globals.userInfo.LoggedInUserID) {\n // this.commonService.showAlert(messages.ALERTTITLINFORMATION, messages.EDITINPROFILE, ['OK']);\n // return;\n }\n if (data.UserID == this.globals.userInfo.LoggedInUserID) {\n this.isLoggedInUserEdit = true;\n }\n data.isLoggedInUserEdit = this.isLoggedInUserEdit;\n this.presentModal(data);\n }\n onDeleteUserclick(data) {\n if (data.UserID == this.globals.userInfo.LoggedInUserID) {\n this.commonService.showAlert(messages.ALERTTITLINFORMATION, messages.CANNOTDELETELOGGEDINUSER, ['OK']);\n return;\n }\n this.commonService.showAlert(messages.MESSAGETITLE, messages.DELETECONFIRM, [\n {\n text: 'Yes',\n handler: () => {\n this.deleteUserData(data.UserID);\n }\n },\n {\n text: 'No',\n role: 'cancel'\n }\n ]);\n\n }\n onAddUserClick() {\n this.userData = {\n UserID: 0, FirstName: '', LastName: '', IsActive: true, Email: '', Password: '', OrganizationID: 0, IsDeleted: false,\n LoggedInEmail: this.globals.userInfo.userName, ControlItemIDs: ''\n }\n this.presentModal(this.userData);\n }\n async presentModal(data) {\n const modal = await this.modalController.create({\n component: AddusersmodalPage,\n componentProps: {\n 'data': data,\n\n }\n });\n modal.onDidDismiss().then((dataReturned) => {\n if (dataReturned !== null) {\n this.dataReturned = dataReturned.data.isCanceldismissed;\n if (!this.dataReturned) {\n this.getAllUsers();\n }\n }\n });\n\n return await modal.present();\n\n }\n async getAllUsers() {\n if (navigator.onLine) {\n var self = this;\n this.usersList = [];\n const loader = await this.commonService.showLoading(messages.ALLUSERS);\n this.userService\n .getAllUsers()\n .then((data: any) => {\n loader.dismiss();\n if (data.length > 0) {\n data.forEach(function (element, index, object) {\n if (element.UserID == self.globals.userInfo.LoggedInUserID) {\n //object.splice(index, 1);\n }\n if (element.IsActive) {\n element.Status = 'Active';\n } else {\n element.Status = 'InActive';\n }\n element.fullName = element.LastName + \", \" + element.FirstName;\n });\n this.usersList = data;\n this.userListOriginal = data;\n this.filterList();\n }\n })\n .catch((e) => {\n loader.dismiss();\n });\n } else {\n this.commonService.showAlert(messages.ALERTTITLINFORMATION, messages.PLEASECONNECTTONETWORK, ['OK']);\n }\n }\n async deleteUserData(userID) {\n if (navigator.onLine) {\n const loader = await this.commonService.showLoading(messages.DELETEORGDATA);\n this.userService\n .deleteUserData(userID)\n .then((data: any) => {\n loader.dismiss();\n if (data.Message == 'SUCCESS') {\n this.usersList.forEach(function (item, index, object) {\n if (item.UserID === userID) {\n object.splice(index, 1);\n }\n });\n\n }\n })\n .catch((e) => {\n loader.dismiss();\n });\n } else {\n this.commonService.showAlert(messages.ALERTTITLINFORMATION, messages.PLEASECONNECTTONETWORK, ['OK']);\n }\n\n }\n\n async getOrganizationsData() {\n if (navigator.onLine) {\n const loader = await this.commonService.showLoading(messages.GETORGANIZATIONDATA);\n this.OrganizationService\n .getOrganizationData()\n .then((data: any) => {\n loader.dismiss();\n if (data.length > 0) {\n data.forEach(element => {\n element.isChecked = false;\n if (element.IsActive) {\n this.organizationData.push(element);\n }\n\n });\n\n\n }\n })\n .catch((e) => {\n loader.dismiss();\n });\n } else {\n this.commonService.showAlert(messages.ALERTTITLINFORMATION, messages.PLEASECONNECTTONETWORK, ['OK']);\n }\n\n }\n async searchBar(evt) {\n this.tempUsersList = this.userListOriginal;\n this.searchTextVal = evt.srcElement.value;\n this.filterList();\n }\n onChangeOrganizationFilter($event) {\n console.log('data ' + $event.target.value);\n this.selectedOrgID = $event.target.value;\n this.filterList();\n }\n filterList() {\n this.tempUsersList = this.userListOriginal;\n\n if (this.searchTextVal != '') {\n this.tempUsersList = this.tempUsersList.filter(current => {\n return (current.FirstName.toLowerCase().indexOf(this.searchTextVal.toLowerCase()) > -1 ||\n current.LastName.toLowerCase().indexOf(this.searchTextVal.toLowerCase()) > -1 ||\n current.Email.toLowerCase().indexOf(this.searchTextVal.toLowerCase()) > -1 ||\n current.LastName.toLowerCase().indexOf(this.searchTextVal.toLowerCase()) > -1\n );\n });\n }\n if (this.selectedOrgID != 0) {\n this.tempUsersList = this.tempUsersList.filter(current => {\n return (current.OrganizationID == this.selectedOrgID);\n });\n }\n this.usersList = this.tempUsersList;\n }\n\n\n}\n"],"sourceRoot":"webpack:///"}