From d1fbd0b5f036b3cb0f5129b62c27f728c62d069c Mon Sep 17 00:00:00 2001 From: umasoodch Date: Wed, 8 Jun 2022 10:33:24 +0300 Subject: [PATCH] first push of mohemm q3 --- .../absence-confirm.component.ts | 116 +- .../absence-replacement-list.component.ts | 2 +- .../submit-absence.component.html | 13 +- .../submit-absence.component.ts | 59 +- Mohem/src/app/app-routing.module.ts | 7 +- Mohem/src/app/app.component.html | 58 +- Mohem/src/app/app.component.ts | 26 +- Mohem/src/app/app.scss | 3 + .../authentication/authentication.module.ts | 14 +- .../business-card.component.html | 51 +- .../business-card.component.scss | 50 +- .../business-card/business-card.component.ts | 22 +- .../change-password.component.html | 134 +- .../change-password.component.scss | 4 + .../change-password.component.ts | 363 ++- .../check-user/check-user.component.html | 2 +- .../check-user/check-user.component.ts | 27 +- .../confirm-login/confirm-login.component.ts | 120 +- .../forgot/forgot.component.html | 59 +- .../forgot/forgot.component.scss | 8 +- .../authentication/forgot/forgot.component.ts | 231 +- .../models/sendActivationByType.ts | 41 +- .../sms-page/sms-page.page.html | 184 +- .../authentication/sms-page/sms-page.page.ts | 522 +++- .../app/eit/add-cei/add-cei.component.html | 24 + .../app/eit/add-cei/add-cei.component.scss | 45 + .../app/eit/add-cei/add-cei.component.spec.ts | 27 + .../src/app/eit/add-cei/add-cei.component.ts | 1561 ++++++++++++ .../cei-homepage/cei-homepage.component.html | 69 + .../cei-homepage/cei-homepage.component.scss | 40 + .../cei-homepage.component.spec.ts | 27 + .../cei-homepage/cei-homepage.component.ts | 51 + .../app/eit/cei-list/cei-list.component.html | 42 + .../app/eit/cei-list/cei-list.component.scss | 330 +++ .../eit/cei-list/cei-list.component.spec.ts | 27 + .../app/eit/cei-list/cei-list.component.ts | 127 + .../confirm-add-cei.component.html | 127 + .../confirm-add-cei.component.scss | 263 ++ .../confirm-add-cei.component.spec.ts | 27 + .../confirm-add-cei.component.ts | 445 ++++ .../confirm-add-eit.component.ts | 28 +- Mohem/src/app/eit/eit.module.ts | 29 +- Mohem/src/app/eit/home/home.component.ts | 17 +- Mohem/src/app/eit/models/add.cei.response.ts | 8 + Mohem/src/app/eit/models/add.eit.response.ts | 1 + Mohem/src/app/eit/models/cei.request.ts | 12 + Mohem/src/app/eit/models/eit.request.ts | 1 - Mohem/src/app/eit/services/eit.service.ts | 44 + .../app/erm-channel/home/home.component.ts | 11 +- .../erm-channel/survey/survey.component.ts | 11 +- Mohem/src/app/hmg-common/hmg-common.module.ts | 44 +- .../attend-services/attend-scan.service.ts | 2 +- .../authentication/authentication.service.ts | 18 +- .../models/smscheck.response.ts | 1 + .../services/common/common.service.ts | 224 +- .../services/connector/connector.service.ts | 4 +- .../services/menu/models/menu-response.ts | 15 +- .../app/hmg-common/services/models/request.ts | 2 + .../hmg-common/services/rate/rate.service.ts | 8 +- .../file-uploader.component.html | 51 +- .../file-uploader.component.scss | 17 + .../file-uploader/file-uploader.component.ts | 324 ++- .../generic-header.component.html | 16 + .../generic-header.component.scss | 4 + .../generic-header.component.ts | 62 +- .../hmg-common/ui/smsdialog/smsdialog.page.ts | 113 +- .../stats-button/stats-button.component.scss | 10 + Mohem/src/app/home/home.page.html | 5 +- Mohem/src/app/home/home.page.scss | 11 + Mohem/src/app/home/home.page.ts | 88 +- .../home/wifi-model/wifi-modal.component.ts | 7 + .../itemforsale/filter/filter.component.html | 31 + .../itemforsale/filter/filter.component.scss | 38 + .../filter/filter.component.spec.ts | 27 + .../itemforsale/filter/filter.component.ts | 56 + .../app/itemforsale/home/home.component.html | 207 +- .../app/itemforsale/home/home.component.scss | 62 +- .../app/itemforsale/home/home.component.ts | 298 ++- .../item-details/item-details.component.html | 47 +- .../item-details/item-details.component.scss | 5 + .../item-details/item-details.component.ts | 32 +- .../src/app/itemforsale/itemforsale.module.ts | 10 +- .../itemforsale/items/items.component.html | 137 +- .../itemforsale/items/items.component.scss | 71 +- .../app/itemforsale/items/items.component.ts | 154 +- Mohem/src/app/itemforsale/services/domsafe.ts | 15 + .../services/service.service.spec.ts | 12 + .../itemforsale/services/service.service.ts | 87 + .../hr-request-form.component.scss | 3 + .../hr-request-form.component.ts | 151 +- .../hr-request/hr-request.component.scss | 1 + Mohem/src/app/mowadhafi/mowadhafi.service.ts | 19 +- .../app/my-team/details/details.component.ts | 3 +- .../src/app/my-team/home/home.component.html | 1 + Mohem/src/app/my-team/my-team.module.ts | 12 +- .../app/my-team/service/my-team.service.ts | 8 + .../subordinate-leave.component.html | 89 + .../subordinate-leave.component.scss | 199 ++ .../subordinate-leave.component.spec.ts | 27 + .../subordinate-leave.component.ts | 57 + .../app/notification/home/home.component.html | 24 +- .../app/notification/home/home.component.scss | 8 +- .../app/notification/home/home.component.ts | 396 +-- .../src/app/notification/models/COCRequest.ts | 8 + .../models/userItemTypeRequest.ts | 6 + .../app/notification/notification.module.ts | 5 + .../service/work-list.main.service.ts | 153 ++ .../notification/service/worklist.service.ts | 16 + .../work-list-main-itg.component.html | 11 +- .../work-list-main-itg.component.ts | 88 +- .../work-list-replacement-itg.component.html | 135 +- .../work-list-replacement-itg.component.scss | 589 ++--- .../work-list-replacement-itg.component.ts | 133 +- .../work-list-replacement-roll.component.html | 105 +- .../work-list-replacement-roll.component.scss | 185 +- .../work-list-replacement-roll.component.ts | 147 +- .../work-list-rfc/work-list-rfc.component.ts | 14 +- .../worklist-advanced-search.component.html | 1 + .../worklist-advanced-search.component.ts | 2 +- .../worklist-main-ic.component.html | 2 +- .../worklist-main-ic.component.ts | 58 +- .../worklist-main-mr.component.html | 2 +- .../worklist-main-mr.component.ts | 53 +- .../worklist-main-po.component.html | 2 +- .../worklist-main-po.component.ts | 78 +- .../worklist-main-pr.component.html | 2 +- .../worklist-main-pr.component.ts | 54 +- .../worklist-main.component.html | 296 ++- .../worklist-main.component.scss | 9 + .../worklist-main/worklist-main.component.ts | 207 +- .../worklist-setting.component.html | 41 + .../worklist-setting.component.scss | 7 + .../worklist-setting.component.spec.ts | 27 + .../worklist-setting.component.ts | 86 + .../filter/filter.component.html | 2 +- .../offersdiscount/home/home.component.html | 2 +- .../app/offersdiscount/home/home.component.ts | 66 +- .../location/location.component.html | 7 + .../location/location.component.scss | 4 + .../location/location.component.spec.ts | 27 + .../location/location.component.ts | 79 + .../offer-details.component.html | 16 +- .../offer-details.component.scss | 5 + .../offer-details/offer-details.component.ts | 16 +- .../offersdiscount/offersdiscount.module.ts | 13 +- .../app/offersdiscount/services/service.ts | 11 +- .../src/app/payslip/home/home.component.scss | 1 + .../home/home.component.html | 102 + .../home/home.component.scss | 117 + .../home/home.component.spec.ts | 27 + .../home/home.component.ts | 56 + .../pending-transaction.module.ts | 36 + .../pending-transaction.page.html | 4 + .../pending-transaction.page.scss | 0 .../pending-transaction.page.spec.ts | 27 + .../pending-transaction.page.ts | 15 + .../service/service.service.spec.ts | 12 + .../service/service.service.ts | 44 + .../add-address/add-address.component.html | 2 +- .../add-basic-details.component.html | 2 +- .../add-update-contact.component.html | 34 + .../add-update-contact.component.scss | 52 + .../add-update-contact.component.spec.ts | 27 + .../add-update-contact.component.ts | 2134 +++++++++++++++++ .../confirm-address.component.ts | 54 +- .../confirm-basic-details.component.ts | 17 +- .../confirm-contact.component.html | 128 + .../confirm-contact.component.scss | 263 ++ .../confirm-contact.component.spec.ts | 27 + .../confirm-contact.component.ts | 438 ++++ .../profile/contact/contact.component.html | 53 + .../profile/contact/contact.component.scss | 119 + .../profile/contact/contact.component.spec.ts | 27 + .../app/profile/contact/contact.component.ts | 120 + .../edit-profile/edit-profile.component.html | 1 + .../src/app/profile/home/home.component.html | 148 +- .../src/app/profile/home/home.component.scss | 69 +- Mohem/src/app/profile/home/home.component.ts | 190 +- .../src/app/profile/models/contact.request.ts | 12 + .../performance-evaluation.component.html | 15 - .../performance-evaluation.component.scss | 9 +- .../performance-evaluation.component.ts | 57 +- Mohem/src/app/profile/profile.module.ts | 23 +- .../app/profile/service/profile.service.ts | 83 + .../concurrent-report.component.html | 31 + .../concurrent-report.component.scss | 56 + .../concurrent-report.component.spec.ts | 27 + .../concurrent-report.component.ts | 1300 ++++++++++ .../reports/report-service.service.spec.ts | 12 + .../src/app/reports/report-service.service.ts | 76 + Mohem/src/app/reports/reports.module.ts | 43 + Mohem/src/app/reports/reports.page.html | 3 + Mohem/src/app/reports/reports.page.scss | 0 Mohem/src/app/reports/reports.page.spec.ts | 27 + Mohem/src/app/reports/reports.page.ts | 15 + .../transaction-list.component.html | 48 + .../transaction-list.component.scss | 146 ++ .../transaction-list.component.spec.ts | 27 + .../transaction-list.component.ts | 103 + .../confirm-termination.component.html | 123 + .../confirm-termination.component.scss | 263 ++ .../confirm-termination.component.spec.ts | 27 + .../confirm-termination.component.ts | 433 ++++ .../termination-service.service.spec.ts | 12 + .../service/termination-service.service.ts | 63 + .../termination-form.component.html | 19 + .../termination-form.component.scss | 44 + .../termination-form.component.spec.ts | 27 + .../termination-form.component.ts | 1465 +++++++++++ .../src/app/termination/termination.module.ts | 46 + .../src/app/termination/termination.page.html | 3 + .../src/app/termination/termination.page.scss | 0 .../app/termination/termination.page.spec.ts | 27 + Mohem/src/app/termination/termination.page.ts | 15 + .../time-card-details.component.scss | 2 +- .../time-card-details.component.ts | 2 +- .../vacation-type.component.html | 6 +- .../vacation-type/vacation-type.component.ts | 13 +- Mohem/src/assets/icon/bar-chart-outline.svg | 1 + Mohem/src/assets/icon/bar-chart.svg | 1 + Mohem/src/assets/icon/blank.svg | 6 + Mohem/src/assets/icon/green.svg | 3 + Mohem/src/assets/icon/select-all.svg | 1 + Mohem/src/assets/icon/settings-not.svg | 10 + Mohem/src/assets/icon/yellow.svg | 3 + Mohem/src/assets/imgs/hr-request.png | Bin 0 -> 10488 bytes .../assets/imgs/mohemm-action/Doable-old.png | Bin 0 -> 1441 bytes .../src/assets/imgs/mohemm-action/Doable.png | Bin 0 -> 1371 bytes .../src/assets/imgs/mohemm-action/More-2.png | Bin 0 -> 914 bytes Mohem/src/assets/imgs/mohemm-action/More.png | Bin 914 -> 1161 bytes .../src/assets/imgs/mohemm-action/Skip-2.png | Bin 0 -> 888 bytes Mohem/src/assets/imgs/mohemm-action/Skip.png | Bin 888 -> 1316 bytes .../src/assets/imgs/mohemm-action/answer.png | Bin 0 -> 1940 bytes .../imgs/mohemm-action/data-corrected (2).png | Bin 0 -> 1818 bytes .../imgs/mohemm-action/data-corrected (3).png | Bin 0 -> 1824 bytes .../imgs/mohemm-action/data-corrected.png | Bin 0 -> 1560 bytes .../imgs/mohemm-action/doable-2-old.png | Bin 0 -> 1371 bytes .../assets/imgs/mohemm-action/info-old.png | Bin 0 -> 1053 bytes Mohem/src/assets/imgs/mohemm-action/info.png | Bin 1053 -> 1293 bytes .../imgs/mohemm-action/notDoable-old.png | Bin 0 -> 1478 bytes .../assets/imgs/mohemm-action/notDoable.png | Bin 0 -> 1461 bytes Mohem/src/assets/imgs/my-request.png | Bin 0 -> 4055 bytes Mohem/src/assets/imgs/no-images.png | Bin 0 -> 38816 bytes Mohem/src/assets/imgs/pending-transaction.png | Bin 0 -> 11004 bytes .../assets/imgs/profile-icons/family-g.svg | 6 + .../src/assets/imgs/profile-icons/family.svg | 6 + Mohem/src/assets/localization/i18n.json | 365 ++- Mohem/src/index.html | 2 + Mohem/src/theme/styles.scss | 35 +- 249 files changed, 19048 insertions(+), 2033 deletions(-) create mode 100644 Mohem/src/app/eit/add-cei/add-cei.component.html create mode 100644 Mohem/src/app/eit/add-cei/add-cei.component.scss create mode 100644 Mohem/src/app/eit/add-cei/add-cei.component.spec.ts create mode 100644 Mohem/src/app/eit/add-cei/add-cei.component.ts create mode 100644 Mohem/src/app/eit/cei-homepage/cei-homepage.component.html create mode 100644 Mohem/src/app/eit/cei-homepage/cei-homepage.component.scss create mode 100644 Mohem/src/app/eit/cei-homepage/cei-homepage.component.spec.ts create mode 100644 Mohem/src/app/eit/cei-homepage/cei-homepage.component.ts create mode 100644 Mohem/src/app/eit/cei-list/cei-list.component.html create mode 100644 Mohem/src/app/eit/cei-list/cei-list.component.scss create mode 100644 Mohem/src/app/eit/cei-list/cei-list.component.spec.ts create mode 100644 Mohem/src/app/eit/cei-list/cei-list.component.ts create mode 100644 Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.html create mode 100644 Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.scss create mode 100644 Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.spec.ts create mode 100644 Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.ts create mode 100644 Mohem/src/app/eit/models/add.cei.response.ts create mode 100644 Mohem/src/app/eit/models/cei.request.ts create mode 100644 Mohem/src/app/itemforsale/filter/filter.component.html create mode 100644 Mohem/src/app/itemforsale/filter/filter.component.scss create mode 100644 Mohem/src/app/itemforsale/filter/filter.component.spec.ts create mode 100644 Mohem/src/app/itemforsale/filter/filter.component.ts create mode 100644 Mohem/src/app/itemforsale/services/domsafe.ts create mode 100644 Mohem/src/app/itemforsale/services/service.service.spec.ts create mode 100644 Mohem/src/app/itemforsale/services/service.service.ts create mode 100644 Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html create mode 100644 Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss create mode 100644 Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts create mode 100644 Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts create mode 100644 Mohem/src/app/notification/models/COCRequest.ts create mode 100644 Mohem/src/app/notification/models/userItemTypeRequest.ts create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.html create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts create mode 100644 Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts create mode 100644 Mohem/src/app/offersdiscount/location/location.component.html create mode 100644 Mohem/src/app/offersdiscount/location/location.component.scss create mode 100644 Mohem/src/app/offersdiscount/location/location.component.spec.ts create mode 100644 Mohem/src/app/offersdiscount/location/location.component.ts create mode 100644 Mohem/src/app/pending-transaction/home/home.component.html create mode 100644 Mohem/src/app/pending-transaction/home/home.component.scss create mode 100644 Mohem/src/app/pending-transaction/home/home.component.spec.ts create mode 100644 Mohem/src/app/pending-transaction/home/home.component.ts create mode 100644 Mohem/src/app/pending-transaction/pending-transaction.module.ts create mode 100644 Mohem/src/app/pending-transaction/pending-transaction.page.html create mode 100644 Mohem/src/app/pending-transaction/pending-transaction.page.scss create mode 100644 Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts create mode 100644 Mohem/src/app/pending-transaction/pending-transaction.page.ts create mode 100644 Mohem/src/app/pending-transaction/service/service.service.spec.ts create mode 100644 Mohem/src/app/pending-transaction/service/service.service.ts create mode 100644 Mohem/src/app/profile/add-update-contact/add-update-contact.component.html create mode 100644 Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss create mode 100644 Mohem/src/app/profile/add-update-contact/add-update-contact.component.spec.ts create mode 100644 Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts create mode 100644 Mohem/src/app/profile/confirm-contact/confirm-contact.component.html create mode 100644 Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss create mode 100644 Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts create mode 100644 Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts create mode 100644 Mohem/src/app/profile/contact/contact.component.html create mode 100644 Mohem/src/app/profile/contact/contact.component.scss create mode 100644 Mohem/src/app/profile/contact/contact.component.spec.ts create mode 100644 Mohem/src/app/profile/contact/contact.component.ts create mode 100644 Mohem/src/app/profile/models/contact.request.ts create mode 100644 Mohem/src/app/reports/concurrent-report/concurrent-report.component.html create mode 100644 Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss create mode 100644 Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts create mode 100644 Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts create mode 100644 Mohem/src/app/reports/report-service.service.spec.ts create mode 100644 Mohem/src/app/reports/report-service.service.ts create mode 100644 Mohem/src/app/reports/reports.module.ts create mode 100644 Mohem/src/app/reports/reports.page.html create mode 100644 Mohem/src/app/reports/reports.page.scss create mode 100644 Mohem/src/app/reports/reports.page.spec.ts create mode 100644 Mohem/src/app/reports/reports.page.ts create mode 100644 Mohem/src/app/reports/transaction-list/transaction-list.component.html create mode 100644 Mohem/src/app/reports/transaction-list/transaction-list.component.scss create mode 100644 Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts create mode 100644 Mohem/src/app/reports/transaction-list/transaction-list.component.ts create mode 100644 Mohem/src/app/termination/confirm-termination/confirm-termination.component.html create mode 100644 Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss create mode 100644 Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts create mode 100644 Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts create mode 100644 Mohem/src/app/termination/service/termination-service.service.spec.ts create mode 100644 Mohem/src/app/termination/service/termination-service.service.ts create mode 100644 Mohem/src/app/termination/termination-form/termination-form.component.html create mode 100644 Mohem/src/app/termination/termination-form/termination-form.component.scss create mode 100644 Mohem/src/app/termination/termination-form/termination-form.component.spec.ts create mode 100644 Mohem/src/app/termination/termination-form/termination-form.component.ts create mode 100644 Mohem/src/app/termination/termination.module.ts create mode 100644 Mohem/src/app/termination/termination.page.html create mode 100644 Mohem/src/app/termination/termination.page.scss create mode 100644 Mohem/src/app/termination/termination.page.spec.ts create mode 100644 Mohem/src/app/termination/termination.page.ts create mode 100644 Mohem/src/assets/icon/bar-chart-outline.svg create mode 100644 Mohem/src/assets/icon/bar-chart.svg create mode 100644 Mohem/src/assets/icon/blank.svg create mode 100644 Mohem/src/assets/icon/green.svg create mode 100644 Mohem/src/assets/icon/select-all.svg create mode 100644 Mohem/src/assets/icon/settings-not.svg create mode 100644 Mohem/src/assets/icon/yellow.svg create mode 100644 Mohem/src/assets/imgs/hr-request.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/Doable-old.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/Doable.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/More-2.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/Skip-2.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/answer.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/data-corrected (2).png create mode 100644 Mohem/src/assets/imgs/mohemm-action/data-corrected (3).png create mode 100644 Mohem/src/assets/imgs/mohemm-action/data-corrected.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/doable-2-old.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/info-old.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/notDoable-old.png create mode 100644 Mohem/src/assets/imgs/mohemm-action/notDoable.png create mode 100644 Mohem/src/assets/imgs/my-request.png create mode 100644 Mohem/src/assets/imgs/no-images.png create mode 100644 Mohem/src/assets/imgs/pending-transaction.png create mode 100644 Mohem/src/assets/imgs/profile-icons/family-g.svg create mode 100644 Mohem/src/assets/imgs/profile-icons/family.svg diff --git a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts index d4a765a3..40dc3dd3 100644 --- a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts +++ b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts @@ -15,13 +15,14 @@ import { AbsenceAttachmentComponent } from '../absence-attachment/absence-attach import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component'; import { FileUploader } from 'ng2-file-upload'; import { SubmitAbsenceModalComponent } from '../submit-absence-modal/submit-absence-modal.component'; +import { HomeComponent } from "src/app/notification/home/home.component"; @Component({ selector: 'app-absence-confirm', templateUrl: './absence-confirm.component.html', styleUrls: ['./absence-confirm.component.scss'] }) export class AbsenceConfirmComponent implements OnInit { - direction:string; + direction: string; P_TransactionID: number; approversList = []; selEmp: string = ''; @@ -58,7 +59,7 @@ export class AbsenceConfirmComponent implements OnInit { this.P_TransactionID = this.common.sharedService.getSharedData( AbsenceResponse.SHARED_DATA ); - this.getPassNotificationDetails =this.common.sharedService.getSharedData( + this.getPassNotificationDetails = this.common.sharedService.getSharedData( AbsenceNotificatonBodyResponse.NOT_WORKLIST, true ); @@ -89,7 +90,7 @@ export class AbsenceConfirmComponent implements OnInit { this.getApproversList(); } - ngOnInit() {} + ngOnInit() { } startAbApproval() { if (this.attachListOver) { //first call add attach inside success call submit @@ -126,12 +127,12 @@ export class AbsenceConfirmComponent implements OnInit { this.startAbsApprovalProcess(); } else { //stope - let filtered = this.attachListOver.filter(function(el) { + let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; }); this.attachListOver = filtered; let msg: string = ''; - // msg = this.translate.translate("addAttach.errorMsg"); + // msg = this.translate.translate("addAttach.errorMsg"); //this.common.showAlert(msg); } } @@ -168,11 +169,12 @@ export class AbsenceConfirmComponent implements OnInit { if (this.common.validResponse(result)) { this.isSubmitBtnClicked = true; //if(this.isResubmitAbs==false){ - let msg: string = this.ts.trPK('general', 'messageSuccess'); - this.common.presentAlert(msg); - + // let msg: string = this.ts.trPK('general', 'messageSuccess'); + // this.common.presentAlert(msg); + this.common.greenToastPK("eit", "approval-message-success") // } // this.navCtrl.popToRoot(); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } @@ -204,61 +206,61 @@ export class AbsenceConfirmComponent implements OnInit { // }); const modal = await this.modalCtrl.create({ component: AbsenceAttachmentComponent, - componentProps:{ indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID}, + componentProps: { indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID }, keyboardClose: true, animated: false - }); + }); modal.onDidDismiss() - .then((data) => { - if (data == 'cancel' || data == 'undefined') { - return; - } else { - if (!str) { - this.updateFile(data, attachDocID); + .then((data) => { + if (data == 'cancel' || data == 'undefined') { + return; } else { - this.attachListDisplay = data.data; - this.attachItems = this.attachListDisplay.map(function (el) { - var o = Object.assign({}, el); - o.isSuccess = false; - return o; - }); - this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + if (!str) { + this.updateFile(data, attachDocID); + } else { + this.attachListDisplay = data.data; + this.attachItems = this.attachListDisplay.map(function (el) { + var o = Object.assign({}, el); + o.isSuccess = false; + return o; + }); + this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + } } - } - }); + }); return await modal.present(); } -/*****submit modal********/ -async openSubmitModal() { - this.common.sharedService.setSharedData( this.attachListOver, 'submitAbsAttachmentList'); - this.common.sharedService.setSharedData(this.absComments, 'absComments'); - const modal = await this.modalCtrl.create({ - component: SubmitAbsenceModalComponent, - backdropDismiss: false, + /*****submit modal********/ + async openSubmitModal() { + this.common.sharedService.setSharedData(this.attachListOver, 'submitAbsAttachmentList'); + this.common.sharedService.setSharedData(this.absComments, 'absComments'); + const modal = await this.modalCtrl.create({ + component: SubmitAbsenceModalComponent, + backdropDismiss: false, - }); - modal.cssClass = 'note-modal'; + }); + modal.cssClass = 'note-modal'; - modal.onDidDismiss() - .then((data) => { - console.log(data.data); + modal.onDidDismiss() + .then((data) => { + console.log(data.data); - if (data.data == 'cancel' || data.data == undefined) { - return; - } else { - this.startAbApproval(); - } - }); + if (data.data == 'cancel' || data.data == undefined) { + return; + } else { + this.startAbApproval(); + } + }); - return await modal.present(); + return await modal.present(); -} + } @@ -266,7 +268,7 @@ async openSubmitModal() { removeFile(objectitem) { - + if (this.attachListOver) { let index2 = this.attachListOver.findIndex(item => item == objectitem); if (index2 > -1) { @@ -300,12 +302,12 @@ async openSubmitModal() { } // valid it } - async OpenAttachFiles(value, Type) { + async OpenAttachFiles(value, Type) { this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage'); const modal = await this.modalCtrl.create({ component: WorkListAttachViewComponent }); - + modal.onDidDismiss() .then((data) => { }); @@ -314,7 +316,7 @@ async openSubmitModal() { } updateFile(attachList, attachDocID) { - + let req = { P_ATTACHED_DOCUMENT_ID: attachDocID, P_FILE_DATA: attachList[0].P_FILE_DATA, @@ -327,7 +329,7 @@ async openSubmitModal() { let msg: string = ''; // msg = this.translate.translate("addAttach.attachUpdate"); // this.common.showAlert(msg); - + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); } } // val @@ -345,7 +347,7 @@ async openSubmitModal() { // }); } continueDelete(attach) { - + let req = { P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID }; @@ -367,9 +369,9 @@ async openSubmitModal() { - /*******************Add attchement Functions*************/ + /*******************Add attchement Functions*************/ - public uploader: FileUploader = new FileUploader({ + public uploader: FileUploader = new FileUploader({ allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], maxFileSize: 10 * 1024 * 1024, formatDataFunctionIsAsync: true, @@ -386,7 +388,7 @@ async openSubmitModal() { }); - onFileSelectedclick(event){ + onFileSelectedclick(event) { event.target.value = ''; } @@ -430,7 +432,7 @@ async openSubmitModal() { pushObject(fileData, name, type) { - console.log('before push: '+ this.index); + console.log('before push: ' + this.index); //this.attachListOver.length++; try { let array = name.split('.'); @@ -438,11 +440,11 @@ async openSubmitModal() { this.attachListOver.push( { - AttachmentID: this.attachListOver.length, + AttachmentID: this.attachListOver.length, P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], P_FILE_DATA: fileData.split(',')[1], P_FILE_NAME: name,//.split('.')[0], - P_TRANSACTION_ID: this.P_TransactionID + P_TRANSACTION_ID: this.P_TransactionID }) } catch (e) { diff --git a/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts index 0fcacdb7..d2ef54b6 100644 --- a/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts +++ b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts @@ -32,7 +32,7 @@ export class AbsenceReplacementListComponent implements OnInit { P_PAGE_NUM: number; P_PAGE_LIMIT: number; ReplacementList: any = []; - searchBy: string = ""; + searchBy: string = "2"; IsReachEnd: boolean = false; ReplacmentListRes: WorKListReplacmentEmployeeResponse; private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.html b/Mohem/src/app/absence/submit-absence/submit-absence.component.html index 9a17288e..f3ffe7d4 100644 --- a/Mohem/src/app/absence/submit-absence/submit-absence.component.html +++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.html @@ -5,19 +5,20 @@ - - + + + let item of AbsenceType; let i=index; {{item.ABSENCE_ATTENDANCE_TYPE_NAME}} - + --> {{ts.trPK('submitAbsence','startDate')}} diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts index 360a5175..159c4842 100644 --- a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts +++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts @@ -3,7 +3,7 @@ import { CommonService } from "src/app/hmg-common/services/common/common.service import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; -import { ModalController ,IonSelectOption ,IonSelect } from "@ionic/angular"; +import { ModalController, IonSelectOption, IonSelect } from "@ionic/angular"; import { SubmitAbsenceService } from "../service/submit.absence.service"; import { AbsenceAttahcmentResponse } from "../models/abs.attach.response"; import { AbsenceListService } from "../service/service.service"; @@ -23,8 +23,8 @@ import { DatePicker } from "@ionic-native/date-picker/ngx"; import { Request } from '../../hmg-common/services/models/request'; // import { Request } from "../models/request"; import * as moment from "moment"; -import {ReplacementListComponent} from "../../vacation-rule/replacement-list/replacement-list.component"; -import {ReplacmentResponse} from "../models/replacment-response"; +import { ReplacementListComponent } from "../../vacation-rule/replacement-list/replacement-list.component"; +import { ReplacmentResponse } from "../models/replacment-response"; import { AbsenceResponse } from '../models/absence.response'; import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component'; import { AbsenceNotificatonBodyResponse } from 'src/app/notification/models/AbsenceNotificationBodyRes'; @@ -51,7 +51,7 @@ export class SubmitAbsenceComponent implements OnInit { private modalFlag: any = false; menuType: any; employeeSel: any; - absenceType: any; + absenceType = 'noType'; absenceTypeName: string = null; absenceTypeList: any; startDate: any; @@ -99,8 +99,8 @@ export class SubmitAbsenceComponent implements OnInit { this.direction = TranslatorService.getCurrentLanguageName(); ////*new add*///// /**********resubmit************ */ - this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true); - this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage'); + this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true); + this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage'); //this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true); // this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage'); if (this.getPassdirfromNotifiPage) { @@ -110,8 +110,8 @@ export class SubmitAbsenceComponent implements OnInit { this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID; this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; this.respID = -999; - this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList'); - console.log() + this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList'); + console.log() } else { this.action = "CREATE"; this.selEmp = this.common.sharedService.getSharedData( @@ -185,7 +185,7 @@ export class SubmitAbsenceComponent implements OnInit { } } calcDay() { - console.log("calcDay" ); + console.log("calcDay"); let msg: string = ""; if ( this.startDate == undefined || @@ -233,7 +233,7 @@ export class SubmitAbsenceComponent implements OnInit { this.totalDays = result.CalculateAbsenceDuration.P_ABSENCE_DAYS; } } - async openSearch(){ + async openSearch() { const modal = await this.modalCtrl.create({ component: ReplacementListComponent, keyboardClose: true, @@ -259,7 +259,7 @@ export class SubmitAbsenceComponent implements OnInit { console.log(data) console.log(user); if (data) { - this.employeeName = user.EMPLOYEE_DISPLAY_NAME; + this.employeeName = user.EMPLOYEE_DISPLAY_NAME; this.employeeID = user.USER_NAME; this.employeeSel = this.employeeName + "," + this.employeeID; } @@ -278,12 +278,12 @@ export class SubmitAbsenceComponent implements OnInit { } public onTypeAbsenceChange() { - + if (this.absenceType) { let obj: any = this.absenceTypeList.find( s => s.ABSENCE_ATTENDANCE_TYPE_ID == this.absenceType ); - + if (obj) this.absenceTypeName = obj.DESC_FLEX_CONTEXT_CODE; else this.absenceTypeName = null; @@ -443,7 +443,7 @@ export class SubmitAbsenceComponent implements OnInit { this.textInput = new TextInput( feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, - defaultVal, + defaultVal, containerId, defaultValText, feildsList[i].MOBILE_ENABLED, @@ -492,9 +492,9 @@ export class SubmitAbsenceComponent implements OnInit { this.fillAbsStructure(); } } - + bindHtmlElemEvents(id, obj) { - + const elem = document.getElementById(id); elem.addEventListener("change", e => { elem.classList.remove("requiredClassElm"); @@ -1039,20 +1039,20 @@ export class SubmitAbsenceComponent implements OnInit { let elem = document.getElementById( this.absenceDffresponse[i].APPLICATION_COLUMN_NAME ) as HTMLInputElement; - let elemVal=""; + let elemVal = ""; if (elem.classList.contains('onic-date')) { - elemVal = (document.getElementById( + elemVal = (document.getElementById( this.absenceDffresponse[i].APPLICATION_COLUMN_NAME ) as HTMLInputElement).value; - if(elemVal){ + if (elemVal) { elemVal = moment(elemVal).format("YYYY/MM/DD hh:mm:ss"); } - - }else{ - elemVal = (document.getElementById( - this.absenceDffresponse[i].APPLICATION_COLUMN_NAME - ) as HTMLInputElement).value; - } + + } else { + elemVal = (document.getElementById( + this.absenceDffresponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + } textValue = elemVal; if ( @@ -1060,7 +1060,7 @@ export class SubmitAbsenceComponent implements OnInit { this.absenceDffresponse[i].DISPLAY_FLAG != "N" ) { //date - elemVal = this.common.formatDate(elemVal); + elemVal = this.common.formatDate(elemVal); } else if ( this.absenceDffresponse[i].FORMAT_TYPE == "Y" && this.absenceDffresponse[i].DISPLAY_FLAG != "N" @@ -1323,6 +1323,7 @@ export class SubmitAbsenceComponent implements OnInit { } return isSt; } + validateAbcenseTransaction() { (this.elementRef.nativeElement.querySelectorAll( "ion-item" @@ -1447,9 +1448,9 @@ export class SubmitAbsenceComponent implements OnInit { private handleSubmitAbsence(result) { if (this.common.validResponse(result)) { if (this.getPassdirfromNotifiPage) { - this.common.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA); - this.common.openConfirmAbsece(); - // this.navCtrl.push("SubmitAbsenceConfirmPage", { isResubmit: true }); + this.common.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA); + this.common.openConfirmAbsece(); + // this.navCtrl.push("SubmitAbsenceConfirmPage", { isResubmit: true }); } else { this.common.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA); this.common.openConfirmAbsece(); diff --git a/Mohem/src/app/app-routing.module.ts b/Mohem/src/app/app-routing.module.ts index b4b5da86..c6a651c9 100644 --- a/Mohem/src/app/app-routing.module.ts +++ b/Mohem/src/app/app-routing.module.ts @@ -25,7 +25,12 @@ const routes: Routes = [ { path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' }, { path: 'mowadhafi', loadChildren: './mowadhafi/mowadhafi.module#MowadhafiPageModule' }, { path: 'erm-channel', loadChildren: './erm-channel/erm-channel.module#ErmChannelPageModule' }, - { path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' } + { path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' }, + { path: 'reports', loadChildren: './reports/reports.module#ReportsPageModule' }, + + { path: 'termination', loadChildren: './termination/termination.module#TerminationPageModule' }, + { path: 'pending-transaction', loadChildren: './pending-transaction/pending-transaction.module#PendingTransactionPageModule' } + diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index 5b40ba6e..f4f782cc 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -35,7 +35,14 @@ {{ts.trPK('userProfile','title')}} - + + + + + + {{ts.trPK('userProfile','performance-evaluation')}} + + @@ -47,13 +54,32 @@ - + {{ts.trPK('userProfile','HR-Request')}} +
+ + + + + + + {{menu.MENU_NAME}} + + +
+ + + + + + {{ts.trPK('general','pending-transaction')}} + + @@ -133,6 +159,14 @@ {{ts.trPK('userProfile','title')}} + + + + + + {{ts.trPK('userProfile','performance-evaluation')}} + + @@ -149,6 +183,26 @@ {{ts.trPK('userProfile','HR-Request')}} +
+ + + + + + + {{menu.MENU_NAME}} + + +
+ + + + + + + {{ts.trPK('general','pending-transaction')}} + + diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 47934fec..676501d7 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -14,6 +14,7 @@ import { DigitalIdComponent } from './authentication/digital-id/digital-id.compo import { checkAndUpdatePureExpressionInline } from '@angular/core/src/view/pure_expression'; import { FirebaseX } from '@ionic-native/firebase-x/ngx'; import { BusinessCardComponent } from './authentication/business-card/business-card.component'; +import { MenuResponse } from './hmg-common/services/menu/models/menu-response'; @Component({ selector: 'app-root', @@ -122,7 +123,7 @@ export class AppComponent implements OnInit { public setScreenNameAnalytics(currentPageName: string) { try { - this.firebasex.setScreenName(currentPageName).then((result)=>{ + this.firebasex.setScreenName(currentPageName).then((result) => { console.log(result); }); } catch (Error) { } @@ -208,7 +209,7 @@ export class AppComponent implements OnInit { let jobTitle = user.POSITION_NAME.split('.'); if (jobTitle && jobTitle.length > 1) { this.User_Job_name = jobTitle[0] + " " + jobTitle[1]; - }​ + } //erm channel // if (!CommonService.SKIP) // this.cs.navigateForward('/erm-channel/survey'); @@ -218,7 +219,10 @@ export class AppComponent implements OnInit { }); }); this.events.subscribe('getNotCount', badge => { this.notBadge = badge; }); - this.events.subscribe('myTeamFlag', myTeamFlag => { this.TeamFlag = myTeamFlag; }); + this.events.subscribe('myTeamFlag', myTeamFlag => { + this.TeamFlag = myTeamFlag; + this.menuList = this.cs.sharedService.getSharedData(MenuResponse.MENU_LIST, false); + }); } private initializeDirection() { @@ -267,7 +271,10 @@ export class AppComponent implements OnInit { this.cs.openProfile('sideMenu'); this.menu.toggle(); } - + public performanceEvaluation() { + this.cs.openPerformanceevaluation(); + this.menu.toggle(); + } public openNotification() { this.cs.openNotificationPage(); this.menu.toggle(); @@ -294,7 +301,7 @@ export class AppComponent implements OnInit { //this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false); const modal = await this.modalController.create({ component: BusinessCardComponent, - cssClass: 'digital-id-modal-css', + cssClass: 'business-card-modal-css', componentProps: { 'userInfo': this.userInfo } @@ -348,4 +355,13 @@ export class AppComponent implements OnInit { } else { } }); } + oepnMyRequest(menu) { + this.cs.sharedService.setSharedData(menu, MenuResponse.SELECTED_MENU); + this.cs.openConcurrentReport(); + this.menu.toggle(); + } + oepnTransaction() { + this.cs.openTransactions(); + this.menu.toggle(); + } } diff --git a/Mohem/src/app/app.scss b/Mohem/src/app/app.scss index e91e3666..057206e1 100644 --- a/Mohem/src/app/app.scss +++ b/Mohem/src/app/app.scss @@ -35,4 +35,7 @@ .my-custom-modal-css .modal-wrapper { width: 95%; height: 60%; +} +.dependent-title .ion-title{ + font-size:0.4cm !important; } \ No newline at end of file diff --git a/Mohem/src/app/authentication/authentication.module.ts b/Mohem/src/app/authentication/authentication.module.ts index 0e5e953e..1cdb0ea9 100644 --- a/Mohem/src/app/authentication/authentication.module.ts +++ b/Mohem/src/app/authentication/authentication.module.ts @@ -14,14 +14,15 @@ import { Device } from '@ionic-native/device/ngx'; import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { SearchableOptionsModule } from '../hmg-common/ui/searchable-select/searchable-options.module'; -import { MobileNumberModule } from 'src/app/hmg-common/ui/mobile-number/mobile-number.module'; +import { MobileNumberModule } from 'src/app/hmg-common/ui/mobile-number/mobile-number.module'; import { SmsdialogPageModule } from 'src/app/hmg-common/ui/smsdialog/smsdialog.module'; import { SmsPageModule } from 'src/app/hmg-common/ui/sms/sms.module'; import { SmsPageComponent } from './sms-page/sms-page.page'; import { CheckUserComponent } from './check-user/check-user.component'; import { ChangePasswordComponent } from './change-password/change-password.component'; -import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component' -import {WelcomeComponent} from '../authentication/welcome/welcome.component' +import { ConfirmLoginComponent } from '../authentication/confirm-login/confirm-login.component' +import { WelcomeComponent } from '../authentication/welcome/welcome.component' +import { SmsRetriever } from '@ionic-native/sms-retriever/ngx'; const routes: Routes = [ { @@ -84,11 +85,12 @@ const routes: Routes = [ // ConfirmLoginComponent, WelcomeComponent, ], - providers:[ + providers: [ FingerprintAIO, Device, - SplashScreen + SplashScreen, + SmsRetriever ], - entryComponents:[] + entryComponents: [] }) export class AuthenticationPageModule { } diff --git a/Mohem/src/app/authentication/business-card/business-card.component.html b/Mohem/src/app/authentication/business-card/business-card.component.html index 6cabace2..efa14208 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.html +++ b/Mohem/src/app/authentication/business-card/business-card.component.html @@ -1,5 +1,5 @@ - + +
+ https://hmgwebservices.com/images/Moheem/CS.jpg +

{{userInfo.name_en}}

+

{{userInfo.name_ar}}

+
{{jobName}}
+
{{userInfo.mobile}}
+
{{userInfo.email}}
+
{{userInfo.company_url}}
+
- +
+ - + +
+ +
+

{{userInfo.name_en}}

+
{{jobName}}
+
{{userInfo.mobile}}
+
{{userInfo.email}}
+
{{userInfo.company_url}}
+
+
+ +
+ +
+
diff --git a/Mohem/src/app/authentication/business-card/business-card.component.scss b/Mohem/src/app/authentication/business-card/business-card.component.scss index f85bbad2..f2ee7250 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.scss +++ b/Mohem/src/app/authentication/business-card/business-card.component.scss @@ -38,10 +38,9 @@ // CS .card-size{ transform: rotate(90deg) !important; - // padding: 5% !important; - // padding-right: 0px !important; padding-right: 0px !important; padding-left: 15% !important; + padding: 8% !important; } .qr-style{ left: 260% !important; @@ -57,6 +56,9 @@ .qr-img-hmg-style{ left: 580px !important; } + .cs-card-size{ + padding: 15px !important; + } } @media screen and (min-width: 400px) and (min-height:700px) and (max-height: 799px){ @@ -81,6 +83,9 @@ .qr-img-hmg-style{ left: 495px !important; } + .cs-card-size{ + padding: 20px !important; + } } @media screen and (min-width: 325px) and (max-width:399px) and (max-height: 812px){ @@ -103,6 +108,9 @@ .qr-img-hmg-style{ left: 550px !important; } + .cs-card-size{ + padding: 10px !important; + } } @media screen and (min-width: 325px) and (max-width:399px) and (max-height: 700px){ @@ -140,18 +148,25 @@ } // HMG .logo-img-hmg-style{ - left: 245px !important; + left: 225px !important; } .qr-img-hmg-style{ left: 430px !important; } + .cs-card-size{ + padding:5px !important; + } + .name-div{ + padding: 3px !important; + } } @media screen and (min-width: 1px) and (max-width:320px) { .card-size{ transform: rotate(90deg) !important; position: relative; - bottom: 3%; + bottom: 10%; left: 8%; + padding: 10% !important } .qr-style{ width: 70% !important; @@ -176,34 +191,47 @@ .logo-img-hmg-style{ width: 380px !important; position: fixed !important; - left: 200px !important; + left: 240px !important; height: 81px !important; - bottom: 205px !important; + bottom: 175px !important; } .qr-img-hmg-style{ width: 105px !important; margin-top: 0px !important; position: relative !important; left: 390px !important; - top: 160px !important; + top: 150px !important; } .cs-card-size{ - padding: 15px !important; + padding: 0px !important; padding-top: 0px !important; padding-left: 1px !important; } } +@media screen and (min-width: 200px) and (max-width: 300px) and (max-height: 700px){ + .font-text-style{ + font-size: 11px !important; + } + .card-size{ + padding: 0% !important; + left: 7% !important; + bottom: 0% !important; + position: relative; + } + +} + .card-size{ transform: rotate(90deg); - padding: 6%; + padding: 18%; } .qr-style{ width: 70%; margin-top: 0px; position: relative; - left: 200%; + left: 135%; } .name-ar-style{ font-size: 20px; @@ -234,5 +262,5 @@ .cs-card-size{ transform: rotate(90deg); - padding: 25px; + padding: 0px; } \ No newline at end of file diff --git a/Mohem/src/app/authentication/business-card/business-card.component.ts b/Mohem/src/app/authentication/business-card/business-card.component.ts index 28a3bde3..0785bfb1 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.ts +++ b/Mohem/src/app/authentication/business-card/business-card.component.ts @@ -2,6 +2,8 @@ import { Component, OnInit, Input } from '@angular/core'; import { ModalController } from '@ionic/angular'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; @Component({ selector: 'app-business-card', @@ -12,15 +14,29 @@ export class BusinessCardComponent implements OnInit { public userInfo: any; public userJobName: any; + public jobName: any; + direction: string; constructor( public modalCtrl: ModalController, public ts: TranslatorService, - public common: CommonService + public common: CommonService, + public authService: AuthenticationService, ) { } ngOnInit() { this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); - console.log(this.userInfo); + this.direction = TranslatorService.getCurrentLanguageName(); + this.authService + .loadAuthenticatedUser() + .subscribe((user: AuthenticatedUser) => { + console.log(user); + if (user) { + let jobTitle = user.POSITION_NAME.split('.'); + if (jobTitle && jobTitle.length > 1) { + this.jobName = jobTitle[0] + " " + jobTitle[1]; + } + } + }); } @@ -30,4 +46,4 @@ export class BusinessCardComponent implements OnInit { }); } -} +} \ No newline at end of file diff --git a/Mohem/src/app/authentication/change-password/change-password.component.html b/Mohem/src/app/authentication/change-password/change-password.component.html index b758a8ce..43e2b34a 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -1,64 +1,106 @@ - + - - - - - - - - -
-
-

{{'changePassword,changePassword' | translate}}

+ + + + + + - -

{{'changePassword,newPassword' | translate}}

+ - - - +

{{'changePassword,newPassword' | translate}}

+ + + + + +

{{recentPasswordNote.text}}

+
+ + + +

{{isLetterCase.text}}

+
+ + +

{{isHasDigit.text}}

+
+ + +

{{isMinLength.text}}

+
+ + +

{{isRepeatedLetter.text}}

+
+ + + +

{{confirmMatchNew.text}}

+
+ + +

{{userNameMatchNew.text}}

+
+ +
+ + + + -
- - - -
- +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/change-password/change-password.component.scss b/Mohem/src/app/authentication/change-password/change-password.component.scss index 727737ed..a05e7a94 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.scss +++ b/Mohem/src/app/authentication/change-password/change-password.component.scss @@ -33,3 +33,7 @@ opacity:.5; } +.info{ + color: #000; + font-weight: bold; +} diff --git a/Mohem/src/app/authentication/change-password/change-password.component.ts b/Mohem/src/app/authentication/change-password/change-password.component.ts index 6ad7b9be..4b2a9f6a 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.ts +++ b/Mohem/src/app/authentication/change-password/change-password.component.ts @@ -9,7 +9,7 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser import { ForgetPassword } from '../models/forget.password'; import { LoginModel } from '../models/LoginModel'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; -import {LoginComponent} from "src/app/authentication/login/login.component"; +import { LoginComponent } from "src/app/authentication/login/login.component"; import { Password } from '../models/password'; import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; //import { FormBuilder, FormGroup, Validators } from '@angular/forms'; @@ -22,17 +22,89 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo export class ChangePasswordComponent implements OnInit { private loginData = new LoginModel(); public P_NEW_PASSWORD: string = ""; - public P_Confirm_NEW_PASSWORD : string = ""; - public P_OLD_PASSWORD : string = ""; - public P_USER_NAME : string; + public P_Confirm_NEW_PASSWORD: string = ""; + public P_OLD_PASSWORD: string = ""; + public P_USER_NAME: string; public logo = "assets/icon/login/lock.png"; + public testy = 'a123'; userData: any = {}; public isExpiredPwd: boolean = false; public NEW_PASSWORD: boolean = false; public Confirm_NEW_PASSWORD: boolean = false; public OLD_PASSWORD: boolean = false; - //public profile_form: FormGroup; + public currentPasswordIcon = 'password'; + public newPasswordIcon = 'password'; + public confirmPasswordIcon = 'password'; + + public recentPasswordNote = { + yellowImg: '../assets/imgs/mohemm-action/info.png', + text: this.ts.trPK('login', 'current-password-validation') + }; + public isLowerCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'lowercase-password-validation'), + isMatch: false + }; + public isUpperCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'uppercase-password-validation'), + isMatch: false + }; + public isLetterCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'letter-password-validation'), + isMatch: false + }; + public isHasDigit = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'numerica-password-validation'), + isMatch: false + }; + public isMinLength = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'min-password-validation'), + isMatch: false + }; + public isRepeatedLetter = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'repeating-password-validation'), + isMatch: false + }; + // public isContainSpecialChar = { + // blankImg: '../assets/icon/blank.svg', + // greenImg: '../assets/icon/green.svg', + // redImg: '../assets/imgs/close.svg', + // text: this.ts.trPK('login', 'special-character-password-validation'), + // isMatch: false + // }; + public confirmMatchNew = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'not-match-password-validation'), + isMatch: false + }; + public userNameMatchNew = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'contain-username-password-validation'), + isMatch: false + }; + public userId: string; constructor( public cs: CommonService, @@ -43,24 +115,24 @@ export class ChangePasswordComponent implements OnInit { public smsService: SmsReaderService, public changeDetector: ChangeDetectorRef, public sharedData: SharedDataService, - // public formBuilder: FormBuilder, - ) { - console.log("change password constructor"); - } + // public formBuilder: FormBuilder, + ) { + console.log("change password constructor"); + } ngOnInit() { console.log("change password oninit"); this.isExpiredPwd = - this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false; + this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false; const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); - this.P_USER_NAME =data.P_USER_NAME; + this.P_USER_NAME = data.P_USER_NAME; console.log(this.isExpiredPwd); console.log(this.P_USER_NAME); - // this.profile_form = this.formBuilder.group({ - // password: ['', Validators.compose([Validators.minLength(8)])] - // }); + // this.profile_form = this.formBuilder.group({ + // password: ['', Validators.compose([Validators.minLength(8)])] + // }); // this.authService // .loadAuthenticatedUser() // .subscribe((user: AuthenticatedUser) => { @@ -78,97 +150,228 @@ export class ChangePasswordComponent implements OnInit { private checkUserResult: CheckUserAuthenticationResponse; - submit(){ + submit() { console.log(this.isExpiredPwd); - if(this.isExpiredPwd){ + if (this.isExpiredPwd) { this.expiredPassword(); - }else{ + } else { this.changePassword(); } } - public expiredPassword(){ + public expiredPassword() { const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); //this.loginData.P_USER_NAME = this.P_USER_NAME; - let request:Password = new Password(); - request.P_OLD_PASSWORD=this.P_OLD_PASSWORD; - request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD; - request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD; + let request: Password = new Password(); + request.P_OLD_PASSWORD = this.P_OLD_PASSWORD; + request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD; + request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD; request.P_USER_NAME = this.P_USER_NAME; this.authService.submitExpiredPassword( - request, - () => { - //this.sendSMSForForgotPassword(); - }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { - if (this.cs.validResponse(result)) { - this.checkUserResult = result; - console.log(result); - this.cs.toastPK("changePassword","successChange"); - this.sharedData.setSharedData(false,Password.IS_EXPIRED_PSW); - this.cs.openLogin(); - } - }); + request, + () => { + //this.sendSMSForForgotPassword(); + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + console.log(result); + this.cs.greenToastPK("changePassword", "successChange"); + this.sharedData.setSharedData(false, Password.IS_EXPIRED_PSW); + // this.cs.sharedService.getSharedData( AuthenticationService.IMEI_USER_DATA); + localStorage.setItem('password', this.P_NEW_PASSWORD); + this.cs.openLogin(); + } + }); } - public changePassword(){ + public changePassword() { const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); //this.loginData.P_USER_NAME = this.P_USER_NAME; - let request:Password = new Password(); - request.P_OLD_PASSWORD=this.P_OLD_PASSWORD; - request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD; - request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD; + let request: Password = new Password(); + request.P_OLD_PASSWORD = this.P_OLD_PASSWORD; + request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD; + request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD; request.P_USER_NAME = this.P_USER_NAME; this.authService.submitChangePassword( - request, - () => { - //this.sendSMSForForgotPassword(); - }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { - if (this.cs.validResponse(result)) { - this.checkUserResult = result; - console.log(result); - this.cs.toastPK("changePassword","successChange"); - this.cs.openHome(); - } - }); + request, + () => { + //this.sendSMSForForgotPassword(); + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + localStorage.setItem('password', this.P_NEW_PASSWORD); + console.log(result); + this.cs.greenToastPK("changePassword", "successChange"); + localStorage.setItem('password', this.P_NEW_PASSWORD); + this.cs.openHome(); + } + }); } - onChangeCNP(){ -// in UAT Alow to the length of password less than 8 -// so if we ready to go life change it to >= 8 + onChangeCNP() { + // in UAT Alow to the length of password less than 8 + // so if we ready to go life change it to >= 8 if (this.P_Confirm_NEW_PASSWORD.length >= 3) { - this.Confirm_NEW_PASSWORD=true; + this.Confirm_NEW_PASSWORD = true; + + + } else { + this.Confirm_NEW_PASSWORD = false; + + } - - }else{ - this.Confirm_NEW_PASSWORD=false; - } - -} -onChangeNP(){ -// in UAT Alow to the length of password less than 8 -// so if we ready to go life change it to >= 8 - if (this.P_NEW_PASSWORD.length >= 3) { - this.NEW_PASSWORD=true; - -}else{ - this.NEW_PASSWORD=false; + onChangeNP() { + // in UAT Alow to the length of password less than 8 + // so if we ready to go life change it to >= 8 + if (this.P_NEW_PASSWORD.length >= 3) { + this.NEW_PASSWORD = true; -} + } else { + this.NEW_PASSWORD = false; -} -onChangeOP(){ -// in UAT Alow to the length of password less than 8 -// so if we ready to go life change it to >= 8 - if (this.P_OLD_PASSWORD.length >= 3) { - this.OLD_PASSWORD=true; - -}else{ - this.OLD_PASSWORD=false; + } -} + } + onChangeOP() { + // in UAT Alow to the length of password less than 8 + // so if we ready to go life change it to >= 8 + if (this.P_OLD_PASSWORD.length >= 3) { + this.OLD_PASSWORD = true; -} + } else { + this.OLD_PASSWORD = false; + + } + + } + + checkerFuncation(val) { + if (this.P_NEW_PASSWORD === '') { + switch (val) { + case 1: + return this.isLetterCase.blankImg; + case 3: + return this.isHasDigit.blankImg; + case 4: + return this.isMinLength.blankImg; + case 5: + return this.isRepeatedLetter.blankImg; + // case 6: + // return this.isContainSpecialChar.blankImg; + case 7: + return this.confirmMatchNew.blankImg; + case 8: + return this.userNameMatchNew.blankImg; + } + } else { + switch (val) { + // case 1: + // if (/[a-z]/.test(this.P_NEW_PASSWORD)) { + // this.isLowerCase.isMatch = true; + // return this.isLowerCase.greenImg; + // } else { + // this.isLowerCase.isMatch = false; + // return this.isLowerCase.redImg; + // } + // case 2: + // if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { + // this.isUpperCase.isMatch = true; + // return this.isUpperCase.greenImg; + // } else { + // this.isUpperCase.isMatch = false; + // return this.isUpperCase.redImg; + // } + case 1: + if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { + this.isLetterCase.isMatch = true; + return this.isLetterCase.greenImg; + } else { + this.isLetterCase.isMatch = false; + return this.isLetterCase.redImg; + } + case 3: + if (/[0-9]/.test(this.P_NEW_PASSWORD)) { + this.isHasDigit.isMatch = true; + return this.isHasDigit.greenImg; + } else { + this.isHasDigit.isMatch = false; + return this.isHasDigit.redImg; + } + case 4: + if (this.P_NEW_PASSWORD.length >= 8) { + this.isMinLength.isMatch = true; + return this.isMinLength.greenImg; + } else { + this.isMinLength.isMatch = false; + return this.isMinLength.redImg; + } + case 5: + if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { + this.isRepeatedLetter.isMatch = false; + return this.isRepeatedLetter.redImg; + } else { + this.isRepeatedLetter.isMatch = true; + return this.isRepeatedLetter.greenImg; + } + // case 6: + // if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { + // this.isContainSpecialChar.isMatch = true; + // return this.isContainSpecialChar.greenImg; + // } else { + // this.isContainSpecialChar.isMatch = false; + // return this.isContainSpecialChar.redImg; + // } + case 7: + if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { + this.confirmMatchNew.isMatch = false; + return this.confirmMatchNew.redImg; + } else { + this.confirmMatchNew.isMatch = true; + return this.confirmMatchNew.greenImg; + } + case 8: + if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) { + this.userNameMatchNew.isMatch = true; + return this.userNameMatchNew.greenImg; + } else { + this.userNameMatchNew.isMatch = false; + return this.userNameMatchNew.redImg; + } + } + } + } + + + disabledSubmitBtn() { + if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch + && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.NEW_PASSWORD + && this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.confirmMatchNew.isMatch) { + return false; + } else { return true; } + } + + showPassword(val) { + if (val === 1) + this.newPasswordIcon = 'password'; + else if (val === 2) { + this.confirmPasswordIcon = 'password' + } + else { + this.currentPasswordIcon = 'password'; + } + } + + hidePassword(val) { + if (val === 1) + this.newPasswordIcon = 'text'; + else if (val === 2) { + this.confirmPasswordIcon = 'text' + } + else { + this.currentPasswordIcon = 'text'; + } + } } diff --git a/Mohem/src/app/authentication/check-user/check-user.component.html b/Mohem/src/app/authentication/check-user/check-user.component.html index 35bde363..e99fae9a 100644 --- a/Mohem/src/app/authentication/check-user/check-user.component.html +++ b/Mohem/src/app/authentication/check-user/check-user.component.html @@ -32,6 +32,6 @@
- +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/check-user/check-user.component.ts b/Mohem/src/app/authentication/check-user/check-user.component.ts index fcaed803..2b74c986 100644 --- a/Mohem/src/app/authentication/check-user/check-user.component.ts +++ b/Mohem/src/app/authentication/check-user/check-user.component.ts @@ -46,32 +46,27 @@ export class CheckUserComponent implements OnInit { return true; } - public userCheck() - { + public userCheck() { this.cs.startLoading(); const request = new CheckUserAuthenticationRequest(); request.P_USER_NAME = this.P_USER_NAME; - this.authService.checkUserAuthentication( - request, - () => { - /* Write code for error */ - }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { - if (this.cs.validResponse(result)) { - this.checkUserResult = result; - this.cs.stopLoading(); - this.sendSMSForForgotPassword(); - } - }); + this.authService.checkUserAuthentication(request, () => {}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + this.cs.stopLoading(); + this.sendSMSForForgotPassword(); + } + }); } private checkUserResult: CheckUserAuthenticationResponse; - private sendSMSForForgotPassword() { + public sendSMSForForgotPassword() { this.cs.startLoading(); let changePwdObj= new LoginRequest(); - changePwdObj.MobileNumber= this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; + // changePwdObj.MobileNumber= this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; changePwdObj.P_USER_NAME=this.P_USER_NAME; - changePwdObj.P_MOBILE_NUMBER=this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; + // changePwdObj.P_MOBILE_NUMBER=this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; this.authService.sendPublicSMS( changePwdObj, diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index 2e345b5c..fe0ba645 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -12,7 +12,7 @@ import { GetLoginInfoResponse } from '../../hmg-common/services/authentication/m import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request'; import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response'; import { PushService } from 'src/app/hmg-common/services/push/push.service'; -import { ModalController, Platform } from '@ionic/angular'; +import { ModalController, Platform, AlertController } from '@ionic/angular'; import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response'; import { LoginModel } from '../models/LoginModel'; import * as moment from 'moment'; @@ -20,6 +20,9 @@ import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authenticat import { NFC } from "@ionic-native/nfc/ngx"; import { DigitalIdComponent } from '../digital-id/digital-id.component'; import { AppUpdateComponent } from '../app-update/app-update.component'; +import { Password } from '../models/password'; +import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request'; +import { SmsRetriever } from '@ionic-native/sms-retriever/ngx'; @Component({ selector: 'app-confirm-login', @@ -53,7 +56,9 @@ export class ConfirmLoginComponent implements OnInit { public isNFCAvailable = false; direction: string; userInfo: any; - + public businessInfo: object; + private checkUserResult: CheckUserAuthenticationResponse; + private signature: string; constructor( public ts: TranslatorService, public cs: CommonService, @@ -63,7 +68,9 @@ export class ConfirmLoginComponent implements OnInit { public pushService: PushService, public platform: Platform, public modalController: ModalController, - private nfc: NFC + public alertController: AlertController, + private nfc: NFC, + private smsRetriever: SmsRetriever ) { this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); this.deviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); @@ -83,6 +90,7 @@ export class ConfirmLoginComponent implements OnInit { this.direction = TranslatorService.getCurrentLanguageName(); this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.checkNFCStatus(); + this.generateSMSsignature(); // **checkIfAvailable FAIO **// this.checkIfAvailable(); // **getSharedData of IMEI_USER_DATA and REGISTER_DATA_FOR_LOGIIN to set defult value **// @@ -224,13 +232,18 @@ export class ConfirmLoginComponent implements OnInit { } - + public generateSMSsignature() { + this.smsRetriever.getAppHash() + .then((res: any) => this.signature = res) + .catch((error: any) => console.error(error)); + } public sendActivationCode(type: number) { + console.log(this.signature); const request = new SendActivationByType(); this.authService.setPublicFields(request); request.OTP_SendType = type; request.MobileNumber = this.loginData.MobileNumber; - + request.smsSignature = this.signature; request.IsMobileFingerPrint = 0; request.P_USER_NAME = this.loginData.P_USER_NAME; @@ -294,7 +307,7 @@ export class ConfirmLoginComponent implements OnInit { private presentBiometricDialog() { this.faio.show({ title: 'Biometric Authetnciation', // (Android Only) | optional | Default: " Biometric Sign On" - subtitle: 'Coolest Plugin ever', // (Android Only) | optional | Default: null + subtitle: 'Mohemm', // (Android Only) | optional | Default: null description: this.ts.trPK('general', 'auth-please'), // optional | Default: null fallbackButtonTitle: this.ts.trPK('general', 'use-pin'), // optional | When disableBackup is false defaults to "Use Pin". disableBackup: true, // optional | default: false @@ -367,10 +380,24 @@ export class ConfirmLoginComponent implements OnInit { this.authService.checkSMS(request, () => { }, this.ts.trPK('general', 'ok')) .subscribe((result: SMSCheckResponse) => { if (this.cs.validResponse(result)) { + this.businessInfo = { + show_business: result.BusinessCardPrivilege, + name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En, + job_en: result.MemberInformationList[0].JOB_NAME_En, + name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar, + job_ar: result.MemberInformationList[0].JOB_NAME_Ar, + mobile: result.MemberInformationList[0].MobileNumberWithZipCode, + qr: result.MemberInformationList[0].BusinessCardQR, + company_logo: result.BC_Logo ? result.BC_Logo : result.CompanyImageURL, + company_url: result.BC_Domain, + company_type: result.CompanyMainCompany, + email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS + } // Wifi Credientials CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; + localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo)); AuthenticationService.servicePrivilage = result.Privilege_List; this.authService.setAuthenticatedUser(result).subscribe(() => { @@ -412,7 +439,7 @@ export class ConfirmLoginComponent implements OnInit { const request = new LoginRequest(); request.P_USER_NAME = this.username; request.P_LANGUAGE = 'US'; // this.language; - request.P_PASSWORD = this.password; + request.P_PASSWORD = localStorage.getItem('password'); this.authService .login(request, () => { console.log('error here'); @@ -431,13 +458,78 @@ export class ConfirmLoginComponent implements OnInit { this.confirm(this.loginType); } else { if (result.IsPasswordExpired) { - // alert("dont forget to handelpresentPasswordExpiredDialog() "); - // this.presentPasswordExpiredDialog(); ***** + this.presentPasswordExpiredDialog(); } } }); } + async presentPasswordExpiredDialog() { + const alert = await this.alertController.create({ + header: this.ts.trPK('general', 'confirm'), + message: this.ts.trPK('login', 'password-expired'), + buttons: [ + { + text: this.ts.trPK('general', 'ok'), + handler: () => { + console.log('Confirm Okay'); + this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW); + this.userCheck(); + } + } + ] + }); + await alert.present(); + } + + public userCheck() { + this.cs.startLoading(); + const request = new CheckUserAuthenticationRequest(); + request.P_USER_NAME = this.username; + this.authService.checkUserAuthentication( + request, + () => { + /* Write code for error */ + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + this.cs.stopLoading(); + this.sendSMSForForgotPassword(); + } + }); + } + + + private sendSMSForForgotPassword() { + this.cs.startLoading(); + const changePwdObj = new LoginRequest(); + changePwdObj.MobileNumber = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; + changePwdObj.P_USER_NAME = this.username; + changePwdObj.P_MOBILE_NUMBER = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; + this.authService.sendPublicSMS( + changePwdObj, + () => { + // this.sendSMSForForgotPassword(); + /* Write code for error */ + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + + console.log(result); + + this.loginData = new LoginModel(); + this.loginData.LogInTokenID = result.LogInTokenID; + this.loginData.P_USER_NAME = this.username; + + this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); + this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); + this.sharedData.setSharedData(true, Password.IS_FORGET_PSW); + this.cs.stopLoading(); + this.cs.openSMSPage(); + } + }); + } + private handleAppUpdate(result) { this.iosLink = result.IOSLink; this.androidLink = result.AndroidLink; @@ -463,14 +555,14 @@ export class ConfirmLoginComponent implements OnInit { }); } - async appUpdate(msg, result) { + async appUpdate(msg, result) { const modal = await this.modalController.create({ component: AppUpdateComponent, cssClass: 'app-update-modal-css', - componentProps: {'msg':msg} + componentProps: { 'msg': msg } }); modal.onDidDismiss().then((data) => { - this.handleAppUpdate(result); + this.handleAppUpdate(result); }); return await modal.present(); } @@ -502,9 +594,9 @@ export class ConfirmLoginComponent implements OnInit { let buttonSelected; this.buttons.forEach(element => { element.forEach(elementValue => { - if(typeNumber === elementValue.value){ + if (typeNumber === elementValue.value) { buttonSelected = elementValue; - }else{ + } else { elementValue.visible = false; } }); diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index f363261d..fc00d176 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -24,18 +24,65 @@ + + + +

{{recentPasswordNote.text}}

+
+ + + +

{{isLetterCase.text}}

+
+ + +

{{isHasDigit.text}}

+
+ + +

{{isMinLength.text}}

+
+ + +

{{isRepeatedLetter.text}}

+
+ + + +

{{confirmMatchNew.text}}

+
+ + +

{{userNameMatchNew.text}}

@@ -45,6 +92,8 @@
- +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/forgot/forgot.component.scss b/Mohem/src/app/authentication/forgot/forgot.component.scss index 139597f9..55589cb9 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.scss +++ b/Mohem/src/app/authentication/forgot/forgot.component.scss @@ -1,2 +1,8 @@ +.disabledButton{ + opacity:.5; - +} +.info{ + color: #000; + font-weight: bold; +} diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 8e76d97a..51cc3e09 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -9,7 +9,6 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser import { ForgetPassword } from '../models/forget.password'; import { LoginModel } from '../models/LoginModel'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; -import {LoginComponent} from "src/app/authentication/login/login.component"; @Component({ selector: 'app-forgot', templateUrl: './forgot.component.html', @@ -18,10 +17,81 @@ import {LoginComponent} from "src/app/authentication/login/login.component"; export class ForgotComponent implements OnInit { private loginData = new LoginModel(); - public P_NEW_PASSWORD: string; - public P_Confirm_NEW_PASSWORD : string; - public P_USER_NAME : string; - public logo = "assets/icon/login/lock.png"; + public P_NEW_PASSWORD = ''; + // tslint:disable-next-line: variable-name + public P_Confirm_NEW_PASSWORD = ''; + public P_USER_NAME: string; + public logo = 'assets/icon/login/lock.png'; + public newPasswordIcon = "password"; + public confirmPasswordIcon = "password"; + public recentPasswordNote = { + yellowImg: '../assets/imgs/mohemm-action/info.png', + text: this.ts.trPK('login', 'current-password-validation') + }; + public isLowerCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'lowercase-password-validation'), + isMatch: false + }; + public isUpperCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'uppercase-password-validation'), + isMatch: false + }; + public isLetterCase = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'letter-password-validation'), + isMatch: false + }; + public isHasDigit = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'numerica-password-validation'), + isMatch: false + }; + public isMinLength = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'min-password-validation'), + isMatch: false + }; + public isRepeatedLetter = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'repeating-password-validation'), + isMatch: false + }; + // public isContainSpecialChar = { + // blankImg: '../assets/icon/blank.svg', + // greenImg: '../assets/icon/green.svg', + // redImg: '../assets/imgs/close.svg', + // text: this.ts.trPK('login', 'special-character-password-validation'), + // isMatch: false + // }; + public confirmMatchNew = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'not-match-password-validation'), + isMatch: false + }; + public userNameMatchNew = { + blankImg: '../assets/icon/blank.svg', + greenImg: '../assets/icon/green.svg', + redImg: '../assets/imgs/close.svg', + text: this.ts.trPK('login', 'contain-username-password-validation'), + isMatch: false + }; + public userId: string; constructor( public cs: CommonService, @@ -35,16 +105,22 @@ export class ForgotComponent implements OnInit { ) { } - ngOnInit() {} + ngOnInit() { + console.log('ENAD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'); + this.userId = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false).P_USER_NAME; + console.log(this.userId); + } public onForgot() { this.sendSMSForForgotPassword(); } + // tslint:disable-next-line: member-ordering private checkUserResult: CheckUserAuthenticationResponse; private sendSMSForForgotPassword() { const request = new ForgetPassword(); + console.log(request); this.authService.sendForgetPassword( request, () => { @@ -56,7 +132,7 @@ export class ForgotComponent implements OnInit { }); } - public forgotpassword(){ + public forgotpassword() { const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); const forgetPasswordTokenResult = this.sharedData.getSharedData('checkSMSResponse', false); let forgetPasswordTokenID = ''; @@ -64,24 +140,149 @@ export class ForgotComponent implements OnInit { forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID; } this.loginData.P_USER_NAME = this.P_USER_NAME; - let request: any = {}; - request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD; - request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD; + const request: any = {}; + request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD; + request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD; request.P_USER_NAME = data.P_USER_NAME; - request.ForgetPasswordTokenID = forgetPasswordTokenID; - + request.ForgetPasswordTokenID = forgetPasswordTokenID; + this.authService.submitForgetPassword( request, () => { - //this.sendSMSForForgotPassword(); }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { if (this.cs.validResponse(result)) { this.checkUserResult = result; console.log(result); - this.cs.toastPK("changePassword","successChange"); + this.cs.greenToastPK("changePassword", "successChange"); + localStorage.setItem('password', this.P_NEW_PASSWORD); this.cs.openLogin(); } }); - + + } + + checkerFuncation(val) { + if (this.P_NEW_PASSWORD === '') { + switch (val) { + // case 1: + // return this.isLowerCase.blankImg; + // case 2: + // return this.isUpperCase.blankImg; + case 1: + return this.isLetterCase.blankImg; + case 3: + return this.isHasDigit.blankImg; + case 4: + return this.isMinLength.blankImg; + case 5: + return this.isRepeatedLetter.blankImg; + // case 6: + // return this.isContainSpecialChar.blankImg; + case 7: + return this.confirmMatchNew.blankImg; + case 8: + return this.userNameMatchNew.blankImg; + } + } else { + switch (val) { + // case 1: + // if (/[a-z]/.test(this.P_NEW_PASSWORD)) { + // this.isLowerCase.isMatch = true; + // return this.isLowerCase.greenImg; + // } else { + // this.isLowerCase.isMatch = false; + // return this.isLowerCase.redImg; + // } + // case 2: + // if (/[A-Z]/.test(this.P_NEW_PASSWORD)) { + // this.isUpperCase.isMatch = true; + // return this.isUpperCase.greenImg; + // } else { + // this.isUpperCase.isMatch = false; + // return this.isUpperCase.redImg; + // } + case 1: + if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) { + this.isLetterCase.isMatch = true; + return this.isLetterCase.greenImg; + } else { + this.isLetterCase.isMatch = false; + return this.isLetterCase.redImg; + } + case 3: + if (/[0-9]/.test(this.P_NEW_PASSWORD)) { + this.isHasDigit.isMatch = true; + return this.isHasDigit.greenImg; + } else { + this.isHasDigit.isMatch = false; + return this.isHasDigit.redImg; + } + case 4: + if (this.P_NEW_PASSWORD.length >= 8) { + this.isMinLength.isMatch = true; + return this.isMinLength.greenImg; + } else { + this.isMinLength.isMatch = false; + return this.isMinLength.redImg; + } + case 5: + if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) { + this.isRepeatedLetter.isMatch = false; + return this.isRepeatedLetter.redImg; + } else { + this.isRepeatedLetter.isMatch = true; + return this.isRepeatedLetter.greenImg; + } + // case 6: + // if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) { + // this.isContainSpecialChar.isMatch = true; + // return this.isContainSpecialChar.greenImg; + // } else { + // this.isContainSpecialChar.isMatch = false; + // return this.isContainSpecialChar.redImg; + // } + case 7: + if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) { + this.confirmMatchNew.isMatch = false; + return this.confirmMatchNew.redImg; + } else { + this.confirmMatchNew.isMatch = true; + return this.confirmMatchNew.greenImg; + } + case 8: + if (!this.P_NEW_PASSWORD.includes(this.userId)) { + this.userNameMatchNew.isMatch = true; + return this.userNameMatchNew.greenImg; + } else { + this.userNameMatchNew.isMatch = false; + return this.userNameMatchNew.redImg; + } + } + } + } + + disabledSubmitBtn() { + if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch + && this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD + && this.P_Confirm_NEW_PASSWORD && this.confirmMatchNew.isMatch) { + return false; + } else { return true; } } + + showPassword(val) { + if (val == 1) + this.newPasswordIcon = 'password'; + else { + this.confirmPasswordIcon = 'password' + } + } + + hidePassword(val) { + if (val == 1) + this.newPasswordIcon = 'text'; + else { + this.confirmPasswordIcon = 'text' + } + } + } diff --git a/Mohem/src/app/authentication/models/sendActivationByType.ts b/Mohem/src/app/authentication/models/sendActivationByType.ts index 76d2f29e..6d1447c5 100644 --- a/Mohem/src/app/authentication/models/sendActivationByType.ts +++ b/Mohem/src/app/authentication/models/sendActivationByType.ts @@ -2,30 +2,31 @@ import { Request } from 'src/app/hmg-common/services/models/request'; export class SendActivationByType extends Request { P_USER_NAME: string; // id - UserName:string; + UserName: string; MobileNumber: string; // phone number ZipCode: string; LogInTokenID: string; - OTP_SendType:number; - IsMobileFingerPrint:number; - P_LEGISLATION_CODE:string; + OTP_SendType: number; + IsMobileFingerPrint: number; + P_LEGISLATION_CODE: string; + smsSignature: string; // VersionID:string; - - - -// Test -//{ -// "Channel":31, -// "LanguageID":2, -// "LogInTokenID":"Wfm9uDlWhEi3vFsQMqUz3w==", -// "MobileNumber":"0508079569", -// "P_USER_NAME":"191817", -// "UserName":"191817", -// "VersionID":2.0, -// "P_LEGISLATION_CODE":"SA", -// "IsMobileFingerPrint":0, -// "OTP_SendType":1 -// } + + + + // Test + //{ + // "Channel":31, + // "LanguageID":2, + // "LogInTokenID":"Wfm9uDlWhEi3vFsQMqUz3w==", + // "MobileNumber":"0508079569", + // "P_USER_NAME":"191817", + // "UserName":"191817", + // "VersionID":2.0, + // "P_LEGISLATION_CODE":"SA", + // "IsMobileFingerPrint":0, + // "OTP_SendType":1 + // } diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.html b/Mohem/src/app/authentication/sms-page/sms-page.page.html index 1fa9de7b..854ab267 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.html +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html @@ -1,70 +1,142 @@ + + + + + +showBack="true" + +[headerText]="'verificationcode,verificationcode' | translate"> + + + - - -
-
- - -

{{'verificationcode,verificationcode' | translate}}

-
-

{{'verificationcode,title' | translate}} - {{'verificationcode,verificationcode' | translate}} - {{'verificationcode,by' | translate}} - {{'verificationcode , sms' | translate}}, - {{'verificationcode , whatsapp' | translate}}, - - {{'verificationcode,instruct' | translate}} - {{'general,submit' | translate}}

- -
-
-
-

- -
-

{{displayTime}}

-

- - - - - - - - - - + + + + + +
+ +
+ + + + + +

{{'verificationcode,verificationcode' | translate}}

+ +
+ +

{{'verificationcode,title' | translate}} + +{{'verificationcode,verificationcode' | translate}} + +{{'verificationcode,by' | translate}} + +{{'verificationcode , sms' | translate}}, + +{{'verificationcode , whatsapp' | translate}}, + + + +{{'verificationcode,instruct' | translate}} + +{{'general,submit' | translate}}

+ +
+ +
+ +
+ +

+ + + +
+ +

{{displayTime}}

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + +

{{messageValue}}

+ +
+ + + -
- -
-
\ No newline at end of file + +
+ + + +
+ +​ diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index 0bc5507f..aa9bf3b6 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -1,306 +1,629 @@ - import { Component, OnInit } from '@angular/core'; + import { ElementRef } from '@angular/core'; + import { NavController, Platform } from '@ionic/angular'; + import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + import { CommonService } from 'src/app/hmg-common/services/common/common.service'; + import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; + import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request'; + import { LoginModel } from '../models/LoginModel'; + import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; + import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response'; + import { Password } from '../models/password'; + import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request'; + import * as moment from 'moment'; + import { NFC } from "@ionic-native/nfc/ngx"; +import { SmsRetriever } from '@ionic-native/sms-retriever/ngx'; + @Component({ + selector: 'app-sms-page', + templateUrl: './sms-page.page.html', + styleUrls: ['./sms-page.page.scss'] + }) + + export class SmsPageComponent implements OnInit { + public static LOGIN_DATA = 'LOGIN_DATA'; + Channel = 0; + activationCode: string; + P_SESSION_ID: number; + P_USER_NAME: string; + timeInSeconds: any; + time: any; + runTimer: any; + hasStarted: any; + hasFinished: any; + remainingTime: any; + displayTime: any; + loginTokenID: string; + public isForgetPwd = false; + public isExpiredPwd = false; + public count = 0; + private loginData = new LoginModel(); + public deviceToken: any; + public loginTypeData: any; + public logo = 'assets/icon/login/password.png'; + // tslint:disable-next-line: variable-name + public smc_code: any = []; + code: any; + // tslint:disable-next-line: variable-name + user_name: string; + public isPostNoLoad = true; + loginType: any; + activeType: any; + public isNFCAvailable = false; + public showErrorMessage = false; + public messageValue: string; + public businessInfo: object; + public isAutoRead: boolean = false; + constructor( + public navCtrl: NavController, + public translate: TranslatorService, + public common: CommonService, + private elementRef: ElementRef, + public authService: AuthenticationService, + public sharedData: SharedDataService, + public platform: Platform, - private nfc: NFC - ) {} + + private nfc: NFC, + + private smsRetriever: SmsRetriever + + ) { } + + ngOnInit() { + this.checkNFCStatus(); - this.activeType=this.common.getActiveTypeLogin(); - console.log("active "+ this.common.sharedService.getSharedData('active-type',true)); - console.log("activeType :"+this.activeType); + this.activeType = this.common.getActiveTypeLogin(); + + console.log("active " + this.common.sharedService.getSharedData('active-type', true)); + + + + console.log("activeType :" + this.activeType); + this.count = 0; + this.initTimer(); + this.startTimer(); + this.isForgetPwd = this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false; + this.isExpiredPwd = this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false; + this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + this.deviceToken = this.common.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + // tslint:disable-next-line: triple-equals + if (this.deviceToken == undefined) { + this.deviceToken = localStorage.getItem('deviceToken'); + } + console.log('deviceToken :' + this.deviceToken); + this.loginTypeData = this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false); - if( this.loginTypeData){ - this.loginType=this.loginTypeData.loginType; - console.log("loginType :"+this.loginTypeData.loginType); - }else{ - this.loginType=1; - } + if (this.loginTypeData) { + + this.loginType = this.loginTypeData.loginType; + + + + console.log("loginType :" + this.loginTypeData.loginType); + + } else { + + this.loginType = 1; + + } + + this.smsRetriever.startWatching() + + .then((res: any) => this.checkActivation(res, true)) + + .catch((error: any) => console.error(error)); + + } + + checkActivation(res, isAndroid) { + + this.isAutoRead = true; + + var pattern = /\d+/g; + + if (isAndroid) + + var code = res.Message.match(pattern)[0]; + + else + + var code = res; + + + this.activationCode = code + + this.smc_code = code.split(''); + + this.checkVerificationCode(); } initTimer() { + if (!this.timeInSeconds) { - this.timeInSeconds = 600; + + this.timeInSeconds = 120; + } + this.time = this.timeInSeconds; + this.runTimer = false; + this.hasStarted = false; + this.hasFinished = false; + this.remainingTime = this.timeInSeconds; + this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime); + } + + startTimer() { + this.runTimer = true; + this.hasStarted = true; + this.timerTick(); + } + + pauseTimer() { + this.runTimer = false; + } + + resumeTimer() { + this.startTimer(); + } + + timerTick() { + setTimeout(() => { + if (!this.runTimer) { + return; + } + this.remainingTime--; + this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime); + if (this.remainingTime > 0) { + this.timerTick(); + } else { + this.hasFinished = true; + this.pauseTimer(); + this.navCtrl.pop(); + } + }, 1000); + } + + ionViewWillLeave() { + this.pauseTimer(); + } + + checkOTPLength() { + // tslint:disable-next-line: triple-equals + if (this.activationCode.length == 4) { + this.checkVerificationCode(); + } + } + + checkVerificationCode() { + this.code = this.smc_code.join(''); + if (this.count < 3) { + // tslint:disable-next-line: triple-equals + if (this.code == undefined || this.code == null || this.code == '') { - // this.common.showAlert(this.translate.translate('verificationcode.emptyCode')); + + // this.common.showAlert(this.translate.translate('verificationcode.emptyCode')); + } else { + this.count = this.count + 1; + if (this.isForgetPwd || this.isExpiredPwd) { + this.checkForgetPwdSMS(); + } else { + this.checkSMS(); + } + } + } else { + const msg: string = this.translate.trPK('general', 'noOfTriesLogin'); + this.common.JustAlertDialog(this.translate.trPK('general', 'ok'), msg); + } + } + + async checkNFCStatus() { + try { + let nfcStatus = await this.nfc.enabled(); + console.log("nfc status >>>>>>>>>>" + nfcStatus); + this.isNFCAvailable = true; + } catch (err) { + console.log("Error reading tag", err); + if (err === "NO_NFC") { + this.isNFCAvailable = false; + } else if (err === "NFC_DISABLED") { - this.isNFCAvailable = true; + + this.isNFCAvailable = true; + } else { + this.isNFCAvailable = false; + } + } + } + + public checkSMS() { - this.showErrorMessage = false; - const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); - const request = new SMSCheckRequest(); - request.LogInTokenID = data.LogInTokenID; - request.activationCode = this.code; // code;this.activationCode; - request.P_USER_NAME = data.P_USER_NAME; - request.MobileNumber = data.MobileNumber; - request.IsDeviceNFC = this.isNFCAvailable; - this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => { - if (this.common.validResponse(result)) { - - //save business card info - this.businessInfo = { - show_business: result.BusinessCardPrivilege, - name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En, - job_en: result.MemberInformationList[0].JOB_NAME_En, - name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar, - job_ar: result.MemberInformationList[0].JOB_NAME_Ar, - mobile: result.MemberInformationList[0].MobileNumberWithZipCode, - qr: result.MemberInformationList[0].BusinessCardQR, - company_logo: result.BC_Logo ? result.BC_Logo: result.CompanyImageURL, - company_url: result.BC_Domain, - company_type: result.CompanyMainCompany, - email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS - } - // Wifi Credientials - CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; - CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; - localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo)); - // this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info'); - - AuthenticationService.servicePrivilage = result.Privilege_List; - this.authService.setAuthenticatedUser(result).subscribe(() => { - localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME); - this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME; - const currDateTime = moment().format('MMM DD , YYYY HH:mm'); - localStorage.setItem('login-at', currDateTime); - if (this.platform.is('cordova')) { - this.insertMobileLogin(); - } - this.common.sharedService.setSharedData(result.MemberInformationList[0].PAYROLL_CODE, "projcet-code"); - this.activeType =this.common.setActiveTypeLogin(0); - this.common.openHome(); - }); - } else { - let errorResult: any; - errorResult = result; - this.showErrorMessage = true; - this.messageValue = errorResult.ErrorEndUserMessage; - this.smc_code = []; - (document.activeElement as HTMLElement).blur(); - setTimeout(() => { - this.showErrorMessage = false; - }, 5000); + this.showErrorMessage = false; + + const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + + const request = new SMSCheckRequest(); + + request.LogInTokenID = data.LogInTokenID; + + request.activationCode = this.code; // code;this.activationCode; + + request.P_USER_NAME = data.P_USER_NAME; + + request.MobileNumber = data.MobileNumber; + + request.IsDeviceNFC = this.isNFCAvailable; + + this.authService.checkSMS(request, () => { }, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => { + + if (this.common.validResponse(result)) { + + + + //save business card info + + this.businessInfo = { + + show_business: result.BusinessCardPrivilege, + + name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En, + + job_en: result.MemberInformationList[0].JOB_NAME_En, + + name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar, + + job_ar: result.MemberInformationList[0].JOB_NAME_Ar, + + mobile: result.MemberInformationList[0].MobileNumberWithZipCode, + + qr: result.MemberInformationList[0].BusinessCardQR, + + company_logo: result.BC_Logo ? result.BC_Logo : result.CompanyImageURL, + + company_url: result.BC_Domain, + + company_type: result.CompanyMainCompany, + + email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS + } - }); + + + + // Wifi Credientials + + CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; + + CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; + + localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo)); + + // this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info'); + + + + AuthenticationService.servicePrivilage = result.Privilege_List; + + this.authService.setAuthenticatedUser(result).subscribe(() => { + + localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME); + + this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME; + + const currDateTime = moment().format('MMM DD , YYYY HH:mm'); + + localStorage.setItem('login-at', currDateTime); + + if (this.platform.is('cordova')) { + + this.insertMobileLogin(); + + } + + this.common.sharedService.setSharedData(result.MemberInformationList[0].PAYROLL_CODE, "projcet-code"); + this.common.sharedService.setSharedData(result.BasicMemberInformation.P_LEGISLATION_CODE, "legislation-code"); + + this.activeType = this.common.setActiveTypeLogin(0); + + this.common.openHome(); + + }); + + } else { + + let errorResult: any; + + errorResult = result; + + this.showErrorMessage = true; + + this.messageValue = errorResult.ErrorEndUserMessage; + + this.smc_code = []; + + (document.activeElement as HTMLElement).blur(); + + setTimeout(() => { + + this.showErrorMessage = false; + + }, 5000); + + } + + }); + } + + public insertMobileLogin() { - const request = new GetLoginInfoRequest(); - this.authService.setPublicFields(request); - request.MobileNumber = this.loginData.MobileNumber; - request.P_USER_NAME = this.loginData.P_USER_NAME; - request.UserName = this.loginData.P_USER_NAME; - request.LogInTokenID = this.loginData.LogInTokenID; - request.CompanyID = 1; // CompanyID - request.DeviceType = this.common.getDeviceType(); - request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken; - request.LoginType = this.loginTypeData.loginType; - request.EmployeeName = this.user_name; - this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad) - .subscribe((result: any) => { - console.log('successful insertMobileLogin' ); - }); + + const request = new GetLoginInfoRequest(); + + this.authService.setPublicFields(request); + + request.MobileNumber = this.loginData.MobileNumber; + + request.P_USER_NAME = this.loginData.P_USER_NAME; + + request.UserName = this.loginData.P_USER_NAME; + + request.LogInTokenID = this.loginData.LogInTokenID; + + request.CompanyID = 1; // CompanyID + + request.DeviceType = this.common.getDeviceType(); + + request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken; + + request.LoginType = this.loginTypeData.loginType; + + request.EmployeeName = this.user_name; + + this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad) + + .subscribe((result: any) => { + + console.log('successful insertMobileLogin'); + + }); + } + + public checkForgetPwdSMS() { + const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + const request = new SMSCheckRequest(); + request.LogInTokenID = data.LogInTokenID; + request.activationCode = this.code; // this.activationCode; + request.P_USER_NAME = data.P_USER_NAME; - this.authService.checkForgetSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => { - if (this.common.validResponse(result)) { - this.sharedData.setSharedData(result, 'checkSMSResponse'); - if (this.isForgetPwd) { - this.common.openForgotPassword(); - } - if (this.isExpiredPwd) { - this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW); - this.common.openChangePassword(); - } + + this.authService.checkForgetSMS(request, () => { }, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => { + + if (this.common.validResponse(result)) { + + this.sharedData.setSharedData(result, 'checkSMSResponse'); + + if (this.isForgetPwd) { + + this.common.openForgotPassword(); + } - }); + + if (this.isExpiredPwd) { + + this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW); + + this.common.openChangePassword(); + + } + + } + + }); + } + + onChange() { // tslint:disable-next-line: only-arrow-functions - const filtered = this.smc_code.filter(function(el) { + const filtered = this.smc_code.filter(function (el) { if (el) { return el; } }); - if (filtered.length === 4) { + + if (filtered.length === 4 && !this.isAutoRead) { this.checkVerificationCode(); } } + + + + + + goToNextInput(e) { const key = e.which; const t = e.target; const sib = t.nextElementSibling; const sibPre = t.previousElementSibling; + + if (key === undefined && e.target.value.length==4 && (this.platform.is('ios') && !this.platform.is('mobileweb'))) { + this.checkActivation(e.target.value, false); + } + if (key !== 9 && (key < 48 || key > 57)) { if (key === 8 || key === 46) { return true; @@ -309,7 +632,6 @@ export class SmsPageComponent implements OnInit { return false; } } - if (key === 9) { return true; } @@ -322,4 +644,6 @@ export class SmsPageComponent implements OnInit { } } } + + } diff --git a/Mohem/src/app/eit/add-cei/add-cei.component.html b/Mohem/src/app/eit/add-cei/add-cei.component.html new file mode 100644 index 00000000..6a1c1bc0 --- /dev/null +++ b/Mohem/src/app/eit/add-cei/add-cei.component.html @@ -0,0 +1,24 @@ + + + + + + + {{'vacation-rule, effectiveDate' | translate}} + {{showEffectiveDate}} + +
+
+
+ + +
+ + {{'vacation-rule, next-label' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/eit/add-cei/add-cei.component.scss b/Mohem/src/app/eit/add-cei/add-cei.component.scss new file mode 100644 index 00000000..a6dbf815 --- /dev/null +++ b/Mohem/src/app/eit/add-cei/add-cei.component.scss @@ -0,0 +1,45 @@ +.footer-button { + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + ion-label { + color: var(--customnavy) !important; + } + + .daynamicForm-Label { + font-size: 16px; + color: #a2a5a6 !important; + display: block; + overflow: hidden; + -webkit-flex: 1; + flex: 1; + font-size: inherit; + white-space: normal; + padding: 5px 0px; + margin: 10px auto; + padding-left: 10px; + } + + + .header-toolbar-new{ + --background: #269DB8; + } + .addEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + background-color: #269DB8; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + .country{ + margin-top: 10px; + padding: 10px; + } \ No newline at end of file diff --git a/Mohem/src/app/eit/add-cei/add-cei.component.spec.ts b/Mohem/src/app/eit/add-cei/add-cei.component.spec.ts new file mode 100644 index 00000000..fa819bbd --- /dev/null +++ b/Mohem/src/app/eit/add-cei/add-cei.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddCeiComponent } from './add-cei.component'; + +describe('AddCeiComponent', () => { + let component: AddCeiComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AddCeiComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AddCeiComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/eit/add-cei/add-cei.component.ts b/Mohem/src/app/eit/add-cei/add-cei.component.ts new file mode 100644 index 00000000..8d9ef1f6 --- /dev/null +++ b/Mohem/src/app/eit/add-cei/add-cei.component.ts @@ -0,0 +1,1561 @@ +import { CommonService } from "src/app/hmg-common/services/common/common.service"; +import { Component, OnInit, ViewChild, ElementRef } from "@angular/core"; +import { MenuEntry } from "src/app/hmg-common/services/menu/models/menu.entry"; +import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; +import { CeiRequest } from "../models/cei.request"; +import { ModalController } from "@ionic/angular"; +import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; +import { EITTransactionsRequest } from "../models/EITTransactionsReq"; +import { EitService } from "../services/eit.service"; +import { TextAreaInput } from "src/app/uI-elements/text-area.input"; +import { NumberInput } from "src/app/uI-elements/number.input"; +import { TextInput } from "src/app/uI-elements/text.input"; +import { SelectInput } from "src/app/uI-elements/select.input"; +import { DateInput } from "src/app/uI-elements/date.input"; +import { TimeInput } from "src/app/uI-elements/time.input"; +import { DateTimeInput } from "src/app/uI-elements/date-time.input"; +import { ButtonInput } from "src/app/uI-elements/button.input"; +import { HiddenInput } from "src/app/uI-elements/hidden.input"; +import * as moment from "moment"; +import { DatePicker } from "@ionic-native/date-picker/ngx"; +import { EIT_ACTION } from "../models/submit.eit.action"; +import { AddCeiResponse } from "../models/add.cei.response"; +import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes"; +@Component({ + selector: 'app-add-cei', + templateUrl: './add-cei.component.html', + styleUrls: ['./add-cei.component.scss'], +}) +export class AddCeiComponent implements OnInit { + @ViewChild("containerDiv") containerDiv: ElementRef; + + ////*new add*///// + getPassNotificationDetails: any; + getPassdirfromNotifiPage: boolean = false; + functionName: string = ""; + menuType: any; + ///////////////// + + private textArea: TextAreaInput; + private numberInput: NumberInput; + private textInput: TextInput; + private selectInput: SelectInput; + private dateInput: DateInput; + private timeInput: TimeInput; + private datetimeInput: DateTimeInput; + private buttonInput: ButtonInput; + private hiddenInput: HiddenInput; + private ceiResponse: any; + + private eitVALSettoCall: any = []; + private comtransNo: number = 0; + // private parentChilds: any[]; + getPassMnuEntryObj: MenuEntry; + selMenu: MenuResponse; + eitSubmitAction: number = 0; //not submit + private ceiRequest: CeiRequest; + private validateEitObj: any = []; + private ExtraObj: any = {}; + private arrValues: any = []; + selEmp: string; + respID: number; + headerTitle: string = ""; + isResubmit: boolean = false; + private updatedValues: any = []; + addEITData: any; + direction:string; + public showEffectiveDate: string = moment(new Date).format("DD-MM-YYYY"); + public selectedContactData: any; + + + constructor( + public modalController: ModalController, + public cs: CommonService, + private ts: TranslatorService, + private eitService: EitService, + public datePicker: DatePicker + ) { + this.direction = TranslatorService.getCurrentLanguageName(); + this.selectedContactData = this.cs.sharedService.getSharedData('selectedContactFORChildEducation', false); + this.selEmp = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_EMP, + false + ); + this.respID = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_RESP_ID, + false + ); + this.selMenu = new MenuResponse(); + this.selMenu = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_DATA, + false + ); + this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false); + console.log("addEITData: " + this.addEITData); + console.log("dirfromNotificationPage: " + this.addEITData.dirfromNotificationPage); + + this.ceiRequest = new CeiRequest(); + + + ////*new add*///// + /**********resubmit************ */ + this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);//WARINING + this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage; + if (this.getPassdirfromNotifiPage) { + this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME; + this.menuType = "E"; + this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; + this.respID = -999; + this.validateEitObj = this.addEITData.submitEITObjList; + // this.eitSubmitAction=this.getPassNotificationDetails.EIT_ACTION; + let msg: string = ""; + msg = this.ts.trPK("eit", "update-title"); + this.headerTitle = msg; + } else { + this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList; + this.comtransNo = this.addEITData.transNo; + this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + this.validateEitObj = this.addEITData.submitEITObjList; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.eitSubmitAction = this.cs.sharedService.getSharedData( + EITTransactionsRequest.SUBMIT_EIT_ACTION + ); + } + } + + ngOnInit() {} + + ngAfterViewInit() { + this.getCEIDffStructure(); + } + + private getCEIDffStructure() { + const body = { + P_FUNCTION_NAME: this.functionName, + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID + }; + this.eitService.getCEIDFFStrutre(body).subscribe((result: any) => { + this.handleCEIDffStructureResult(result); + }); + } + + handleCEIDffStructureResult(result) { + if (result.GetCEIDFFStructureList != null) { + this.ceiResponse = result.GetCEIDFFStructureList; + this.drawCEIFields(result.GetCEIDFFStructureList); + } + } + + private drawCEIFields(feildsList) { + const containerId = "containerDiv"; + this.eitVALSettoCall = []; + for (let i = 0; i < feildsList.length; i++) { + let defaultVal: string = ""; + let defaultValText: string = ""; + defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + : ""; + defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + : ""; + + if (feildsList[i].DISPLAY_FLAG != "N") { + //check if the field should be displayed + if (feildsList[i].VALIDATION_TYPE == "N") { + //text , date , time + if (feildsList[i].FORMAT_TYPE == "C") { + // character + // if(feildsList[i].DEFAULT_TYPE=="C"||feildsList[i].DEFAULT_TYPE==""){// default type constant + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){// profile/ sql + // this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); + // } + } else if (feildsList[i].FORMAT_TYPE == "N") { + // number + // if(feildsList[i].DEFAULT_TYPE=="C"||feildsList[i].DEFAULT_TYPE==""){ + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){ + // this.numberInput = new NumberInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); + // } + } else if (feildsList[i].FORMAT_TYPE == "X") { + // standard date + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + //constant + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + // else if(feildsList[i].DEFAULT_TYPE=="D"){//current date + // // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"currentDate",containerId,feildsList[i].MOBILE_ENABLED); + // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,defaultVal,containerId,feildsList[i].MOBILE_ENABLED); + + // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){// sql and profile + // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); + // } + } else if (feildsList[i].FORMAT_TYPE == "Y") { + // standard date time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatStandardDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + const elem = document.getElementById( + feildsList[i].APPLICATION_COLUMN_NAME + ); + // elem.addEventListener("click", e => { + // if (feildsList[i].MOBILE_ENABLED != "Y") return false; + // this.showDateTimePicker( + // feildsList[i].APPLICATION_COLUMN_NAME, + // feildsList[i].MAXIMUM_SIZE + // ); + // e.stopImmediatePropagation(); + // }); + // else if(feildsList[i].DEFAULT_TYPE=="D"){ + // this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"currentDateTime",containerId,feildsList[i].MOBILE_ENABLED); + // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){ + // this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); + // } + } else if (feildsList[i].FORMAT_TYPE == "I") { + //time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } + } else { + if (feildsList[i].READ_ONLY == "Y") { + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else { + // dropdown list missing open in differnt page + //check this validation since he doesnt check the other default_type + //if(feildsList[i].DEFAULT_TYPE=="P" || feildsList[i].DEFAULT_TYPE=="S"){ + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + // }else{ + // this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"",containerId,feildsList[i].MOBILE_ENABLED); + // } + // this.getValueSet(feildsList[i].SEGMENT_NAME); + this.fillDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].E_SERVICES_VS, + feildsList[i].E_SERVICES_DV + ); + // this.eitVALSettoCall.push(feildsList[i]); + } + } + //const elem = document.getElementById(feildsList[i].APPLICATION_COLUMN_NAME); + //elem.addEventListener("click", (e) => { + // this.getValueSet(feildsList[i].SEGMENT_NAME); + // e.stopImmediatePropagation(); + // }); + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } else { + // if(feildsList[i].VALIDATION_TYPE=="N"){ + this.hiddenInput = new HiddenInput( + defaultVal, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultValText, + containerId + ); + // }else{ + // this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,defaultVal,containerId,feildsList[i].MOBILE_ENABLED,feildsList[i].DISPLAY_FLAG); + // this.fillDropdownList(feildsList[i].SEGMENT_NAME,feildsList[i].E_SERVICES_VS,feildsList[i].E_SERVICES_DV); + // } + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } + } + // this.callValueSet(); + // let msg:string=""; + // msg=this.translate.translate("confirmAddEit.start"); + // this.buttonInput = new ButtonInput("EIT_Btn_Submit", this.translate.translate('general.submit'), containerId, ""); + // const elem = document.getElementById("EIT_Btn_Submit"); + // elem.addEventListener("click", (e) => { + // this.validateEITTransaction(); + // }); + if (this.validateEitObj && this.validateEitObj.length > 0) { + this.fillEITStructure(); + } + } + + addFieldToDOM( + fieldObject: any, + fieldId: any, + clickListenerEvent: any, + hasClickListener: boolean + ) { + console.log("AddFieldToDOM"); + const elemDiv = document.createElement("div"); + elemDiv.className = ""; + elemDiv.innerHTML = fieldObject.getTemplate(); + console.log(this.containerDiv.nativeElement); + + this.containerDiv.nativeElement.appendChild(elemDiv); + // document.getElementById('containerDiv').appendChild(elemDiv); + + if (hasClickListener) { + let elem = document.getElementById(fieldId); + elem.addEventListener("click", e => { + clickListenerEvent(e); + e.stopImmediatePropagation(); + }); + } + } + + closeModal() { + console.log("closeModal"); + this.updatedValues = []; + this.modalController.dismiss(); + } + + public showDateTimePicker(elemID, maxSize) { + let elem = document.getElementById(elemID) as HTMLDivElement; + let date: any; + let value = elem.innerHTML; + if (value) date = moment(value, "YYYY/MM/DD HH:mm:ss").toDate(); + else date = new Date(); + this.datePicker + .show({ + date: date, + is24Hour: true, + mode: "datetime" + }) + .then( + date => { + let dateString: string = moment(date).format("YYYY/MM/DD HH:mm:ss"); + //remove seconds if the maximum size is 17 + if (maxSize == 17) { + elem.innerHTML = dateString.substring(0, 16); + elem.dataset.dtvalue = dateString.substring(0, 16); + } else { + elem.innerHTML = dateString; + elem.dataset.dtvalue = dateString; + } + //elem.innerHTML = dateString; + // elem.dataset.dtvalue = dateString; + }, + err => console.log("Error occurred while getting date: ", err) + ); + } + public showTimePicker(elemID, maxSize) { + let elem = document.getElementById(elemID) as HTMLDivElement; + let date: any; + let value = elem.innerHTML; + if (value) { + let nowDate = moment().format("YYYY/MM/DD") + " " + value; + date = moment(nowDate, "YYYY/MM/DD HH:mm:ss").toDate(); + } else { + date = new Date(); + } + this.datePicker + .show({ + date: date, + is24Hour: true, + mode: "time" + }) + .then( + date => { + let dateString: string = moment(date).format("HH:mm:ss"); + //remove seconds if the maximum size is 5 + if (maxSize == 5) { + elem.innerHTML = dateString.substring(0, 5); + elem.dataset.dtvalue = dateString.substring(0, 5); + } else { + elem.innerHTML = dateString; + elem.dataset.dtvalue = dateString; + } + }, + err => console.log("Error occurred while getting date: ", err) + ); + } + + fillDropdownList(segmentName, optionList: any = [], DV: any = "") { + let elemID: any = ""; + let eitObj: any; + if (optionList.length > 0) { + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].SEGMENT_NAME == segmentName) { + eitObj = this.ceiResponse[i]; + if ( + this.ceiResponse[i].READ_ONLY == "Y" || + this.ceiResponse[i].DISPLAY_FLAG == "N" + ) { + return false; + } + elemID = this.ceiResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + + // for(let i = select.options.length - 1 ; i >= 0 ; i--) + // { + // select.remove(i); + // } + if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") { + var firstoption = document.createElement("option"); + firstoption.text = this.ts.trPK("general", "choose"); + firstoption.value = ""; + select.add(firstoption); + } + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].VALUE_COLUMN_NAME; + option.value = optionList[i].ID_COLUMN_NAME; + select.add(option); + } + if (select.dataset.hiddenval) { + select.value = select.dataset.hiddenval; + //select.dataset.hiddenval=""; + } else { + select.value = DV.P_ID_COLUMN_NAME; + } + select.disabled = false; + } + } + + bindHtmlElemEvents(id, obj) { + const elem = document.getElementById(id); + console.log(elem); + console.log(obj); + const elemType = elem.tagName; + let changeEvent = "ionChange"; + + if (elemType == "SELECT") changeEvent = "change"; + + try { + // elem.addEventListener("change", (e) => { + elem.addEventListener(changeEvent, e => { + //console.log("elem change "+elem.id); + //let x=e.currentTarget as HTMLInputElement; + //let isEmpty:boolean=false; + // if(!x.value) + // isEmpty=true; + //emptyChildElement + elem.classList.remove("requiredClassElm"); + if ( + obj.CHILD_SEGMENTS_VS_Splited && + obj.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + //if(isEmpty) + this.emptyChildElement(element); + // else + this.getValueSet(element); + }); + } + if ( + obj.CHILD_SEGMENTS_DV_Splited && + obj.CHILD_SEGMENTS_DV_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_DV_Splited; + listArray.forEach(element => { + // if(isEmpty){ + this.emptyChildElement(element); + // }else{ + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].SEGMENT_NAME == element) { + this.getDefaultValue( + this.ceiResponse[i], + this.ceiResponse[i].DESC_FLEX_NAME, + this.ceiResponse[i].DESC_FLEX_CONTEXT_CODE, + this.ceiResponse[i].SEGMENT_NAME, + this.ceiResponse[i].PARENT_SEGMENTS_VS_SplitedVS, + this.ceiResponse[i].PARENT_SEGMENTS_DV_Splited + ); + } + } + // } + }); + } + return false; + // e.stopImmediatePropagation(); + }); + } catch (e) { + console.log(e.status); + } + } + + public getDefaultValue( + obj, + descFlexName, + descFlexContextCode, + segmentName, + parentValue, + ParentsList + ) { + let dependenciesList: any = []; + let parentVal: any = null; + let isStandardDate: boolean = false; + let isStandardTimeDate: boolean = false; + let isStandardTime: boolean = false; + let isHidden: boolean = false; + let isReadOnlyList: boolean = false; + let isSelectElement: boolean = false; + isStandardDate = this.isStandardDate(obj); + isStandardTimeDate = this.isStandardDateTime(obj); + isStandardTime = this.isStandardTime(obj); + if (obj.DISPLAY_FLAG == "N") isHidden = true; + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") { + isReadOnlyList = true; + } + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") { + isSelectElement = true; + } + //if(parentValue!=""){ parentVal= this.getDependenciesParams(parentValue)[0].ID_COLUMN_NAME;} + //if(ParentsList!=""){dependenciesList =this.getDependenciesParams(ParentsList); } + + if ( + parentValue != "" && + (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y") + ) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + if (parentValue) ParentsList.concat(parentValue); + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + + //if (dependenciesList==false){return false}; + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList + }; + + this.eitService.getDefaultValue(body).subscribe((result: any) => { + let elem = this.getElementByName(segmentName); + // console.log(elem); + // if(elem.dataset.hiddenval){ + // elem.dataset.hiddenval=""; + // return false; + // } + let obj = this.handleDefaultValueResult(result); + let val = obj.value; + let text = obj.text; + if (val==null){val="";} + if (text==null){text="";} + if (isStandardDate) { + console.log("isStandardDate"); + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardTimeDate) { + console.log("isStandardTimeDate"); + if (val) { + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else if (isStandardTime) { + console.log("isStandardTime"); + if (val) { + elem.dataset.dtvalue = val; + elem.innerHTML = val; + elem.value=val; + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else { + if (isSelectElement) { + let elem = this.getSelectElementByName(segmentName); + elem = document.getElementById(elem), + //alert(elem.length); + // var firstoption = document.createElement("option"); + // firstoption.text = text; + // firstoption.value = val; + // elem.add(firstoption); + elem.value = val; + //elem.text=text; + + }else{ + // console.log("else - " + elem.value); + elem.value = val; + elem.innerText = text; + elem.setAttribute("value", val); + // console.log("else - " + elem.value); + } + } + if (isHidden || isReadOnlyList) { + if (val) elem.dataset.colmText = val; + else elem.dataset.colmText = ""; + elem.value = text; + } + var event = new Event("ionChange"); + elem.dispatchEvent(event); + }); + } + + handleDefaultValueResult(result) { + let data = { + text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME, + value: result.GetDefaultValueList.P_ID_COLUMN_NAME + }; + return data; + } + + callValueSet() { + for (var i = 0; i < this.eitVALSettoCall.length; i++) { + this.getValueSet(this.eitVALSettoCall[i].SEGMENT_NAME); + } + } + + getParentValue(parentValue) { + if (parentValue.length == 0) { + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].SEGMENT_NAME == parentValue[0].Name) { + if (this.ceiResponse[i].VALIDATION_TYPE == "N") { + let val = (document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + return val; + } else { + let x = document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (x.options.length > 0) { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + return val; + } else { + return ""; + } + } + } + } + } else { + return ""; + } + } + + public getValueSet(segmentName) { + let descFlexName: any = ""; + let descFlexContextCode: any = ""; + let parentValue: any = []; + let ParentsList: any = []; + let parentVal: any = null; + let dependenciesList: any = []; + let validationType: string = ""; + + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].SEGMENT_NAME == segmentName) { + descFlexName = this.ceiResponse[i].DESC_FLEX_NAME; + descFlexContextCode = this.ceiResponse[i].DESC_FLEX_CONTEXT_CODE; + parentValue = this.ceiResponse[i].PARENT_SEGMENTS_VS_SplitedVS; + ParentsList = this.ceiResponse[i].PARENT_SEGMENTS_VS_SplitedVS; + validationType = this.ceiResponse[i].VALIDATION_TYPE; + break; + } + } + if (parentValue != "" && (validationType == "D" || validationType == "Y")) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList, + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + }; + + this.eitService.getSetValue(body).subscribe((result: any) => { + if (result.GetValueSetValuesList != null) { + this.fillDropdownList(segmentName, result.GetValueSetValuesList); + } + }); + let arr: any = []; + return arr; + } + + getDependenciesParams(parentsList) { + let parentArr: any = []; + for (let i = 0; i < parentsList.length; i++) { + for (let j = 0; j < this.ceiResponse.length; j++) { + if (this.ceiResponse[j].SEGMENT_NAME == parentsList[i].Name) { + if (this.ceiResponse[j].DISPLAY_FLAG != "N") { + if (this.ceiResponse[j].VALIDATION_TYPE == "N") { + let idColName: string; + let val: any; + if ( + this.ceiResponse[j].FORMAT_TYPE == "Y" || + this.ceiResponse[j].FORMAT_TYPE == "I" + ) { + //standard date time or //time + let elem = document.getElementById( + this.ceiResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLDivElement; + val = elem.dataset.dtvalue; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.ceiResponse[j].FORMAT_TYPE == "Y") + idColName = this.cs.formatStandardDate(val); + } else { + val = (document.getElementById( + this.ceiResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.ceiResponse[j].FORMAT_TYPE == "X") { + //date + // idColName = this.cs.formatDate(val); + idColName = this.cs.formatDateNew(val); + } + } + parentArr.push({ + SEGMENT_NAME: this.ceiResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: val, + DESCRIPTION: "", + ID_COLUMN_NAME: idColName, + FLEX_VALUE_SET_NAME: this.ceiResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + if (this.ceiResponse[j].READ_ONLY != "Y") { + let x = document.getElementById( + this.ceiResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let text = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : ""; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : undefined; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.ceiResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.ceiResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + let x = document.getElementById( + this.ceiResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.ceiResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.ceiResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } else { + let x = document.getElementById( + this.ceiResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.ceiResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.ceiResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } + } + return parentArr; + } + + emptyChildElement(segmentName) { + let elem = this.getElementByName(segmentName); + elem.value = null; + elem.innerHTML = ""; + if ("dtvalue" in elem.dataset) { + elem.dataset.dtvalue = ""; + } + if ("colmText" in elem.dataset) { + elem.dataset.colmText = ""; + } + var event = new Event("change"); + elem.dispatchEvent(event); + elem.classList.remove("requiredClassElm"); + } + + getRequiredFilds() { + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].REQUIRED_FLAG == "Y") { + let elemVal = (document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if (elemVal == "") { + //alert(this.ceiResponse[i].SEGMENT_NAME+" is required"); + break; + } + } + } + } + + getElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].SEGMENT_NAME == segmentName) { + elemID = this.ceiResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + return document.getElementById(elemID) as HTMLInputElement; + } + + getSelectElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.ceiResponse.length; i++) { + if (this.ceiResponse[i].SEGMENT_NAME == segmentName) { + elemID = this.ceiResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + return elemID; + } + + isStandardDate(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + // standard date + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + isStandardDateTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + isStandardTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + isStandardDateVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + // standard date + // if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + // } + } + return isSt; + } + isStandardDateTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + //} + } + return isSt; + } + isStandardTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard time + //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + //} + } + return isSt; + } + + fillEITStructure() { + var obj = { peiObjVer: null, peiExtraInfoID: null }; + for (let i = 0; i < this.validateEitObj.length; i++) { + let val: any; + if (this.validateEitObj[i].VARCHAR2_VALUE) + val = this.validateEitObj[i].VARCHAR2_VALUE; + else if (this.validateEitObj[i].DATE_VALUE) + val = this.validateEitObj[i].DATE_VALUE; + else if (this.validateEitObj[i].NUMBER_VALUE) + val = this.validateEitObj[i].NUMBER_VALUE; + const elem = document.getElementById( + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER; + if (elem) { + if (val) { + let feldDetails = this.ceiResponse.find( + x => + x.APPLICATION_COLUMN_NAME == + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ); + if (feldDetails) { + let isStandardDate = this.isStandardDateVal(feldDetails); + let isStandardDateTime = this.isStandardDateTimeVal(feldDetails); + let isStandardTime = this.isStandardTimeVal(feldDetails); + if (isStandardDate) { + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardDateTime) { + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + } else if (isStandardTime) { + elem.innerHTML = val; + elem.dataset.dtvalue = val; + } else { + elem.value = val; + elem.setAttribute("value", elem.value); + } + if ( + feldDetails.DISPLAY_FLAG == "N" || + (feldDetails.VALIDATION_TYPE != "N" && + feldDetails.READ_ONLY == "Y") + ) { + elem.dataset.colmText = val; + elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP; + elem.setAttribute("value", elem.value); + } + } + elem.dataset.hiddenval = val; //hide the value to set it after calling get value set + if ( + feldDetails.CHILD_SEGMENTS_VS_Splited && + feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.getValueSet(element); + }); + } + // var event = new Event('change'); + // elem.dispatchEvent(event); + } + } else { + if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == + "CEI_OBJECT_VERSION_NUMBER" + ) + obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE; + else if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == "CONTACT_EXTRA_INFO_ID" + ) + obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE; + } + } + this.ExtraObj = obj; + } + + public getElementsValues(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = this.comtransNo; + let textValue : any; + // if(this.ExtraObj.transactionNo) + // transNo=this.ExtraObj.transactionNo; + for (let i = 0; i < this.ceiResponse.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + /*********set transaction No of the updated object ********/ + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + } + if (this.ceiResponse[i].DISPLAY_FLAG != "N") { + if (this.ceiResponse[i].VALIDATION_TYPE == "N") { + let elem = document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let elemVal = (document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + textValue = elemVal; + //let elemVal= (document.getElementById(this.ceiResponse[i].APPLICATION_COLUMN_NAME)).value; + if ( + this.ceiResponse[i].FORMAT_TYPE == "X" && + this.ceiResponse[i].DISPLAY_FLAG != "N" + ) { + //date + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.ceiResponse[i].FORMAT_TYPE == "Y" && + this.ceiResponse[i].DISPLAY_FLAG != "N" + ) { + //standard date time + // elemVal = elem.dataset.dtvalue; + // elemVal = this.cs.formatStandardDate(elemVal); + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.ceiResponse[i].FORMAT_TYPE == "I" && + this.ceiResponse[i].DISPLAY_FLAG != "N" + ) { + //time + if(elemVal.length>5){ + elemVal = elemVal.substring(11, 16); + }else{ + elemVal = elemVal; + } + } + if (this.ceiResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + // if (elemVal != 'null'){ + varcharValue = elemVal; + //} else{ + // elemVal = null; + // } + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.ceiResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (this.ceiResponse[i].READ_ONLY == "Y") { + let text = x.value; + let val = x.dataset.colmText; + varcharValue = val; + textValue = text; + } else { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + let txt = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : null; + varcharValue = val; + textValue = txt; + } + if (this.ceiResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.ceiResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } //end else + } else { + let x = document.getElementById( + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let val = x.dataset.colmText; + textValue = x.value; + if (this.ceiResponse[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + if (val) varcharValue = val; + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.ceiResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.ceiResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + let y = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue, + SEGMENT_VALUE_DSP: textValue, + APPLICATION_COLUMN_NAME: this.ceiResponse[i] + .APPLICATION_COLUMN_NAME, + DATATYPE: this.ceiResponse[i].DATATYPE, + DESC_FLEX_CONTEXT_CODE: this.ceiResponse[i].DESC_FLEX_CONTEXT_CODE, + DESC_FLEX_NAME: this.ceiResponse[i].DESC_FLEX_NAME, + DISPLAY_FLAG: this.ceiResponse[i].DISPLAY_FLAG, + SEGMENT_NAME: this.ceiResponse[i].SEGMENT_NAME, + SEGMENT_PROMPT: this.ceiResponse[i].SEGMENT_PROMPT + }; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } + } + } // end for + + if (this.getPassdirfromNotifiPage) { + let updatedObj1 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION" + ); + let updatedObj2 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "CONTACT_EXTRA_INFO_ID" + ); + let updatedObj3 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "CEI_OBJECT_VERSION_NUMBER" + ); + this.updatedValues.push(updatedObj1); + this.updatedValues.push(updatedObj2); + this.updatedValues.push(updatedObj3); + valuseArr = this.fillExtraInformation( + valuseArr, + updatedObj1.VARCHAR2_VALUE, + updatedObj2.NUMBER_VALUE, + updatedObj3.NUMBER_VALUE, + transNo + ); + } else { + if (this.eitSubmitAction == EIT_ACTION.ADD) { + this.updatedValues = this.fillExtraValuesUpdated( + this.updatedValues, + "NEW_ROW", + -1, + 0, + transNo + ); + valuseArr = this.fillExtraInformation( + valuseArr, + "NEW_ROW", + -1, + 0, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "UPDATE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.DELETE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "DELETE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } + } + return valuseArr; + } // end getElementsValues + + fillExtraValuesUpdated( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + let obj1 = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null, + SEGMENT_VALUE_DSP: "", + APPLICATION_COLUMN_NAME: "PEI_ACTION", + DATATYPE: "VARCHAR2", + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj2 = { + TRANSACTION_NUMBER: 1, + APPLICATION_COLUMN_NAME: "CEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATATYPE: "NUMBER", + SEGMENT_VALUE_DSP: "", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj3 = { + APPLICATION_COLUMN_NAME: "CONTACT_EXTRA_INFO_ID", + DATATYPE: "NUMBER", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + NUMBER_VALUE: peiExtraInfoID, + SEGMENT_NAME: "", + SEGMENT_PROMPT: "", + SEGMENT_VALUE_DSP: "", + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: null + }; + values.push(obj1); + values.push(obj2); + values.push(obj3); + return values; + } + fillExtraInformation( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_ACTION", + VARCHAR2_VALUE: 'NEW_ROW', + NUMBER_VALUE: null, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "CONTACT_EXTRA_INFO_ID", + VARCHAR2_VALUE: null, + NUMBER_VALUE: 0, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "CEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: 0, + DATE_VALUE: null + }); + return values; + } + + submitEit() { + let list = this.ceiRequest.EITTransactionTBL; + this.ceiRequest.EITTransactionTBL = this.fixTransactionNo(list); + this.eitService + .submitChildEducation(this.ceiRequest) + .subscribe((result: AddCeiResponse) => { + this.handleSubmitEitResult(result); + }); + } + + fixTransactionNo(transactionTBL: any): any[] { + let list: any = []; + let newIndex: number = 1; + let length: number = transactionTBL.length; + if (length > 0) { + for (let i = 0; i < length; i++) { + // let item :any={}; + const item = Object.assign({}, transactionTBL[i]); + let transNo: number = item.TRANSACTION_NUMBER; + let obj: any = item; + if (i == 0) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + let prevEl: any = transactionTBL[i - 1].TRANSACTION_NUMBER; + if (transNo == prevEl) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + newIndex++; + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } + } + } + } + return list; + } + + + public handleSubmitEitResult(result) { + if (this.cs.validResponse(result)) { + this.cs.sharedService.setSharedData(this.ceiRequest, CeiRequest.SHARED_DATA); + this.cs.sharedService.setSharedData(result, AddCeiResponse.SHARED_DATA); + this.cs.openConfirmCEIPage(); + } + } + + public submitChildEducationTransaction() { + this.arrValues = this.getElementsValues(); + if (this.arrValues) { + this.ceiRequest = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, + P_FUNCTION_NAME: this.functionName, + P_CONTACT_RELATIONSHIP_ID: this.selectedContactData.CONTACT_RELATIONSHIP_ID, + P_DESC_FLEX_CONTEXT_CODE: this.ceiResponse[0].DESC_FLEX_CONTEXT_CODE, + EITTransactionTBL: this.arrValues + }; + + this.eitService.submitChildEducation(this.ceiRequest).subscribe((result: any) => { + this.handleSubmitEitResult(result); + }); + } + } +} + diff --git a/Mohem/src/app/eit/cei-homepage/cei-homepage.component.html b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.html new file mode 100644 index 00000000..55aeadb4 --- /dev/null +++ b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.html @@ -0,0 +1,69 @@ + + + + + + +
+ + + + + +

{{user.CONTACT_NAME}}

+
+ +
+ +

{{ts.trPK('eit','relationship-start-date')}}

+
+ +

12/31/2022

+
+
+
+
+ + + +

{{user.RELATIONSHIP}}

+
+
+ +
+ +

{{ts.trPK('eit','relationship-end-date')}}

+
+ +

12/31/2022

+
+
+
+
+
+ +
+
+
+ +
+ + + +
+ {{'vacation-rule, next-label' | translate}} +
+
+ + \ No newline at end of file diff --git a/Mohem/src/app/eit/cei-homepage/cei-homepage.component.scss b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.scss new file mode 100644 index 00000000..9bcdab44 --- /dev/null +++ b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.scss @@ -0,0 +1,40 @@ +@media screen and (min-width: 300px){ + .CreateBtn{ +--background: var(--newgreen) !important; +background: var(--newgreen) !important; +white-space: normal; +color: var(--light); +text-transform: capitalize; +min-height: 1.0cm; +--border-radius: 7px !important; +border-radius: 7px !important; +--min-height: 1.6cm !important; +width: 315px; +font-family: var(--fontFamilyPoppins-SemiBold, inherit); +}} + +@media screen and (min-width: 1px) and (max-width:290px) { +.CreateBtn{ +--background: var(--newgreen) !important; +background: var(--newgreen) !important; +white-space: normal; +color: var(--light); +text-transform: capitalize; +min-height: 1.0cm; +--border-radius: 7px !important; +border-radius: 7px !important; +--min-height: 1.6cm !important; +width: 257px; +font-family: var(--fontFamilyPoppins-SemiBold, inherit); +}} + +.footer{ +padding: 15px 0px; +background-color: var(--light) !important; +border: 0px !important; +box-shadow: none !important; +-webkit-box-shadow: none; +} +.Btn{ +margin: auto; text-align: center; display: block; +} \ No newline at end of file diff --git a/Mohem/src/app/eit/cei-homepage/cei-homepage.component.spec.ts b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.spec.ts new file mode 100644 index 00000000..3ebdf92c --- /dev/null +++ b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CeiHomepageComponent } from './cei-homepage.component'; + +describe('CeiHomepageComponent', () => { + let component: CeiHomepageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CeiHomepageComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CeiHomepageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/eit/cei-homepage/cei-homepage.component.ts b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.ts new file mode 100644 index 00000000..4db964a0 --- /dev/null +++ b/Mohem/src/app/eit/cei-homepage/cei-homepage.component.ts @@ -0,0 +1,51 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { EitService } from '../services/eit.service'; + +@Component({ + selector: 'app-cei-homepage', + templateUrl: './cei-homepage.component.html', + styleUrls: ['./cei-homepage.component.scss'], +}) +export class CeiHomepageComponent implements OnInit { + + public familyMemberData; + public selectedServiceType; + public direction: string; + myColor: string = 'secondary'; + constructor( + private eitService: EitService, + public ts: TranslatorService, + public cs: CommonService + ) {} + + + ngOnInit() { + this.getContactInfo(); + } + + public getContactInfo () { + this.eitService.getContactInfo({ + P_MENU_TYPE: 'E', + P_SELECTED_RESP_ID: -999 + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + if (this.cs.validResponse(response)) { + this.familyMemberData = response['GetEmployeeContactsList']; + this.selectedServiceType = this.familyMemberData[0]; + console.log(this.familyMemberData); + } + }); + } + + public gotoTransactionsPage() { + console.log(this.selectedServiceType); + this.cs.sharedService.setSharedData(this.selectedServiceType, 'selectedContactFORChildEducation'); + this.cs.openCEIListPage(); + } + + public selectedUser(user){ + this.selectedServiceType = user; + } + +} diff --git a/Mohem/src/app/eit/cei-list/cei-list.component.html b/Mohem/src/app/eit/cei-list/cei-list.component.html new file mode 100644 index 00000000..31f62243 --- /dev/null +++ b/Mohem/src/app/eit/cei-list/cei-list.component.html @@ -0,0 +1,42 @@ + + + + +
+
+ + + +

{{'general, noData' | translate}}

+
+ +
+
+ +
+
+ +
+ + + +
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ diff --git a/Mohem/src/app/eit/cei-list/cei-list.component.scss b/Mohem/src/app/eit/cei-list/cei-list.component.scss new file mode 100644 index 00000000..28b2905f --- /dev/null +++ b/Mohem/src/app/eit/cei-list/cei-list.component.scss @@ -0,0 +1,330 @@ +.footer-button { + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + .datetime{ + text-align: center; + font-family: WorkSans-Bold; + margin-left: 47px; + margin-top: -19px; + + } + .iconCalendar{ + margin-left: 30px !important; + width: 22% !important; + height: 26px !important; + margin-top: -69px !important; + margin-bottom: 20px !important; + } + h4 { + font-size: 2.2rem; + text-align: center; + color: #000000; + } + .grids{ + border-radius: 20px !important; + background: white; + padding-left: 1px; + padding-right: 1px; + margin: 13px; + padding-top: 0px; + padding-bottom: 3px; + padding-left: 13px; + padding-right: 13px; + border: 1px solid #cac8c8; + } + + .bgcolor { + + color: white; + border-top-right-radius: 19px; + border-top-left-radius: 15px; + padding-top: 1; + padding-bottom: 0; + margin-top: 0; + margin-bottom: 0; + /* border-radius: 12px !important; */ + background: #269DB8; + border-bottom: 1px solid #a7a4a4; + border-top: 1px solid #cac8c8; + margin-left: -13px; + margin-right: -13px; + } + .colEit{ + border-right: 1px solid #cac8c8; + border-bottom-left-radius: -10px !important; + padding-top: 8px; + padding-bottom: 8px; + margin-left: 18px; + font-size: 12px !important; + } + + .header-div { + + background-color: #269DB8; + text-transform: capitalize; + height: 160px; + // position: relative; + display: block; + margin-bottom: -28px; + } + + .header-toolbar-new{ + --background: #269DB8; + } + + .addClass{ + background-color: #269DB8; + width: 80px; + height: 80px; + right: 8%; + position: fixed; + color: white; + bottom: 5%; + border-radius: 50%; + z-index: 999; + -webkit-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + -moz-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + } + + .contentEit:before { + position: absolute; + content: ""; + // background: #269DB8; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; + } + + .hrClass{ + border-width: 0; + box-sizing: content-box; + border-bottom: 1px solid #e6e6e6; + background: #fff !important; + height: 1px; + } + + //////////////////////////////// + .content:before { + position: absolute; + content: ""; + background: #269DB8; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; + } + + + .colorBG{ + --background: #f0efef; + } + + .Title{ + text-align: center; + color: white; + margin-top: -33px; + font-size: 17px; + } + .title{ + text-align: center; + color: black; + margin-top: 5px; + font-size: 17px; + } + .today-graph{ + display: block !important; + height: 196px; + width: 365px; + /* padding-left: 51px; */ + margin-left: 28px !important; + } + + .headerGrid{ + background-color: white !important; + border: 1px solid #cac8c8 !important; + padding-bottom: 53px; + padding-top: -30px; + margin-left: 13px; + margin-right: 13px; + margin-bottom: 10px; + position: relative; + z-index: 1; + border-radius: 20px; + margin-top: 17px; + } + .result-graph{ + font-size: 14px; + margin-left: -48px; + margin-right: 3px; + margin-bottom: -30px; + + + + } + + .green-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 42px; + } + .green-label-ar{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 15px; + } + .blue-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 13px; + } + .light-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: -26px; + } + .light-label-ar{ + font-size: 15px !important; + margin-right: 7px !important; + margin-left: -26px; + } + + .light-dote{ + background-color: #3CB9D5; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + } + .blue-dote{ + + background-color: #269DB8; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + } + .green-dote{ + background-color: #1FA269; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + margin-right: -1px; + } + .col{ + text-align: right; + } + + .gridService{ + + /* margin-top: 87px; */ + border-radius: 10px; + /* margin-bottom: -49px; */ + margin-left: 14px; + margin-right: 14px; + + } + .columns{ + margin: 3px; + margin-bottom: 13px; + background: white; + border-radius: 27px; + padding-left: 30px; + padding-right: 6px; + padding-top: 19px; + padding-bottom: 8px; + border: 1px solid #cac8c8 !important; + } + + + .service{ + font-size: 22px; + color: black; + letter-spacing: 1px; + font-weight: bold; + } + .services{ + + font-size: 12px; + color: black; + } + + .adult-dote{ + background-color: #3CB9D5; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + } + + .adult-dote-ar{ + background-color: #3CB9D5; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-right: 0px; + margin-left: 5px; + } + .child-dote{ + + background-color: #269DB8; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + } + .child-dote-ar{ + background-color: #269DB8; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-right: 1px; + margin-left: 5px; + } + .infants-dote{ + background-color: #1FA269; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + // margin-bottom: 6px; + } + + .infants-dote-ar{ + background-color: #1FA269; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-right: 1px; + margin-left: 5px; + } + .addEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + background-color: #269DB8; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + \ No newline at end of file diff --git a/Mohem/src/app/eit/cei-list/cei-list.component.spec.ts b/Mohem/src/app/eit/cei-list/cei-list.component.spec.ts new file mode 100644 index 00000000..ef47a3a9 --- /dev/null +++ b/Mohem/src/app/eit/cei-list/cei-list.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CeiListComponent } from './cei-list.component'; + +describe('CeiListComponent', () => { + let component: CeiListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CeiListComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CeiListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/eit/cei-list/cei-list.component.ts b/Mohem/src/app/eit/cei-list/cei-list.component.ts new file mode 100644 index 00000000..2b7aeec3 --- /dev/null +++ b/Mohem/src/app/eit/cei-list/cei-list.component.ts @@ -0,0 +1,127 @@ +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { EITTransactionsRequest } from './../models/EITTransactionsReq'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { Component, OnInit } from '@angular/core'; +import { EitService } from '../services/eit.service'; +import { EIT_ACTION } from '../models/submit.eit.action'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; + +@Component({ + selector: 'app-cei-list', + templateUrl: './cei-list.component.html', + styleUrls: ['./cei-list.component.scss'], +}) +export class CeiListComponent implements OnInit { + Sdate: any; + emp_no: any; + balance:any; + P_PAGE_NUM: number; + P_PAGE_LIMIT: number; + IsReachEnd = false; + userName: any; + isDelete = false; + getResCEITransactionList: any = []; + eitAddedList: any = []; + getPassMnuEntryObj: any; + selMenu: MenuResponse = new MenuResponse(); + CEITransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest(); + selEmp: string; + respID: number; + transactionNo = 0; + menuType = ''; + public functionName = ''; + private pAction = 0; + public headerTitle = ''; + data: any; + accrualNetInfants: any; + accrualUNetChild: any; + accrualNetAdult: any; + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false }}; + gaugeType = 'full'; + accrualBalancesList: any; + common: any; + direction: string; + + constructor( + private cs: CommonService, + private EITService: EitService, + public ts: TranslatorService, + public authService:AuthenticationService,) { + this.direction = TranslatorService.getCurrentLanguageName(); + this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList; + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + this.transactionNo = 0; + this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.P_PAGE_NUM = 1; + this.P_PAGE_LIMIT = 100; + } + + ngOnInit() { + this.getCEITransactions(); + } + + + public getCEITransactions() { + this.IsReachEnd = false; + this.CEITransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.CEITransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.CEITransactionsListObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + this.CEITransactionsListObj.P_SELECTED_RESP_ID = this.respID; + this.CEITransactionsListObj.P_MENU_TYPE = this.selMenu.List_Menu.MENU_TYPE; + this.CEITransactionsListObj.P_FUNCTION_NAME = this.getPassMnuEntryObj.FUNCTION_NAME; + this.EITService.getCEITransactionsList(this.CEITransactionsListObj). + subscribe((result: any) => { + this.handleCEITransactionsResult(result); + }); + } + + public handleCEITransactionsResult(result) { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.GetEITTransactionList)) { + this.getResCEITransactionList = result.GetEITTransactionList; + this.P_PAGE_NUM++; + this.CEITransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM; + const lastItemIndex = this.getResCEITransactionList.length - 1; + if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) { + const lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]; + // tslint:disable-next-line: triple-equals + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + } + } + + public addCEIRrq(i?) { + this.pAction = EIT_ACTION.ADD; + this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION); + this.openCEINew(i); + } + + openCEINew(index) { + let item: any = []; + if (this.pAction == EIT_ACTION.UPDATE) { + item = this.getResCEITransactionList[index].Collection_Transaction; + } + this.transactionNo++; + // tslint:disable-next-line: max-line-length + this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData'); + this.cs.openAddCEIPage(); + } + +} + + + diff --git a/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.html b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.html new file mode 100644 index 00000000..6c5d2842 --- /dev/null +++ b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.html @@ -0,0 +1,127 @@ + + + + {{headerTitle}} + + + + + + + + + +
{{'general, addAttach' | translate}}
+
+ +
+ +
+
+
+ + + {{ 'general, notAttch' | translate}} + +
+ + +
+ + + + {{attachList.AttachmentID +1 }} . + + + + + {{attachList.P_FILE_NAME }} + + + + + + + +
+ +
+ +
+ + +
+
+ + {{attachRes.FILE_NAME }} + +
+ + + + +
+
+ +
+ + + +
{{'confirmAddEit, comment' | translate}}
+ + + +
+ + +
{{'confirmAddEit, approverList' | translate}}
+
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+
+ +
+
+ + + {{employee.APPROVER}} + + + {{employee.POSITION_TITLE}} + + + +
+
+
+
+
+ +
+ +
+ + +
+ + {{ (isDelete ? 'general, delete' : 'general, submit') | translate }} +
+
\ No newline at end of file diff --git a/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.scss b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.scss new file mode 100644 index 00000000..2ed98379 --- /dev/null +++ b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.scss @@ -0,0 +1,263 @@ +.footer-button { + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + .imgSize { + width: 22px; + height: 22px; + } + + .Header { + font-weight: bold; + color: #1a586d !important; + font-size: 10px; + } + + .tbData { + font-size: 10px; + } + + .btnBack { + background: transparent; + float: right; + } + + .attachmentDiv{ + background: #ffffff; + height: auto; + text-align: center; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + .submitNote{ + background: #ffffff; + height: 80px; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .approvalList{ + --background: #f0efef; + height: auto; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + + /************************New Design**********************************/ + .notification-list{ + background: none; + background: none; + border-radius: 32px; + ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 100%; + font-size: 16px; + font-weight: bold; + + text-align: start; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 12%; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + padding-top: 15%; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + + } + } + + + + + + + .timeline { + position: relative; + margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); + } + + .timeline:before { + + content: ''; + position: inherit !important; + top: 0; + bottom: 0; + width: 4px; + // background: #e4e4e4; + z-index: 1; + left: 35px; + /* margin-left: -10px; */ + /* z-index: 1; */ + } + + .timeline .timeline-thumb { + + border-radius: 500px; + width: 70px !important; + z-index: 2; + position: absolute; + left: 0px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; + } + + .timeline .timeline-thumb.timeline-icon { + height: 70px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); + } + + + + .timeline .timeline-item { + width: 40px; + + } + + .timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + + } + + .empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + + } + .empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; + } + + .line{ + padding-bottom:87px; + } + + .attachLable{ + position: absolute; + top: 0px; + z-index: 0; + background: #30b8c6; + color: #fff; + border-radius: 50%; + border: 0px; + width: 24px; + height: 24px; + text-align: center; + font-size: 5px; + } + + .removeLable{ + top: 0px; + z-index: 0; + background: #d8252d; + color: #fff; + border-radius: 50%; + border: 0px; + width: 20px; + height: 20px; + text-align: center; + font-size: 5px; + } + + .note-modal { + // width: 90%; + // height: 50%; + // top: 20%; + // left: 5%; + // right: 5%; + // bottom: 5%; + background: rgba(0, 0, 0, 0.5) !important; + padding: 30% 10% !important; + --height: 12cm !important; + // --width: 80% !important; + --border-radius:20px; + + } + .header-toolbar-new{ + --background: #269DB8; + } + .title{ + margin-top: -37px; + margin-left: 85px; + } + .title-ar{ + margin-top: -37px; + margin-right: 101px; + } + .confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + background-color: #269DB8; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + .approvalTitle-ar{ + font-weight: bold; + font-size: 16px; + text-align: right; + + } + .approvalTitle{ + font-weight: bold; + font-size: 16px; + text-align: left; + } + \ No newline at end of file diff --git a/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.spec.ts b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.spec.ts new file mode 100644 index 00000000..2cf5f990 --- /dev/null +++ b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfirmAddCeiComponent } from './confirm-add-cei.component'; + +describe('ConfirmAddCeiComponent', () => { + let component: ConfirmAddCeiComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ConfirmAddCeiComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfirmAddCeiComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.ts b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.ts new file mode 100644 index 00000000..9235b0d8 --- /dev/null +++ b/Mohem/src/app/eit/confirm-add-cei/confirm-add-cei.component.ts @@ -0,0 +1,445 @@ +import { WorkListAttachViewComponent } from './../../notification/work-list-attach-view/work-list-attach-view.component'; +import { AddAttachComponent } from './../add-attach/add-attach.component'; +import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes'; +import { EITNotificatonBodyResponse } from './../models/EITNotificationBodyRes'; +import { WorkListButtonRequest } from './../models/NotificationButtonReq'; +import { ApproversList } from './../../absence/models/approvers'; +import { CeiRequest } from './../models/cei.request'; +import { Component, OnInit } from '@angular/core'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { ModalController } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { EitService } from '../services/eit.service'; +import { AddCeiResponse } from '../models/add.cei.response'; +import { FileUploader } from 'ng2-file-upload'; +import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component'; + +@Component({ + selector: 'app-confirm-add-cei', + templateUrl: './confirm-add-cei.component.html', + styleUrls: ['./confirm-add-cei.component.scss'], +}) +export class ConfirmAddCeiComponent implements OnInit { + + private P_TransactionID: number; + private ceiRequest: CeiRequest; + approversList = []; + addrespList: any; + eitComments: string = ""; + menuType: string = ""; + selEmp: string = ""; + respID: number; + selMenu: MenuResponse; + getAttachList: any; + attachListDisplay: any = []; + headerTitle: string = ""; + isTrue: any = 0; + attachItems: any; + public isResubmitEIT: boolean = false; + private itemKey: string = ""; + private pActionMode: string = "SUBMIT"; + attachReqObj: WorkListButtonRequest = new WorkListButtonRequest(); + attachmentRes: any; + objIndex1: any; + attachListOver: any = []; + index: any = 0; + getPassNotificationDetails: any; + isSubmitBtnClicked: boolean; + isDelete: boolean = false; + + isUpload: boolean = false; + inQueue: boolean = false; + addAttachmentListReq: any; + attachmentID: number = 0; + addAttachRequest: any = []; + fileData: any; + fileType: any; + dirPage: any; + TransactionID: any; + indexLastObj: any = 0; + filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; + direction: string; + + + constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) { + this.direction = TranslatorService.getCurrentLanguageName() + this.isSubmitBtnClicked = false; + this.ceiRequest = new CeiRequest(); + } + + ngOnInit() { + this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.ceiRequest = this.cs.sharedService.getSharedData(CeiRequest.SHARED_DATA, false); + // this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit; + if (this.isResubmitEIT) { + this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING ** + this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true); + this.itemKey = this.getPassNotificationDetails.ITEM_KEY; + this.pActionMode = "RESUBMIT"; + this.menuType = "E"; + this.respID = -999; + this.selEmp = this.ceiRequest.P_SELECTED_EMPLOYEE_NUMBER; + this.getApproversList(); + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + let msg: string = ""; + msg = this.ts.trPK("eit", "update-title"); + this.headerTitle = msg; + } else { + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.addrespList = this.cs.sharedService.getSharedData(AddCeiResponse.SHARED_DATA); + this.itemKey = this.addrespList.SubmitCEITransactionList.P_ITEM_KEY; + this.P_TransactionID = this.addrespList.SubmitCEITransactionList.P_TRANSACTION_ID; + // this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; + this.getApproversList(); + } + } + + getApproversList() { + let body: any = { + P_TRANSACTION_ID: this.P_TransactionID, + P_AME_TRANSACTION_TYPE: "SSHRMS", + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + } + this.eitService.getApproversList( + body). + subscribe((result: any) => { + this.handleApproversResult(result); + }); + } + + handleApproversResult(result) { + if (this.cs.validResponse(result)) { + this.approversList = result.GetApprovesList; + } + } + + startCeiApproval() { + if (this.attachListOver) { + let request = { + AddAttachmentList: this.attachListOver + } + this.eitService.addAttachment( + request). + subscribe((result: any) => { + this.handleAddAttachmentResults(result); + }); + } else { + this.startCeiApprovalProcess(); + } + } + + + handleAddAttachmentResults(result) { + if (this.cs.validResponse(result)) { + //this.isUpload=true; + this.isTrue = 0; + for (let i = 0; i < result.AddAttSuccessList.length; i++) { + if (!result.AddAttSuccessList[i].AddSuccess) { + this.attachListOver[i].isSuccess = false; + // if false display cancel button with waring icon or design + }// end if + else { + // if true remove cancel and set isSuccess = true + this.attachListOver[i].isSuccess = true; + this.isTrue = this.isTrue + 1; //count flag of attach status + } // end else + } // end for + + if (this.isTrue == result.AddAttSuccessList.length) { + this.startCeiApprovalProcess(); + } + else { + //stope + let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; }); + this.attachListOver = filtered; + let msg: string = ""; + msg = this.ts.trPK("eit", "attach-errorMsg"); + this.cs.presentAlert(msg); + } + } + } + + startCeiApprovalProcess() { + let request: any = {}; + request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + request.P_MENU_TYPE = this.menuType; + request.P_SELECTED_RESP_ID = this.respID; + request.P_TRANSACTION_ID = this.P_TransactionID; + request.P_ITEM_KEY = this.itemKey; + request.P_ACTION_MODE = this.pActionMode; + request.P_COMMENTS = this.eitComments; + this.eitService.startCeiApprovalProcess( + request). + subscribe((result: any) => { + this.handleResults(result); + }); + } + cancelEitProcess() { + let body: any = { + P_TRANSACTION_ID: this.P_TransactionID + } + this.eitService.cancelHRTransaction( + body). + subscribe((result: any) => { + this.handleCancelResults(result); + }); + + } + handleCancelResults(result) { + if (this.cs.validResponse(result)) { + this.isSubmitBtnClicked = false; + } + } + handleResults(result) { + if (this.cs.validResponse(result)) { + this.isSubmitBtnClicked = true; + // let msg: string = this.ts.trPK("eit", "approval-message-success"); + // this.cs.presentAlert(msg); + this.cs.greenToastPK("eit", "approval-message-success") + this.cs.openNotificationPage(); + } + } + + async addAttachment(str: boolean, attachItems: any) { + let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; + + this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID'); + this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj'); + + const modal = await this.modalController.create({ + component: AddAttachComponent + }); + + modal.onDidDismiss() + .then((data) => { + if (data == "cancel" || data == "undefined") { + return; + } else { + if (!str) { + this.updateFile(data, attachDocID); + } else { + console.log(data); + this.attachListDisplay = data.data; + this.attachItems = this.attachListDisplay.map(function (el) { + var o = Object.assign({}, el); + o.isSuccess = false; + return o; + }); + + this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + } + } + }); + + return await modal.present(); + } + + /*****submit modal********/ + async openSubmitModal() { + this.cs.sharedService.setSharedData( this.attachListOver, 'submitAttachmentList'); + this.cs.sharedService.setSharedData(this.eitComments, 'eitComments'); + const modal = await this.modalController.create({ + component: SubmitEitModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + this.startCeiApproval(); + } + }); + + return await modal.present(); + + } + + + + removeFile(objectitem) { + if (this.attachListOver) { + let index2 = this.attachListOver.findIndex(item => item == objectitem); + if (index2 > -1) { + this.attachListOver.splice(index2, 1); + } + } + if (this.attachmentRes) { + + let index3 = this.attachmentRes.findIndex(item => item == objectitem); + if (index3 > -1) { + + this.attachmentRes.splice(index3, 1); + } + } + + } + + + getAttachment(NotificationID) { + + this.attachReqObj.P_NOTIFICATION_ID = NotificationID; + + this.eitService.getAttach(this.attachReqObj). + subscribe((result: NotificationGetAttachResponse) => { + this.handleWorkListAttachResult(result); + }); + } + + handleWorkListAttachResult(result) { + if (this.cs.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (result.GetAttachementList != null) { + this.attachmentRes = result.GetAttachementList; + } // if result == null + } // valid it + + } + + async OpenAttachFiles(value, Type) { + + this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage'); + const modal = await this.modalController.create({ + component: WorkListAttachViewComponent + }); + + modal.onDidDismiss() + .then((data) => { + }); + + return await modal.present(); + } + + + delelteFile(attach) { + this.cs.confirmAlertDialog((data) => { + if (data == true) { + this.continueDelete(attach); + } + }, this.ts.trPK('general', 'ok'), () => { + + }, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm')); + } + continueDelete(attach) { + let req = { + P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID + } + this.eitService.deleteAttach(req). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") { + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + let msg: string = ""; + msg = this.ts.trPK("eit", "deleteAttach"); + this.cs.presentAlert(msg); + } + } + }); + } + + updateFile(attachList, attachDocID) { + let req = { + P_ATTACHED_DOCUMENT_ID: attachDocID, + P_FILE_DATA: attachList[0].P_FILE_DATA, + P_FILE_NAME: attachList[0].P_FILE_NAME, + P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE + } + this.eitService.updateAttach(req). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.MessageStatus == 1) { + let msg: string = ""; + msg = this.ts.trPK("eit", "attachUpdate"); + this.cs.presentAlert(msg); + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + } + } // val + }); + } + + + ionViewWillLeave() { + if (this.P_TransactionID && this.isSubmitBtnClicked == false) + this.cancelEitProcess(); + } + + public uploader: FileUploader = new FileUploader({ + allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async (item) => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + onFileSelectedclick(event){ + event.target.value = ''; + } + + + + onFileSelected(input) { + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "notSupport"); + this.cs.presentAlert(msg); + return + } // todo: show alert that you tried uploading wrong files + + else { + const file = input.target.files[0]; + this.getBase64(file).then( + data => this.pushObject(data, file.name, file.type) + ); + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); + } + + + pushObject(fileData, name, type) { + try { + let array = name.split('.'); + let attachType: string = array[array.length - 1]; + + this.attachListOver.push( + { + AttachmentID: this.attachListOver.length, + P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], + P_FILE_DATA: fileData.split(',')[1], + P_FILE_NAME: name,//.split('.')[0], + P_TRANSACTION_ID: this.P_TransactionID + }) + + } catch (e) { + + } + } +} + diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts index 72cf9af1..35abae8a 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts @@ -14,6 +14,7 @@ import { EitService } from '../services/eit.service'; import { AddEitResponse } from '../models/add.eit.response'; import { FileUploader } from 'ng2-file-upload'; import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component'; +import { HomeComponent } from 'src/app/notification/home/home.component'; @Component({ selector: 'app-confirm-add-eit', @@ -62,7 +63,7 @@ export class ConfirmAddEitComponent implements OnInit { filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; direction: string; - + constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) { this.direction = TranslatorService.getCurrentLanguageName() this.isSubmitBtnClicked = false; @@ -81,8 +82,8 @@ export class ConfirmAddEitComponent implements OnInit { this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING ** // console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails); this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true); - // let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); - + // let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); + this.itemKey = this.getPassNotificationDetails.ITEM_KEY; this.pActionMode = "RESUBMIT"; this.menuType = "E"; @@ -228,12 +229,15 @@ export class ConfirmAddEitComponent implements OnInit { if (this.cs.validResponse(result)) { this.isSubmitBtnClicked = true; //if(this.isResubmitEIT==false){ - let msg: string = this.ts.trPK("eit", "approval-message-success"); - this.cs.presentAlert(msg); + // let msg: string = this.ts.trPK("eit", "approval-message-success"); + // this.cs.presentAlert(msg); + this.cs.greenToastPK("eit", "approval-message-success") // } // this.navCtrl.popToRoot(); // this.cs.openHome(); + this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + //this.cs.setTotalNumberOfWorklistRequest(true); this.cs.openNotificationPage(); } } @@ -249,7 +253,7 @@ export class ConfirmAddEitComponent implements OnInit { //open the modal with return data let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; - this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID'); + this.cs.sharedService.setSharedData(this.P_TransactionID, 'TransactionID'); this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj'); const modal = await this.modalController.create({ @@ -298,7 +302,7 @@ export class ConfirmAddEitComponent implements OnInit { /*****submit modal********/ async openSubmitModal() { - this.cs.sharedService.setSharedData( this.attachListOver, 'submitAttachmentList'); + this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList'); this.cs.sharedService.setSharedData(this.eitComments, 'eitComments'); const modal = await this.modalController.create({ component: SubmitEitModalComponent, @@ -314,7 +318,7 @@ export class ConfirmAddEitComponent implements OnInit { if (data.data == "cancel" || data.data == undefined) { return; } else { - this.startEitApproval(); + this.startEitApproval(); } }); @@ -482,7 +486,7 @@ export class ConfirmAddEitComponent implements OnInit { }); - onFileSelectedclick(event){ + onFileSelectedclick(event) { event.target.value = ''; } @@ -529,7 +533,7 @@ export class ConfirmAddEitComponent implements OnInit { pushObject(fileData, name, type) { - console.log("before push: "+ this.index); + console.log("before push: " + this.index); //this.attachListOver.length++; try { let array = name.split('.'); @@ -537,11 +541,11 @@ export class ConfirmAddEitComponent implements OnInit { this.attachListOver.push( { - AttachmentID: this.attachListOver.length, + AttachmentID: this.attachListOver.length, P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], P_FILE_DATA: fileData.split(',')[1], P_FILE_NAME: name,//.split('.')[0], - P_TRANSACTION_ID: this.P_TransactionID + P_TRANSACTION_ID: this.P_TransactionID }) } catch (e) { diff --git a/Mohem/src/app/eit/eit.module.ts b/Mohem/src/app/eit/eit.module.ts index 98d5bde0..a42eebc6 100644 --- a/Mohem/src/app/eit/eit.module.ts +++ b/Mohem/src/app/eit/eit.module.ts @@ -14,7 +14,10 @@ import { DatePicker } from '@ionic-native/date-picker/ngx'; import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; import { EitUpdateListComponent } from './eit-update-list/eit-update-list.component'; import { SubmitEitModalComponent } from './submit-eit-modal/submit-eit-modal.component'; - +import { CeiHomepageComponent } from './cei-homepage/cei-homepage.component'; +import { CeiListComponent } from './cei-list/cei-list.component'; +import { AddCeiComponent } from './add-cei/add-cei.component'; +import { ConfirmAddCeiComponent } from './confirm-add-cei/confirm-add-cei.component'; const routes: Routes = [ { @@ -48,7 +51,23 @@ const routes: Routes = [ { path: 'eit-submit-modal', component: SubmitEitModalComponent - } + }, + { + path: 'cei-homepage', + component: CeiHomepageComponent + }, + { + path: 'cei-list', + component: CeiListComponent + }, + { + path: 'add-cei', + component: AddCeiComponent + }, + { + path: 'confirm-cei', + component: ConfirmAddCeiComponent + }, ] } ]; @@ -69,7 +88,11 @@ const routes: Routes = [ ConfirmAddEitComponent, AddAttachComponent, EitUpdateListComponent, - SubmitEitModalComponent + SubmitEitModalComponent, + CeiHomepageComponent, + CeiListComponent, + AddCeiComponent, + ConfirmAddCeiComponent ], entryComponents: [ WorkListAttachViewComponent diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts index 7402a672..b3fd95e5 100644 --- a/Mohem/src/app/eit/home/home.component.ts +++ b/Mohem/src/app/eit/home/home.component.ts @@ -2,6 +2,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service import { Component, OnInit } from '@angular/core'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { TerminationServiceService } from 'src/app/termination/service/termination-service.service'; @Component({ selector: 'app-home', @@ -19,7 +20,7 @@ export class HomeComponent implements OnInit { direction: string; pageType: string; - constructor(private cs: CommonService, private ts: TranslatorService) { + constructor(private cs: CommonService, private ts: TranslatorService, public terminationService: TerminationServiceService) { this.direction = TranslatorService.getCurrentLanguageName(); this.menu = this.cs.sharedService.getSharedData('menuEntries', false); this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false); @@ -45,6 +46,11 @@ export class HomeComponent implements OnInit { this.selectedMenu = index; } } + if (page['FUNCTION_NAME'] == 'HR_TERM_SS' || page['FUNCTION_NAME'] == 'HR_TERM_EMP_SS') { + this.cs.sharedService.setSharedData(page, TerminationServiceService.TERMINATION_PAGE); + + this.cs.openTermination(); + } console.log('selected>>>>>>>' + this.selectedMenu); } @@ -59,8 +65,10 @@ export class HomeComponent implements OnInit { this.cs.openEitListPage(); } else if (menuEntry.REQUEST_TYPE === 'BASIC_DETAILS') { this.cs.openProfile('basicDetails'); - } else if (menuEntry.REQUEST_TYPE === 'ADDRESS') { - this.cs.openProfile('address'); + } else if (menuEntry.REQUEST_TYPE === 'ADDRESS' || menuEntry.REQUEST_TYPE === 'PHONE_NUMBERS') { + this.cs.openProfile('contact'); + } else if (menuEntry.REQUEST_TYPE === 'CONTACT') { + this.cs.openProfile('family'); } if (menuEntry.REQUEST_TYPE === 'PAYSLIP') { this.cs.openPayslipPage(); @@ -68,6 +76,9 @@ export class HomeComponent implements OnInit { if (menuEntry.REQUEST_TYPE === 'TIME_CARD') { this.cs.openTimeCardPage(); } + if (menuEntry.REQUEST_TYPE === 'CEI') { + this.cs.openCEIPage(); + } } } diff --git a/Mohem/src/app/eit/models/add.cei.response.ts b/Mohem/src/app/eit/models/add.cei.response.ts new file mode 100644 index 00000000..070c330a --- /dev/null +++ b/Mohem/src/app/eit/models/add.cei.response.ts @@ -0,0 +1,8 @@ +import { Response } from '../../hmg-common/services/models/response'; +import { EitRespModel } from './eit.response.model' + +export class AddCeiResponse extends Response { + public static SHARED_DATA = 'add-cei-response'; + SubmitCEITransactionList: EitRespModel; +} + diff --git a/Mohem/src/app/eit/models/add.eit.response.ts b/Mohem/src/app/eit/models/add.eit.response.ts index b54537a7..c7a18133 100755 --- a/Mohem/src/app/eit/models/add.eit.response.ts +++ b/Mohem/src/app/eit/models/add.eit.response.ts @@ -3,6 +3,7 @@ import { EitRespModel } from './eit.response.model' export class AddEitResponse extends Response { public static SHARED_DATA = 'add-eit-response'; + public static isContact = 'isContact'; SubmitEITTransactionList: EitRespModel; } diff --git a/Mohem/src/app/eit/models/cei.request.ts b/Mohem/src/app/eit/models/cei.request.ts new file mode 100644 index 00000000..7b06f904 --- /dev/null +++ b/Mohem/src/app/eit/models/cei.request.ts @@ -0,0 +1,12 @@ +import { EitTransactionModel } from './eit.transaction.model'; + +export class CeiRequest { + public static SHARED_DATA = 'cei-request'; + public P_MENU_TYPE: string; + public P_SELECTED_EMPLOYEE_NUMBER: string; + public P_FUNCTION_NAME: string; + public P_SELECTED_RESP_ID: Number; + P_CONTACT_RELATIONSHIP_ID: Number; + P_DESC_FLEX_CONTEXT_CODE: string; + EITTransactionTBL: EitTransactionModel[]; +} \ No newline at end of file diff --git a/Mohem/src/app/eit/models/eit.request.ts b/Mohem/src/app/eit/models/eit.request.ts index 51e746a5..cc9d4311 100755 --- a/Mohem/src/app/eit/models/eit.request.ts +++ b/Mohem/src/app/eit/models/eit.request.ts @@ -8,5 +8,4 @@ export class EitRequest { public P_SELECTED_RESP_ID: Number; P_DESC_FLEX_CONTEXT_CODE: string; EITTransactionTBL: EitTransactionModel[]; - } \ No newline at end of file diff --git a/Mohem/src/app/eit/services/eit.service.ts b/Mohem/src/app/eit/services/eit.service.ts index 9063a6ff..4b95bdda 100644 --- a/Mohem/src/app/eit/services/eit.service.ts +++ b/Mohem/src/app/eit/services/eit.service.ts @@ -5,6 +5,7 @@ import { Injectable } from '@angular/core'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; import { AddEitResponse } from '../models/add.eit.response'; +import { AddCeiResponse } from '../models/add.cei.response'; import { ApproversList } from 'src/app/absence/models/approvers'; import { WorkListButtonRequest } from '../models/NotificationButtonReq'; @@ -16,19 +17,24 @@ export class EitService { /* EIT Services URLs */ public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES'; public static getEITTransctions = 'Services/ERP.svc/REST/GET_EIT_TRANSACTIONS'; + public static getCEITransctions = 'Services/ERP.svc/REST/GET_CEI_TRANSACTIONS'; public static getEITDFFStrutre = 'Services/ERP.svc/REST/GET_EIT_DFF_STRUCTURE'; + public static getCEIDFFStrutre = 'Services/ERP.svc/REST/GET_CEI_DFF_STRUCTURE'; public static getSetValue = 'Services/ERP.svc/REST/GET_VALUE_SET_VALUES'; public static getDefaultValue = 'Services/ERP.svc/REST/GET_DEFAULT_VALUE'; public static validateEITTransctions = 'Services/ERP.svc/REST/VALIDATE_EIT_TRANSACTION'; public static submitEit = 'Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION'; + public static submitCEI = 'Services/ERP.svc/REST/SUBMIT_CEI_TRANSACTION'; public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION'; public static startEitProcess = 'Services/ERP.svc/REST/START_EIT_APPROVAL_PROCESS'; + public static startCeiProcess = 'Services/ERP.svc/REST/START_CEI_APPROVAL_PROCESS'; public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT'; public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT'; public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST'; public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT'; public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION'; public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS'; + public static getContactInfo = 'Services/ERP.svc/REST/GET_EMPLOYEE_CONTACTS'; constructor(public authService: AuthenticationService, public con: ConnectorService) { } @@ -49,6 +55,13 @@ export class EitService { return this.con.post(EitService.getEITTransctions, request, onError, errorLabel); } + // tslint:disable-next-line: no-shadowed-variable + public getCEITransactionsList(EITTransactionsRequest: EITTransactionsRequest, onError?: any, errorLabel?: string): Observable { + const request = EITTransactionsRequest; + this.authService.authenticateRequest(request); + return this.con.post(EitService.getCEITransctions, request, onError, errorLabel); + } + public submitEit(eit: any, onError?: any, errorLabel?: string): Observable { const request = eit; request.EITTransactionTBLModel = eit.EITTransactionTBL; @@ -56,6 +69,20 @@ export class EitService { return this.con.post(EitService.submitEit, request, onError, errorLabel); } + public submitChildEducation(cei: any, onError?: any, errorLabel?: string): Observable { + const request = cei; + request.EITTransactionTBL = cei.EITTransactionTBL; + this.authService.authenticateRequest(request); + return this.con.post(EitService.submitCEI, request, onError, errorLabel); + } + + public submitCEI(eit: any, onError?: any, errorLabel?: string): Observable { + const request = eit; + request.EITTransactionTBLModel = eit.EITTransactionTBL; + this.authService.authenticateRequest(request); + return this.con.post(EitService.submitEit, request, onError, errorLabel); + } + public validateEITTransaction(validateEITTransactionReq: any, onError?: any, errorLabel?: string): Observable { const request = validateEITTransactionReq; this.authService.authenticateRequest(request); @@ -68,6 +95,12 @@ export class EitService { return this.con.post(EitService.getEITDFFStrutre, request, onError, errorLabel); } + public getCEIDFFStrutre(EITDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable { + const request = EITDFFStrutreReq; + this.authService.authenticateRequest(request); + return this.con.post(EitService.getCEIDFFStrutre, request, onError, errorLabel); + } + public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable { const request = SetValueReq; this.authService.authenticateRequest(request); @@ -101,6 +134,12 @@ export class EitService { return this.con.post(EitService.startEitProcess, request, onError, errorLabel); } + public startCeiApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable { + const request = eitProcess; + this.authService.authenticateRequest(request); + return this.con.post(EitService.startCeiProcess, request, onError, errorLabel); + } + public cancelHRTransaction(transactionID: any, onError?: any, errorLabel?: string): Observable { const request = transactionID; this.authService.authenticateRequest(request); @@ -131,4 +170,9 @@ export class EitService { return this.con.post(EitService.resubmitEit, request, onError, errorLabel); } + public getContactInfo(request: any, onError?: any, errorLabel?: string): Observable { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME; + return this.con.post(EitService.getContactInfo, request, onError, errorLabel); + } } diff --git a/Mohem/src/app/erm-channel/home/home.component.ts b/Mohem/src/app/erm-channel/home/home.component.ts index 5bec5386..6d621078 100644 --- a/Mohem/src/app/erm-channel/home/home.component.ts +++ b/Mohem/src/app/erm-channel/home/home.component.ts @@ -60,9 +60,14 @@ export class HomeComponent implements OnInit { }, ( ) => { }, this.ts.trPK('general', 'ok')).subscribe((result) => { - CommonService.SKIP = true; - this.cs.openHome(); - }) + if (this.cs.validResponse(result)){ + this.cs.greenToastPK("erm-channel", "viedo-success"); + CommonService.SKIP = true; + this.cs.openHome(); + }else{ + this.cs.redToastPK("erm-channel", "erm-failed"); + } + }); } } diff --git a/Mohem/src/app/erm-channel/survey/survey.component.ts b/Mohem/src/app/erm-channel/survey/survey.component.ts index b547457b..a5a6d759 100644 --- a/Mohem/src/app/erm-channel/survey/survey.component.ts +++ b/Mohem/src/app/erm-channel/survey/survey.component.ts @@ -52,9 +52,14 @@ export class SurveyComponent implements OnInit { this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => { - CommonService.SKIP = true; - this.cs.openHome(); - }) + if (this.cs.validResponse(result)){ + this.cs.greenToastPK("erm-channel", "survey-success"); + CommonService.SKIP = true; + this.cs.openHome(); + }else{ + this.cs.redToastPK("erm-channel", "erm-failed"); + } + }); } select(rating) { this.satisfied = rating; diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index c0d8c8f9..2b8da3ac 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -85,32 +85,39 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl import { FileUploadModule } from 'ng2-file-upload'; import { PdfViewerModule } from 'ng2-pdf-viewer'; import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; -import {Camera} from '@ionic-native/Camera/ngx'; -import {File} from '@ionic-native/file/ngx'; -import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component'; +import { Camera } from '@ionic-native/Camera/ngx'; +import { File } from '@ionic-native/file/ngx'; +import { FileUploderProfileComponent } from './ui/file-uploder-profile/file-uploder-profile.component'; import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; -import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' -import {DashboredService} from './services/dashbored/dashbored.service'; -import {NgxGaugeModule} from 'ngx-gauge'; +import { AccordinTabCustomComponent } from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' +import { DashboredService } from './services/dashbored/dashbored.service'; +import { NgxGaugeModule } from 'ngx-gauge'; import { StatsButtonComponent } from './ui/stats-button/stats-button.component'; import { ServicesButtonComponent } from './ui/services-button/services-button.component'; -import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component' -import {WelcomeComponent} from './ui/welcome-login/welcome.component' -import {FabButtonComponent} from './ui/fab-button/fab-button.component' +import { ConfirmLoginComponent } from '../authentication/confirm-login/confirm-login.component' +import { WelcomeComponent } from './ui/welcome-login/welcome.component' +import { FabButtonComponent } from './ui/fab-button/fab-button.component' import { AttendScanService } from './services/attend-services/attend-scan.service'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { NgCircleProgressModule } from 'ng-circle-progress'; import { CardFilterComponent } from './ui/card-filter/card-filter.component'; import { EmployeeInformationComponent } from './ui/employee-information/employee-information.component'; import { CircleCalendarComponent } from './ui/circle-calendar/circle-calendar.component'; -import { NgCalendarModule } from 'ionic2-calendar'; +import { NgCalendarModule } from 'ionic2-calendar'; import { DateInfoModalComponent } from './ui/circle-calendar/date-info-modal/date-info-modal.component'; import { ChartModule } from 'primeng/chart'; import { GenericHeaderComponent } from './ui/generic-header/generic-header.component'; import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component'; import { CardCalendarComponent } from './ui/card-calendar/card-calendar.component'; +import { WorklistSettingComponent } from '../notification/worklist-setting/worklist-setting.component'; +import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit-address-modal.component'; +import { FileOpener } from '@ionic-native/file-opener/ngx'; +import { FilePath } from '@ionic-native/file-path/ngx'; +import { FileChooser } from "@ionic-native/file-chooser/ngx"; +import { IOSFilePicker } from '@ionic-native/file-picker/ngx'; +import { SanitizeHtmlPipe } from '../itemforsale/services/domsafe'; @NgModule({ imports: [ @@ -130,6 +137,7 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen ], declarations: [ FabButtonComponent, + SanitizeHtmlPipe, WelcomeComponent, NumberRangeComponent, SSpacerComponent, @@ -194,7 +202,9 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen Modal, GenericHeaderComponent, AttendanceOptionsComponent, - CardCalendarComponent + CardCalendarComponent, + WorklistSettingComponent, + SubmitAddressModalComponent ], exports: [ FabButtonComponent, @@ -265,7 +275,9 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen Modal, GenericHeaderComponent, AttendanceOptionsComponent, - CardCalendarComponent + CardCalendarComponent, + SubmitAddressModalComponent, + SanitizeHtmlPipe, ], providers: [ AttendScanService, @@ -304,9 +316,13 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen MenuService, OpenNativeSettings, BarcodeScanner, - BackgroundGeolocation + BackgroundGeolocation, + FileOpener, + FilePath, + FileChooser, + IOSFilePicker ], - entryComponents: [DateInfoModalComponent], + entryComponents: [DateInfoModalComponent, WorklistSettingComponent], }) export class HmgCommonModule { } diff --git a/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts b/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts index 30002b70..29c24f36 100644 --- a/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts +++ b/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts @@ -34,7 +34,7 @@ export class AttendScanService { userData: any = {}; public isFakeLocationUsed = false; public isGpsRequired = false; - public collection = 'HMG'; + public collection = 'CS'; constructor(private device: Device, private zbar: ZBar, diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index a8eb8067..55367138 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -134,6 +134,9 @@ export class AuthenticationService { public setPublicFields(request: Request): Request { const isAndroid = this.platform.is('android'); const isIOS = this.platform.is('ios'); + // const userData = this.cs.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false); + const userPayrollCode = this.cs.sharedService.getSharedData("projcet-code", false); + const userLegislationCode = this.cs.sharedService.getSharedData("legislation-code", false); let mobileType = ''; if (isAndroid) { mobileType = 'android'; @@ -142,11 +145,18 @@ export class AuthenticationService { } else { mobileType = 'android'; } - request.VersionID = 3.2; - request.Channel = 33; + request.VersionID = 3.6; + request.Channel = 31; request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.MobileType = mobileType; + if (userPayrollCode) { + request.PayrollCodeStr = userPayrollCode; + } + if (userLegislationCode) { + request.LegislationCodeStr = userLegislationCode + } + return request; } public authenticateAndSetPersonalInformation( @@ -218,7 +228,7 @@ export class AuthenticationService { public login(request: LoginRequest, onError: any, errorLabel: string): Observable { this.setPublicFields(request); - request.P_APP_VERSION = "HMG"; + request.P_APP_VERSION = "CS"; return this.con.post(AuthenticationService.login, request, onError, errorLabel); } @@ -475,7 +485,7 @@ export class AuthenticationService { public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) : Observable { this.setPublicFields(request); - request.P_APP_VERSION = "HMG"; + request.P_APP_VERSION = "CS"; return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel); } diff --git a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts index 387a7d73..68ca3ab7 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts @@ -3,6 +3,7 @@ import { Response } from 'src/app/hmg-common/services/models/response'; import { AuthenticatedUser } from './authenticated-user'; import { PrivilageModel } from './privilage-model'; export class SMSCheckResponse extends Response { + BasicMemberInformation: any = {}; AuthenticationTokenID: string; MemberInformationList:AuthenticatedUser[]; Privilege_List:PrivilageModel[]; diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index cac80b88..2a8ae0fd 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -78,6 +78,16 @@ export class CommonService { 'نوفمبر', 'ديسمبر' ]; + public filterKeys = { + 'HRSSA': 0, + 'INVMOA': 0, + 'REQAPPRV': 0, + 'POAPPRV': 0, + 'INVITEM': 0, + "STAMP": 0, + 'ITG': 0, + 'COC': 0 + } private progressLoaders: any[] = []; private loadingProgress: any; @@ -207,7 +217,7 @@ export class CommonService { const toast = await this.toastController.create({ message: message, showCloseButton: true, - position: 'middle', + position: 'top', duration: 2000, closeButtonText: this.ts.trPK('general', 'close') }); @@ -226,7 +236,7 @@ export class CommonService { const toast = await this.toastController.create({ message: message, showCloseButton: true, - position: 'middle', + position: 'top', duration: 2000, color: 'danger', closeButtonText: this.ts.trPK('general', 'close') @@ -237,7 +247,7 @@ export class CommonService { const toast = await this.toastController.create({ message: message, showCloseButton: true, - position: 'middle', + position: 'top', duration: 2000, color: 'success', closeButtonText: this.ts.trPK('general', 'close') @@ -819,6 +829,11 @@ export class CommonService { return '/Date(' + date.getTime() + ')/'; } + public convertDateToJsonDateUpdated(date: Date): string { + const newDate = new Date(date); + return '/Date(' + newDate.getTime() + ')/'; + } + /* date iso format and time is 24 format hh:mm:ss @@ -888,6 +903,11 @@ export class CommonService { return this.getDateTimeISO(date) + ' ' + this.getTimeISO(date); } + public getDateTimeISOFromStringUpdated(dateStr: string): string { + const date = this.evaluteDateAsObject(dateStr); + return this.getDateTimeISO(date); + } + public getCurrentTimeISO(): string { return this.getTimeISO(new Date()); } @@ -1119,9 +1139,15 @@ export class CommonService { public openAddEitPage() { this.nav.navigateForward(['/eit/add-eit']); } + public openAddCEIPage() { + this.nav.navigateForward(['/eit/add-cei']); + } public openConfirmEitPage() { this.nav.navigateForward(['/eit/confirm-add-eit']); } + public openConfirmCEIPage() { + this.nav.navigateForward(['/eit/confirm-cei']); + } public openConfirmBasicDetailsPage() { this.nav.navigateForward(['/profile/confirm-basic']); } @@ -1172,6 +1198,9 @@ export class CommonService { public openMyTeamDetailPage() { this.nav.navigateForward(['/my-team/details']); } + public openSubordinateLeavePage() { + this.nav.navigateForward(['/my-team/subordinate-leave']); + } public openMyRequestPage() { this.nav.navigateForward(['/mowadhafi/my-request']); } @@ -1216,6 +1245,9 @@ export class CommonService { public openWorklistMainPage() { this.nav.navigateForward(['/notification/worklist-main']); } + public openWorklistSettingsPage() { + this.nav.navigateForward(['/notification/worklist-settings']); + } public openWorklistMainPRPage() { this.nav.navigateForward(['/notification/worklist-main-PR']); } @@ -1290,6 +1322,16 @@ export class CommonService { public openAddAddress() { this.nav.navigateForward(['/profile/add-address']); } + public openAddContact() { + this.nav.navigateForward(['/profile/contact']); + } + public openAddUpdateContact() { + this.nav.navigateForward(['/profile/add-update-contact']); + } + public confirmContact() { + this.nav.navigateForward(['/profile/confirm-contact']); + } + public openConfirmAddAddress() { this.nav.navigateForward(['/profile/confirm-add-address']); } @@ -1299,12 +1341,45 @@ export class CommonService { public eitUpdate() { this.nav.navigateForward(['/eit/eit-update-list']); } + public openCEIPage() { + this.nav.navigateForward(['/eit/cei-homepage']); + } + public openCEIListPage() { + this.nav.navigateForward(['/eit/cei-list']); + } public openAnnouncement() { this.nav.navigateForward(['/backend-integrations/announcement']); } + public openConcurrentReport() { + this.nav.navigateForward(['/reports/concurrent-report']); + } + public openConcurrentTransaction() { + this.nav.navigateForward(['/reports/transaction-list']); + } + public openTermination() { + this.nav.navigateForward(['/termination/termination-form']); + } + public confirmTermination() { + + this.nav.navigateForward(['/termination/confirm-termination']); + } + public openTransactions() { + + this.nav.navigateForward(['/pending-transaction/home']); + } + + public openItemForSale() { + this.nav.navigateForward('/itemforsale/items'); + } + public openCreateitems() { + this.nav.navigateForward('/itemforsale/home'); + } + public filterItemforSale() { + this.nav.navigateForward('/itemforsale/filter'); + } public navigatePage(path) { this.nav.navigateForward([path]); } @@ -1507,4 +1582,147 @@ export class CommonService { return this.activeType; } + public totalCounter = 0; + getTotalNumberOfWorklistRequest() { + this.totalCounter = parseInt(this.sharedService.getSharedData('total-count', false)); + return this.totalCounter ? this.totalCounter : 0; + } + setTotalNumberOfWorklistRequest() { + if (this.totalCounter > 0) { + this.totalCounter -= 1; + } + this.sharedService.setSharedData(this.totalCounter, 'total-count'); + } + + public setFilterValues(data) { + for (const notification of data) { + + this.filterKeys[notification.ITEM_TYPE] = notification.OPEN_NTF_NUMBER + } + } + + + public filters = [ + { + value: 0, + name: 'HR', + active: false, + color: '#18a169', + key: 'HRSSA', + disable: false, + total: 0 + }, + { + value: 0, + name: 'MR', + active: false, + color: '#3cb9d5', + key: 'INVMOA', + disable: false, + total: 0 + }, + { + value: 0, + name: 'PR', + active: false, + color: '#114475', + key: 'REQAPPRV', + disable: false, + total: 0 + }, + { + value: 0, + name: 'PO', + active: false, + color: '#38c9b3', + key: 'POAPPRV', + disable: false, + total: 0 + }, + { + value: 0, + name: 'ITG', + active: false, + color: '#cc3232', + key: 'ITG', + disable: false, + total: 0 + }, + { + value: 0, + name: 'IC', + active: false, + color: '#9e7e97', + key: 'INVITEM', + disable: false, + total: 0 + }, + { + value: 0, + name: 'STAMP', + active: false, + color: '#ff9800', + key: 'STAMP', + disable: false, + total: 0, + }, + { + value: 0, + name: 'COC', + active: false, + color: '#787299', + key: 'COC', + disable: true, + total: 0, + } + ]; + + public data = { + datasets: [ + { + data: [0, 0, 0, 0, 0, 0, 0, 0], + backgroundColor: [ + '#18a169', + '#3cb9d5', + '#114475', + '#38c9b3', + '#cc3232', + '#9e7e97', + '#ff9800', + '#787299' + ], + borderWidth: 6 + }] + }; + + getFiltersData() { + // for (const notification of openNotificationsArray) { + // if (notification.ITEM_TYPE === 'HRSSA') { + this.filters[0].value = this.filterKeys['HRSSA']; + this.data.datasets[0].data[0] = this.filterKeys['HRSSA']; + // } else if (notification.ITEM_TYPE === 'INVMOA') { + this.filters[1].value = this.filterKeys['INVMOA']; + this.data.datasets[0].data[1] = this.filterKeys['INVMOA']; + // } else if (notification.ITEM_TYPE === 'REQAPPRV') { + this.filters[2].value = this.filterKeys['REQAPPRV']; + this.data.datasets[0].data[2] = this.filterKeys['REQAPPRV']; + // } else if (notification.ITEM_TYPE === 'POAPPRV') { + this.filters[3].value = this.filterKeys['POAPPRV']; + this.data.datasets[0].data[3] = this.filterKeys['POAPPRV']; + // } else if (notification.ITEM_TYPE === 'INVITEM') { + this.filters[5].value = this.filterKeys['INVITEM']; + this.data.datasets[0].data[5] = this.filterKeys['INVITEM']; + // } else if (notification.ITEM_TYPE === 'STAMP') { + this.filters[6].value = this.filterKeys['STAMP']; + this.data.datasets[0].data[6] = this.filterKeys['STAMP']; + + this.filters[7].value = this.filterKeys['COC']; + this.data.datasets[0].data[7] = this.filterKeys['COC']; + + let val = { 'filters': [], 'data': {} }; + val.filters = this.filters; + val.data = this.data; + return val; + } + } diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index dc119ce4..5a1959c6 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -25,7 +25,7 @@ export class ConnectorService { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) }; public static retryTimes = 0; - public static timeOut = 120 * 1000; + public static timeOut = 180 * 1000; // public static host = 'https://uat.hmgwebservices.com/'; public static host = 'https://hmgwebservices.com/'; @@ -235,7 +235,7 @@ export class ConnectorService { } return false; } else if (result.ErrorType === 2 || result.ErrorType === 4) { - this.cs.stopLoading(); + this.cs.stopLoading(); } else { this.cs.stopLoading(); if (!fromSMS) { diff --git a/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts b/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts index 1c7a2e1d..0a7cd754 100644 --- a/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts +++ b/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts @@ -2,10 +2,13 @@ import { ListMenu } from './list.menu'; import { MenuEntry } from './menu.entry'; export class MenuResponse { public static SHARED_DATA = 'menu_response'; - public static SHARED_SEL_EMP= 'sel_empolyee'; - public static SHARED_SEL_RESP_ID= 'sel_resp_id'; - public userid:string; - public search:boolean; - public List_Menu:ListMenu; - public GetMenuEntriesList:MenuEntry; + public static MENU_LIST = 'menu_list'; + public static SELECTED_MENU = 'selected_menu'; + public static SHARED_SEL_EMP = 'sel_empolyee'; + public static SHARED_SEL_RESP_ID = 'sel_resp_id'; + public static ITG_COUNTS = 'itg-counts'; + public userid: string; + public search: boolean; + public List_Menu: ListMenu; + public GetMenuEntriesList: MenuEntry; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/models/request.ts b/Mohem/src/app/hmg-common/services/models/request.ts index 1a9e8fd2..6a16ec13 100644 --- a/Mohem/src/app/hmg-common/services/models/request.ts +++ b/Mohem/src/app/hmg-common/services/models/request.ts @@ -18,6 +18,8 @@ export class Request { public P_MOBILE_NUMBER: string; public P_EMAIL_ADDRESS: string; public P_NOTIFICATION_ID: number; + public PayrollCodeStr: string; + public LegislationCodeStr: string; // public P_LEGISLATION_CODE: string; // public OTP_SendType: number; diff --git a/Mohem/src/app/hmg-common/services/rate/rate.service.ts b/Mohem/src/app/hmg-common/services/rate/rate.service.ts index f9fef5d7..9176bf13 100644 --- a/Mohem/src/app/hmg-common/services/rate/rate.service.ts +++ b/Mohem/src/app/hmg-common/services/rate/rate.service.ts @@ -20,13 +20,13 @@ export class RateService { } - public rateFeature(ratedFeedBack?: any , featureKey: string = RateService.app , delay: number = 2000) { + public rateFeature(ratedFeedBack?: any, featureKey: string = RateService.app, delay: number = 2000) { if (this.isRated(featureKey)) { if (ratedFeedBack) { ratedFeedBack(true); } } else { - setTimeout( () => { + setTimeout(() => { this.startRating(featureKey, ratedFeedBack); }, delay); } @@ -38,7 +38,7 @@ export class RateService { this.appRate.preferences = { displayAppName: this.ts.trPK('general', 'app-name'), promptAgainForEachNewVersion: true, - inAppReview: true, + // inAppReview: true, storeAppURL: { ios: 'com.ejada.hmg', android: 'market://details?id=com.ejada.hmg', @@ -47,7 +47,7 @@ export class RateService { callbacks: { handleNegativeFeedback: () => { this.setAsRated(featureKey); - //this.cs.openFeedback(); + //this.cs.openFeedback(); }, onButtonClicked: (buttonIndex) => { // when user click rate diff --git a/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.html b/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.html index 5e4d2dac..f91aece1 100644 --- a/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.html +++ b/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.html @@ -1,13 +1,40 @@ - - - - {{'general,select-attachment' | translate}} - + -
- -

{{file.name}}

-

-
-
\ No newline at end of file + + + + {{'general,select-attachment' | translate}} + + + + + + + + + + +
+
+
X
+ +
+ +
+
+ +
+
+
+
+ +
+ {{errorMsg}} +
\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.scss b/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.scss index 56325173..6b308e7b 100644 --- a/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.scss +++ b/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.scss @@ -2,4 +2,21 @@ width: .7cm; height: .6cm; vertical-align: middle; +} +.closed{ + position: absolute; + right: 0; + font-size: 14px; + color: #fff; + top: -5px; + right: -10px; + font-weight: bolder; + background: red; + padding: 6px; + border-radius: 50%; + text-align: center; + line-height: .7; +} +.image-container{ + margin-top: 10px; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.ts b/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.ts index 9df5a0c8..fe573455 100644 --- a/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.ts +++ b/Mohem/src/app/hmg-common/ui/file-uploader/file-uploader.component.ts @@ -1,100 +1,288 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { CommonService } from 'src/app/hmg-common/services/common/common.service'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -import { AlertController } from '@ionic/angular'; +import { Component, OnInit, Input, Output, EventEmitter, NgZone } from "@angular/core"; +import { CommonService } from "src/app/hmg-common/services/common/common.service"; +import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; +import { AlertController, ActionSheetController, Platform } from "@ionic/angular"; +import { + Camera, + CameraOptions, + PictureSourceType +} from "@ionic-native/Camera/ngx"; +import { FileChooser } from "@ionic-native/file-chooser/ngx"; +import { File } from "@ionic-native/file/ngx"; +import { FilePath } from "@ionic-native/file-path/ngx"; +import { Base64 } from "@ionic-native/base64/ngx"; +import { IOSFilePicker } from '@ionic-native/file-picker/ngx'; +import { Location } from '@angular/common'; +import { DomSanitizer, SafeUrl } from "@angular/platform-browser"; -export interface CustomWindow extends Window { - File: any; - FileReader: any; -} -declare let window: CustomWindow; - @Component({ - selector: 'file-uploader', - templateUrl: './file-uploader.component.html', - styleUrls: ['./file-uploader.component.scss'] + selector: "file-uploader", + templateUrl: "./file-uploader.component.html", + styleUrls: ["./file-uploader.component.scss"] }) export class FileUploaderComponent implements OnInit { @Input() multiupload = false; - @Input() attachmentname = 'attachment-loader'; + @Input() attachmentname = "attachment-loader"; public attachmentData: string; - @Input() maxFileSize = 10 * 1024 * 1024; + public errorMsg: string; + public selectedOpn: number = 1; + public allowdType: any = ["jpg", "jpeg", "png", "gif", "pdf", "doc", "docx"]; + @Input() maxFileSize = 5 * 1024 * 1024; @Output() fileSelected = new EventEmitter(); public inputFiles: any = []; - public attachmentImg = 'assets/icon/attachment.png'; - public deleteImg = 'assets/icon/delete.png'; + public attachmentImg = "assets/icon/attachment.png"; + public deleteImg = "assets/icon/delete.png"; + public nativePath: any; + public actionSheet: any; + public isActionSheetShown: boolean = false; + @Input() selectedAttachment = []; constructor( public cs: CommonService, public ts: TranslatorService, - public alertController: AlertController - ) { - } + public alertController: AlertController, + private cameraController: Camera, + private actionSheetController: ActionSheetController, + private fileChooser: FileChooser, + private file: File, + private filePath: FilePath, + public base64: Base64, + public platform: Platform, + private iOSfilePicker: IOSFilePicker, + public ngzone: NgZone, + public loc: Location, + public sanitizer: DomSanitizer + ) { } ngOnInit() { + this.platform.backButton.subscribeWithPriority(9999, () => { + // You decide what happens + if (this.isActionSheetShown) + this.actionSheet.dismiss(); + else + this.loc.back(); + }); + this.inputFiles = this.selectedAttachment; } - - public loadAttachment(changeEvent) { - const fileInput = this.getFileElement(); - if (this.isFileSupported()) { - if (fileInput.files != null && fileInput.files.length > 0) { - const file = fileInput.files[0]; - const reader = new FileReader(); - if (file.size <= this.maxFileSize) { - reader.onload = (data) => { - if (this.multiupload) { - this.inputFiles.push({name: file.name, data: data.target['result']}); - } else { - this.inputFiles = [{name: file.name, data: data.target['result']}]; - } - this.fileSelected.emit( { - name: file.name , - data: data.target['result'], - inputFiles: this.inputFiles - }); - }; - reader.readAsDataURL(file); - } else { - this.attachmentData = null; - changeEvent.target.value = ''; // remove current selection - this.showFileExceededMaxSize(); - } - } else { - this.attachmentData = null; - } - } + ngOnDestroy(): void { } + async openFile() { + if (this.platform.is('ios')) + this.openiOSActionSheet(); + else + this.openAndroidActionSheet(); + //this.openiOSActionSheet(); - private isFileSupported() { - return (window.FileReader && window.File); } + async openAndroidActionSheet() { + this.actionSheet = await this.actionSheetController.create({ + header: this.ts.trPK("itemforsale", "slect-source-file"), //"Select Image file", - private showFileExceededMaxSize() { - this.cs.presentConfirmDialog( - this.ts.trPK('general', 'large-file'), - () => { - this.openFile(); - }, - () => { - } - ); + buttons: [ + { + text: this.ts.trPK("itemforsale", "from-library"), + handler: () => { + this.takePictureiOS(); + } + }, + { + text: this.ts.trPK("itemforsale", "from-camera"), + handler: () => { + this.takePicture(this.cameraController.PictureSourceType.CAMERA); + } + }, + { + text: this.ts.trPK("general", "cancel"), + role: "cancel" + } + ] + }); + this.isActionSheetShown = true; + await this.actionSheet.present(); } - private getFileElement(): HTMLInputElement { - return document.getElementById(this.attachmentname) as HTMLInputElement; + async openiOSActionSheet() { + this.actionSheet = await this.actionSheetController.create({ + header: this.ts.trPK("itemforsale", "slect-source-file"), //"Select Image file", + buttons: [ + { + text: this.ts.trPK("itemforsale", "from-library"), + handler: () => { + this.takePictureiOS(); + } + }, + { + text: this.ts.trPK("itemforsale", "from-camera"), + handler: () => { + this.takePicture(this.cameraController.PictureSourceType.CAMERA); + } + }, + + { + text: this.ts.trPK("itemforsale", "from-icloud"), + handler: () => { + this.takePicture(this.cameraController.PictureSourceType.PHOTOLIBRARY); + } + }, + { + text: this.ts.trPK("general", "cancel"), + role: "cancel" + } + ] + }); + this.isActionSheetShown = true; + await this.actionSheet.present(); } - public openFile() { - const fileInput = this.getFileElement(); - fileInput.click(); + public takePictureiOS() { + const options: CameraOptions = { + quality: 60, + sourceType: this.cameraController.PictureSourceType.PHOTOLIBRARY, + destinationType: this.cameraController.DestinationType.DATA_URL, + encodingType: this.cameraController.EncodingType.JPEG, + mediaType: this.cameraController.MediaType.PICTURE, + correctOrientation: true, + } + this.cameraController.getPicture(options).then((imageData) => { + const data = "data:image/jpeg;base64," + imageData; + this.pushFiles(this.getFileName(), data); + }, (err) => { + }); } + public deleteFiles(index: number) { this.inputFiles.splice(index, 1); - this.fileSelected.emit( { + this.fileSelected.emit({ name: null, - data: '', + data: "", inputFiles: this.inputFiles }); + this.errorMsg = null; + } + public switchOptions($event) { + this.selectedOpn = $event; + } + public takePicture(sourceType: PictureSourceType) { + const options: CameraOptions = { + quality: 50, + destinationType: this.cameraController.DestinationType.DATA_URL, + encodingType: this.cameraController.EncodingType.JPEG, + sourceType: sourceType, + mediaType: this.cameraController.MediaType.PICTURE, + correctOrientation: true + }; + if (sourceType === this.cameraController.PictureSourceType.PHOTOLIBRARY) { + if (this.platform.is('android')) { + this.fileChooser + .open() + .then(uri => { + this.readFile(uri); + }) + .catch(e => { }); + } else { + this.iOSfilePicker.pickFile(['public.content']).then(uri => { + + let correctPath = uri.substr(0, uri.lastIndexOf('/') + 1); + let currentName = uri.substring(uri.lastIndexOf('/') + 1); + this.nativePath = uri; + + this.file.readAsDataURL("file:///" + correctPath, currentName).then(result => { + this.pushFiles(currentName, result); + }).catch(e => { }); + }).catch(e => { }); + } + } else { + this.cameraController.getPicture(options).then(imageData => { + const data = "data:image/jpeg;base64," + imageData; + this.pushFiles(this.getFileName(), data); + }); + } + } + pushFiles(name, files) { + this.ngzone.run(() => { + if (this.multiupload) { + this.inputFiles.push({ name: name, data: files }); + } else { + this.inputFiles = [{ name: name, data: files }]; + } + this.fileSelected.emit({ + name: name, + data: files, + inputFiles: this.inputFiles + }); + }); + } + readFile(fileUrl: any) { + this.filePath.resolveNativePath(fileUrl).then(filePathResult => { + this.nativePath = filePathResult; + this.file.resolveLocalFilesystemUrl(this.nativePath).then(entry => { + entry.getMetadata(metadata => { + if (metadata.size <= this.maxFileSize) { + this.errorMsg = null; + this.encodeFiles(entry); + } else { + this.errorMsg = this.ts.trPK("general", "large-file"); + } + }, (error) => { + console.log(error) + }); + }); + }); + } + getImgContent(imgFile): SafeUrl { + console.log(imgFile); + return this.sanitizer.bypassSecurityTrustUrl(imgFile); + } + + checkDuplicate(name: string) { + return this.inputFiles.filter(a => { + return a.name === name; + }); + } + encodeFiles(entry) { + let fileName = entry.nativeURL.split('/').pop(); + let path = entry.nativeURL.substring(0, entry.nativeURL.lastIndexOf("/") + 1); + + this.file.readAsDataURL(path, fileName) + .then(base64File => { + }) + .catch((err) => { + console.log('Error reading file', err); + }) + this.base64.encodeFile(this.nativePath).then( + (base64File: string) => { + const type = this.nativePath.substr( + this.nativePath.lastIndexOf(".") + 1 + ); + if (this.allowdType.includes(type.toLowerCase())) { + if (this.checkDuplicate(entry.name).length === 0) { + this.pushFiles(entry.name, base64File); + this.errorMsg = null; + } else { + this.errorMsg = this.ts.trPK("general", "file-name-exist"); + } + } else { + this.attachmentData = null; + this.errorMsg = this.ts.trPK("general", "not-supported"); + } + }, + err => { + console.log(err); + } + ); + } + getFileName() { + const date = new Date().valueOf(); + let text = ""; + const possibleText = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (let i = 0; i < 5; i++) { + text += possibleText.charAt( + Math.floor(Math.random() * possibleText.length) + ); + } + const imageName = date + "." + text + ".jpeg"; + return imageName; } } diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html index 7d62b3c5..40d6516a 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.html @@ -30,6 +30,22 @@ -->
+ +
+ +
+
+ + +
+ +
+
+ +
+ +
+
\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss index a8495839..60f1d786 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss @@ -23,4 +23,8 @@ } .header-toolbar-new { --background: #269DB8; +} +.setting-conatainer{ + height: 40px !important; + width: 40px !important; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts index 75dc2703..404710f4 100644 --- a/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts +++ b/Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.ts @@ -1,5 +1,11 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { WorklistSettingComponent } from 'src/app/notification/worklist-setting/worklist-setting.component'; import { CommonService } from '../../services/common/common.service'; +import { DashboredService } from '../../services/dashbored/dashbored.service'; +import { PerformanceAppraisalResponse } from '../../services/dashbored/performance-appraisal.response'; +import { SharedDataService } from '../../services/shared-data-service/shared-data.service'; +import { TranslatorService } from '../../services/translator/translator.service'; @Component({ selector: 'app-generic-header', @@ -16,10 +22,21 @@ export class GenericHeaderComponent implements OnInit { @Input() updateDirection = false; @Input() headerText = ''; @Input() backLink: string; + @Input() worklistSetting = false; + @Input() performanceEvaluation = false; + @Input() subordinateLeave = false; @Output() trigger = new EventEmitter(); + public appraisalArr: any = []; + public performanceData: any = []; + public close = 'assets/imgs/cancel.png'; - constructor(public common: CommonService) { } + constructor( + public common: CommonService, + public DS: DashboredService, + public sharedData: SharedDataService, + public ts: TranslatorService, + public modalController: ModalController) { } ngOnInit() { if (this.updateDirection) { @@ -35,4 +52,47 @@ export class GenericHeaderComponent implements OnInit { this.trigger.emit(); } + async openNotifictionSetting() { + // const modal = await this.modalController.create({ + // component: WorklistSettingComponent, + // cssClass: 'app-update-modal-css', + // }); + // return await modal.present(); + this.common.openWorklistSettingsPage(); + } + + + public openPerormance() { + this.showPerformanceAppraisal(); + } + + public showPerformanceAppraisal() { + this.DS.getPerformanceAppraisal(() => { + this.showPerformanceAppraisal(); + }).subscribe((result: PerformanceAppraisalResponse) => { + this.handlePerformanceAppraisalResult(result); + }); + } + + private handlePerformanceAppraisalResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetPerformanceAppraisalList)) { + this.appraisalArr = result.GetPerformanceAppraisalList; + this.performanceData = []; + for (let i = 0; i < this.appraisalArr.length; i++) { + this.performanceData.push({ name: this.appraisalArr[i].APPRAISAL_YEAR, value: parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed() }); + } + console.log('PerformanceAppraisalResponse'); + this.sharedData.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA); + this.common.openPerformanceevaluation(); + } else { + let msg: string = this.ts.trPK("userProfile", "no-appraisal"); + this.common.presentAlert(msg); + } + } + } + + public openSubordinateLeavePage() { + this.common.openSubordinateLeavePage(); + } } diff --git a/Mohem/src/app/hmg-common/ui/smsdialog/smsdialog.page.ts b/Mohem/src/app/hmg-common/ui/smsdialog/smsdialog.page.ts index 24cc3e4f..64e9872c 100644 --- a/Mohem/src/app/hmg-common/ui/smsdialog/smsdialog.page.ts +++ b/Mohem/src/app/hmg-common/ui/smsdialog/smsdialog.page.ts @@ -18,57 +18,56 @@ import { AlertController } from '@ionic/angular'; styleUrls: ['./smsdialog.page.scss'], }) export class SmsdialogPage implements OnInit { - public timeInSeconds : number ; - public time : number; - public runTimer : boolean; + public timeInSeconds: number; + public time: number; + public runTimer: boolean; public static SHARED_DATA = 'h2o-login-details'; - public hasStarted : boolean; + public hasStarted: boolean; public countryCode: CountryCode; - public hasFinished : boolean; - public remainingTime : number; - public displayTime : string = ""; + public hasFinished: boolean; + public remainingTime: number; + public displayTime: string = ""; // public userData: UserDetailsModel; - public mobile : string; - public country_code : string; - public id : string; - public MobileNumber : string; - public token : string; - public resend : boolean = false; - public smc_code : any; + public mobile: string; + public country_code: string; + public id: string; + public MobileNumber: string; + public token: string; + public resend: boolean = false; + public smc_code: any; constructor(public cs: CommonService, public ts: TranslatorService, public alertController: AlertController, public smsService: SmsReaderService, public sharedData: SharedDataService, - private modalCtrl:ModalController, + private modalCtrl: ModalController, // private navParams: NavParams, - public smsservice: SMSDialogService) { - // this.country_code = this.navParams.get("c_code"); - // this.MobileNumber = this.navParams.get('mobile'); - // this.mobile = this.navParams.get('mobile'); - // this.id = this.navParams.get('id'); - // this.smsservice.sendActivationCode(this.id, this.mobile, - // this.country_code, () => { }, - // this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => { - // if (this.cs.validResponse(result)) { - // if (result.isSMSSent) { - // this.token = result.LogInTokenID; - // this.initTimer(); - // this.startTimer(); - // } else { - // this.stopSMSMonitoring(); - // } - // } else { - // this.stopSMSMonitoring(); - // } - // }); - } + public smsservice: SMSDialogService) { + // this.country_code = this.navParams.get("c_code"); + // this.MobileNumber = this.navParams.get('mobile'); + // this.mobile = this.navParams.get('mobile'); + // this.id = this.navParams.get('id'); + // this.smsservice.sendActivationCode(this.id, this.mobile, + // this.country_code, () => { }, + // this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => { + // if (this.cs.validResponse(result)) { + // if (result.isSMSSent) { + // this.token = result.LogInTokenID; + // this.initTimer(); + // this.startTimer(); + // } else { + // this.stopSMSMonitoring(); + // } + // } else { + // this.stopSMSMonitoring(); + // } + // }); + } ngOnInit() { } - closeModal() - { + closeModal() { this.modalCtrl.dismiss(); } @@ -77,8 +76,8 @@ export class SmsdialogPage implements OnInit { } initTimer() { - if (!this.timeInSeconds) { - this.timeInSeconds = 60; + if (!this.timeInSeconds) { + this.timeInSeconds = 60; } this.time = this.timeInSeconds; this.runTimer = false; @@ -87,22 +86,22 @@ export class SmsdialogPage implements OnInit { this.remainingTime = this.timeInSeconds; this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); } - + startTimer() { this.runTimer = true; this.hasStarted = true; this.resend = false; this.timerTick(); } - + pauseTimer() { this.runTimer = false; } - + resumeTimer() { this.startTimer(); } - + timerTick() { setTimeout(() => { if (!this.runTimer) { return; } @@ -117,7 +116,7 @@ export class SmsdialogPage implements OnInit { } }, 1000); } - + getSecondsAsDigitalClock(inputSeconds: number) { var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param var hours = Math.floor(sec_num / 3600); @@ -132,13 +131,12 @@ export class SmsdialogPage implements OnInit { return minutesString + ':' + secondsString; } - validate() - { + validate() { this.checkSMSActivationCode(this.smc_code); } public presentSMSPasswordDialog() { - + } async presentAlert() { @@ -153,21 +151,20 @@ export class SmsdialogPage implements OnInit { private checkSMSActivationCode(smsCode: string) { this.smsservice.validateActivationCode(this.token, smsCode, - () => {}, this.ts.trPK('settings', 'incorrect_otp')).subscribe((result: Response) => { - if (this.cs.validResponse(result)) { - this.stopSMSMonitoring(); - this.modalCtrl.dismiss(); - SMSDialogService.modal_success = true; - } - }); + () => { }, this.ts.trPK('settings', 'incorrect_otp')).subscribe((result: Response) => { + if (this.cs.validResponse(result)) { + //this.stopSMSMonitoring(); + this.modalCtrl.dismiss(); + SMSDialogService.modal_success = true; + } + }); } public stopSMSMonitoring() { - this.smsService.stopSMSMonitoring(); + this.smsService.stopSMSMonitoring(); } - public ResendOTP() - { + public ResendOTP() { // this.smsservice.sendActivationCode(this.id, this.mobile, // this.country_code, () => { }, // this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => { diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss index 0663997a..6895ceb4 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss @@ -53,3 +53,13 @@ width: 100px; height: 70px; } + +.loader { + position: absolute; + width: 100%; + top: 70px; + left: 2px; + img { + width: 25px; + } +} diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index b323351c..f189e43a 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -10,6 +10,9 @@ +
+ +
{{'general,other-services' | translate}} - + diff --git a/Mohem/src/app/home/home.page.scss b/Mohem/src/app/home/home.page.scss index ba5d461a..f74783fe 100644 --- a/Mohem/src/app/home/home.page.scss +++ b/Mohem/src/app/home/home.page.scss @@ -156,3 +156,14 @@ ion-label{ // text-transform: uppercase; // } // } + + +.loader { + position: absolute; + width: 100%; + top: 70px; + left: 2px; + img { + width: 25px; + } +} \ No newline at end of file diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 0a882f0f..98b422d6 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -11,6 +11,7 @@ import { Geolocation } from '@ionic-native/geolocation/ngx'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { Device } from '@ionic-native/device/ngx'; import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request'; +import { COCRequest } from 'src/app/notification/models/COCRequest'; import { Response } from 'src/app/hmg-common/services/models/response'; import { AttendanceService } from './services/attendance.services'; import { LoginRequest } from '../hmg-common/services/authentication/models/login.request'; @@ -41,7 +42,9 @@ import { NFC, Ndef } from "@ionic-native/nfc/ngx" import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component'; import { FirebaseX } from '@ionic-native/firebase-x/ngx'; import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component"; - +import * as moment from "moment"; +import { count } from 'console'; +import { HomeComponent } from "src/app/notification/home/home.component"; @Component({ selector: 'app-home', templateUrl: './home.page.html', @@ -68,6 +71,7 @@ export class HomePage implements OnInit { public showVcationRule = false; public isFakeLocationUsed = false; public intervalCountdown: any; + public showLoader = true; public statsButtons = [ { title: this.ts.trPK('attendance-tracking', 'title'), @@ -192,11 +196,11 @@ export class HomePage implements OnInit { spaceBetween: 10 }; this.slideOptsTwo = { - slidesPerView: width > 320 ? 3.2 : 2.5, - spaceBetween: width > 320 ? 10 : 5 + slidesPerView: width > 320 ? 3.2 : 2.5, + spaceBetween: width > 320 ? 10 : 5 }; this.showStaticServices = true; -} + } ionViewWillEnter() { this.common.startLoading(); this.slideSettingsTwo(); @@ -369,10 +373,18 @@ export class HomePage implements OnInit { callDashboardServices() { this.getMenu(); this.setServicesPrivilage(); - this.openNotificationsDashbored(); + if (this.common.getTotalNumberOfWorklistRequest()) { + this.statsButtons[1].statsValue = this.common.getTotalNumberOfWorklistRequest(); + this.showLoader = false; + } else { + this.openNotificationsDashbored(); + } + this.showOpenMissingSwipes(); this.showAttendanceTracking(); - this.getAccrualBalance(); + var accrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false); + if (!accrualBalance) + this.getAccrualBalance(); } public Vacation_Rule() { @@ -408,6 +420,7 @@ export class HomePage implements OnInit { selMenu.List_Menu = item; selMenu.userid = this.userData.EMPLOYEE_NUMBER; this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); + this.common.sharedService.setSharedData(this.menuList, MenuResponse.MENU_LIST); this.getMenuEntries(item); // tslint:disable-next-line: prefer-for-of for (let i = 0; i < this.menuList.length; i++) { @@ -657,14 +670,64 @@ export class HomePage implements OnInit { result, 'worklistNotifications' ); + this.common.setFilterValues(result['GetOpenNotificationsList']); + } else { + this.showLoader = false; + this.common.stopLoading(); } + }, (error) => { + this.showLoader = false; + this.common.stopLoading(); }); } ITGCountAllNotification() { this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => { - this.statsButtons[1].statsValue = - Math.floor(this.countAllNotification + result.TotalCount); + if (this.common.validResponse(result)) { + this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS); + this.common.filterKeys['ITG'] = result.TotalCount; + this.statsButtons[1].statsValue = Math.floor(this.countAllNotification + result.TotalCount); + this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count'); + this.getCOCNotificationCount(); + this.common.stopLoading(); + } else { + this.showLoader = false; + this.common.stopLoading(); + } + }, (error) => { + this.showLoader = false; + this.common.stopLoading(); + }); + } + + getCOCNotificationCount() { + const request = new COCRequest(); + request.ItgPageSize = 1; + request.ItgPageNo = 1; + request.Date = moment(new Date()).format("YYYY-MM-DD"); + + this.workListService.getCOCCount(request, '', '', this.isPostNoLoad).subscribe((result: any) => { + console.log(result); + if (this.common.validResponse(result)) { + const countResult = result.Mohemm_ITG_Pending_Task_ResponseItem; + const totalCount = countResult.escalation + countResult.waitingToClose + countResult.waitingForAcceptance + countResult.extendTATRequest; + this.common.filterKeys['COC'] = totalCount; + + + this.statsButtons[1].statsValue = Math.floor(this.statsButtons[1].statsValue + totalCount); + + this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count'); + + this.showLoader = false; + this.common.stopLoading(); + } else { + this.showLoader = false; + this.common.stopLoading(); + } + + + }, (error) => { + this.showLoader = false; this.common.stopLoading(); }); } @@ -749,7 +812,7 @@ export class HomePage implements OnInit { totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; } } - this.statsButtons[4].statsValue = Number(totalTicketsLeft.toFixed(2)); + this.statsButtons[4].statsValue = Number(totalTicketsLeft.toFixed(2)); } }); } @@ -769,7 +832,8 @@ export class HomePage implements OnInit { // this.getDeviceLocation(); this.showAttendanceOptions(); // tslint:disable-next-line: triple-equals - } else if (link == '1') { + } else if (link == '1' && this.showLoader === false) { + this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count'); this.common.startLoading(); this.common.openNotificationPage(); // tslint:disable-next-line: triple-equals @@ -795,14 +859,14 @@ export class HomePage implements OnInit { async openBusinessCard() { const modal = await this.modalController.create({ component: BusinessCardComponent, - cssClass: 'digital-id-modal-css' + cssClass: 'business-card-modal-css' }); return await modal.present(); } itemForSale() { - this.common.navigateForward('/itemforsale/items'); + this.common.openItemForSale(); } offersDiscount() { this.common.navigateForward('/offersdiscount/home'); diff --git a/Mohem/src/app/home/wifi-model/wifi-modal.component.ts b/Mohem/src/app/home/wifi-model/wifi-modal.component.ts index cd90f7ce..a7b722b4 100644 --- a/Mohem/src/app/home/wifi-model/wifi-modal.component.ts +++ b/Mohem/src/app/home/wifi-model/wifi-modal.component.ts @@ -55,6 +55,13 @@ export class WifiModalComponent implements OnInit { }, 1000); } + + + async getConnectedBSSID(ssid:string){ + let avaialbleSSID = await this.wifiWizard2.getConnectedBSSID(); + console.log(avaialbleSSID); + } + async startWifiConnection() { const isAndroid = this.platform.is("android"); const isIOS = this.platform.is("ios"); diff --git a/Mohem/src/app/itemforsale/filter/filter.component.html b/Mohem/src/app/itemforsale/filter/filter.component.html new file mode 100644 index 00000000..0e0d674c --- /dev/null +++ b/Mohem/src/app/itemforsale/filter/filter.component.html @@ -0,0 +1,31 @@ + + + +
+ + + + {{key.title}} + + + {{key.title_Ar}} + + +
+
+
+
+ + +
+ + {{ts.trPK('general','apply-filters')}} + +
+
+
\ No newline at end of file diff --git a/Mohem/src/app/itemforsale/filter/filter.component.scss b/Mohem/src/app/itemforsale/filter/filter.component.scss new file mode 100644 index 00000000..2375e2ef --- /dev/null +++ b/Mohem/src/app/itemforsale/filter/filter.component.scss @@ -0,0 +1,38 @@ +ion-label{ + font-size: 14px !important; +} +ion-thumbnail img{ + width: 40px; + height: 40px; + margin: 10px; +} +.active::before{ + position: absolute; + right: 10px; + top: 15px; + padding: 0px; + background: #3cc353; + padding: 3px 2px 1px 3px; + border-radius: 60%; + font-size: 12px; + color: #fff; + content: '✓'; + width: 20px; + height: 20px; + text-align: center; + z-index: 2; +} +ion-item{ + border-bottom: 1px solid #ccc; + --padding-start: 0px; + margin: 0 20px 4px 20px; +} + +.footer-button{ + background: var(--newgreen)!important;border-radius: 10px; --background: transparent; + width: 80%; +} +ion-footer{ + position: fixed; + bottom: 0; +} \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/filter/filter.component.spec.ts b/Mohem/src/app/itemforsale/filter/filter.component.spec.ts new file mode 100644 index 00000000..ff6002ba --- /dev/null +++ b/Mohem/src/app/itemforsale/filter/filter.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FilterComponent } from './filter.component'; + +describe('FilterComponent', () => { + let component: FilterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FilterComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FilterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/itemforsale/filter/filter.component.ts b/Mohem/src/app/itemforsale/filter/filter.component.ts new file mode 100644 index 00000000..ddfdc0ce --- /dev/null +++ b/Mohem/src/app/itemforsale/filter/filter.component.ts @@ -0,0 +1,56 @@ +import { AfterViewInit, Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ModalController } from '@ionic/angular'; +import { OfferDiscountService } from 'src/app/offersdiscount/services/service'; +import { ItemForSaleService } from '../services/service.service'; +@Component({ + selector: 'app-filter', + templateUrl: './filter.component.html', + styleUrls: ['./filter.component.scss'], +}) +export class FilterComponent implements AfterViewInit { + + segment: any = '1'; + categoriesObj: any; + categories: any = []; + offersData: any = []; + activeClass: any; + tempSearch: any = []; + searchText: String; + public activeKey = {} + direction: any; + + constructor(public ts: TranslatorService, public modalController: ModalController, public cs: CommonService, public offersService: OfferDiscountService) { } + + ngAfterViewInit(): void { + this.direction = TranslatorService.getCurrentDirection(); + this.categories = this.cs.sharedService.getSharedData(OfferDiscountService.categories, false); + + + // this.getOfferDiscount(); + } + + + openDetails(offer) { + // this.cs.sharedService.setSharedData(offer, OfferDiscountService.selected_offers); + + // var related = this.offersData.filter((res) => res.rowID != offer.rowID); + // this.cs.sharedService.setSharedData(related, OfferDiscountService.related_offers); + + // this.cs.navigateForward('/offersdiscount/offer-details'); + } + + + filterOffers(key) { + this.activeKey = key + this.activeClass = key.title; + + } + + + applyFilters() { + this.cs.sharedService.setSharedData(this.activeKey, ItemForSaleService.selected_filters); + this.cs.back(); + } +} diff --git a/Mohem/src/app/itemforsale/home/home.component.html b/Mohem/src/app/itemforsale/home/home.component.html index 4086bfe6..0c53582e 100644 --- a/Mohem/src/app/itemforsale/home/home.component.html +++ b/Mohem/src/app/itemforsale/home/home.component.html @@ -22,7 +22,7 @@
{{ts.trPK('itemforsale','select-category')}}
{{ts.trPK('itemforsale','completed')}}
-
+
@@ -34,7 +34,7 @@
{{ts.trPK('itemforsale','add-details')}}
-
{{step >2 ? "Completed" : "Locked"}}
+
{{step >2 ? ts.trPK('itemforsale','completed') :ts.trPK('itemforsale','locked')}}
@@ -42,9 +42,9 @@
{{ts.trPK('itemforsale','review-sell')}}
-
{{step >3 ? "Completed" : "Locked"}}
+
{{step >3 ? ts.trPK('itemforsale','completed') : ts.trPK('itemforsale','locked')}}
- + @@ -53,85 +53,34 @@
-

What are you offering?

+

{{ts.trPK('itemforsale','offering')}}

- -
+ +
- +
-

Mobile & Tablets

+

{{category.title}}

+

{{category.title_Ar}}

- - -
-
- -
-
-

Cars & Vehicles

-
-
-
- -
-
- -
-
-

Electronic Applicance

-
-
+ - - - -
-
- -
-
-

Furniture & Home Decor

-
-
-
- -
-
- -
-
-

Fashion & beauty

-
-
-
- -
-
- -
-
-

Books, Sports & Hobbies

-
-
-
-
- +
-

Add Details

+

{{ts.trPK('itemforsale','add-details')}}

-

Item Info

+

{{ts.trPK('itemforsale','item-info')}}

- +
@@ -142,77 +91,63 @@ - + -

Item Condition

- - - - +

{{ts.trPK('itemforsale','item-condition')}}

+ - New + {{ts.trPK('itemforsale','new')}} - Used + {{ts.trPK('itemforsale','used')}}
- + + +

{{ts.trPK('itemforsale','region')}}

+ + {{region.regionName}} + + +
+
-

Item Price

+

{{ts.trPK('itemforsale','item-price')}}

- +
-

Item Photos

+

{{ts.trPK('itemforsale','item-photos')}}

- - -
-
-
X
- -
- -
-
- -
-
-
X
- +
+
+ + + +
- -
- - -
-
- - -
- +
-
- - - - +
@@ -222,25 +157,48 @@
-

Furniture Table

+

+ {{selectedCategory.title_Ar}} +

+

+ {{selectedCategory.title}} +

+ - +

{{itemInfo}}

- Consectetur adipiscing elit. Donec blandit diam nulla, non euismod eros efficitur imperdiet. Fusce erat enim, volutpat at enim in, venenatis iaculis risus. + {{itemDescription}}

-

Used

+

{{itemCondition}}

- - + + + + + + +
+
+ + +
+ +
+
+ +
+
+
+
- Selling for

500 SAR

+ {{ts.trPK('itemforsale','selling-for')}}

{{itemPrice}} SAR

- +
@@ -250,8 +208,8 @@
- - cancel + + {{ts.trPK('general','cancel')}}
@@ -260,13 +218,16 @@
- - cancel - + + {{ts.trPK('general','cancel')}} + {{ts.trPK('general','next')}} - - Confirm + + {{ts.trPK('general','confirm')}} + + {{ts.trPK('general','update')}} +
diff --git a/Mohem/src/app/itemforsale/home/home.component.scss b/Mohem/src/app/itemforsale/home/home.component.scss index da69d29b..ff52efa4 100644 --- a/Mohem/src/app/itemforsale/home/home.component.scss +++ b/Mohem/src/app/itemforsale/home/home.component.scss @@ -117,6 +117,10 @@ margin-left:0px margin-right: 0px; left: 40%; } +.md-stepper-horizontal .md-step .md-step-bar-right { + margin-right: 0px; + right: 40%; +} .orange .md-step-bar-left { background:#CC9B14 !important; font-weight: bold; @@ -214,7 +218,7 @@ margin-bottom: 70px; background: #fff; margin: 15px; padding: 10px; - box-shadow: 3px 4px 3px -1px #ccc; + box-shadow: 0px 0px 2px 1px #ccc; border-radius: 20px; } .add-details ion-item{ @@ -246,7 +250,7 @@ position: relative; right: 0; font-size: 14px; color: #fff; - top: -15px; + top: -10px; right: -10px; font-weight: bolder; background: red; @@ -341,3 +345,57 @@ ion-footer{ position: absolute; top: 15px; } +.upload-container{ + display: inline-block; +} +@media screen and (min-width: 325px){ + .fileUpload { + position: relative; + overflow: hidden; + margin: 10px; + + }} + @media screen and (min-width: 1px) and (max-width:320px){ + .fileUpload { + position: relative; + overflow: hidden; + margin: 10px; + + + }} + + .fileUpload input.upload { + position: absolute; + top: 0; + right: 0; + margin: 0; + padding: 0; + font-size: 20px; + cursor: pointer; + opacity: 0; + filter: alpha(opacity=0); + } + + .iconButton .imgSize{ + width: 10px !important; + height: 10px; + } +.close-btn{ + color: red; + font-size: 22px; + position: relative; + top: 5px; +} +ion-radio{ + border: 1px solid; + border-radius: 5px; + color: gray; + height: 20px; + width: 21px; + margin-top: 5px; + +} +.sale-icon .top-icon{ + position: relative; + margin: 5px 8px; +} \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/home/home.component.ts b/Mohem/src/app/itemforsale/home/home.component.ts index ace51a36..bdff62ff 100644 --- a/Mohem/src/app/itemforsale/home/home.component.ts +++ b/Mohem/src/app/itemforsale/home/home.component.ts @@ -1,6 +1,10 @@ import { Component, OnInit } from '@angular/core'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { FileUploader } from 'ng2-file-upload'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ItemForSaleService } from '../services/service.service'; @Component({ selector: 'app-home', @@ -9,19 +13,303 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl }) export class HomeComponent implements OnInit { step: any = 1; - constructor(public ts: TranslatorService, public cs: CommonService,) { } + categories: any = []; + direction: string; + uploaded: any = []; + public selectedFile: any; + indexLastObj: any = 0; + addAttachRequest: any = []; + selectedPicture = []; + selectedCategory: any; + filterAllowedType: any = [ + "image/jpeg", + "image/png", + "image/jpg", + ]; + itemInfo: string; + itemDescription: string; + itemCondition: string; + itemPrice: any; + regions: any = []; + regionID: any = 1; + editItem: any; + constructor(public ts: TranslatorService, private authService: AuthenticationService, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService) { } - ngOnInit() { } + ngOnInit() { + this.direction = TranslatorService.getCurrentDirection(); + this.categories = this.cs.sharedService.getSharedData(ItemForSaleService.CATEGORIES, false); + this.categories.shift(); + this.getRegion(); + this.editItem = this.cs.sharedService.getSharedData(ItemForSaleService.EDIT_ITEMS); + if (this.editItem) { + this.setEditPage(); + } + } + getRegion() { + this.itemService.getRegion({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.regions = this.itemService.parser(result); + console.log(this.regions); + }) + } openItem() { - - this.cs.navigateForward('/itemforsale/items'); } - nextStep() { + nextStep(category) { + this.selectedCategory = category; this.step = 2; } openMyAds() { this.cs.navigateForward('/itemforsale/my-ads'); } + onFileSelectedclick(event) { + event.target.value = ''; + } + public uploader: FileUploader = new FileUploader({ + allowedMimeType: [ + "image/jpeg", + "image/png", + "image/jpg", + ], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async item => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + + + // onFileSelected(input) { + // if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + // let msg: string = ""; + // msg = this.ts.trPK("general", "notSupportFile"); + // this.cs.presentAlert(msg); + // return; + // } // todo: show alert that you tried uploading wrong files + // else { + // const file = input.target.files[0]; + // this.selectedFile = input.target.files; + + + // this.getBase64(file).then(data => + // this.pushObject(data, file.name, file.type) + // ); + // } + // } + + // getBase64(file) { + // return new Promise((resolve, reject) => { + // const reader = new FileReader(); + // reader.readAsDataURL(file); + // reader.onload = () => resolve(reader.result); + // reader.onerror = error => reject(error); + // }); + // } + + // pushObject(fileData, name, type) { + + // this.indexLastObj++; + // try { + // let array = name.split("."); + // let attachType: string = array[array.length - 1]; + + // this.addAttachRequest.push({ + // AttachmentID: this.indexLastObj, + // ContentType: 'image/' + attachType, //type.split('/')[1], + // Base64Data: fileData.split(",")[1], + // FileName: name, //.split('.')[0], + + // }); + // } catch (e) { } + // } + + removeFile(objectitem) { + + let objIndex = this.addAttachRequest.findIndex( + item => item.AttachmentID == objectitem.AttachmentID + ); + this.addAttachRequest.splice(objIndex, 1); + } + getImgContent(imgFile): SafeUrl { + + return this.sanitizer.bypassSecurityTrustUrl(imgFile); + } + + createItemForSale() { + + var authUser = this.authService.getAuthenticatedRequest(); + this.cs.startLoading(); + // var request = new FormData(); + // request.append('title', this.itemInfo); + // request.append('title_Ar', this.itemInfo); + // request.append('categoryID', this.selectedCategory.categoryID); + // request.append('description', this.itemDescription); + // request.append('description_Ar', this.itemDescription); + // request.append('employeeNumber', authUser.P_USER_NAME); + // request.append('quotePrice', this.itemPrice); + // request.append('isActive', 'true'); + // request.append('regionID', this.regionID); + // request.append('status', this.itemCondition); + // console.log(this.selectedFile); + // if (this.selectedFile && this.selectedFile !== undefined) { + // request.append('fileColl', this.addAttachRequest.toString()); + // } + // request.append('Channel', authUser.Channel.toString()); + // request.append('LogInToken', authUser.LogInTokenID); + // request.append('Token', authUser.TokenID); + // request.append('EmployeeNumber', authUser.P_USER_NAME); + // request.append('MobileNo', authUser.MobileNumber); + var request = { + "TokenID": authUser.LogInTokenID, "EmployeeNumber": authUser.P_USER_NAME, "ItgImageCollList": this.addAttachRequest, + "ItgTitle": this.itemInfo, + "ItgTitleAr": this.itemInfo, + "ItgCategoryID": this.selectedCategory.categoryID, + "ItgDescription": this.itemDescription, + "ItgDescriptionAr": this.itemDescription, + "ItgQuotePrice": this.itemPrice, + "RegionID": this.regionID, + "ItgIsActive": true, + "ItgStatus": this.itemCondition + } + + this.itemService.createItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + if (this.cs.validResponse(result)) { + this.cs.stopLoading(); + + this.cs.greenToastPK("general", "success-create"); + this.openItem(); + } else { + this.cs.stopLoading(); + this.cs.redToastPK("general", "try-again"); + } + + + }) + } + setEditPage() { + this.step = 2; + this.selectedCategory = { + categoryID: this.editItem.categoryID, + title: this.editItem.categoryTitle, + title_Ar: this.editItem.categoryTitle + } + this.itemInfo = this.editItem.title; + this.itemDescription = this.editItem.description; + this.itemPrice = this.editItem.quotePrice; + this.regionID = this.editItem.regionID; + this.itemCondition = this.editItem.status.toLowerCase(); + this.selectedPicture = this.getAttachment(this.editItem.itemAttachments); + } + getAttachment(itemsArray) { + let item = []; + itemsArray.forEach(element => { + + item.push({ + // attachmentId: element.attachmentId, + // ContentType: element.contentType, + data: 'data:image/png;base64,' + element.content, + name: element.fileName, + + }); + }); + return item; + } + updateItemForSale() { + + var authUser = this.authService.getAuthenticatedRequest(); + this.cs.startLoading(); + var request = new FormData(); + request.append('itemSaleID', this.editItem.itemSaleID); + request.append('title', this.itemInfo); + request.append('title_Ar', this.itemInfo); + request.append('categoryID', this.selectedCategory.categoryID); + request.append('description', this.itemDescription); + request.append('description_Ar', this.itemDescription); + request.append('employeeNumber', authUser.P_USER_NAME); + request.append('quotePrice', this.itemPrice); + request.append('isActive', 'true'); + request.append('regionID', this.regionID); + request.append('status', this.itemCondition); + // console.log(this.selectedFile); + // if (this.selectedFile && this.selectedFile !== undefined) { + // request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name); + // } + request.append('Channel', authUser.Channel.toString()); + request.append('LogInToken', authUser.LogInTokenID); + request.append('Token', authUser.TokenID); + request.append('EmployeeNumber', authUser.P_USER_NAME); + request.append('MobileNo', authUser.MobileNumber); + + + this.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + if (this.cs.validResponse(result)) { + this.cs.stopLoading(); + + this.cs.greenToastPK("general", "success-create"); + this.openItem(); + } else { + this.cs.stopLoading(); + this.cs.redToastPK("general", "try-again"); + } + + + }) + } + cancelItem() { + if (this.step == 2 || this.step == 3) { + this.step = 1; + } else { + this.cs.back(); + } + + } + validate() { + if (!this.validateChar(this.itemInfo) || !this.itemDescription || !this.itemPrice || !this.itemCondition || this.addAttachRequest.length == 0) { + return false; + } else { + return true; + } + } + validateChar(text) { + var regExp = /^[a-zA-Z]*$/ + if ((!regExp.test(text) && !this.hasArabicCharacters(text)) || !text) { + return false; + } + else { + return true; + } + } + hasArabicCharacters(text) { + var regex = new RegExp("[\u0600-\u06ff]|[\u0750-\u077f]|[\ufb50-\ufc3f]|[\ufe70-\ufefc]"); + return regex.test(text); + } + public attachmentSelected(event: any) { + try { + this.addAttachRequest = event.inputFiles.map((res: any) => { + let array = res.name.split("."); + let attachType: string = array[array.length - 1]; + this.indexLastObj++; + return { AttachmentID: this.indexLastObj, FileName: res.name, Base64Data: res.data.split(",")[1], ContentType: 'image/' + attachType }; + }); + + + + + + + + + + + } catch (e) { } + } } diff --git a/Mohem/src/app/itemforsale/item-details/item-details.component.html b/Mohem/src/app/itemforsale/item-details/item-details.component.html index add7aca6..279a4fc8 100644 --- a/Mohem/src/app/itemforsale/item-details/item-details.component.html +++ b/Mohem/src/app/itemforsale/item-details/item-details.component.html @@ -1,4 +1,4 @@ - +
-
+
- - - - Furniture Table + + + + + + + + {{itemDetails.title}} + {{itemDetails.title_Ar}} - Keep close to Nature's heart... and break clear away, once in awhile, - and climb a mountain or spend a week in the woods. Wash your spirit clean. + {{itemDetails.description}} + {{itemDetails.description_Ar}}
-

New

-

500 SAR

+

{{itemDetails.status}}

+

+ {{itemDetails.quotePrice}} {{itemDetails.currencyCode}} +

@@ -33,9 +41,9 @@ -

Mohammed Imran

-

Posted on 22 April 2020

-

View Profile

+

{{itemDetails.fullName}}

+

{{getDate(itemDetails.created) }}

+
@@ -50,14 +58,15 @@ \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/item-details/item-details.component.scss b/Mohem/src/app/itemforsale/item-details/item-details.component.scss index bcd3e47a..6bcb6c6e 100644 --- a/Mohem/src/app/itemforsale/item-details/item-details.component.scss +++ b/Mohem/src/app/itemforsale/item-details/item-details.component.scss @@ -76,4 +76,9 @@ ion-footer{ margin: 0px; position: relative; left: -10px; +} +.icon-footer-ar{ + margin: 0px; + position: relative; + left: 5px; } \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/item-details/item-details.component.ts b/Mohem/src/app/itemforsale/item-details/item-details.component.ts index cae7ea97..c5257bfb 100644 --- a/Mohem/src/app/itemforsale/item-details/item-details.component.ts +++ b/Mohem/src/app/itemforsale/item-details/item-details.component.ts @@ -1,15 +1,41 @@ import { Component, OnInit } from '@angular/core'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; - +import { ItemForSaleService } from '../services/service.service'; +import * as moment from 'moment'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-item-details', templateUrl: './item-details.component.html', styleUrls: ['./item-details.component.scss'], }) export class ItemDetailsComponent implements OnInit { - constructor(public ts: TranslatorService, public cs: CommonService,) { } + itemDetails: any; + direction: any; + + constructor(public ts: TranslatorService, public itemService: ItemForSaleService, public route: ActivatedRoute, public cs: CommonService, private sanitizer: DomSanitizer,) { + this.route + .params.subscribe(val => { + setTimeout(() => { + this.ionEnter(); + }, 100); + }); + } + + ngOnInit() { + + } + ionEnter() { + this.direction = TranslatorService.getCurrentDirection(); + this.itemDetails = this.cs.sharedService.getSharedData(ItemForSaleService.ITEMS_SELECTED, false); - ngOnInit() { } + } + getDate(date) { + return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY"); + } + getImgContent(imgFile): SafeUrl { + return this.sanitizer.bypassSecurityTrustUrl(imgFile); + } } diff --git a/Mohem/src/app/itemforsale/itemforsale.module.ts b/Mohem/src/app/itemforsale/itemforsale.module.ts index 6a7aea24..7a868eb0 100644 --- a/Mohem/src/app/itemforsale/itemforsale.module.ts +++ b/Mohem/src/app/itemforsale/itemforsale.module.ts @@ -11,6 +11,8 @@ import { ItemsComponent } from './items/items.component'; import { ItemDetailsComponent } from './item-details/item-details.component'; import { MyAdsComponent } from './my-ads/my-ads.component'; import { HmgCommonModule } from '../hmg-common/hmg-common.module'; +import { ItemForSaleService } from './services/service.service'; +import { FilterComponent } from './filter/filter.component'; const routes: Routes = [ { @@ -32,6 +34,10 @@ const routes: Routes = [ { path: 'my-ads', component: MyAdsComponent + }, + { + path: 'filter', + component: FilterComponent } ], } @@ -45,6 +51,8 @@ const routes: Routes = [ HmgCommonModule, RouterModule.forChild(routes) ], - declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent] + declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent, FilterComponent], + providers: [ItemForSaleService], + }) export class ItemforsalePageModule { } diff --git a/Mohem/src/app/itemforsale/items/items.component.html b/Mohem/src/app/itemforsale/items/items.component.html index bab28e0c..e17dacd4 100644 --- a/Mohem/src/app/itemforsale/items/items.component.html +++ b/Mohem/src/app/itemforsale/items/items.component.html @@ -28,7 +28,7 @@ - + @@ -37,73 +37,49 @@

{{ts.trPK('itemforsale','browse-categories')}}

- +
-
-
-
- -
-
-

Mobile & Tablets

-
-
-
-
-
-
- -
-
-

Cars & Vehicle

-
-
-
-
-
-
- -
-
-

Electronic Appliance

-
-
-
-
-
-
- +
+
+
+
-

Fashion & Beauty

+

{{category.title}}

+

{{category.title_Ar}}

+
- - - +
+ +
+ + + - - - Furniture Table + + + {{item.title}} + {{item.title_Ar}} + - Keep close to Nature's heart... and break -

- Used -

+
{{getDotted(item.description, 60)}}
+
{{getDotted(item.description_Ar, 60)}}
+

{{item.status}}

- 500 SAR + {{item.quotePrice}} {{item.currencyCode}} @@ -114,62 +90,55 @@
- - - - + +
+ + + - Furniture Table - - - - Keep close to Nature's heart... and break -

- New -

- - - - 500 SAR - - - - - - - -
- - +
+

{{ts.trPK('general','empty')}}

+
+ + + +
- + - + + -

Furniture Table

-

- Posted on 24 April 2021 -

-

good condition only 6th month used

+

{{item.title}}

+

{{item.title_Ar}}

+ +

{{getDate(item.created) }}

+ +

{{getDotted(item.description, 30)}}

+

{{getDotted(item.description_Ar, 30)}}

-

Pending Review

+

{{item.status}}

+
- - + +
+
diff --git a/Mohem/src/app/itemforsale/items/items.component.scss b/Mohem/src/app/itemforsale/items/items.component.scss index bcba7e10..f8c6c061 100644 --- a/Mohem/src/app/itemforsale/items/items.component.scss +++ b/Mohem/src/app/itemforsale/items/items.component.scss @@ -7,9 +7,20 @@ background: #259CB8; top: 0; } +.no-dataDiv{ + position: absolute; + left: 0; + right: 0; + margin: auto; +} .header-toolbar{ --background: #259CB8 !important; } +.top{ + position: relative; + margin: 5px 10px; + +} .bottom{ height: 100%; width: 100%; @@ -51,7 +62,10 @@ margin-top: 5px; margin-bottom: 5px; margin-left: 5px; - font-size: 14px; + font-size: 12px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } .bottom-icon{ text-overflow: clip; @@ -69,7 +83,8 @@ ion-card-title{ font-weight: bold; font-size: 14px; - padding: 5px + padding: 5px; + height: 40px; } .orange{ color: #CC9B14; @@ -88,9 +103,9 @@ ion-card-content p{ font-weight: bold; } .my-ads ion-item{ - margin: 10px; + margin:0px 10px; --border-radius: 10px; - padding: 15px 10px 0px 10px; + padding: 10px 10px 0px 10px; width: 100%; } .my-ads ion-thumbnail img{ @@ -112,9 +127,10 @@ ion-segment-button{ } ion-segment-button ion-label{ padding: 0; - font-size: 16px; + font-size: 14px; white-space: normal; font-weight: bold; + line-height: 1.1; } .segment-button-checked ion-label{ color: #fff !important; @@ -132,6 +148,7 @@ ion-item h3{ color: #000; font-weight: bold; font-size: 14px; + margin-top:10px; } .yellow{ color:#CC9B14; @@ -145,6 +162,10 @@ ion-item .icon{ position: absolute; right: 0px; } +.edit-ar{ + position: absolute; + left: 0px; +} .fab-button{ position: fixed; bottom: 5%; @@ -155,7 +176,7 @@ ion-item .icon{ --background: #259CB8; } ion-footer{ - position: absolute; + position: fixed; bottom: 0; } ion-footer .footer-button{ @@ -219,4 +240,42 @@ ion-fab-button{ } .grid-row{ margin:10px; +} + +.active .top::before{ + position: absolute; + right: 0px; + top: 2px; + padding: 0px; + background: #3cc353; + padding: 2px 3px 4px 3px; + border-radius: 60%; + font-size: 10px; + color: #fff; + content: '✓'; + width: 12px; + height: 12px; + text-align: center; +} +.space{ + height:100px; +} +.loader{ + display: block; + position: absolute; + margin: auto; + text-align: center; + width: 100%; +} +.loader img{ + display: inline-block; + margin: auto; + width: 25px; + +} +.description-cont{ + min-height: 60px; + height: 65px; + overflow: hidden; + font-size: 14px; } \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/items/items.component.ts b/Mohem/src/app/itemforsale/items/items.component.ts index 73fc2398..a98e1105 100644 --- a/Mohem/src/app/itemforsale/items/items.component.ts +++ b/Mohem/src/app/itemforsale/items/items.component.ts @@ -1,6 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ItemForSaleService } from '../services/service.service'; +import { deepCopy } from '@angular-devkit/core/src/utils/object'; +import * as moment from 'moment'; +import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; @Component({ selector: 'app-items', @@ -9,17 +15,157 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl }) export class ItemsComponent implements OnInit { segment: any = '1'; - constructor(public ts: TranslatorService, public cs: CommonService,) { } + items: any; + categories: any = []; + direction: string; + activeClass: any; + pageNo: number = 1; + tempSearch: any = []; + itemsByEmployee: any = []; + allCategory = { + categoryID: 0, + content: '', + isActive: true, + title: "All", + title_Ar: "الجميع", + } + constructor(public ts: TranslatorService, public route: ActivatedRoute, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService, private authService: AuthenticationService) { + this.route + .params.subscribe(val => { + setTimeout(() => { + this.cs.startLoading(); + var selectedFilter = this.cs.sharedService.getSharedData(ItemForSaleService.selected_filters); + if (selectedFilter) { + this.selectCategory(selectedFilter); + } + else { + this.getItemsCategories(); + this.getItemsByEmployee(); + } + + + }, 100); + }); + + } + - ngOnInit() { } - openDetails() { + ngOnInit() { + this.direction = TranslatorService.getCurrentDirection(); + + } + getItemsCategories() { + + this.itemService.getCategories({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.categories = this.itemService.parser(result); + this.categories.unshift(this.allCategory); + this.cs.sharedService.setSharedData(this.categories, ItemForSaleService.CATEGORIES); + }) + this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.items = []; + this.items = this.itemService.parser(result); + this.tempSearch = deepCopy(this.items); + console.log(this.tempSearch); + this.cs.stopLoading(); + }) + } + openDetails(selected) { + this.cs.sharedService.setSharedData(selected, ItemForSaleService.ITEMS_SELECTED); this.cs.navigateForward('/itemforsale/items-details'); } segmentChanged(value) { this.segment = value.detail.value; } openSale() { - this.cs.navigateForward('/itemforsale/home'); + this.cs.openCreateitems(); + } + selectCategory(item) { + this.cs.startLoading(); + this.activeClass = item.categoryID; + this.pageNo = 1; + this.itemService.getItems({ pageNo: this.pageNo, ItgCategoryID: item.categoryID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.items = []; + this.items = this.itemService.parser(result); + this.tempSearch = deepCopy(this.items); + this.cs.stopLoading(); + }) + } + getDotted(temp: string, valueCount: number) { + temp = this.stripHtml(temp); + return temp.substring(0, valueCount) + " ..."; + } + stripHtml(html) { + var temporalDivElement = document.createElement("div"); + + temporalDivElement.innerHTML = html; + + return temporalDivElement.textContent || temporalDivElement.innerText || ""; } + loadData(event) { + this.pageNo = this.pageNo + 1; + this.itemService.getItems({ pageNo: this.pageNo, categoryID: this.activeClass }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.items.concat(this.itemService.parser(result)); + this.tempSearch = deepCopy(this.items); + event.target.complete(); + }) + } + search(t) { + if (t === '') { + this.items = this.tempSearch; + } else { + this.items = this.tempSearch.filter((post) => { + if (this.direction == 'ltr') + return (post.title.toLowerCase().indexOf(t.toLowerCase()) > -1); + else + return (post.title_Ar.indexOf(t) > -1); + }); + } + + } + getItemsByEmployee() { + + this.cs.startLoading(); + this.itemService.getItemsByEmployee({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.itemsByEmployee = this.itemService.parser(result); + + this.cs.stopLoading(); + console.log(this.itemsByEmployee); + }) + } + + getDate(date) { + return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY"); + } + + getImgContent(imgFile): SafeUrl { + return this.sanitizer.bypassSecurityTrustUrl(imgFile); + } + editItems(items) { + this.cs.sharedService.setSharedData(items, ItemForSaleService.EDIT_ITEMS); + this.cs.openCreateitems(); + } + deleteItems(item) { + var authUser = this.authService.getAuthenticatedRequest(); + this.cs.startLoading(); + var request = new FormData(); + request.append('itemSaleID', item.itemSaleID); + request.append('isActive', 'false'); + request.append('Channel', authUser.Channel.toString()); + request.append('LogInToken', authUser.LogInTokenID); + request.append('Token', authUser.TokenID); + request.append('EmployeeNumber', authUser.P_USER_NAME); + request.append('MobileNo', authUser.MobileNumber); + request.append('employeeNumber', authUser.P_USER_NAME); + this.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + if (this.cs.validResponse(result)) { + this.cs.greenToastPK('itemforsale', 'item-deleted'); + this.getItemsByEmployee(); + + } + }) + } + openModel() { + this.cs.filterItemforSale(); + } } diff --git a/Mohem/src/app/itemforsale/services/domsafe.ts b/Mohem/src/app/itemforsale/services/domsafe.ts new file mode 100644 index 00000000..79b677ac --- /dev/null +++ b/Mohem/src/app/itemforsale/services/domsafe.ts @@ -0,0 +1,15 @@ +import { Pipe, PipeTransform } from "@angular/core"; +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; + +@Pipe({ + name: 'sanitizeHTMLPipe' +}) +export class SanitizeHtmlPipe implements PipeTransform { + + constructor(private _sanitizer: DomSanitizer) { + } + + transform(v: string): SafeHtml { + return this._sanitizer.bypassSecurityTrustHtml(v); + } +} \ No newline at end of file diff --git a/Mohem/src/app/itemforsale/services/service.service.spec.ts b/Mohem/src/app/itemforsale/services/service.service.spec.ts new file mode 100644 index 00000000..99221043 --- /dev/null +++ b/Mohem/src/app/itemforsale/services/service.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { ItemForSaleService } from './service.service'; + +describe('ServiceService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: ItemForSaleService = TestBed.get(ItemForSaleService); + expect(service).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/itemforsale/services/service.service.ts b/Mohem/src/app/itemforsale/services/service.service.ts new file mode 100644 index 00000000..222e776c --- /dev/null +++ b/Mohem/src/app/itemforsale/services/service.service.ts @@ -0,0 +1,87 @@ +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; +import { MowadhafiService } from 'src/app/mowadhafi/mowadhafi.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ItemForSaleService { + public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale'; + public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee'; + public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory'; + public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSaleMobile'; + public static updateItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateItemForSale'; + public static getRegion = 'Services/COCWS.svc/REST/Mohemm_ITG_GetRegion'; + public static ITEMS_SELECTED = 'item-selected'; + public static CATEGORIES = 'categories'; + public static EDIT_ITEMS = 'edit-items'; + public static selected_filters = 'selected_filter'; + constructor( + public con: ConnectorService, + private authService: AuthenticationService, + private http: HttpClient + ) { } + public getItems(request: any, onError?: any, errorLabel?: string) { + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.UserName; + request.ItgPageNo = request.pageNo; + request.ItgPageSize = 10; + request.ItgStatus = "Approved"; + return this.con.postNoLoad(ItemForSaleService.getItemForSale, request, onError, errorLabel); + } + + public getCategories(request: any, onError?: any, errorLabel?: string) { + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.UserName; + + return this.con.postNoLoad(ItemForSaleService.getCategories, request, onError, errorLabel); + } + + + + parser(response: any) { + try { + var result = JSON.parse(response.Mohemm_ITG_ResponseItem); + if (result.result) + return result.result.data + else + return {} + } catch (res) { + console.log(res); + } + } + + getItemsByEmployee(request: any, onError?: any, errorLabel?: string) { + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.UserName; + request.ItgEmployeeNumber = request.UserName; //request.UserName; + return this.con.post(ItemForSaleService.getItemForSaleByEmployee, request, onError, errorLabel); + } + getRegion(request: any, onError?: any, errorLabel?: string) { + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.UserName; + request.ItgEmployeeNumber = request.UserName; //request.UserName; + return this.con.post(ItemForSaleService.getRegion, request, onError, errorLabel); + } + + createItemForSale(itemRequest: any, onError?: any, errorLabel?: string) { + const request = itemRequest; + this.authService.authenticateRequest(request); + request.employeeNumber = request.P_USER_NAME; + //return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, { + return this.con.post(ItemForSaleService.createItemForSale, request, onError, errorLabel); + //} + //) + } + updateItemForSale(itemRequest: any, onError?: any, errorLabel?: string) { + const request = itemRequest; + this.authService.authenticateRequest(request); + request.employeeNumber = request.P_USER_NAME; + return this.http.post(ConnectorService.host + ItemForSaleService.updateItemForSale, itemRequest, { + + } + ) + } +} diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss index c0f5006c..60613fd8 100644 --- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss +++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.scss @@ -526,4 +526,7 @@ select option[data-default] { .button-native { box-shadow: none!important; + } + .gridAH{ + text-align: justify; } \ No newline at end of file diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts index 70c5c7e0..1ec8c7ed 100644 --- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts +++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts @@ -35,7 +35,7 @@ export class HrRequestFormComponent implements OnInit { public searchKeySelect = 'Complaints'; myColor: string = 'secondary'; public showRequestDetails = false; - public proID = "HMG" + public proID = "CS" public inquiry: string; public HR: string; public complaints: string; @@ -54,9 +54,9 @@ export class HrRequestFormComponent implements OnInit { public sectionDep: any; public projectCode; public SelectedServiceType: any; - public depType: any =""; - public secType: any =""; - public topicType: any =""; + public depType: any = ""; + public secType: any = ""; + public topicType: any = ""; indexLastObj: any; addAttachRequest: any = []; TransactionID: any; @@ -73,17 +73,17 @@ export class HrRequestFormComponent implements OnInit { "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ]; - projctid:any; - employeeNumber:any; - ticketType: any =[]; + projctid: any; + employeeNumber: any; + ticketType: any = []; public direction: string; HRServices = ''; - Complaints=''; - Inquiry=''; - input = document.getElementById ("firstLabel"); - - - + Complaints = ''; + Inquiry = ''; + input = document.getElementById("firstLabel"); + + + constructor( public ts: TranslatorService, public cs: CommonService, @@ -100,20 +100,20 @@ export class HrRequestFormComponent implements OnInit { } ngOnInit() { - this.projectCode = this.cs.sharedService.getSharedData("projcet-code",false); + this.projectCode = this.cs.sharedService.getSharedData("projcet-code", false); this.getTicketTypes(); this.getProject(); - + } - + public isValidForm(): boolean { if (this.depType && this.SelectedServiceType && this.secType && this.topicType) { - return false; + return false; } return true; -} + } onSelectChange(event, type) { @@ -121,20 +121,20 @@ export class HrRequestFormComponent implements OnInit { console.log(value); // this.topicTypeList =[]; // this.sectionTypeList =[]; - if(type==1){ + if (type == 1) { this.depType = value; - this.sectionTypeList =[]; - this.topicTypeList =[]; + this.sectionTypeList = []; + this.topicTypeList = []; this.getDepartmentSections(value); - - }else if(type==2){ + + } else if (type == 2) { this.getSectionTopics(value); - this.topicTypeList =[]; + this.topicTypeList = []; } - - } - onFileSelectedclick(event){ + } + + onFileSelectedclick(event) { event.target.value = ''; } @@ -158,8 +158,8 @@ export class HrRequestFormComponent implements OnInit { }) } handlegetTicketTypesResult(result) { - this.ticketType =result.Mohemm_Itg_TicketTypesList; - + this.ticketType = result.Mohemm_Itg_TicketTypesList; + } ///////////////////////////////////////////////// @@ -177,11 +177,11 @@ export class HrRequestFormComponent implements OnInit { } handlegetProjectResult(result) { this.Projectresult = result.Mohemm_Itg_ProjectsList; - this.projctid=this.Projectresult[0].projectId; + this.projctid = this.Projectresult[0].projectId; this.getProjectDepartments(); } -//////////////////////////////////////////////////// + //////////////////////////////////////////////////// getProjectDepartments() { const request = { EmployeeNumber: "", @@ -204,7 +204,7 @@ export class HrRequestFormComponent implements OnInit { getDepartmentSections(value) { const request = { EmployeeNumber: "", - ItgProjectDepartmentId: value ?value : this.departTypeList.projectDepartmentId, + ItgProjectDepartmentId: value ? value : this.departTypeList.projectDepartmentId, }; @@ -218,11 +218,11 @@ export class HrRequestFormComponent implements OnInit { // this.getSectionTopics(); } - getSectionTopics(value=null) { + getSectionTopics(value = null) { const request = { EmployeeNumber: "", // ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId, - ItgDepartmentSectionId: value ?value : this.sectionTypeList.departmentSectionId, + ItgDepartmentSectionId: value ? value : this.sectionTypeList.departmentSectionId, }; this.MowadhafiService.getSectionTopics(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { @@ -238,41 +238,57 @@ export class HrRequestFormComponent implements OnInit { } - /*******************Create Ticket Function*************/ + /*******************Create Ticket Function*************/ CreateTicket() { - - var authUser =this.authService.getAuthenticatedRequest(); + + var authUser = this.authService.getAuthenticatedRequest(); this.cs.startLoading(); - var request = new FormData(); - request.append('ticketTypeId', this.SelectedServiceType); - request.append('projectId', this.projctid); - request.append('departmentId', this.depType); - request.append('sectionId', this.secType); - request.append('sectionTopicId', this.topicType); - request.append('description', this.Description); - console.log("TEST:______") - console.log(this.selectedFile); - if(this.selectedFile && this.selectedFile !== undefined){ - request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name); - } - request.append('employeeNumber', authUser.P_USER_NAME); - request.append('ticketStatus', 'new'); - request.append('channelId', '3'); - request.append('Channel', authUser.Channel.toString()); - request.append('LogInToken', authUser.LogInTokenID); - request.append('Token', authUser.TokenID); - request.append('EmployeeNumber', authUser.P_USER_NAME); - request.append('MobileNo', authUser.MobileNumber); + // var request = new FormData(); + // request.append('ticketTypeId', this.SelectedServiceType); + // request.append('projectId', this.projctid); + // request.append('departmentId', this.depType); + // request.append('sectionId', this.secType); + // request.append('sectionTopicId', this.topicType); + // request.append('description', this.Description); + + // if(this.selectedFile && this.selectedFile !== undefined){ + // request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name); + // } + // request.append('employeeNumber', authUser.P_USER_NAME); + // request.append('ticketStatus', 'new'); + // request.append('channelId', '3'); + // request.append('Channel', authUser.Channel.toString()); + // request.append('LogInToken', authUser.LogInTokenID); + // request.append('Token', authUser.TokenID); + // request.append('EmployeeNumber', authUser.P_USER_NAME); + // request.append('MobileNo', authUser.MobileNumber); + + var request = { + "TokenID": authUser.LogInTokenID, "EmployeeNumber": authUser.P_USER_NAME, "ItgImageCollList": this.addAttachRequest, + "ticketTypeId": this.SelectedServiceType, + "projectId": this.projctid, + "departmentId": this.depType, + "sectionId": this.secType, + "sectionTopicId": this.topicType, + "description": this.Description, + "employeeNumber": authUser.P_USER_NAME, + "ticketStatus": "new", + "channelId": 3, + "Channel": authUser.Channel.toString(), + "LogInToken": authUser.LogInTokenID, + "Token": authUser.TokenID, + "MobileNo": authUser.MobileNumber, + } this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => { - if(this.cs.validResponse(result)){ + if (this.cs.validResponse(result)) { this.cs.stopLoading(); this.checkERM('After Service Submission'); this.cs.greenToastPK("general", "success-create"); this.cs.openMyRequestPage(); - }else{ + } else { this.cs.stopLoading(); this.cs.redToastPK("general", "try-again"); } @@ -329,7 +345,7 @@ export class HrRequestFormComponent implements OnInit { else { const file = input.target.files[0]; this.selectedFile = input.target.files; - + this.getBase64(file).then(data => this.pushObject(data, file.name, file.type) @@ -348,18 +364,21 @@ export class HrRequestFormComponent implements OnInit { } pushObject(fileData, name, type) { - + this.indexLastObj++; try { let array = name.split("."); let attachType: string = array[array.length - 1]; this.addAttachRequest.push({ - AttachmentID: this.indexLastObj, - P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1], - P_FILE_DATA: fileData.split(",")[1], - P_FILE_NAME: name, //.split('.')[0], - P_TRANSACTION_ID: this.TransactionID + // AttachmentID: this.indexLastObj, + // P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1], + // P_FILE_DATA: fileData.split(",")[1], + // P_FILE_NAME: name, //.split('.')[0], + // P_TRANSACTION_ID: this.TransactionID + Base64Data: fileData.split(",")[1], + FileName: name, + ContentType: 'image/' + attachType }); } catch (e) { } } diff --git a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss index 3999867e..9a786617 100644 --- a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss +++ b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.scss @@ -176,6 +176,7 @@ letter-spacing: -0.64px; color: #2B353E; opacity: 1; + line-height: 20px; } diff --git a/Mohem/src/app/mowadhafi/mowadhafi.service.ts b/Mohem/src/app/mowadhafi/mowadhafi.service.ts index 8976393b..2a34d1d8 100644 --- a/Mohem/src/app/mowadhafi/mowadhafi.service.ts +++ b/Mohem/src/app/mowadhafi/mowadhafi.service.ts @@ -19,7 +19,7 @@ export class MowadhafiService { public static getTicketStatisticsByEmp = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketStatisticsByEmployee'; public static getTicketTransaction = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketTransaction'; public static getTicketDetails = 'Services/COCWS.svc/REST/Mohemm_ITG_GetTicketDetails'; - public static getCreateTicket = 'Services/COCWS.svc/REST/Mohemm_ITG_CreateTicket'; + public static getCreateTicket = 'Services/COCWS.svc/REST/Mohemm_ITG_CreateTicketMobile'; constructor( public con: ConnectorService, @@ -108,16 +108,17 @@ export class MowadhafiService { const request = absence; this.authService.authenticateRequest(request); request.employeeNumber = request.P_USER_NAME; - const HttpUploadOptions = { - headers: new HttpHeaders({ "Content-Type": "multipart/form-data", }) - } + return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); + // const HttpUploadOptions = { + // headers: new HttpHeaders({ "Content-Type": "multipart/form-data", }) + // } // return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); - return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, { - // reportProgress: true, - // observe: 'events' - } - ) + //return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, { + // reportProgress: true, + // observe: 'events' + //} + // ) } } \ No newline at end of file diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index 4469f7ec..98955dfd 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -235,7 +235,7 @@ export class DetailsComponent implements OnInit { ngOnInit() { this.common.startLoading(); this.intializeMemberDetail(); - this.showAttendanceTracking(); + // this.showAttendanceTracking(); // tslint:disable-next-line: max-line-length this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex); } @@ -266,6 +266,7 @@ export class DetailsComponent implements OnInit { if (this.activeSegment === 'Attendance') { this.common.startLoading(); this.initAttendance(); + this.showAttendanceTracking(); } else if (this.activeSegment != 'Attendance' && this.activeSegment != 'TeamMembers') { this.activeSegment = 'About'; diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html index 2280064d..0cbb0cef 100644 --- a/Mohem/src/app/my-team/home/home.component.html +++ b/Mohem/src/app/my-team/home/home.component.html @@ -1,5 +1,6 @@ diff --git a/Mohem/src/app/my-team/my-team.module.ts b/Mohem/src/app/my-team/my-team.module.ts index 49925b71..17fa5ede 100644 --- a/Mohem/src/app/my-team/my-team.module.ts +++ b/Mohem/src/app/my-team/my-team.module.ts @@ -10,6 +10,7 @@ import { MyTeamPage } from './my-team.page'; import { HmgCommonModule } from '../hmg-common/hmg-common.module'; import { from } from 'rxjs'; import { WorklistService } from '../notification/service/worklist.service'; +import { SubordinateLeaveComponent } from './subordinate-leave/subordinate-leave.component'; const routes: Routes = [ @@ -28,7 +29,10 @@ const routes: Routes = [ path: 'details-2', component: DetailsComponent }, - + { + path: 'subordinate-leave', + component: SubordinateLeaveComponent + } ] } @@ -44,7 +48,11 @@ const routes: Routes = [ ], providers: [WorklistService], - declarations: [MyTeamPage, HomeComponent, DetailsComponent, + declarations: [ + MyTeamPage, + HomeComponent, + DetailsComponent, + SubordinateLeaveComponent ] }) export class MyTeamPageModule { } diff --git a/Mohem/src/app/my-team/service/my-team.service.ts b/Mohem/src/app/my-team/service/my-team.service.ts index 87507d70..81149b41 100644 --- a/Mohem/src/app/my-team/service/my-team.service.ts +++ b/Mohem/src/app/my-team/service/my-team.service.ts @@ -7,6 +7,7 @@ import { AuthenticationService } from "src/app/hmg-common/services/authenticatio export class MyTeamService { public static EMPLOYEE_SHARED_DATA = 'employee'; public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES'; + public static getSubordintesLeaves = 'Services/ERP.svc/REST/GET_SUBORDINATES_LEAVES_TOTAL_VACATIONS'; // public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS'; @@ -20,6 +21,13 @@ export class MyTeamService { return this.con.post(MyTeamService.getMyTeam, request, onError, errorLabel); } + public getEmployeeSubordinatesLeave(absence: any, onError?: any, errorLabel?: string){ + const request = absence; + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.post(MyTeamService.getSubordintesLeaves, request, onError, errorLabel); + } + // public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){ // const request = absence; // this.authService.authenticateRequest(request); diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html new file mode 100644 index 00000000..8adf1dde --- /dev/null +++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.html @@ -0,0 +1,89 @@ + + + + + +
+ + +

{{ts.trPK('myTeam','select-duration')}}

+
+
+ + + + {{ts.trPK('general','from')}} + + + +   + + + + + {{ts.trPK('general','to')}} + + +   + + + + + +
+ +
+ +
+
+
+

+ {{ts.trPK('general','empty')}} +

+
+ +
+
+
+ + +
+
+ + +
+
+
+ +
+ +

{{user.EMPLOYEE_NAME}}

+ {{ts.trPK('general','from')}}: {{getDate(user.DATE_START)}}     + {{ts.trPK('general','to')}}: {{getDate(user.DATE_END)}} +
+ {{ts.trPK('myTeam','no-of-days')}}: {{diffDays(user)}} +
+
+
+
+
+
+
+ +
+ + +
+ {{ts.trPK('general','submit')}} +
+
+ + + + + \ No newline at end of file diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss new file mode 100644 index 00000000..6a147428 --- /dev/null +++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.scss @@ -0,0 +1,199 @@ +.confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background: #269DB8; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + .team-member-container{ + // background: white; + // border-radius: 100px 20px 20px 100px; + // margin-top: 15px; + // font-family: WorkSans-Regular; + // border: 1px solid #ccc; + // border-radius: 15px; + // padding-bottom: 8px; + background: white; + /* margin-top: 2px; */ + font-family: WorkSans-Regular; + border: 1px solid #ccc; + border-radius: 15px; + padding-bottom: 8px; + padding-top: 9px; + margin-bottom: 7px; +} + +// .user-image-container{ +// position: relative; +// width: 70px; +// height: 70px; +// display: block; +// margin: 0 auto; +// &:before{ +// position: absolute; +// content: ""; +// width: 20px; +// height: 20px; +// border-radius: 20px; +// border: 1px solid white; +// top: 0; +// right: 0; +// background-color: red; +// z-index: 9; +// } +// &.present:before{ +// background-color: green !important; +// } +// } +.user-image{ + // overflow: hidden; + // position: relative; + // display: block; + // width: 100%; + // height: 100%; + // border-radius: 80px; + // border: 1px solid #ccc; + // margin: 0px auto 6px; + + img { + // width: 100%; + // max-height: 100%; + width: 74%; + max-height: 74%; + margin-top: 7px; + margin-left: 6px; + } +} + +.employee-name{ + display: inline-block; + width: 80%; + .name{ + // font-size: 16px; + // color: black; + // // margin: 0; + // width: 100%; + // text-overflow: ellipsis; + // white-space: nowrap; + // overflow: hidden; + // margin-left: -10px; + // margin-top: -5px; + // font-family: 'WorkSans-Bold'; + font-size: 16px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + margin-left: -10px; + margin-top: -5px; + text-align: left; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); + line-height: 25px; + letter-spacing: -0.64px; + color: #2B353E; + opacity: 1; + } + + .title{ + // font-size: 13px; + // color: #888; + // width: 100%; + // text-overflow: ellipsis; + // white-space: nowrap; + // overflow: hidden; + // display: block; + // margin-left: -10px; + // margin-top: -6px; + // color: black; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); + line-height: 12px; + letter-spacing: -0.56px; + color: #575757; + opacity: 1; + font-size: 14px; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + display: block; + margin-left: -10px; + margin-top: -10px; + } +} + +.employee-name-ar{ + display: inline-block; + width: 80%; + .name{ + // font-size: 16px; + // color: black; + // // margin: 0; + // width: 100%; + // text-overflow: ellipsis; + // white-space: nowrap; + // overflow: hidden; + // margin-left: -10px; + // margin-top: -5px; + // font-family: 'WorkSans-Bold'; + font-size: 16px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + margin-left: -10px; + margin-top: -5px; + text-align: right; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); + line-height: 25px; + letter-spacing: -0.64px; + color: #2B353E; + opacity: 1; + } + + .title{ + // font-size: 13px; + // color: #888; + // width: 100%; + // text-overflow: ellipsis; + // white-space: nowrap; + // overflow: hidden; + // display: block; + // margin-left: -10px; + // margin-top: -6px; + // color: black; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); + line-height: 12px; + letter-spacing: -0.56px; + color: #575757; + opacity: 1; + font-size: 14px; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + display: block; + margin-left: -10px; + margin-top: -10px; + } +} +.image-container{ + width: 20%; + display: inline-block; + text-align: center; + vertical-align: top; + margin-top: 5px; +} +.swipe-information{ + color: #888; + font-size: 12px; + border-top: 1px solid #ccc; + padding-top: 6px; + margin-top: 6px; + .check-in { + font-size: 12px; + margin-right: 15px; + } +} \ No newline at end of file diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts new file mode 100644 index 00000000..8b69962b --- /dev/null +++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubordinateLeaveComponent } from './subordinate-leave.component'; + +describe('SubordinateLeaveComponent', () => { + let component: SubordinateLeaveComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubordinateLeaveComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubordinateLeaveComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts new file mode 100644 index 00000000..cdcbd788 --- /dev/null +++ b/Mohem/src/app/my-team/subordinate-leave/subordinate-leave.component.ts @@ -0,0 +1,57 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { MyTeamService } from '../service/my-team.service'; +import * as moment from 'moment'; + +@Component({ + selector: 'app-subordinate-leave', + templateUrl: './subordinate-leave.component.html', + styleUrls: ['./subordinate-leave.component.scss'], +}) +export class SubordinateLeaveComponent implements OnInit { + public startDate: any; + public endDate: any; + public list = []; + public noData = true; + + constructor( + public ts: TranslatorService, + public common: CommonService, + public myTeamService: MyTeamService, + ) { } + + ngOnInit() {} + + subordinateLeaveList() { + const Sdata = this.common.convertDateToJsonDateUpdated(this.startDate); + const Edata = this.common.convertDateToJsonDateUpdated(this.endDate); + this.myTeamService.getEmployeeSubordinatesLeave({ + P_DATE_FROM: Sdata, + P_DATE_TO: Edata + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + if (this.common.validResponse(result)) { + this.list = result.GetSubordinatesLeavesTotalVacationsList; + this.noData = false; + } + }); + } + + getDate(date) { + const newDate = this.common.localizeDate(new Date(this.common.getDateTimeISOFromStringUpdated(date).split(' ')[0])); + return newDate; + } + diffDays(date) { + const date1 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_START).split(' ')[0]); + const date2 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_END).split(' ')[0]); + const diff = Math.abs(date1.getTime() - date2.getTime()); + const diffDays = Math.ceil(diff / (1000 * 3600 * 24)); + return diffDays; + } + + checkDate() { + if (this.startDate && this.endDate) { + return false; + } else { return true; } + } +} diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index fe0b6141..31eda5f2 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -1,6 +1,7 @@ @@ -10,19 +11,20 @@
{{ts.trPK('work-list','open-analysis')}}
-
- {{newWorkListResponse.length + ITGCount}} {{ts.trPK('work-list','of')}} - {{newWorkListResponse.length}} {{ts.trPK('work-list','of')}} -

{{totalRequestCount}}

-

{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}

-

{{newWorkListResponse[0].NO_OF_ROWS}}

+
+

{{totalRequestCount}}

+ + {{ts.trPK('work-list','total')}}
{{ts.trPK('work-list','open-reqest')}}
+ - +
- + {{ts.trPK('work-list','clear-search')}} - + {{ts.trPK('work-list','advanced-search')}} @@ -70,7 +72,6 @@
-
@@ -99,9 +100,8 @@
- - + diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index c1faeb72..b7444c88 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -355,7 +355,7 @@ z-index: 99; ion-col{ background: white; border-radius: 12px; - padding-right: 30px; + // padding-right: 30px; flex: none; ion-icon{ margin-right: 3px; @@ -459,4 +459,10 @@ padding: 10px 30px; } .slideCss{ width: auto !important; +} + +.spinner-custom-class{ + position: absolute; + right: 160px; + top: 100px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 89200ab2..0ec194c5 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -11,6 +11,8 @@ import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/wor import { DatePipe } from '@angular/common'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { COCRequest } from '../models/COCRequest'; @Component({ selector: 'app-home', @@ -22,6 +24,7 @@ export class HomeComponent implements OnInit { public static REQUSET_INFO = 'requset_info'; public static ALL_REQUEST = 'all_request'; public static NOTIFICATION_DATA = 'notification_data'; + public static COUNT_CHANGED = 'count_changed'; public static NOTIFICATION_ARR = 'notification_arr'; public static NAMES_ALL_iTEMS = 'names-all-items'; public static IS_ALL_NAME = 'is_all_names'; @@ -66,16 +69,17 @@ export class HomeComponent implements OnInit { public newWorkListResponse = []; public showFormattedData = []; public allFormattedData = []; - public selectedFilter = 'ALL'; + public selectedFilter = 'HR'; public showSearchButton = false; - public itemType = ''; + public itemType = 'HRSSA'; public receivedITGCount = false; - + public countChanged: any = false; public totalHR = 0; public totalPO = 0; public totalPR = 0; public totalMR = 0; public totalIC = 0; + public totalStamp = 0; public showChart = false; @@ -85,30 +89,24 @@ export class HomeComponent implements OnInit { tooltips: { enabled: false }, legend: { display: false } }; - public data = { - datasets: [ - { - data: [0, 0, 0, 0, 0, 0], - backgroundColor: [ - '#18a169', - '#3cb9d5', - '#114475', - '#38c9b3', - '#cc3232', - '#9e7e97' - ], - borderWidth: 5 - }] - }; + // public data = { + // datasets: [ + // { + // data: [0, 0, 0, 0, 0, 0, 0], + // backgroundColor: [ + // '#18a169', + // '#3cb9d5', + // '#114475', + // '#38c9b3', + // '#cc3232', + // '#9e7e97', + // '#ff9800' + // ], + // borderWidth: 6 + // }] + // }; + public data: any; public filters = [ - { - value: 0, - name: 'All', - active: true, - color: '#124375', - key: 'ALL', - disable: false - }, { value: 0, name: 'HR', @@ -156,6 +154,14 @@ export class HomeComponent implements OnInit { color: '#9e7e97', key: 'INVITEM', disable: false + }, + { + value: 0, + name: 'STAMP', + active: false, + color: '#ff9800', + key: 'STAMP', + disable: false } ]; @@ -184,7 +190,7 @@ export class HomeComponent implements OnInit { this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_PAGE_NUM = 0; - this.WorkListObj.P_PAGE_LIMIT = 50; + this.WorkListObj.P_PAGE_LIMIT = 25; } ngOnInit() { @@ -192,8 +198,14 @@ export class HomeComponent implements OnInit { this.isLoading = true; } + + ionViewWillEnter() { - console.log(this.filters); + this.totalRequestCount = this.common.getTotalNumberOfWorklistRequest(); + const values = this.common.getFiltersData(); + this.data = values.data; + this.filters = values.filters; + const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false); if (loadWorkList) { this.receivedITGCount = false; @@ -205,88 +217,61 @@ export class HomeComponent implements OnInit { } this.currentActiveIndex = 0; this.previousActiveIndex = 0; - this.itemType = ''; - this.selectedFilter = 'ALL'; + this.itemType = 'HRSSA'; + this.selectedFilter = 'HR'; + this.enableFilters(); + this.filters[0].active = true; this.isPostNoLoad = true; - this.disableFilters(); this.resetData(); this.direction = TranslatorService.getCurrentLanguageName(); this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); - this.openNotificationsDashboard(); + + var isWorklistChanged = this.common.sharedService.getSharedData(HomeComponent.COUNT_CHANGED); + if (isWorklistChanged) { + this.openNotificationsDashboard() + } + this.openNotificationsDashboardLocal(); } } callWorkListServices() { + // if (this.countChanged) { this.Count(); + // } this.getAllPushNotificationFun(); } - openNotificationsDashboard() { - this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => { - if (this.common.validResponse(result)) { - this.worklistNotifications = result; - this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER; - this.common.sharedService.setSharedData(result, 'worklistNotifications'); - this.Details(); - this.callWorkListServices(); - } - }); + openNotificationsDashboardLocal() { + this.Details(); + this.callWorkListServices(); + } assignDataToFilters() { - this.ngZone.run(() => { - this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; - this.filters[1].value = this.totalHR; - this.filters[2].value = this.totalMR; - this.filters[3].value = this.totalPR; - this.filters[4].value = this.totalPO; - this.filters[6].value = this.totalIC; - }); - - - if (this.totalHR === 0) { - this.data.datasets[0].data[0] = 0; - } - - if (this.totalPO === 0) { - this.data.datasets[0].data[1] = 0; - } - - if (this.totalPR === 0) { - this.data.datasets[0].data[2] = 0; - } - - if (this.totalMR === 0) { - this.data.datasets[0].data[3] = 0; - } - - if (this.totalIC === 0) { - this.data.datasets[0].data[5] = 0; - } - const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList; for (const notification of openNotificationsArray) { if (notification.ITEM_TYPE === 'HRSSA') { - this.filters[1].value = this.totalHR; + this.filters[0].value = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'INVMOA') { - this.filters[2].value = this.totalMR; + this.filters[1].value = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'REQAPPRV') { - this.filters[3].value = this.totalPR; + this.filters[2].value = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'POAPPRV') { - this.filters[4].value = this.totalPO; + this.filters[3].value = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'INVITEM') { - this.filters[6].value = this.totalIC; + this.filters[5].value = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[5] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'STAMP') { + this.filters[6].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[6] = notification.OPEN_NTF_NUMBER; } } - // this.data.datasets[0].data[4] = this.ITGCount; this.showChart = true; - // this.common.stopLoading(); this.isLoading = false; } @@ -299,16 +284,46 @@ export class HomeComponent implements OnInit { } } + public initiateNewWorklistData(selectedFilter: any, filterValue: any) { + this.WorkListObj = new WorkListRequest(); + this.WorkListObj.P_NOTIFICATION_TYPE = '1'; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_PAGE_NUM = 0; + this.WorkListObj.P_PAGE_LIMIT = 25; + + if (this.infiniteScroll) { + this.infiniteScroll.complete(); + } + this.itemType = this.selectedFilter; + + this.newWorkListResponse = []; + this.showFormattedData = []; + this.allFormattedData = []; + + if (filterValue > 0) { + this.getAllPushNotificationFun(); + } else { + this.common.stopLoading(); + } + + } + activeFilter(index: number) { - console.log(this.filters); - if (this.currentActiveIndex !== index) { + if (index !== this.currentActiveIndex && index !== 7) { + if (index !== 4) { + this.common.startLoading(); + } this.previousActiveIndex = this.currentActiveIndex; this.currentActiveIndex = index; this.filters[this.previousActiveIndex].active = false; this.filters[this.currentActiveIndex].active = true; this.selectedFilter = this.filters[this.currentActiveIndex].key; + const filterValue = this.filters[this.currentActiveIndex].value; if (this.selectedFilter !== 'ITG') { - this.getFilteredData(this.selectedFilter); + this.initiateNewWorklistData(this.selectedFilter, filterValue); } } } @@ -317,12 +332,14 @@ export class HomeComponent implements OnInit { this.common.openProfile('sideMenu'); } - disableFilters() { + configureFilters() { for (const filter of this.filters) { if (filter.key === this.itemType) { + const index = this.filters.map(function (e) { return e.key; }).indexOf(this.itemType); + this.currentActiveIndex = index; + this.previousActiveIndex = 0; filter.disable = false; filter.active = true; - filter.value = 0; this.selectedFilter = filter.name; } else if (this.itemType === '') { filter.disable = false; @@ -332,17 +349,34 @@ export class HomeComponent implements OnInit { filter.active = false; } } + if (this.itemType === '') { this.filters[0].active = true; } } + + enableFilters() { + this.currentActiveIndex = 0; + this.previousActiveIndex = 0; + for (const filter of this.filters) { + filter.disable = false; + if (filter.key === this.itemType) { + filter.active = true; + } else { + filter.active = false; + } + } + } + async openSearchModal() { const modal = await this.modalController.create({ component: WorklistAdvancedSearchComponent, cssClass: 'advanced-search-modal-custom', backdropDismiss: false, - componentProps: {} + componentProps: { + itemType: this.itemType + } }); modal.onDidDismiss().then(result => { if (result.data) { @@ -358,13 +392,10 @@ export class HomeComponent implements OnInit { this.WorkListObj.P_PAGE_NUM = 1; this.newWorkListResponse = []; this.showFormattedData = []; - this.selectedFilter = 'ALL'; - this.filters[this.currentActiveIndex].active = false; - this.currentActiveIndex = 0; - this.previousActiveIndex = 0; - this.filters[this.currentActiveIndex].active = true; + this.allFormattedData = []; + if (this.itemType !== '') { - this.disableFilters(); + this.configureFilters(); } this.isPostNoLoad = false; this.getAllPushNotificationFun(); @@ -398,21 +429,6 @@ export class HomeComponent implements OnInit { ); } - getFilteredData(filter: string) { - if (filter === 'ALL') { - this.showFormattedData = this.allFormattedData; - } else { - let arrayToFilter; - arrayToFilter = this.newWorkListResponse.filter((workList) => { - return workList.ITEM_TYPE === filter; - }); - const categorizeData = this.categorizeData(arrayToFilter); - this.showFormattedData = this.sortArray(categorizeData); - // const sortData = this.sortArray(arrayToFilter); - // this.showFormattedData = this.categorizeData(sortData); - } - } - checkDateExistance(currentDate: any, formattedData: any) { let existsBefore = false; let index = 0; @@ -429,33 +445,10 @@ export class HomeComponent implements OnInit { }; } - addCountInFilters(workList: any) { - if (workList.ITEM_TYPE === 'HRSSA') { - this.totalHR = this.totalHR + 1; - } else if (workList.ITEM_TYPE === 'POAPPRV') { - this.totalPO = this.totalPO + 1; - } else if (workList.ITEM_TYPE === 'REQAPPRV') { - this.totalPR = this.totalPR + 1; - } else if (workList.ITEM_TYPE === 'INVMOA') { - this.totalMR = this.totalMR + 1; - } else if (workList.ITEM_TYPE === 'INVITEM') { - this.totalIC = this.totalIC + 1; - } - } - categorizeData(arrayToCategorize: any) { - this.ngZone.run(() => { - this.totalHR = 0; - this.totalPO = 0; - this.totalPR = 0; - this.totalMR = 0; - this.totalIC = 0; - }) - const datePipe = new DatePipe('en-US'); const formattedData = []; for (const workList of arrayToCategorize) { - this.addCountInFilters(workList); const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); const currentObject = { date: '', @@ -486,6 +479,7 @@ export class HomeComponent implements OnInit { } private handleWorkListResult(result: any) { + this.common.stopLoading(); console.log(this.filters); const lastItemIndex = result.length - 1; const lastitem = result[lastItemIndex]; @@ -515,28 +509,25 @@ export class HomeComponent implements OnInit { this.showFormattedData = this.sortArray(categorizedWorkListResponse); this.allFormattedData = this.showFormattedData; this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); - this.assignDataToFilters(); } } else { this.newWorkListResponse = []; - // this.assignDataToFilters(); if (this.showFormattedData.length === 0) { - this.resetFiltersUI(); + // this.resetFiltersUI(); } this.data.datasets[0].data[4] = this.ITGCount; this.showChart = true; - // this.common.stopLoading(); this.isLoading = false; } } - public resetFiltersUI () { + public resetFiltersUI() { this.ngZone.run(() => { this.filters[0].value = 0; this.filters[1].value = 0; this.filters[2].value = 0; this.filters[3].value = 0; - this.filters[4].value = 0; + this.filters[5].value = 0; this.filters[6].value = 0; this.data.datasets[0].data[0] = 0; @@ -544,11 +535,12 @@ export class HomeComponent implements OnInit { this.data.datasets[0].data[2] = 0; this.data.datasets[0].data[3] = 0; this.data.datasets[0].data[5] = 0; + this.data.datasets[0].data[6] = 0; }); } openNotificationDetail(obj) { - this.common.sharedService.setSharedData(this.selectedFilter, 'selectedFilter'); + this.common.sharedService.setSharedData(this.itemType, 'selectedFilter'); this.common.sharedService.setSharedData(false, 'loadWorkList'); this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); if (obj.REQUEST_TYPE === 'PR') { @@ -582,24 +574,19 @@ export class HomeComponent implements OnInit { this.WorkListObj.P_SEARCH_SUBJECT = ''; } - // initializeWorkList() { - - // } - clearSearch() { this.common.startLoading(); - this.isLoading = true; - this.itemType = ''; - this.selectedFilter = 'ALL'; + this.isLoading = false; + this.itemType = 'HRSSA'; + this.selectedFilter = 'HR'; this.isPostNoLoad = true; - this.disableFilters(); + this.enableFilters(); this.resetData(); this.getAllPushNotificationFun(); } doInfinite(infiniteScroll) { if (!this.isReachEnd && this.selectedFilter !== 'ITG') { - this.common.startLoading(); this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => { if (this.common.validResponse(result)) { this.handleWorkListResult(result.GetWorkList); @@ -619,46 +606,43 @@ export class HomeComponent implements OnInit { this.ITGItem = []; this.workListService.getITGCount('', '', this.isPostNoLoad) .subscribe((result: any) => { - if (result.RequestType.length > 0) { - this.ITGSegment[0] = { - name: 'All', - code: 'All', - data: null, - style: false - }; - this.ITGSegment[0].data = datas; - this.ITGSegment[0].names = names; - this.setActive(this.ITGSegment[0].code); - } - console.log(result.RequestType); - let count = 1; - for (let i = 0; i < result.RequestType.length; i++) { - console.log() - this.ITGSegment[count] = { - name: result.RequestType[i].RequestTypeName, - code: result.RequestType[i].RequestTypeCode, - data: result.RequestType[i].RequestDetails, - style: false - }; - datas[i] = result.RequestType[i].RequestDetails; - names[i] = result.RequestType[i].RequestTypeCode; - count++; + if (result.RequestType) { + if (result.RequestType.length > 0) { + this.countChanged = false; + this.ITGSegment[0] = { + name: 'All', + code: 'All', + data: null, + style: false + }; + this.ITGSegment[0].data = datas; + this.ITGSegment[0].names = names; + this.setActive(this.ITGSegment[0].code); + } + console.log(result.RequestType); + let count = 1; + for (let i = 0; i < result.RequestType.length; i++) { + console.log() + this.ITGSegment[count] = { + name: result.RequestType[i].RequestTypeName, + code: result.RequestType[i].RequestTypeCode, + data: result.RequestType[i].RequestDetails, + style: false + }; + datas[i] = result.RequestType[i].RequestDetails; + names[i] = result.RequestType[i].RequestTypeCode; + count++; + } } - //this.sortArrayOfAll(this.ITGSegment[0].data) - console.log(this.ITGSegment); }); } Details() { - this.workListService.getITGDetails('', '', this.isPostNoLoad) - .subscribe((result: any) => { - this.ITGCount = result.TotalCount; - this.totalRequestCount = this.totalRequestCount + result.TotalCount; - this.data.datasets[0].data[4] = this.ITGCount; - this.filters[5].value = result.TotalCount; - this.receivedITGCount = true; - }); + this.ITGCount = this.common.filterKeys['ITG'];//result.TotalCount; + this.data.datasets[0].data[4] = this.common.filterKeys['ITG'];//this.ITGCount; + this.filters[4].value = this.common.filterKeys['ITG']; + this.receivedITGCount = true; } searchBtn() { @@ -715,4 +699,58 @@ export class HomeComponent implements OnInit { } this.openITG(ITEM, NAME); } + + openNotificationsDashboard() { + this.common.startLoading(); + this.totalRequestCount = 0; + this.DS.getOpenNotifications('', '', false).subscribe((result: GetOpenNotificationsResponse) => { + if (this.common.validResponse(result)) { + const key = 'P_OPEN_NTF_NUMBER'; + // this.totalRequestCount = ; + this.ITGCountAllNotification(result[key]); + this.common.sharedService.setSharedData( + result, + 'worklistNotifications' + ); + + this.common.setFilterValues(result['GetOpenNotificationsList']); + + + } + }); + } + ITGCountAllNotification(count) { + this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => { + this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS); + this.common.filterKeys['ITG'] = result.TotalCount; + const values = this.common.getFiltersData(); + this.data = values.data; + this.filters = values.filters; + this.totalRequestCount = Math.floor(count + result.TotalCount); + this.common.sharedService.setSharedData(this.totalRequestCount, 'total-count'); + this.getCOCNotificationCount(); + this.common.stopLoading(); + }); + } + getCOCNotificationCount() { + const request = new COCRequest(); + request.ItgPageSize = 1; + request.ItgPageNo = 1; + request.Date = moment(new Date()).format("YYYY-MM-DD"); + + this.workListService.getCOCCount(request, '', '', this.isPostNoLoad).subscribe((result: any) => { + console.log(result); + const countResult = result.Mohemm_ITG_Pending_Task_ResponseItem; + const totalCount = countResult.escalation + countResult.waitingToClose + countResult.waitingForAcceptance + countResult.extendTATRequest; + this.common.filterKeys['COC'] = totalCount; + + + this.totalRequestCount = Math.floor(this.totalRequestCount + totalCount); + + this.common.sharedService.setSharedData(this.totalRequestCount, 'total-count'); + + this.common.stopLoading(); + }); + } + } diff --git a/Mohem/src/app/notification/models/COCRequest.ts b/Mohem/src/app/notification/models/COCRequest.ts new file mode 100644 index 00000000..97e45176 --- /dev/null +++ b/Mohem/src/app/notification/models/COCRequest.ts @@ -0,0 +1,8 @@ +import { Request } from 'src/app/hmg-common/services/models/request'; + +export class COCRequest extends Request { + public ItgPageSize: number; + public ItgPageNo: number; + public Date: string; + public EmployeeNumber: string; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/models/userItemTypeRequest.ts b/Mohem/src/app/notification/models/userItemTypeRequest.ts new file mode 100644 index 00000000..d6c934a2 --- /dev/null +++ b/Mohem/src/app/notification/models/userItemTypeRequest.ts @@ -0,0 +1,6 @@ +export class UserItemTypes extends Request { + public P_ITEM_TYPE: string; + public P_FYA_ENABLED_FALG: string; + public P_FYI_ENABLED_FLAG: string; + public ItemID: number; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index d9b5da73..8364c21c 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -32,6 +32,7 @@ import { MoreActionModalComponent } from './more-action-modal/more-action-modal. import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component'; import { MoItemHistoryComponent } from './mo-item-history/mo-item-history.component'; import { WorklistMainIcComponent } from './worklist-main-ic/worklist-main-ic.component'; +import { WorklistSettingComponent } from './worklist-setting/worklist-setting.component'; const routes: Routes = [ @@ -123,6 +124,10 @@ const routes: Routes = [ { path: 'item-creation-IC', component: WorklistMainIcComponent + }, + { + path: 'worklist-settings', + component: WorklistSettingComponent } ] } diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index a68047d4..8c53b0bf 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -20,6 +20,9 @@ import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; import { Request } from 'src/app/hmg-common/services/models/request'; import { LoginModel } from '../../authentication/models/LoginModel'; import { itgRequest } from '../models/itgFormDetailsRequest'; +import { COCRequest } from '../models/COCRequest'; + +import { UserItemTypes } from "../models/userItemTypeRequest"; @Injectable() export class WorklistMainService { @@ -30,7 +33,13 @@ export class WorklistMainService { public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY"; public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY"; + public static getPhoneNotificationBody = "Services/ERP.svc/REST/GET_PHONES_NOTIFICATION_BODY"; + public static getTerminationNotificationBody = "Services/ERP.svc/REST/GET_TERM_NOTIFICATION_BODY"; + public static getContactNotificationBody = "Services/ERP.svc/REST/GET_CONTACT_NOTIFICATION_BODY"; + public static getStampMSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_MS_NOTIFICATION_BODY"; + public static getStampNSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_NS_NOTIFICATION_BODY"; public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY"; + public static getCEINotificationBody = "Services/ERP.svc/REST/GET_CEI_NOTIFICATION_BODY"; public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY"; public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY"; public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; @@ -40,7 +49,10 @@ export class WorklistMainService { public static getQutationAnalysisUrl = "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS"; public static getITGFormTaskCount = 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType'; public static getITGFormTaskDetails = 'Services/COCWS.svc/REST/ITGFormsPendingTasks'; + public static getCOCCount = 'Services/COCWS.svc/REST/Mohemm_ITG_ReviewerAdmin_Pending_Tasks'; public static getITGFormDetails = 'Services/COCWS.svc/REST/ITGGetFormDetials'; + public static getWorklistNotificationURL = 'Services/ERP.svc/REST/GET_USER_ITEM_TYPES'; + public static updateWorklistNotificationURL = 'Services/ERP.svc/REST/UPDATE_USER_ITEM_TYPES'; @@ -94,6 +106,21 @@ export class WorklistMainService { ); } + public getCEINotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getCEINotificationBody, + request, + onError, + errorLabel + ); + } + public getPRNotificationBody( WorkListBodyRequest: any, onError?: any, @@ -124,6 +151,36 @@ export class WorklistMainService { ); } + public getStampMSNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getStampMSNotificationBody, + request, + onError, + errorLabel + ); + } + + public getStampNSNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getStampNSNotificationBody, + request, + onError, + errorLabel + ); + } + public getAddressNotificationBody( WorkListBodyRequest: any, onError?: any, @@ -154,6 +211,52 @@ export class WorklistMainService { ); } + public getPhoneNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getPhoneNotificationBody, + request, + onError, + errorLabel + ); + } + + + public getTerminationNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getTerminationNotificationBody, + request, + onError, + errorLabel + ); + } + + public getContactNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getContactNotificationBody, + request, + onError, + errorLabel + ); + } + public getPOItemHistory( POItemHistoryReq: any, onError?: any, @@ -331,6 +434,28 @@ export class WorklistMainService { } } + public getCOCCount( request: COCRequest, onError?: any, errorLabel?: string, isPostNoLoad = false): Observable { + // const request = new Request(); + console.log(request); + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.UserName; + if (isPostNoLoad) { + return this.api.postNoLoad( + WorklistMainService.getCOCCount, + request, + onError, + errorLabel + ); + } else { + return this.api.post( + WorklistMainService.getCOCCount, + request, + onError, + errorLabel + ); + } + } + public getITGActionRequest(itgrequest:itgRequest,actionURL:string, onError?: any, errorLabel?: string): Observable { this.authService.authenticateRequest(itgrequest); @@ -346,4 +471,32 @@ export class WorklistMainService { } + public getWorklistNotifications( + onError?: any, + errorLabel?: string + ): Observable { + const request = new Request(); + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getWorklistNotificationURL, + request, + onError, + errorLabel + ); + } + + public updateWorklistNotifications( + requestData: any, + onError?: any, + errorLabel?: string + ): Observable { + this.authService.authenticateRequest(requestData); + return this.api.post( + WorklistMainService.updateWorklistNotificationURL, + requestData, + onError, + errorLabel + ); + } + } diff --git a/Mohem/src/app/notification/service/worklist.service.ts b/Mohem/src/app/notification/service/worklist.service.ts index 1673443f..b35b867d 100644 --- a/Mohem/src/app/notification/service/worklist.service.ts +++ b/Mohem/src/app/notification/service/worklist.service.ts @@ -6,6 +6,7 @@ import { WorkListReplacmentEmployeeRequest } from '../models/ReplacmentEmployeeR import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes'; import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; +import { Request } from 'src/app/hmg-common/services/models/request'; @Injectable() @@ -16,6 +17,7 @@ export class WorklistService { public static getRFCEmployeeList = 'Services/ERP.svc/REST/GET_RFC_EMPLOYEE_LIST'; public static getActionHistory = 'Services/ERP.svc/REST/GET_ACTION_HISTORY'; public static getFavorite = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacements'; + public static getFavoriteWithoutImage = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacementsWithoutImage'; public static saveFavorite = 'Services/ERP.svc/REST/Mohemm_ChangeFavoriteReplacements'; constructor( public api: ConnectorService, @@ -53,6 +55,15 @@ export class WorklistService { public getFavorite(req: any, onError?: any, errorLabel?: string): Observable { this.authService.authenticateRequest(req); + console.log(req); + return this.api.post(WorklistService.getFavorite, req, onError, errorLabel); + } + + public getFavoriteByLetter(letter: string, onError?: any, errorLabel?: string): Observable { + const req = new Request(); + this.authService.authenticateRequest(req); + req['ItgFilter'] = letter; + console.log(letter); return this.api.post(WorklistService.getFavorite, req, onError, errorLabel); } public saveFavoriteList(request: any, onError?: any, errorLabel?: string): Observable { @@ -63,6 +74,11 @@ export class WorklistService { return this.api.post(WorklistService.saveFavorite, req, onError, errorLabel); } + public getFavoriteWithoutImage(req: any, onError?: any, errorLabel?: string): Observable { + this.authService.authenticateRequest(req); + return this.api.post(WorklistService.getFavoriteWithoutImage, req, onError, errorLabel); + } + public getFavoriteMyTeam(req: any, onError?: any, errorLabel?: string): Observable { this.authService.authenticateRequest(req); return this.api.post(WorklistService.getFavorite, req, onError, errorLabel); diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index d6286590..13606458 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -112,10 +112,15 @@
- -
+
Note: {{approvalInfo.Notes}}
+
+ Note: {{approvalInfo.Notes}} +
+
@@ -561,7 +566,7 @@ - + Skip diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index 6ebede5e..fba4d82a 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -62,6 +62,7 @@ export class WorkListMainItgComponent implements OnInit { defaultSegment = ''; public slideIndex = 0; public messageSuccess = false; + public actionHistory = false; constructor( public common: CommonService, public ts: TranslatorService, @@ -148,28 +149,28 @@ export class WorkListMainItgComponent implements OnInit { return '../assets/imgs/mohemm-action/info.png'; } if (actionName === 'Grant') { - return '../assets/imgs/mohemm-action/info.png'; + return '../assets/imgs/mohemm-action/grant.png'; } if (actionName === 'Delegate') { return '../assets/imgs/mohemm-action/delegate.png'; } if (actionName === 'Answer') { - return '../assets/imgs/mohemm-action/info.png'; + return '../assets/imgs/mohemm-action/answer.png'; } if (actionName === 'Question') { - return '../assets/imgs/mohemm-action/info.png'; + return '../assets/imgs/mohemm-action/question.png'; } if (actionName === 'ReportGenerated') { return '../assets/imgs/mohemm-action/ReportGenerated.png'; } if (actionName === 'Doable') { - return '../assets/imgs/mohemm-action/info.png'; + return '../assets/imgs/mohemm-action/Doable.png'; } if (actionName === 'NotDoable') { - return '../assets/imgs/mohemm-action/info.png'; + return '../assets/imgs/mohemm-action/notDoable.png'; } if (actionName === 'DataCorrected') { - return '../assets/imgs/mohemm-action/info.png'; + return '../assets/imgs/mohemm-action/data-corrected.png'; } } @@ -192,8 +193,14 @@ export class WorkListMainItgComponent implements OnInit { }); } - skip() { + skip(flag?) { // check if the user clicked on all type of request + if (flag != 'skip') { + this.common.setTotalNumberOfWorklistRequest(); + // this.common.assignDataToFilters(this.common.sharedService.getSharedData('worklistNotifications', false), 'ITG'); + if (this.common.filterKeys['ITG'] != 0) + this.common.filterKeys['ITG'] = (this.common.filterKeys['ITG'] - 1) + } if (this.is_all_items_sents) { for (let i = 1; i < this.all_request_names.length; i++) { for (let j = 0; j < this.all_request_names[i].data.length; j++) { @@ -213,6 +220,7 @@ export class WorkListMainItgComponent implements OnInit { } } else if (this.index === this.all_request_names.length) { // if its the end request redirecte to worklist home this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); return false; } @@ -228,6 +236,7 @@ export class WorkListMainItgComponent implements OnInit { return; } else { this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); return; } @@ -235,6 +244,7 @@ export class WorkListMainItgComponent implements OnInit { } } this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); return; } @@ -271,13 +281,17 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.confirmMsg(1); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else if (action === 2) {// reject @@ -291,13 +305,16 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = true; + // this.messageSuccess = true; this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(2); this.skip(); - this.messageSuccess = false; + // this.messageSuccess = false; }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } @@ -315,15 +332,18 @@ export class WorkListMainItgComponent implements OnInit { } if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(3); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } @@ -336,15 +356,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(4); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else if (action === 5) { // answer @@ -358,15 +381,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(5); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } @@ -383,15 +409,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(6); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else { @@ -409,15 +438,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(6); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else { @@ -470,7 +502,8 @@ export class WorkListMainItgComponent implements OnInit { this.actionService(1, this.commentText); } if (this.actionSelected === 'Delegate') { - this.common.sharedService.setSharedData(info,'selectedEmpInfo'), + this.common.sharedService.setSharedData(info, 'selectedEmpInfo'), + this.common.sharedService.setSharedData('Delegate', 'pressedBtn') this.presentModal(4); } if (this.actionSelected === 'Doable') { @@ -489,6 +522,7 @@ export class WorkListMainItgComponent implements OnInit { this.actionService(2, this.commentText); } if (this.actionSelected === 'RequestInformation') { + this.common.sharedService.setSharedData('RequestInformation', 'pressedBtn') this.presentModal(3); } if (this.actionSelected === 'ReportGenerated') { @@ -509,9 +543,9 @@ export class WorkListMainItgComponent implements OnInit { modal.cssClass = 'replaceRoll-modal'; modal.onDidDismiss() .then((data) => { - if(data.data.empData){ + if (data.data.empData) { this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID; - this.commentText = data.data.comments ? data.data.comments: null; + this.commentText = data.data.comments ? data.data.comments : null; if (actionNumber === 3) { this.actionService(3, this.commentText); } else if (actionNumber === 4) { @@ -542,8 +576,8 @@ export class WorkListMainItgComponent implements OnInit { returnDateTime(stringDate: string) { let allDateTime = stringDate.split(' '); let time = allDateTime[1].split(':', 2); - let dateArr= allDateTime[0].split('/') - let correctDate = dateArr[1]+'/'+dateArr[0]+'/'+dateArr[2]; + let dateArr = allDateTime[0].split('/') + let correctDate = dateArr[1] + '/' + dateArr[0] + '/' + dateArr[2]; let fullDate = this.transform(correctDate); return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; @@ -568,7 +602,7 @@ export class WorkListMainItgComponent implements OnInit { return this.locale[lang].month_names_short[month]; } - backgroundColor(statusName: string){ + backgroundColor(statusName: string) { // {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'} switch (statusName) { case 'Submit': diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html index 85e6ad39..f54b721a 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html @@ -1,13 +1,12 @@ - - + @@ -60,9 +59,15 @@ --> - {{'replacementRoll, searchBy' | translate}} + + {{ + 'replacementRoll, title' | translate}} + {{ 'worklistMain, request' | translate}} + + {{ 'worklistMain, delegate' | translate}} - + + + +
+ + + +
+ + +
+ + + +
+ +
+ + +

{{'replacementRoll, workflow' | translate}}

+

{{'replacementRoll, favorite' | translate}}

+

{{'replacementRoll, employee-id' | translate}}

+

{{'replacementRoll, employee-email' | translate}}

+

{{'replacementRoll, employee-name' | translate}}

+
+
+
+
+
+
+ + + +
+ +
+
+
+
- - + + +
+ +
+

{{filter}}

+
+ +
+ +
+ +
+

{{filter}}

+
+ +
+ + + -
+
{{'replacementRoll, search-result' | translate}}
@@ -227,8 +301,8 @@
-
+
{{'replacementRoll, favorite' | translate}}
@@ -259,6 +333,25 @@
+
+ +

+ {{'general, fav-showData' | translate}} +

+
+
+
+ +

+ {{'general, fav-noData' | translate}} +

+
+
+
diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss index 9ea7dfa7..be2d6286 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss @@ -1,280 +1,313 @@ +.disabledButton { + opacity: 0.5; +} -.disabledButton{ - opacity:.5; - - } - - .radio-label{ - margin: 4px; - position: relative; - bottom: 4px; - } - ion-radio{ - --color-checked: #269db8; - } - .center{text-align: center;} - .boldTxtNav{ - font-weight: bold; - } - .employee-details{ - display:inline-block; - margin: 10px; - } - .empImgeRep{ - display: inline-block; - height: 40px; - width: 40px; - } - .star-fav{ - float: right; - margin: 10px; - } - .star-fav-left{ - float: left; - margin: 10px 5px; - } - .uk-margin{margin: 15px 15px 0px 15px; - font-weight: bold; - clear: both; - position: relative; - top: 10px;} - .uk-padding{ padding: 20px;} - .uk-padding .employee-details{ - bottom: 10px; - position: relative;} - - .filterInput{ - border: solid var(--gray) 1px; - border-radius: 21px; - padding-left: 10px !important; - } - .filterInput-ar{ - - border: solid var(--gray) 1px; - border-radius: 21px; - --padding-start: 10px !important; - - } - .square-container{ - width:100%; - clear: both; - } - .square{ - clear: both; - } - .top-radio-row{ - font-size: 12px; - } +.radio-label { + margin: 4px; + position: relative; + bottom: 4px; +} +ion-radio { + --color-checked: #269db8; +} +.center { + text-align: center; +} +.boldTxtNav { + text-align: start; + font-weight: bold; + padding: 12px; +} +.employee-details { + display: inline-block; + margin: 10px; +} +.empImgeRep { + display: inline-block; + height: 40px; + width: 40px; +} +.star-fav { + float: right; + margin: 10px; +} +.star-fav-left { + float: left; + margin: 10px 5px; +} +.uk-margin { + margin: 15px 15px 0px 15px; + font-weight: bold; + clear: both; + position: relative; + top: 10px; +} +.uk-padding { + padding: 20px; +} +.uk-padding .employee-details { + bottom: 10px; + position: relative; +} - button.item-button.button.button-md.button-clear.button-clear-md { - background-color: transparent; - } - - .footer-button { - background: #dbdbdb; - border-radius: 10px; - color: black; - --background: transparent; - font-weight: bold; - width: 75%; - } - - // ion-item { - // margin-top: 5%; - // margin-right: 7%; - // width: 100%; - // } - .ionItem{ - border: #e4e4e4 solid; - /* margin: 6px; */ - /* padding: 11px; */ - height: 85px; - width: 164px; - border-radius: 5px; - text-align: center; - - } - - - .profileImageDiv{ - - z-index: 3; - position: relative; - top: 0; - - } - .profileImage{ - width:60px !important; - - } - - .activated{ - border: #209a83 0.02cm solid ; - } - .deactivated{ border: #e4e4e4 0.02cm solid; - } - .repContentDiv{ - text-align: center; - width: 85%; - font-size: 14px; - border: #e4e4e4 solid; - border-radius: 5px; - padding: 20px 8px 8px 8px; - margin-top: -9px; - margin-right: -35px - - } - .selIEmpDiv{ - text-align: right; - margin-bottom: -26px; - margin-right: 0px; - z-index: 3; - position: relative; - top: 0; - } - - .selIEmpImage{ - width:22px !important - - } - - .noteInput{ - border: solid var(--gray) 1px; - border-radius: 15px; - margin: 8px 17px 0px 17px; - padding: 10px 2px 10px 2px; - } - .filterInput{ - border: solid var(--gray) 1px; - border-radius: 21px; - padding-left: 10px !important; - } - - .filterInput-ar{ - // border: solid var(--gray) 1px; - // border-radius: 21px; - // padding-left: 10px !important; - border: solid var(--gray) 1px; - border-radius: 21px; - // width:250px - // padding-left: 145px !important; - //margin-left: 123px; - // padding-right: 129px; - //margin-right: -136px; - - } - .filterBtn{ - background: var(--newgreen); - --background: var (--newgreen); - border-radius: 50%; - height: 60px; - width: 60px; - } - .filterBtn-ar{ - // background: var(--newgreen); - // --background: var (--newgreen); - // border-radius: 50%; - // height: 60px; - // width: 60px; - background: var(--newgreen); - --background: var (--newgreen); - border-radius: 50%; - height: 60px; - width: 60px; - margin-left: -183px; - margin-right: 260px; - } - - - - *{ - box-sizing: border-box; - } - - .square-container{ - // padding: 8px; - width:100%; - } - .square{ - // width:calc(100% / 2); - width:100%; - float:left; - position: relative; - // padding-bottom: calc(100% / 2); - } - - .square .content{ - width: calc(100% - 16px) !important; - height: calc(100% - 16px) !important; - margin: 8px; - padding: 16px; - // position: absolute; - color: white; - border-radius: 9px; - text-align: center; - min-height: 92px; - // background-color: #0095ff; - // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); - } - - .disabledButton{ - opacity:.5; - - } - - .radio-label{ - font-size: 9px; - margin: 4px; - position: relative; - bottom: 4px; - } - ion-radio{ - --color-checked: #269db8; - } - .center{text-align: center;padding: 5px;} - .boldTxtNav{ - font-weight: bold; - padding: 5px; - } - .employee-details{ - display:inline-block; - margin: 10px; - text-overflow: ellipsis; - white-space: nowrap; - width: 70%; - } - .empImgeRep{ - display: inline-block; - height: 40px; - width: 40px; - } - .star-fav{ - float: right; - margin: 15px 0px 0px 0px; - } - .uk-margin{margin: 15px 15px 0px 15px; - font-weight: bold; - clear: both; - position: relative; - top: 10px;} - .uk-padding{ padding: 20px;} - .uk-padding .employee-details{ - bottom: 10px; - position: relative;} - - // .star-fav-left{ - // float: left; - // margin: 10px 5px; - // } - .top-radio-row{ - font-size: 12px; - display: block; - padding-bottom: 25px; - padding-top: 15px; - } - .textSearchType{ - padding-top: 8px; - font-size: 12px; - } - - \ No newline at end of file +.filterInput { + border: solid var(--gray) 1px; + border-radius: 21px; + padding-left: 10px !important; +} +.filterInput-ar { + border: solid var(--gray) 1px; + border-radius: 21px; + --padding-start: 10px !important; +} +.square-container { + width: 100%; + clear: both; +} +.square { + clear: both; +} +.top-radio-row { + font-size: 12px; +} + +button.item-button.button.button-md.button-clear.button-clear-md { + background-color: transparent; +} + +.footer-button { + background: #dbdbdb; + border-radius: 10px; + color: black; + --background: transparent; + font-weight: bold; + width: 75%; +} + +// ion-item { +// margin-top: 5%; +// margin-right: 7%; +// width: 100%; +// } +.ionItem { + border: #e4e4e4 solid; + /* margin: 6px; */ + /* padding: 11px; */ + height: 85px; + width: 164px; + border-radius: 5px; + text-align: center; +} + +.profileImageDiv { + z-index: 3; + position: relative; + top: 0; +} +.profileImage { + width: 60px !important; +} + +.activated { + border: #209a83 0.02cm solid; +} +.deactivated { + border: #e4e4e4 0.02cm solid; +} +.repContentDiv { + text-align: center; + width: 85%; + font-size: 14px; + border: #e4e4e4 solid; + border-radius: 5px; + padding: 20px 8px 8px 8px; + margin-top: -9px; + margin-right: -35px; +} +.selIEmpDiv { + text-align: right; + margin-bottom: -26px; + margin-right: 0px; + z-index: 3; + position: relative; + top: 0; +} + +.selIEmpImage { + width: 22px !important; +} + +.noteInput { + border: solid var(--gray) 1px; + border-radius: 15px; + margin: 8px 17px 0px 17px; + padding: 10px 2px 10px 2px; +} +.filterInput { + border: solid var(--gray) 1px; + border-radius: 21px; + padding-left: 10px !important; +} + +.filterInput-ar { + // border: solid var(--gray) 1px; + // border-radius: 21px; + // padding-left: 10px !important; + border: solid var(--gray) 1px; + border-radius: 21px; + // width:250px + // padding-left: 145px !important; + //margin-left: 123px; + // padding-right: 129px; + //margin-right: -136px; +} +.filterBtn { + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; +} +.filterBtn-ar { + // background: var(--newgreen); + // --background: var (--newgreen); + // border-radius: 50%; + // height: 60px; + // width: 60px; + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; + margin-left: -183px; + margin-right: 260px; +} + +* { + box-sizing: border-box; +} + +.square-container { + // padding: 8px; + width: 100%; +} +.square { + // width:calc(100% / 2); + width: 100%; + float: left; + position: relative; + // padding-bottom: calc(100% / 2); +} + +.square .content { + width: calc(100% - 16px) !important; + height: calc(100% - 16px) !important; + margin: 8px; + padding: 16px; + // position: absolute; + color: white; + border-radius: 9px; + text-align: center; + min-height: 92px; + // background-color: #0095ff; + // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); +} + +.disabledButton { + opacity: 0.5; +} + +.radio-label { + font-size: 9px; + margin: 4px; + position: relative; + bottom: 4px; +} +ion-radio { + --color-checked: #269db8; +} +.center { + text-align: center; + padding: 5px; +} +.boldTxtNav { + font-weight: bold; + padding: 5px; +} +.employee-details { + display: inline-block; + margin: 10px; + text-overflow: ellipsis; + white-space: nowrap; + width: 70%; +} +.empImgeRep { + display: inline-block; + height: 40px; + width: 40px; +} +.star-fav { + float: right; + margin: 15px 0px 0px 0px; +} +.uk-margin { + margin: 15px 15px 0px 15px; + font-weight: bold; + clear: both; + position: relative; + top: 10px; +} +.uk-padding { + padding: 20px; +} +.uk-padding .employee-details { + bottom: 10px; + position: relative; +} + +// .star-fav-left{ +// float: left; +// margin: 10px 5px; +// } +.top-radio-row { + font-size: 12px; + display: block; + padding-bottom: 25px; + padding-top: 15px; +} +.textSearchType { + padding-top: 8px; + font-size: 12px; +} + +.isFavLetterActive { + color: #269db8; + display: block; + width: 60%; + float: right; + transition-duration: 0ms; + height: 35px; +} +.vl { + border-left: 2px solid lightgray; + height: 42px; +} +.searchText{ + background: transparent; + color: #269db8; + font-weight: bold; + text-decoration: underline; +} + +.letterDiv{ + font-weight: bold; + width: 10%; + float: right; +} +.letterDivLoop{ + display: block; + width: 60%; + float: right; + transition-duration: 0ms; + height: 35px; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts index bd1ab765..9426bf97 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts @@ -40,6 +40,16 @@ export class WorkListReplacementItgComponent implements OnInit { public direction = ''; arr = []; delegtedEmp; + isFavoriteLetterActive = false; + getPassActionMode: any; + + public slideOptsOne = { + slidesPerView: 6, + spaceBetween: 5 + }; + + public activeSelectedLetter:string; + constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, @@ -54,7 +64,9 @@ export class WorkListReplacementItgComponent implements OnInit { // } ngOnInit() { + this.onChangeSelect1('1'); this.delegtedEmp = this.cs.sharedService.getSharedData('selectedEmpInfo', true); + this.getPassActionMode = this.cs.sharedService.getSharedData('pressedBtn', true); if (this.delegtedEmp === undefined) { if (!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined) { this.arr = this.cs.sharedService.getSharedData('workflow-user', false); @@ -68,7 +80,7 @@ export class WorkListReplacementItgComponent implements OnInit { this.relatedList.push(lookupObject[i]); } } - this.getFavruite(); + // this.getFavruite(); } else { this.select(this.delegtedEmp, 1); } @@ -164,9 +176,11 @@ export class WorkListReplacementItgComponent implements OnInit { if (this.isSave == true) { if (this.selEmp) { data = this.selEmp; - this.messageSuccess = true; + // this.messageSuccess = true; + // this.cs.greenToastPK('worklist', 'save-successfully'); } else { data = null; + // this.cs.redToastPK('worklist', 'save-error'); } if (typeof this.callback == 'function') { this.callback(data); @@ -212,6 +226,31 @@ export class WorkListReplacementItgComponent implements OnInit { } } + onChangeSelect1(select) { + let selectValue = select; + this.searchKey = ''; + if (selectValue == "1") { + this.listOfRealted = this.relatedList; + console.log(this.relatedList); + this.isSelect = true; + this.isFilter = true; + this.ReplacementList = []; + } else if (selectValue == "4") { + this.listOfFav = this.favoriteUserList; + this.isFilter = true; + this.ReplacementList = []; + // if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined){ + this.getFavruite(); + // } + } else if (selectValue === '2' || selectValue === '3' || selectValue === '5') { + this.isSelect = true; + this.isFilter = false; + } + else { + this.isSelect = false; + + } + } getPlaceHolder() { return this.searchKeySelect == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchKeySelect == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail'); } @@ -261,10 +300,10 @@ export class WorkListReplacementItgComponent implements OnInit { const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === userID); console.log(userIndex); if (userIndex === -1) { - selEmp.IsFavorite = !selEmp.IsFavorite; this.cs.presentConfirmDialog( confirmBoxhtml , () => { + selEmp.IsFavorite = !selEmp.IsFavorite; const request = [ { @@ -306,28 +345,63 @@ export class WorkListReplacementItgComponent implements OnInit { } }); } + + + favLetter = []; + favIsActive = []; + getFavruite() { this.cs.startLoading(); - this.worklistService.getFavorite({}, () => { - + this.worklistService.getFavoriteWithoutImage({}, () => { }).subscribe((result) => { if (this.cs.validResponse(result)) { - this.cs.stopLoading(); - this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; - this.favoriteUserList.forEach((obj) => { + // this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + let favList = result['Mohemm_GetFavoriteReplacementsList']; + favList.forEach((obj) => { obj.IsFavorite = true; + this.favLetter.push(obj.EMPLOYEE_DISPLAY_NAME.charAt(0).toUpperCase()); }); - this.relatedList.forEach((obj) => { - if (this.favoriteUserList.some(x => x.USER_NAME === obj.EmployeeID)) { - obj.IsFavorite = true; - } else { - obj.IsFavorite = false; - } + this.favLetter = this.favLetter.filter((elem, index, self) => { + return index === self.indexOf(elem); }); - console.log('enad test'); - console.log(this.relatedList); + if (this.activeSelectedLetter) { + this.selectedLetter(this.activeSelectedLetter); + } else { + this.favLetter.forEach((obj, index) => { + if(this.activeSelectedLetter) {} + if (index === 0) { + // this.selectedLetter(obj); + this.favIsActive.push(true); + } else { + this.favIsActive.push(false); + } + }); + } + console.log(this.favLetter); + console.log(this.favIsActive); } }); + // this.cs.startLoading(); + // this.worklistService.getFavorite({}, () => { + + // }).subscribe((result) => { + // if (this.cs.validResponse(result)) { + // this.cs.stopLoading(); + // this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + // this.favoriteUserList.forEach((obj) => { + // obj.IsFavorite = true; + // }); + // this.relatedList.forEach((obj) => { + // if (this.favoriteUserList.some(x => x.USER_NAME === obj.EmployeeID)) { + // obj.IsFavorite = true; + // } else { + // obj.IsFavorite = false; + // } + // }); + // console.log('enad test'); + // console.log(this.relatedList); + // } + // }); } listOfRealted = []; @@ -365,4 +439,31 @@ export class WorkListReplacementItgComponent implements OnInit { return true; else { return false; } } + + selectedLetter(el) { + this.isFavoriteLetterActive = true; + this.favLetter.forEach((letter, index) => { + if (letter === el) { + this.favIsActive[index] = true; + this.activeSelectedLetter = el; + this.worklistService.getFavoriteByLetter(letter,() => { + }).subscribe((result) => { + if (this.cs.validResponse(result)) { + this.cs.stopLoading(); + this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + this.listOfFav = this.favoriteUserList; + this.favoriteUserList.forEach((obj) => { + obj.IsFavorite = true; + }); + } + }); + } else { + this.favIsActive[index] = false; + } + }); + } + + returnIsActiveFunction(i) { + return this.favIsActive[i]; + } } diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html index cd1fb3b3..ef3ff306 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html @@ -1,14 +1,12 @@ - - - - {{ + + + - @@ -18,9 +16,15 @@ - {{'replacementRoll, searchBy' | translate}} + + {{ + 'replacementRoll, title' | translate}} + {{ 'worklistMain, request' | translate}} + + {{ 'worklistMain, delegate' | translate}} + - + -
+ @@ -80,10 +83,68 @@
+
--> + +
+ + + +
+ + +
+ + + +
+ +
+ + +

{{'replacementRoll, workflow' | translate}}

+

{{'replacementRoll, favorite' | translate}}

+

{{'replacementRoll, employee-id' | translate}}

+

{{'replacementRoll, employee-email' | translate}}

+

{{'replacementRoll, employee-name' | translate}}

+
+
+
+
+
- - + + + +
+ +
+
+
+
+ +
+ +
+

{{filter}}

+
+ +
+ +
+ +
+

{{filter}}

+
+ +
{{"replacementRoll, question" | translate}} : @@ -130,8 +191,8 @@
-
-
+
+
{{'replacementRoll, favorite' | translate}}
@@ -160,10 +221,18 @@
-
+ +
+ +

+ {{'general, fav-showData' | translate}} +

+
+
+
-

- Sorry there is no data +

+ {{'general, fav-noData' | translate}}

diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss index 7bd616a2..ac20567e 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss @@ -16,7 +16,7 @@ button.item-button.button.button-md.button-clear.button-clear-md { // margin-right: 7%; // width: 100%; // } -.ionItem{ +.ionItem { border: #e4e4e4 solid; /* margin: 6px; */ /* padding: 11px; */ @@ -24,28 +24,24 @@ button.item-button.button.button-md.button-clear.button-clear-md { width: 164px; border-radius: 5px; text-align: center; - } - -.profileImageDiv{ - +.profileImageDiv { z-index: 3; position: relative; top: 0; - } -.profileImage{ - width:60px !important; - +.profileImage { + width: 60px !important; } -.activated{ - border: #209a83 0.02cm solid ; +.activated { + border: #209a83 0.02cm solid; } -.deactivated{ border: #e4e4e4 0.02cm solid; +.deactivated { + border: #e4e4e4 0.02cm solid; } -.repContentDiv{ +.repContentDiv { text-align: center; width: 85%; font-size: 14px; @@ -53,10 +49,9 @@ button.item-button.button.button-md.button-clear.button-clear-md { border-radius: 5px; padding: 20px 8px 8px 8px; margin-top: -9px; - margin-right: -35px - + margin-right: -35px; } -.selIEmpDiv{ +.selIEmpDiv { text-align: right; margin-bottom: -26px; margin-right: 0px; @@ -65,24 +60,23 @@ button.item-button.button.button-md.button-clear.button-clear-md { top: 0; } -.selIEmpImage{ - width:22px !important - +.selIEmpImage { + width: 22px !important; } -.noteInput{ +.noteInput { border: solid var(--gray) 1px; border-radius: 15px; margin: 8px 17px 0px 17px; padding: 10px 2px 10px 2px; } -.filterInput{ +.filterInput { border: solid var(--gray) 1px; border-radius: 21px; padding-left: 10px !important; } -.filterInput-ar{ +.filterInput-ar { // border: solid var(--gray) 1px; // border-radius: 21px; // padding-left: 10px !important; @@ -93,16 +87,15 @@ button.item-button.button.button-md.button-clear.button-clear-md { //margin-left: 123px; // padding-right: 129px; //margin-right: -136px; - } -.filterBtn{ +.filterBtn { background: var(--newgreen); --background: var (--newgreen); border-radius: 50%; height: 60px; width: 60px; } -.filterBtn-ar{ +.filterBtn-ar { // background: var(--newgreen); // --background: var (--newgreen); // border-radius: 50%; @@ -117,25 +110,23 @@ button.item-button.button.button-md.button-clear.button-clear-md { margin-right: 260px; } - - -*{ +* { box-sizing: border-box; } -.square-container{ +.square-container { // padding: 8px; - width:100%; + width: 100%; } -.square{ - // width:calc(100% / 2); - width:100%; - float:left; +.square { + // width:calc(100% / 2); + width: 100%; + float: left; position: relative; // padding-bottom: calc(100% / 2); } -.square .content{ +.square .content { width: calc(100% - 16px) !important; height: calc(100% - 16px) !important; margin: 8px; @@ -149,64 +140,114 @@ button.item-button.button.button-md.button-clear.button-clear-md { // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); } -.disabledButton{ - opacity:.5; - +.disabledButton { + opacity: 0.5; } -.radio-label{ +.radio-label { font-size: 9px; - margin: 4px; - position: relative; - bottom: 4px; + margin: 4px; + position: relative; + bottom: 4px; } -ion-radio{ +ion-radio { --color-checked: #269db8; - } -.center{text-align: center;padding: 5px;} -.boldTxtNav{ - font-weight: bold; +} +.center { + text-align: center; padding: 5px; } -.employee-details{ - display:inline-block; +.boldTxtNav { + text-align: start; + font-weight: bold; + padding: 12px; +} +.employee-details { + display: inline-block; margin: 10px; text-overflow: ellipsis; white-space: nowrap; width: 70%; } -.empImgeRep{ +.empImgeRep { display: inline-block; height: 40px; width: 40px; } -.star-fav{ +.star-fav { float: right; margin: 15px 0px 0px 0px; } -.uk-margin{margin: 15px 15px 0px 15px; +.uk-margin { + margin: 15px 15px 0px 15px; font-weight: bold; clear: both; position: relative; - top: 10px;} -.uk-padding{ padding: 20px;} -.uk-padding .employee-details{ + top: 10px; +} +.uk-padding { + padding: 20px; +} +.uk-padding .employee-details { bottom: 10px; - position: relative;} - - .star-fav-left{ - float: left; - margin: 10px 5px; - } - .top-radio-row{ - font-size: 12px; - display: block; - padding-bottom: 25px; - padding-top: 15px; - } - .textSearchType{ - padding-top: 8px; - font-size: 12px; - } + position: relative; +} - +.star-fav-left { + float: left; + margin: 10px 5px; +} +.top-radio-row { + font-size: 12px; + display: block; + padding-bottom: 25px; + padding-top: 15px; +} +.textSearchType { + padding-top: 8px; + font-size: 12px; +} +.isFavLetterActive { + // background: #269db8; + // width: 55px; + // border-radius: 60px; + color: #269db8; + display: block; + width: 60%; + float: right; + transition-duration: 0ms; + height: 35px; +} +.vl { + border-left: 2px solid lightgray; + height: 42px; +} +.clearText{ + background: transparent; + color: #D55D5C; + font-weight: bold; + text-decoration: underline; +} +.searchText{ + background: transparent; + color: #269db8; + font-weight: bold; + text-decoration: underline; +} +.filterClass input{ + box-shadow: none !important; + -webkit-box-shadow: none !important; +} + +.letterDiv{ + font-weight: bold; + width: 10%; + float: right; +} +.letterDivLoop{ + display: block; + width: 60%; + float: right; + transition-duration: 0ms; + height: 35px; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index f39e81c2..0e2a6346 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -49,11 +49,20 @@ export class WorkListReplacementRollComponent implements OnInit { arr = []; favoriteUserList: any = []; isFilter = true; + isFavoriteLetterActive = false; + + public slideOptsOne = { + slidesPerView: 6, + spaceBetween: 5 + }; + + public activeSelectedLetter: string; + constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { this.P_PAGE_NUM = 1; this.P_PAGE_LIMIT = 50; this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false); - this.getFavruite(); + // this.getFavruite(); this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false); this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false); @@ -352,7 +361,7 @@ export class WorkListReplacementRollComponent implements OnInit { // } // }, 5000); - this.cs.openNotificationPage(); + // this.cs.openNotificationPage(); // this.messageSuccess = true; // setTimeout(() => { @@ -433,25 +442,23 @@ export class WorkListReplacementRollComponent implements OnInit { } selectedType; - counter=0; + counter = 0; onChangeSelect(select) { let selectValue = select.detail.value; - if (selectValue == '1') { this.isSelect = true; this.isFilter = true; this.selectedType = 1; this.listOfRealted = this.actionHistory; - if(this.counter > 0) - { - this.actionHistory.forEach((obj, i) => { - if(this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) { - this.actionHistory[i].IsFavorite = true; - }else{ - this.actionHistory[i].IsFavorite = false; - } - }); - } + // if (this.counter > 0) { + this.actionHistory.forEach((obj, i) => { + if (this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) { + this.actionHistory[i].IsFavorite = true; + } else { + this.actionHistory[i].IsFavorite = false; + } + }); + // } this.counter = 1; } else if (selectValue === '4') { // if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) { @@ -474,9 +481,9 @@ export class WorkListReplacementRollComponent implements OnInit { this.ReplacementList = []; clearTimeout(this.typingTimer); // this.typingTimer = setTimeout(() => { - // if (this.inputSearch.length > 2) { - this.getreplacmentemployee(); - // } + // if (this.inputSearch.length > 2) { + this.getreplacmentemployee(); + // } // }, 3000); @@ -489,34 +496,60 @@ export class WorkListReplacementRollComponent implements OnInit { // } } getPlaceHolder() { - return this.searchBy == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchBy == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail'); + return this.searchBy === '1' ? + this.ts.trPK('replacementRoll', 'searchbyname') : + this.searchBy === '2' ? + this.ts.trPK('replacementRoll', 'searchbyusername') : + this.ts.trPK('replacementRoll', 'searchbyemail'); } + + favLetter = []; + favIsActive = []; + getFavruite() { this.cs.startLoading(); - this.worklistService.getFavorite({}, () => { - + this.worklistService.getFavoriteWithoutImage({}, () => { }).subscribe((result) => { if (this.cs.validResponse(result)) { - this.cs.stopLoading(); - this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; - this.listOfFav = this.favoriteUserList; - this.favoriteUserList.forEach((obj) => { + // this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + let favList = result['Mohemm_GetFavoriteReplacementsList']; + favList.forEach((obj) => { obj.IsFavorite = true; + this.favLetter.push(obj.EMPLOYEE_DISPLAY_NAME.charAt(0).toUpperCase()); + }); + this.favLetter = this.favLetter.filter((elem, index, self) => { + return index === self.indexOf(elem); }); - /**** THIS CODE TO CHECK STAR OF EMPLOYEE IF IT IS IN FAVORITE LIST AND SHOW IN WORKFLOW LIST****/ - // this.actionHistory.forEach((obj, i) => { - // if(this.favoriteUserList.some(x => x['USER_NAME'] === obj.USER_NAME)) { - // this.actionHistory[i].isInFavorite = true; - // } else { - // this.actionHistory[i].isInFavorite = false; - // } - // }); - // console.log(this.actionHistory); - /**** END ****/ + this.favLetter.forEach((obj, index) => { + if (this.activeSelectedLetter) { + this.selectedLetter(this.activeSelectedLetter); + } + if (index === 0) { + // this.selectedLetter(obj); + this.favIsActive.push(true); + } else { + this.favIsActive.push(false); + } + }); + console.log(this.favLetter); + console.log(this.favIsActive); } }); + // this.worklistService.getFavorite({}, () => { + + // }).subscribe((result) => { + // if (this.cs.validResponse(result)) { + // this.cs.stopLoading(); + // this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + // this.listOfFav = this.favoriteUserList; + // this.favoriteUserList.forEach((obj) => { + // obj.IsFavorite = true; + // }); + // } + // }); } + saveUserFavruiteList(request, isFav: boolean) { this.worklistService.saveFavoriteList(request, () => { }).subscribe((result) => { @@ -528,14 +561,10 @@ export class WorkListReplacementRollComponent implements OnInit { } this.getFavruite(); } - }) + }); } setFavorite(selEmp) { - selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME; - selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : ''; - selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : ''; - selEmp.IsFavorite = !selEmp.IsFavorite; let confirmBoxhtml = `

Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list


@@ -559,6 +588,10 @@ export class WorkListReplacementRollComponent implements OnInit { this.cs.presentConfirmDialog( confirmBoxhtml , () => { + selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME; + selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : ''; + selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : ''; + selEmp.IsFavorite = !selEmp.IsFavorite; const request = [ { @@ -573,6 +606,10 @@ export class WorkListReplacementRollComponent implements OnInit { this.saveUserFavruiteList(request, selEmp.IsFavorite); }, () => { }); } else { + selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME; + selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : ''; + selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : ''; + selEmp.IsFavorite = !selEmp.IsFavorite; const request = [ { @@ -591,6 +628,7 @@ export class WorkListReplacementRollComponent implements OnInit { listOfRealted: any = []; listOfFav: any = []; + filterList(event) { const val = event.target.value; if (this.selectedType === 1) { @@ -613,4 +651,35 @@ export class WorkListReplacementRollComponent implements OnInit { return; } } + + selectedLetter(el) { + this.isFavoriteLetterActive = true; + this.favLetter.forEach((letter, index) => { + if (letter === el) { + this.favIsActive[index] = true; + this.activeSelectedLetter = el; + this.worklistService.getFavoriteByLetter(letter, () => { + }).subscribe((result) => { + if (this.cs.validResponse(result)) { + this.cs.stopLoading(); + this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + this.listOfFav = this.favoriteUserList; + this.favoriteUserList.forEach((obj) => { + obj.IsFavorite = true; + }); + } + }); + } else { + this.favIsActive[index] = false; + } + }); + } + + returnIsActiveFunction(i) { + return this.favIsActive[i]; + } + + clearSearchInput() { + this.inputSearch = ''; + } } diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts index e8e41c87..b18b1bba 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts @@ -7,6 +7,7 @@ import { WorklistService } from '../service/worklist.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { ModalController } from '@ionic/angular'; +import { HomeComponent } from '../home/home.component'; @Component({ selector: 'app-work-list-rfc', @@ -39,7 +40,7 @@ export class WorkListRfcComponent implements OnInit { public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController - ) { + ) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); @@ -125,7 +126,7 @@ export class WorkListRfcComponent implements OnInit { if (result.MessageStatus == 1) { this.cs.sharedService.setSharedData(true, 'loadWorkList'); - + this.messageSuccess = true; setTimeout(() => { @@ -138,6 +139,7 @@ export class WorkListRfcComponent implements OnInit { }); }, 5000); + this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.cs.openNotificationPage(); } @@ -178,18 +180,18 @@ export class WorkListRfcComponent implements OnInit { this.modalCtrl.dismiss(); } - select(selectEmp,index){ + select(selectEmp, index) { console.log(selectEmp.USER_NAME); console.log(selectEmp.SEQ); - this.radioButtonValue=selectEmp.USER_NAME + this.radioButtonValue = selectEmp.USER_NAME this.seqNo = selectEmp.SEQ; -////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////// // let emp: any = this.RFCEmployeeListListRes[v]; // this.seqNo = emp.SEQ; // this.radioButtonValue = emp.USER_NAME; - this.active=index; + this.active = index; } } diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html index 67b487cc..a185754a 100644 --- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html @@ -54,6 +54,7 @@ PR MR IC + STAMP diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts index 8b9db09f..319c5c60 100644 --- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts @@ -15,7 +15,7 @@ export class WorklistAdvancedSearchComponent implements OnInit { public inputSearch = ''; public selectedValue = ''; public notificationType = ''; - public itemType = ''; + public itemType; public direction: string; constructor( diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html index b22aa453..c2161ae3 100644 --- a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html @@ -435,7 +435,7 @@ {{reqInfo_label}} - + {{'worklistMain, skip' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts index f5c2abec..1d08ec1f 100644 --- a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts @@ -381,12 +381,12 @@ export class WorklistMainIcComponent implements OnInit { this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); // console.log("test" + this.notificationButtonRes.length); for (let i = 0; i < this.notificationButtonRes.length; i++) { - if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE" || this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") { this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL; this.approveDis = true; } else - if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT" || this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") { this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL; this.rejectDis = true; } else @@ -401,7 +401,7 @@ export class WorklistMainIcComponent implements OnInit { this.closeDis = true; } else if ( - this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") { + this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED") { this.moreDisabled = false; } @@ -427,12 +427,15 @@ export class WorklistMainIcComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); + this.common.setTotalNumberOfWorklistRequest(); setTimeout(() => { - this.messageSuccess = false; - // this.openNotificationsDashboard(); + this.nextNotfification(); - }, 5000); + }, 300); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -458,7 +461,7 @@ export class WorklistMainIcComponent implements OnInit { // } // } - public nextNotfification() { + public nextNotfification(flag?) { if (document.getElementById('notificationDynamicFieldsPO') != null) { document.getElementById('notificationDynamicFieldsPO').innerHTML = ''; } @@ -467,6 +470,9 @@ export class WorklistMainIcComponent implements OnInit { let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE; + if (this.common.filterKeys[previousRequestType] != 0 && flag != 'skip') + this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1) + index += 1; if (index < this.notificationArray.length) { @@ -477,9 +483,13 @@ export class WorklistMainIcComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } @@ -1210,13 +1220,17 @@ export class WorklistMainIcComponent implements OnInit { return; } else if (data.data.data == "Success") { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); + this.common.setTotalNumberOfWorklistRequest(); setTimeout(() => { - this.messageSuccess = false; + this.nextNotfification(); - }, 2000); + }, 300); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); @@ -1272,34 +1286,34 @@ export class WorklistMainIcComponent implements OnInit { this.actionButton(flag); } - returnDateTime(stringDate: string){ + returnDateTime(stringDate: string) { let allDateTime = stringDate.split(' '); let time = allDateTime[1].split(':', 2); - let fullDate = this.transform(stringDate); + let fullDate = this.transform(stringDate); return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; - + } locale = { en: { - // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } -}; + }; transform(value: string) { let x = new Date(Date.parse(value)); //return value.toLowerCase(); - let month = this.getMonthNameShort('en',x.getMonth()) - return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); + let month = this.getMonthNameShort('en', x.getMonth()) + return "" + x.getDate() + " " + month + " " + x.getFullYear(); } - - getMonthNameShort(lang,month) { + + getMonthNameShort(lang, month) { lang = lang && (lang in this.locale) ? lang : 'en'; return this.locale[lang].month_names_short[month]; -}; + }; } diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html index 59a8ead5..de2dff5f 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -665,7 +665,7 @@ - + {{'worklistMain, skip' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index c64765f5..bfdf25c6 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -368,12 +368,16 @@ export class WorklistMainMRComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; // this.openNotificationsDashboard(); + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); - }, 5000); + }, 100); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -402,7 +406,7 @@ export class WorklistMainMRComponent implements OnInit { // } - public nextNotfification() { + public nextNotfification(flag?) { //let itemExist = false; if (document.getElementById("notificationDynamicFieldsMR") != null) { document.getElementById("notificationDynamicFieldsMR").innerHTML = ""; @@ -411,7 +415,11 @@ export class WorklistMainMRComponent implements OnInit { let itemNo = this.getPassNotificationDetails.ROW_NUM; let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let previousRequest = this.notificationArray[index].REQUEST_TYPE; + let previousRequestType = this.notificationArray[index].ITEM_TYPE; + if (this.common.filterKeys[previousRequestType] != 0 && flag != 'skip') + this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1) + index += 1; if (index < this.notificationArray.length) { @@ -422,9 +430,13 @@ export class WorklistMainMRComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } @@ -1111,13 +1123,16 @@ export class WorklistMainMRComponent implements OnInit { return; } else if (data.data.data == 'Success') { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); - }, 2000); + }, 100); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); @@ -1147,7 +1162,7 @@ export class WorklistMainMRComponent implements OnInit { if (data.data == 'cancel' || data.data == undefined) { return; } else if (data.data == 'Success') { - // this.openNotificationsDashboard(); + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); } @@ -1218,35 +1233,35 @@ export class WorklistMainMRComponent implements OnInit { this.actionButton(flag); } - returnDateTime(stringDate: string){ + returnDateTime(stringDate: string) { let allDateTime = stringDate.split(' '); let time = allDateTime[1].split(':', 2); - let fullDate = this.transform(stringDate); + let fullDate = this.transform(stringDate); return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; - + } locale = { en: { - // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } -}; + }; transform(value: string) { let x = new Date(Date.parse(value)); //return value.toLowerCase(); - let month = this.getMonthNameShort('en',x.getMonth()) - return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); + let month = this.getMonthNameShort('en', x.getMonth()) + return "" + x.getDate() + " " + month + " " + x.getFullYear(); } - - getMonthNameShort(lang,month) { + + getMonthNameShort(lang, month) { lang = lang && (lang in this.locale) ? lang : 'en'; return this.locale[lang].month_names_short[month]; -}; + }; } diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html index 0c4f4e38..bd933831 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -633,7 +633,7 @@ {{reqInfo_label}} - + {{'worklistMain, skip' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index 844f3af6..f2e79a55 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -404,12 +404,14 @@ export class WorklistMainPoComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; - // this.openNotificationsDashboard(); + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); - }, 5000); + }, 100); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -435,7 +437,7 @@ export class WorklistMainPoComponent implements OnInit { // } // } - public nextNotfification() { + public nextNotfification(flag?) { if (document.getElementById('notificationDynamicFieldsPO') != null) { document.getElementById('notificationDynamicFieldsPO').innerHTML = ''; } @@ -443,7 +445,11 @@ export class WorklistMainPoComponent implements OnInit { let itemNo = this.getPassNotificationDetails.ROW_NUM; let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let previousRequest = this.notificationArray[index].REQUEST_TYPE; + let previousRequestType = this.notificationArray[index].ITEM_TYPE; + if (this.common.filterKeys[previousRequestType] != 0 && flag != 'skip') + this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1) + index += 1; if (index < this.notificationArray.length) { @@ -454,9 +460,13 @@ export class WorklistMainPoComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } @@ -1168,64 +1178,44 @@ export class WorklistMainPoComponent implements OnInit { } async openRepRolModal() { - - this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData'); - const modal = await this.modalCtrl.create({ component: WorkListReplacementRollComponent, backdropDismiss: false, - }); modal.cssClass = 'replaceRoll-modal'; - modal.onDidDismiss() .then((data) => { - console.log(data.data); - - if (data.data.data == "cancel" || data.data.data == undefined) { + if (data.data.data === 'cancel' || data.data.data === undefined) { return; - } else if (data.data.data == "Success") { - // this.openNotificationsDashboard(); - this.messageSuccess = true; + } else if (data.data.data === 'Success') { + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); - }, 2000); - // this.nextNotfification(); - + }, 100); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); return await modal.present(); - - - } async openRFCModal() { - - - - const modal = await this.modalCtrl.create({ component: WorkListRfcComponent, backdropDismiss: false, }); modal.cssClass = 'replaceRoll-modal'; - modal.onDidDismiss() .then((data) => { console.log(data.data); - if (data.data == "cancel" || data.data == undefined) { return; - } else { - - - } + } else { } }); return await modal.present(); @@ -1250,33 +1240,33 @@ export class WorklistMainPoComponent implements OnInit { this.actionButton(flag); } - returnDateTime(stringDate: string){ + returnDateTime(stringDate: string) { let allDateTime = stringDate.split(' '); let time = allDateTime[1].split(':', 2); - let fullDate = this.transform(stringDate); + let fullDate = this.transform(stringDate); return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; - + } locale = { en: { - // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } -}; + }; transform(value: string) { let x = new Date(Date.parse(value)); //return value.toLowerCase(); - let month = this.getMonthNameShort('en',x.getMonth()) - return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); + let month = this.getMonthNameShort('en', x.getMonth()) + return "" + x.getDate() + " " + month + " " + x.getFullYear(); } - - getMonthNameShort(lang,month) { + + getMonthNameShort(lang, month) { lang = lang && (lang in this.locale) ? lang : 'en'; return this.locale[lang].month_names_short[month]; -}; + }; } diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html index ccc730ee..69de2e55 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -411,7 +411,7 @@ {{reqInfo_label}} - + {{'worklistMain, skip' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index 83f68c84..74cc53ce 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -394,13 +394,11 @@ export class WorklistMainPRComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - // show succsfull popup - this.messageSuccess = true; - setTimeout(() => { - this.messageSuccess = false; - }, 5000); - // this.openNotificationsDashboard(); + this.common.greenToastPK('worklist', 'done-successfully'); + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -427,7 +425,7 @@ export class WorklistMainPRComponent implements OnInit { // } - public nextNotfification() { + public nextNotfification(flag?) { //let itemExist = false; if (document.getElementById("notificationDynamicFieldsPR") != null) { @@ -437,9 +435,12 @@ export class WorklistMainPRComponent implements OnInit { let itemNo = this.getPassNotificationDetails.ROW_NUM; console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); - console.log(index); - console.log(this.notificationArray); + let previousRequest = this.notificationArray[index].REQUEST_TYPE; + let previousRequestType = this.notificationArray[index].ITEM_TYPE; + if (this.common.filterKeys[previousRequestType] != 0 && flag != 'skip') + this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1) + index += 1; if (index < this.notificationArray.length) { @@ -450,9 +451,13 @@ export class WorklistMainPRComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { + //this.common.setTotalNumberOfWorklistRequest(true); + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } @@ -1111,13 +1116,16 @@ export class WorklistMainPRComponent implements OnInit { return; } else if (data.data.data == 'Success') { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); setTimeout(() => { - this.messageSuccess = false; + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); - }, 2000); + }, 100); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); @@ -1172,33 +1180,33 @@ export class WorklistMainPRComponent implements OnInit { this.actionButton(flag); } - returnDateTime(stringDate: string){ + returnDateTime(stringDate: string) { let allDateTime = stringDate.split(' '); let time = allDateTime[1].split(':', 2); - let fullDate = this.transform(stringDate); + let fullDate = this.transform(stringDate); return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; - + } locale = { en: { - // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } -}; + }; transform(value: string) { let x = new Date(Date.parse(value)); //return value.toLowerCase(); - let month = this.getMonthNameShort('en',x.getMonth()) - return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); + let month = this.getMonthNameShort('en', x.getMonth()) + return "" + x.getDate() + " " + month + " " + x.getFullYear(); } - - getMonthNameShort(lang,month) { + + getMonthNameShort(lang, month) { lang = lang && (lang in this.locale) ? lang : 'en'; return this.locale[lang].month_names_short[month]; -}; + }; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index 0d6073b6..0bc23f9c 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -47,9 +47,25 @@ - -
+ + +
+

{{'worklist, loading'| translate}}

+
+ +
+

{{ 'general, empty' | translate}}

+
+ +
@@ -68,6 +84,165 @@
+ +
+ + +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+
+
+
+ +
+ + +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+
+
+
+
+
{{ts.trPK('worklistMain','employee-on-leave')}} @@ -120,9 +295,21 @@ - + + getPassNotificationDetails?.REQUEST_TYPE == 'ADDRESS' || + getPassNotificationDetails?.REQUEST_TYPE == 'CONTACT' && + getPassNotificationDetails?.REQUEST_TYPE != 'PHONE_NUMBERS' && + getPassNotificationDetails?.REQUEST_TYPE != 'TERMINATION' && + getPassNotificationDetails?.REQUEST_TYPE != 'CEI'"> +
+

{{'worklist, loading'| translate}}

+
+ +
+

{{ 'general, empty' | translate}}

+
@@ -139,7 +326,7 @@ - + @@ -158,8 +345,101 @@
- + + +
+

{{'worklist, loading'| translate}}

+
+ +
+

{{ 'general, empty' | translate}}

+
+
+ + +
+ + + +
+ +
+
+
+
+
+
+
+ + + +
+

{{'worklist, loading'| translate}}

+
+ +
+

{{ 'general, empty' | translate}}

+
+
+ + +
+ + + +
+ +
+
+
+
+
+
+
+ + + +
+

{{'worklist, loading'| translate}}

+
+ +
+

{{ 'general, empty' | translate}}

+
+
+ + +
+ + + +
+ +
+
+
+
+
+
+
+ @@ -541,7 +821,7 @@ {{reqInfo_label}} - + {{'worklistMain, skip' | translate}} diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss index a60545fb..31893558 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -137,6 +137,15 @@ border-radius: 10px; margin: 10px; } + + .no-data-div{ + background: #ffffff; + height: 100%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + } .container { font-size: 14px; diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index fcfaf93e..4b9560b3 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -53,6 +53,8 @@ export class WorklistMainComponent implements OnInit { public static PASS_RES_ATTR = "passResAttr"; TransactionID: number = -999; notificationBodyRes: any = []; + stampNsNotificationBodyRes: any = []; + stampMsNotificationBodyRes: any = []; actionHistoryRes: any = []; notificationButtonRes: any; actionMode: any; @@ -88,6 +90,7 @@ export class WorklistMainComponent implements OnInit { newArr: any = []; selEmp: any; subordinatesleaveList: any = []; + allSubordinatesleaveList: any = []; private WorkListSubmitterInfoObj: WorkListSubmitterInfoRequest; submitterInfoRes: any; approveDis: boolean = false; @@ -107,6 +110,8 @@ export class WorklistMainComponent implements OnInit { closeDis: boolean = false; public selectedFilter: string; public arr_hr_req_only = []; + public showInformation = true; + constructor( public worklistService: WorklistService, @@ -143,6 +148,7 @@ export class WorklistMainComponent implements OnInit { false ); this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false); + console.log(this.selectedFilter); if (this.selEmp) { } else { this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { if (user) { @@ -209,6 +215,8 @@ export class WorklistMainComponent implements OnInit { HomeComponent.NOTIFICATION_DATA, false ); + console.log('/////////////////////////////////////'); + console.log(this.getPassNotificationDetails); this.notificationArray = [] this.subordinatesleaveList = []; @@ -217,7 +225,8 @@ export class WorklistMainComponent implements OnInit { false ); console.log(this.selectedFilter); - if (this.selectedFilter === 'HRSSA') { + if (this.selectedFilter === 'HRSSA' || this.selectedFilter === 'STAMP') { + console.log("ENAD") this.arr_hr_req_only = []; this.sortRequests(); } @@ -276,10 +285,62 @@ export class WorklistMainComponent implements OnInit { } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'ADDRESS') { this.getAddressNotification(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'BASIC_DETAILS') { - this.getBasicDetailsNotification(this.WorkListBodyObj) + this.getBasicDetailsNotification(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'STAMP_MS') { + this.getStampMSNotification(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'STAMP_NS') { + this.getStampNSNotification(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'TERMINATION') { + this.getTerminationNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'PHONE_NUMBERS') { + this.getPhoneNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'CONTACT') { + this.getContactNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE === 'CEI') { + this.getCEINotification(this.WorkListBodyObj); } } + getStampMSNotification(notificationBodyObj) { + this.worklistMainService + .getStampMSNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "STAMP_MS"); + }); + } + + getStampNSNotification(notificationBodyObj) { + this.worklistMainService + .getStampNSNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "STAMP_NS"); + }); + } + + getTerminationNotificationDetails(notificationBodyObj) { + this.worklistMainService + .getTerminationNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "TERMINATION"); + }); + } + + getPhoneNotificationDetails(notificationBodyObj) { + this.worklistMainService + .getPhoneNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "PHONE_NUMBERS"); + }); + } + + getContactNotificationDetails(notificationBodyObj) { + this.worklistMainService + .getContactNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "CONTACT"); + }); + } + getBasicDetailsNotification(notificationBodyObj) { this.worklistMainService .getBasicDetailNotificationBody(notificationBodyObj) @@ -295,6 +356,14 @@ export class WorklistMainComponent implements OnInit { }); } + getCEINotification(notificationBodyObj) { + this.worklistMainService + .getCEINotificationBody(notificationBodyObj) + .subscribe((result: MONotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "CEI"); + }); + } + getPRNotificationDetails(notificationBodyObj) { this.worklistMainService .getPRNotificationBody(notificationBodyObj) @@ -336,7 +405,7 @@ export class WorklistMainComponent implements OnInit { } handleWorkListBodyResult(result, Type) { - + this.showInformation = false; if (this.common.validResponse(result)) { this.pInformation = result.P_INFORMATION; this.pQuestion = result.P_QUESTION; @@ -367,18 +436,60 @@ export class WorklistMainComponent implements OnInit { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; } - } else if (Type === "ADDRESS"){ + } else if (Type === "ADDRESS") { + console.log(result.GetAddressNotificationBodyList) if (result.GetAddressNotificationBodyList) { this.notificationBodyRes = - result.GetAddressNotificationBodyList; + result.GetAddressNotificationBodyList; console.log(result); } - } else if (Type === "BASIC_DETAILS"){ + } else if (Type === "BASIC_DETAILS") { if (result.GetBasicDetNtfBodyList) { this.notificationBodyRes = result.GetBasicDetNtfBodyList; - console.log(result); - } + console.log(result); + } + } else if (Type === "CEI") { + if (result.GetCEICollectionNotificationBodyList) { + this.notificationBodyRes = + result.GetCEICollectionNotificationBodyList[0].Collection_Notification; + console.log(result.GetCEICollectionNotificationBodyList[0].Collection_Notification); + } + } + else if (Type === "STAMP_MS") { + if (result.GetStampMsNotificationBodyList) { + this.stampMsNotificationBodyRes = + result.GetStampMsNotificationBodyList; + console.log(result); + } + } + else if (Type === "STAMP_NS") { + if (result.GetStampNsNotificationBodyList) { + this.stampNsNotificationBodyRes = + result.GetStampNsNotificationBodyList; + console.log(result); + } + } + else if (Type === "PHONE_NUMBERS") { + if (result.GetPhonesNotificationBodyList) { + this.notificationBodyRes = + result.GetPhonesNotificationBodyList; + console.log(result); + } + } + else if (Type === "TERMINATION") { + if (result.GetTermNotificationBodyList) { + this.notificationBodyRes = + result.GetTermNotificationBodyList; + console.log(result); + } + } + else if (Type === "CONTACT") { + if (result.GetContactNotificationBodyList) { + this.notificationBodyRes = + result.GetContactNotificationBodyList.ContactNotificationBody; + console.log(result); + } } } } //End handleWorkListBodyResult @@ -448,12 +559,14 @@ export class WorklistMainComponent implements OnInit { // this.notificationArray.splice(i, 1); // } // } - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); + this.common.setTotalNumberOfWorklistRequest(); setTimeout(() => { - this.messageSuccess = false; - // this.openNotificationsDashboard(); this.nextNotfification(); - }, 2000); + }, 300); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -483,18 +596,27 @@ export class WorklistMainComponent implements OnInit { // } - public nextNotfification() { + public nextNotfification(flag?) { if (document.getElementById("notificationDynamicFields") != null) { document.getElementById("notificationDynamicFields").innerHTML = ""; } + let itemNo = this.getPassNotificationDetails.ROW_NUM; console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); console.log(index); console.log(this.notificationArray); let previousRequest = this.notificationArray[index].REQUEST_TYPE; - index += 1; + let itemType = this.notificationArray[index].ITEM_TYPE; + if (previousRequest == 'STAMP_MS' || previousRequest == 'STAMP_NS') { + previousRequest = 'STAMP'; + } else { + previousRequest = itemType; + } + if (this.common.filterKeys[previousRequest] != 0 && flag != 'skip') + this.common.filterKeys[previousRequest] = (this.common.filterKeys[previousRequest] - 1) + index += 1; if (index < this.notificationArray.length) { this.activeSegment = 'info'; if (this.selectedFilter === 'ALL') { @@ -508,11 +630,15 @@ export class WorklistMainComponent implements OnInit { this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA); this.intializeNotificationDetail(); } else { + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + //this.common.setTotalNumberOfWorklistRequest(true); this.common.openNotificationPage(); } } } } else { + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + //this.common.setTotalNumberOfWorklistRequest(true); this.common.openNotificationPage(); } @@ -905,7 +1031,7 @@ export class WorklistMainComponent implements OnInit { let jobTitle = title.split('.'); if (jobTitle && jobTitle.length > 1) { jobName = jobTitle[0] + " " + jobTitle[1]; - }​ + } } else { jobName = ''; } @@ -986,7 +1112,14 @@ export class WorklistMainComponent implements OnInit { public handleSubordinatesLeavesResult(result) { if (this.common.validResponse(result)) { if (this.common.hasData(result.SubordinatesOnLeavesList)) { - this.subordinatesleaveList = result.SubordinatesOnLeavesList; + this.allSubordinatesleaveList = result.SubordinatesOnLeavesList; + // this.subordinatesleaveList.push(this.allSubordinatesleaveList.find( + // el => el.EMPLOYEE_NUMBER !== this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER)); + this.allSubordinatesleaveList.forEach(element => { + if (element.EMPLOYEE_NUMBER !== this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER) { + this.subordinatesleaveList.push(element); + } + }); } } } @@ -1021,12 +1154,16 @@ export class WorklistMainComponent implements OnInit { if (data.data.data == "cancel" || data.data.data == undefined) { return; } else if (data.data.data == "Success") { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'done-successfully'); + this.common.setTotalNumberOfWorklistRequest(); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.nextNotfification(); - }, 2000); + }, 300); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); return await modal.present(); @@ -1045,6 +1182,7 @@ export class WorklistMainComponent implements OnInit { return; } else if (data.data == "Success") { // this.openNotificationsDashboard(); + this.common.setTotalNumberOfWorklistRequest(); this.nextNotfification(); } }); @@ -1113,41 +1251,48 @@ export class WorklistMainComponent implements OnInit { } sortRequests() { for (let i = 0; i < this.notificationArray.length; i++) { - if (this.notificationArray[i].ITEM_TYPE === 'HRSSA') { + if (this.notificationArray[i].ITEM_TYPE === 'HRSSA' || this.notificationArray[i].ITEM_TYPE === 'STAMP') { this.arr_hr_req_only.push(this.notificationArray[i]); } } console.log(this.arr_hr_req_only); } - returnDateTime(stringDate: string){ + returnDateTime(stringDate: string) { let allDateTime = stringDate.split(' '); let time = allDateTime[1].split(':', 2); - let fullDate = this.transform(stringDate); + let fullDate = this.transform(stringDate); return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2]; - + } locale = { en: { - // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } -}; + }; transform(value: string) { let x = new Date(Date.parse(value)); //return value.toLowerCase(); - let month = this.getMonthNameShort('en',x.getMonth()) - return ""+ x.getDate()+" "+ month +" "+x.getFullYear(); + let month = this.getMonthNameShort('en', x.getMonth()) + return "" + x.getDate() + " " + month + " " + x.getFullYear(); } - - getMonthNameShort(lang,month) { + getMonthNameShort(lang, month) { lang = lang && (lang in this.locale) ? lang : 'en'; return this.locale[lang].month_names_short[month]; -} + } + + showLoading(notificationList) { + if (notificationList.length < 0) { + return true; + } else if (notificationList === []) { + return false; + } else { return true; } + } } diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.html b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.html new file mode 100644 index 00000000..490f2123 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.html @@ -0,0 +1,41 @@ + + + {{ 'worklist, worklist-setting' | translate}} + + + + + + + + + +
+

{{ 'worklist, turn-on-notification' | translate}}

+
+
+ + + + +

item type

+
+

FYA

+          +

FYI

+
+ + +

{{data.ITEM_TYPE}}

+
+ +     + +
+
+
+
+ + + {{ 'worklist, save-changes' | translate}} + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss new file mode 100644 index 00000000..927b8dc3 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.scss @@ -0,0 +1,7 @@ +.header-toolbar{ + --background: #269DB8; +} + +ion-toggle{ + --background-checked: #269DB8; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts new file mode 100644 index 00000000..627b60c6 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistSettingComponent } from './worklist-setting.component'; + +describe('WorklistSettingComponent', () => { + let component: WorklistSettingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistSettingComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts new file mode 100644 index 00000000..1521d3e6 --- /dev/null +++ b/Mohem/src/app/notification/worklist-setting/worklist-setting.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { UserItemTypes } from '../models/userItemTypeRequest'; +import { WorklistMainService } from '../service/work-list.main.service'; + +@Component({ + selector: 'app-worklist-setting', + templateUrl: './worklist-setting.component.html', + styleUrls: ['./worklist-setting.component.scss'], +}) +export class WorklistSettingComponent implements OnInit { + + notificationList = []; + request = []; + isChange = false; + + public direction: string; + + constructor( + public modalController: ModalController, + public ts: TranslatorService, + public common: CommonService, + public workListService: WorklistMainService) {} + + + ngOnInit() { + this.direction = TranslatorService.getCurrentDirection(); + this.workListService.getWorklistNotifications() + .subscribe((result: any) => { + this.notificationList = result.GetUserItemTypesList; + for (let i = 0; i < this.notificationList.length; i++) { + this.request[i] = { + P_FYA_ENABLED_FALG: this.notificationList[i].FYA_ENABLED_FALG, + P_FYI_ENABLED_FLAG: this.notificationList[i].FYI_ENABLED_FLAG, + P_ITEM_TYPE: this.notificationList[i].ITEM_TYPE, + ItemID: i + }; + } + }); + } + + chnageToggle(toggleValue, type, val) { + if ( val === 'Y') { + val = 'N'; + } else if ( val === 'N') { + val = 'Y'; + } + this.notificationList.forEach((el, index) => { + if ( el.ITEM_TYPE === toggleValue.ITEM_TYPE) { + if (type === 'FYI') { + this.request[index].P_FYI_ENABLED_FLAG = val; + } else if (type === 'FYA') { + this.request[index].P_FYA_ENABLED_FALG = val; + } + this.request[index].ItemID = index; + } + this.request[index].P_ITEM_TYPE = el.ITEM_TYPE; + }); + } + + saveChanges() { + const body = { + UpdateItemTypeList: this.request + }; + this.workListService.updateWorklistNotifications(body) + .subscribe((result: any) => { + if (result.UpdateItemTypeSuccessList) { + if (result.UpdateUserItemTypesList) { + this.common.greenToastPK('worklist', 'save-successfully'); + this.dismiss(); + } else { + this.common.redToastPK('worklist', 'save-error'); + } + } else { + this.common.redToastPK('worklist', 'save-error'); + } + }); + } + + public dismiss() { + this.common.sharedService.setSharedData(false, 'loadWorkList'); + this.common.back(); + } +} diff --git a/Mohem/src/app/offersdiscount/filter/filter.component.html b/Mohem/src/app/offersdiscount/filter/filter.component.html index f8391b3b..ed6856df 100644 --- a/Mohem/src/app/offersdiscount/filter/filter.component.html +++ b/Mohem/src/app/offersdiscount/filter/filter.component.html @@ -18,7 +18,7 @@ {{key.categoryName_ar}} -
+
diff --git a/Mohem/src/app/offersdiscount/home/home.component.html b/Mohem/src/app/offersdiscount/home/home.component.html index 9c5cadcf..b84354f8 100644 --- a/Mohem/src/app/offersdiscount/home/home.component.html +++ b/Mohem/src/app/offersdiscount/home/home.component.html @@ -33,7 +33,7 @@
-
+
diff --git a/Mohem/src/app/offersdiscount/home/home.component.ts b/Mohem/src/app/offersdiscount/home/home.component.ts index b73c910c..8ee773ac 100644 --- a/Mohem/src/app/offersdiscount/home/home.component.ts +++ b/Mohem/src/app/offersdiscount/home/home.component.ts @@ -5,7 +5,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { OfferDiscountService } from '../services/service'; import { IonInfiniteScroll } from '@ionic/angular'; -import { DomSanitizer} from '@angular/platform-browser'; +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -26,14 +26,20 @@ export class HomeComponent implements AfterViewInit { itemCounter = 1; itemType: any; isData = true; - // categories:any = []; + allCategory: any = { + categoryID: 0, + content: '', + isActive: true, + categoryName_en: "All", + categoryName_ar: "الجميع", + } constructor( - public ts: TranslatorService, - public modalController: ModalController, - public cs: CommonService, - public offersService: OfferDiscountService, + public ts: TranslatorService, + public modalController: ModalController, + public cs: CommonService, + public offersService: OfferDiscountService, public route: ActivatedRoute, - private sanitizer: DomSanitizer) { + ) { this.route .params.subscribe(val => { @@ -62,9 +68,11 @@ export class HomeComponent implements AfterViewInit { getCategories() { this.offersService.getCategories({}).subscribe((result) => { this.categories = JSON.parse(result.Mohemm_ITG_ResponseItem).result.data; //result.result.data; - for (let i = 0; i < this.categories.length; i++) { - this.categories[i].content = this.sanitizer.bypassSecurityTrustHtml(this.categories[i].content); - } + //this.allCategory.content = this.sanitizer.bypassSecurityTrustHtml(); + this.categories.unshift(this.allCategory); + // for (let i = 0; i < this.categories.length; i++) { + // this.categories[i].content = this.sanitizer.bypassSecurityTrustHtml(this.categories[i].content); + // } this.cs.sharedService.setSharedData(this.categories, OfferDiscountService.categories); }); } @@ -80,13 +88,13 @@ export class HomeComponent implements AfterViewInit { getOfferDiscount(pageNo?, categoryId?) { this.cs.startLoading(); if (categoryId) { - this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'),pageNo, categoryId).subscribe((res) => { + this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), pageNo, categoryId).subscribe((res) => { var data = JSON.parse(res['Mohemm_ITG_ResponseItem']); this.cs.stopLoading(); if (data['result']) { this.displayOffers(data['result']); this.isData = true; - }else{ + } else { this.isData = false; } }); @@ -94,10 +102,10 @@ export class HomeComponent implements AfterViewInit { this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((res) => { var data = JSON.parse(res['Mohemm_ITG_ResponseItem']); this.cs.stopLoading(); - if (data['result']){ + if (data['result']) { this.displayOffers(data['result']); this.isData = true; - } else{this.isData = false;} + } else { this.isData = false; } }); } @@ -107,19 +115,25 @@ export class HomeComponent implements AfterViewInit { if (data['data']) { var parseJSON = data['data']; var offers = JSON.parse(parseJSON); - this.offersData = offers; + console.log(offers); + this.offersData = this.filterActiveItems(offers); + console.log(this.offersData); this.tempSearch = this.offersData; } } - + filterActiveItems(offers) { + return offers.filter((res) => { + return res['IsActive'] == 'True'; + }); + } filterOffers(key) { - if(this.direction === 'ltr') { + if (this.direction === 'ltr') { this.activeClass = key.categoryName_en; - }else { + } else { this.activeClass = key.categoryName_ar } this.itemType = key.id; - this.getOfferDiscount(1,this.itemType) + this.getOfferDiscount(1, this.itemType) } checkDate(date) { @@ -142,9 +156,9 @@ export class HomeComponent implements AfterViewInit { search(t) { console.log(this.tempSearch); - if(t === ''){ + if (t === '') { this.offersData = this.tempSearch; - } else{ + } else { this.offersData = this.tempSearch.filter((post) => { return (post.Title.toLowerCase().indexOf(t.toLowerCase()) > -1); }); @@ -172,8 +186,9 @@ export class HomeComponent implements AfterViewInit { console.log(this.itemCounter); this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), this.itemCounter, this.itemType).subscribe((res) => { const data = JSON.parse(res['Mohemm_ITG_ResponseItem']); - if (data['result']){ - const allItem = JSON.parse(data.result['data']); + if (data['result']) { + var allItem = JSON.parse(data.result['data']); + allItem = this.filterActiveItems(allItem); if (allItem) { allItem.forEach(element => { this.offersData.push(element); @@ -189,8 +204,9 @@ export class HomeComponent implements AfterViewInit { console.log(this.itemCounter); this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), this.itemCounter).subscribe((res) => { const data = JSON.parse(res['Mohemm_ITG_ResponseItem']); - if (data['result']){ - const allItem = JSON.parse(data.result['data']); + if (data['result']) { + var allItem = JSON.parse(data.result['data']); + allItem = this.filterActiveItems(allItem); if (allItem) { allItem.forEach(element => { this.offersData.push(element); diff --git a/Mohem/src/app/offersdiscount/location/location.component.html b/Mohem/src/app/offersdiscount/location/location.component.html new file mode 100644 index 00000000..c7fb1856 --- /dev/null +++ b/Mohem/src/app/offersdiscount/location/location.component.html @@ -0,0 +1,7 @@ + + + +
+ +
+
\ No newline at end of file diff --git a/Mohem/src/app/offersdiscount/location/location.component.scss b/Mohem/src/app/offersdiscount/location/location.component.scss new file mode 100644 index 00000000..70d9ad57 --- /dev/null +++ b/Mohem/src/app/offersdiscount/location/location.component.scss @@ -0,0 +1,4 @@ +#map { + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/Mohem/src/app/offersdiscount/location/location.component.spec.ts b/Mohem/src/app/offersdiscount/location/location.component.spec.ts new file mode 100644 index 00000000..26caad16 --- /dev/null +++ b/Mohem/src/app/offersdiscount/location/location.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LocationComponent } from './location.component'; + +describe('LocationComponent', () => { + let component: LocationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LocationComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LocationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/offersdiscount/location/location.component.ts b/Mohem/src/app/offersdiscount/location/location.component.ts new file mode 100644 index 00000000..7c899f54 --- /dev/null +++ b/Mohem/src/app/offersdiscount/location/location.component.ts @@ -0,0 +1,79 @@ +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { HMGUtils } from 'src/app/hmg-common/hmg_utils'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { OfferDiscountService } from '../services/service'; +declare var google; +@Component({ + selector: 'app-location', + templateUrl: './location.component.html', + styleUrls: ['./location.component.scss'], +}) + +export class LocationComponent implements OnInit { + @ViewChild('map') mapContainer: ElementRef; + locations: any = []; + map: any; + offerDetails: any; + constructor(public hmgUtils: HMGUtils, public route: ActivatedRoute, public cs: CommonService) { + this.route + .params.subscribe(val => { + setTimeout(() => { + this.ionEnter(); + }, 100); + }); + } + ionEnter() { + this.locations = this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false); + this.offerDetails = this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false); + this.displayMap(); + } + ngOnInit() { + + } + displayMap() { + + const map = new google.maps.Map( + document.getElementById("map") as HTMLElement, + { + zoom: 10, + center: { lat: 24.7136, lng: 46.6753 }, + } + ); + + this.setMarkers(map); + + } + setMarkers(map) { + + for (let i = 0; i < this.locations.length; i++) { + const loc = this.locations[i]; + const infoWindow = new google.maps.InfoWindow(); + var marker = new google.maps.Marker({ + position: { lat: loc.latitude, lng: loc.longitude }, + map, + // icon: image, + // shape: shape, + title: this.offerDetails.Title, + + }); + marker.addListener("click", () => { + this.cs.openLocation(loc.latitude, loc.longitude) + }); + } + this.hmgUtils.getCurrentLocation((resp) => { + console.log(resp); + if (resp) { + const latLng = new google.maps.LatLng(resp.latitude, resp.longitude); + const mapOptions = { + center: latLng, + zoom: 17, + mapTypeId: google.maps.MapTypeId.ROADMAP, + myLocation: true + }; + + this.map = new google.maps.Map(this.mapContainer.nativeElement, mapOptions); + }; + }) + } +} diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html index f3a127c8..1d9c3d44 100644 --- a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html +++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html @@ -11,9 +11,11 @@
-
- - + + + {{details.Title}} {{details.Title_AR}} @@ -44,6 +46,12 @@
+ + + + +

{{ts.trPK('itemforsale','location')}}

+
@@ -84,7 +92,7 @@ - + diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss index b487cc9b..5ea4054b 100644 --- a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss +++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss @@ -144,4 +144,9 @@ ion-card{ margin: 2px 0px 5px -3px; font-size: 14px; font-weight: bold; +} +.location-text{ + font-weight: bold; + font-size: 14px; + text-decoration: underline; } \ No newline at end of file diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts index 20a253b7..ee364abe 100644 --- a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts +++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts @@ -38,9 +38,9 @@ export class OfferDetailsComponent implements OnInit { console.log(this.details); const offerMessage = this.direction === 'ltr' ? this.details.Description : this.details.Description_AR; const offerSubject = this.direction === 'ltr' ? this.details.Title : this.details.Title_AR; - + const options = { - message: this.stripHtml(offerMessage), + message: this.stripHtml(offerMessage), subject: this.stripHtml(offerSubject), files: [this.details.Banner_Image] } @@ -56,4 +56,16 @@ export class OfferDetailsComponent implements OnInit { }, 200); } + openLocation() { + this.cs.navigateForward('/offersdiscount/location'); + } + getLocation() { + this.cs.startLoading(); + this.offersService.getOfferLocation({ OfferId: this.details.rowID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.cs.stopLoading(); + result = JSON.parse(result.Mohemm_ITG_ResponseItem).result.data; + this.cs.sharedService.setSharedData(result, OfferDiscountService.selected_offers); + this.openLocation(); + }) + } } diff --git a/Mohem/src/app/offersdiscount/offersdiscount.module.ts b/Mohem/src/app/offersdiscount/offersdiscount.module.ts index c64e20bb..fa0495d4 100644 --- a/Mohem/src/app/offersdiscount/offersdiscount.module.ts +++ b/Mohem/src/app/offersdiscount/offersdiscount.module.ts @@ -11,6 +11,9 @@ import { OfferDetailsComponent } from './offer-details/offer-details.component'; import { HmgCommonModule } from '../hmg-common/hmg-common.module'; import { OfferDiscountService } from './services/service'; import { FilterComponent } from './filter/filter.component'; +import { LocationComponent } from './location/location.component'; +import { ImageModalModule } from '../hmg-common/ui/image-modal/image-modal.module'; + const routes: Routes = [ @@ -30,6 +33,10 @@ const routes: Routes = [ path: 'filter-page', component: FilterComponent }, + { + path: 'location', + component: LocationComponent + }, ], } ]; @@ -42,10 +49,12 @@ const routes: Routes = [ FormsModule, IonicModule, HmgCommonModule, + ImageModalModule, RouterModule.forChild(routes) ], - declarations: [OffersdiscountPage, HomeComponent, OfferDetailsComponent, FilterComponent], + declarations: [OffersdiscountPage, HomeComponent, OfferDetailsComponent, FilterComponent, LocationComponent], entryComponents: [FilterComponent], - providers: [OfferDiscountService, SocialSharing] + providers: [OfferDiscountService, SocialSharing], + }) export class OffersdiscountPageModule { } diff --git a/Mohem/src/app/offersdiscount/services/service.ts b/Mohem/src/app/offersdiscount/services/service.ts index b3bd357f..2a838807 100644 --- a/Mohem/src/app/offersdiscount/services/service.ts +++ b/Mohem/src/app/offersdiscount/services/service.ts @@ -15,8 +15,9 @@ export class OfferDiscountService { public static related_offers = 'related-offers'; public static selected_filters = 'selected-filters'; public static categories = 'categories'; + public static offer_location = 'offer_location'; public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetCategories'; - + public static offerLocation = 'Services/COCWS.svc/REST/Mohemm_ITG_OffersLocation'; constructor( public con: ConnectorService, private authService: AuthenticationService, @@ -39,7 +40,7 @@ export class OfferDiscountService { return this.con.postNoLoad(OfferDiscountService.offersDiscountData, request, onError, errorLabel); } - getCategories(request: any, onError?: any, errorLabel?: string): Observable { + getCategories(request: any, onError?: any, errorLabel?: string): Observable { this.authService.authenticateRequest(request); request['EmployeeNumber'] = request.UserName; request['ItgChannelId'] = 3; @@ -56,4 +57,10 @@ export class OfferDiscountService { errorLabel ); } + public getOfferLocation(request: any, onError?: any, errorLabel?: string) { + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.UserName; + + return this.con.postNoLoad(OfferDiscountService.offerLocation, request, onError, errorLabel); + } } \ No newline at end of file diff --git a/Mohem/src/app/payslip/home/home.component.scss b/Mohem/src/app/payslip/home/home.component.scss index 5b6eeb2b..1406aede 100644 --- a/Mohem/src/app/payslip/home/home.component.scss +++ b/Mohem/src/app/payslip/home/home.component.scss @@ -354,6 +354,7 @@ .hrTitle{ margin-left: 11px !important; font-size: 15px !important; + margin-right: 11px !important; } .date{ font-size: 15px !important; diff --git a/Mohem/src/app/pending-transaction/home/home.component.html b/Mohem/src/app/pending-transaction/home/home.component.html new file mode 100644 index 00000000..6ac756a4 --- /dev/null +++ b/Mohem/src/app/pending-transaction/home/home.component.html @@ -0,0 +1,102 @@ + + +
+ + + +
+
+
+
+
+ + +
+ + +
+ +
+
+
+ + + +
+ + {{ 'general,from-date' | translate}} + +
+
+ + +
+ + {{ 'general,to-date' | translate}} + +
+
+
+
+ +
+
+
+ + + + +

{{'general, noData' | translate}}

+
+
+
+ +
{{transaction.CREATION_DATE}}
+ + +

{{'transaction, created-for' | translate}}

+

{{transaction.TRANSACTION_CREATED_FOR}}

+
+ + +
+

{{'transaction, request-type' | translate}}

+

{{transaction.REQUEST_TYPE}}

+
+
+
+
+ +
+
+
+ + +
+ + {{'general, submit' | translate}} + + {{'general, reset' | translate}} +
+
+ diff --git a/Mohem/src/app/pending-transaction/home/home.component.scss b/Mohem/src/app/pending-transaction/home/home.component.scss new file mode 100644 index 00000000..d5c8e7ac --- /dev/null +++ b/Mohem/src/app/pending-transaction/home/home.component.scss @@ -0,0 +1,117 @@ +.display-created{ + display: inline-block; + + color:#000; +} +#containerDiv{ + margin-top:20px; +} +.padding{ + padding-left:5px; + padding-right: 5px; +} +.bold{ + font-weight: bold; + font-size: 16px; +} +.color-black{ + color:#000; +} +.date-en{ + position: absolute; + font-size: 14px; + padding: 10px; + right:0; + width: 100px; + color:#969696; + margin: -8px; +} +.date-ar{ + position: absolute; + font-size: 14px; + padding: 10px; + left: 10px; + width: 100px; + color:#969696; + margin: -8px; +} +.transaction-list{ + margin-top:20px; +} +.date-container{ + margin:0px 20px; +} + +.label{ + font-size: 16px; + // margin-left: 15px; + color: #a2a5a6 !important; + display: block; + overflow: hidden; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + /* font-size: inherit; */ + // text-overflow: ellipsis; + // white-space: nowrap; + white-space: normal; + // padding-top: 10px; + padding: 5px 0px; + padding-left: 10px !important; + margin: 10px auto; + :root[dir="ltr"]{ + font-family: var(--fontFamilySemiBoldEN) !important; + } + :root[dir="rtl"]{ + font-family: var(--fontFamilyIOSAR) !important; + font-weight: bold; + } + + +} + +.Field-en{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 15px; + padding-left: 20px !important; + padding-top: 6px !important; + color: #999999 !important; +} + +.Field-ar{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 20px; + padding-right: 20px !important; + padding-top: 6px !important; + color: #999999 !important; +} +select{ + width: 300px !important; + border: none !important; +} +.padding_date{ + padding-left:5px !important; +} +.date-icon{ + font-size: 20px; + left: -1px; + position: relative; + top: 2px; +} +ion-card{ + padding: 20px 10px 20px 10px; + border-radius: 11px; + box-shadow: 0px 1px 2px 1px #ccc; +} +.display-inline{ + display:inline-block; + +} +.red{ +color:#CA3332; +font-weight: 600; +margin:0px 5px; +} \ No newline at end of file diff --git a/Mohem/src/app/pending-transaction/home/home.component.spec.ts b/Mohem/src/app/pending-transaction/home/home.component.spec.ts new file mode 100644 index 00000000..5ec1377b --- /dev/null +++ b/Mohem/src/app/pending-transaction/home/home.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/pending-transaction/home/home.component.ts b/Mohem/src/app/pending-transaction/home/home.component.ts new file mode 100644 index 00000000..e722d588 --- /dev/null +++ b/Mohem/src/app/pending-transaction/home/home.component.ts @@ -0,0 +1,56 @@ +import { Component, ElementRef, OnInit } from '@angular/core'; +import { EitService } from 'src/app/eit/services/eit.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ServiceService } from '../service/service.service'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'], +}) +export class HomeComponent implements OnInit { + public direction: any; + public transactions: any = []; + public selectedTransaction: any; + public dateTo: any; + public dateFrom: any; + public transactionDetails; + constructor(public cs: CommonService, private elementRef: ElementRef, public trServcice: ServiceService, public ts: TranslatorService, public eitService: EitService) { } + + + ngOnInit() { + + + this.getPendingTransaction(); + this.direction = TranslatorService.getCurrentLanguageName(); + + } + getPendingTransaction() { + this.cs.startLoading(); + this.trServcice.getPendingRequests({ + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + this.cs.stopLoading(); + this.transactions = response['GetPendingReqFunctionsList']; + }) + } + getPendingRequestDetails() { + this.cs.startLoading(); + this.trServcice.getPendingRequestDetails({ + 'P_FUNCTION_ID': this.selectedTransaction, + 'P_CREATION_DATE_FROM': "/Date(" + Date.parse(this.dateFrom) + '+0300' + ")/", + 'P_CREATION_DATE_TO': "/Date(" + Date.parse(this.dateTo) + '+0300' + ")/", + 'P_PAGE_NUM': 1, + 'P_PAGE_LIMIT': 20, + + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + this.cs.stopLoading(); + this.transactionDetails = response['GetPendingReqDetailsList']; + }) + } + isValid() { + if (this.selectedTransaction && this.dateFrom && this.dateTo) + return true; + else return false + } +} diff --git a/Mohem/src/app/pending-transaction/pending-transaction.module.ts b/Mohem/src/app/pending-transaction/pending-transaction.module.ts new file mode 100644 index 00000000..1d95ebc2 --- /dev/null +++ b/Mohem/src/app/pending-transaction/pending-transaction.module.ts @@ -0,0 +1,36 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { Routes, RouterModule } from '@angular/router'; + +import { IonicModule } from '@ionic/angular'; + +import { PendingTransactionPage } from './pending-transaction.page'; +import { HomeComponent } from './home/home.component'; +import { ServiceService } from './service/service.service'; +import { HmgCommonModule } from '../hmg-common/hmg-common.module'; +const routes: Routes = [ + { + path: '', + component: PendingTransactionPage, + children: [ + { + path: 'home', + component: HomeComponent + }, + ] + } +]; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + RouterModule.forChild(routes), + HmgCommonModule + ], + declarations: [PendingTransactionPage, HomeComponent], + providers: [ServiceService] +}) +export class PendingTransactionPageModule { } diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.html b/Mohem/src/app/pending-transaction/pending-transaction.page.html new file mode 100644 index 00000000..d26b79fd --- /dev/null +++ b/Mohem/src/app/pending-transaction/pending-transaction.page.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.scss b/Mohem/src/app/pending-transaction/pending-transaction.page.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts b/Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts new file mode 100644 index 00000000..b6a16ed9 --- /dev/null +++ b/Mohem/src/app/pending-transaction/pending-transaction.page.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PendingTransactionPage } from './pending-transaction.page'; + +describe('PendingTransactionPage', () => { + let component: PendingTransactionPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PendingTransactionPage ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PendingTransactionPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/pending-transaction/pending-transaction.page.ts b/Mohem/src/app/pending-transaction/pending-transaction.page.ts new file mode 100644 index 00000000..1377c463 --- /dev/null +++ b/Mohem/src/app/pending-transaction/pending-transaction.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-pending-transaction', + templateUrl: './pending-transaction.page.html', + styleUrls: ['./pending-transaction.page.scss'], +}) +export class PendingTransactionPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/Mohem/src/app/pending-transaction/service/service.service.spec.ts b/Mohem/src/app/pending-transaction/service/service.service.spec.ts new file mode 100644 index 00000000..d2923aa3 --- /dev/null +++ b/Mohem/src/app/pending-transaction/service/service.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { ServiceService } from './service.service'; + +describe('ServiceService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: ServiceService = TestBed.get(ServiceService); + expect(service).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/pending-transaction/service/service.service.ts b/Mohem/src/app/pending-transaction/service/service.service.ts new file mode 100644 index 00000000..f5521403 --- /dev/null +++ b/Mohem/src/app/pending-transaction/service/service.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@angular/core'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ServiceService { + + + public static GET_PENDING_REQ_FUNCTIONS = 'Services/ERP.svc/REST/GET_PENDING_REQ_FUNCTIONS'; + public static GET_PENDING_REQ_DETAILS = 'Services/ERP.svc/REST/GET_PENDING_REQ_DETAILS'; + constructor( + public con: ConnectorService, + private authService: AuthenticationService, + public cs: CommonService + ) { } + + getPendingRequests(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ServiceService.GET_PENDING_REQ_FUNCTIONS, + request, + onError, + errorLabel + ); + } + getPendingRequestDetails(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ServiceService.GET_PENDING_REQ_DETAILS, + request, + onError, + errorLabel + ); + } + + + + +} diff --git a/Mohem/src/app/profile/add-address/add-address.component.html b/Mohem/src/app/profile/add-address/add-address.component.html index b66eab09..695cd8b3 100644 --- a/Mohem/src/app/profile/add-address/add-address.component.html +++ b/Mohem/src/app/profile/add-address/add-address.component.html @@ -21,7 +21,7 @@ - Effective Date + {{'vacation-rule, effectiveDate' | translate}} diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html index ce1335e8..352a55a6 100644 --- a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html +++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html @@ -10,7 +10,7 @@ - Effective Date + {{'vacation-rule, effectiveDate' | translate}} {{showEffectiveDate}}
diff --git a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.html b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.html new file mode 100644 index 00000000..4a92fa86 --- /dev/null +++ b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.html @@ -0,0 +1,34 @@ + + + + + + + + Effective Date + {{showEffectiveDate}} + +
+
+
+ + {{ts.trPK('submitAbsence','endDate')}} + + +
+ + +
+ + {{'vacation-rule, next-label' | translate}} + +
+
\ No newline at end of file diff --git a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss new file mode 100644 index 00000000..764fe8af --- /dev/null +++ b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss @@ -0,0 +1,52 @@ +.date-container{ + margin:0px 20px; +} + +.label{ + font-size: 16px; + // margin-left: 15px; + color: #a2a5a6 !important; + display: block; + overflow: hidden; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + /* font-size: inherit; */ + // text-overflow: ellipsis; + // white-space: nowrap; + white-space: normal; + // padding-top: 10px; + padding: 5px 0px; + padding-left: 10px !important; + margin: 10px auto; + :root[dir="ltr"]{ + font-family: var(--fontFamilySemiBoldEN) !important; + } + :root[dir="rtl"]{ + font-family: var(--fontFamilyIOSAR) !important; + font-weight: bold; + } + + +} + +.Field-en{ + border-radius: 30px; + border: 1px solid #a2a5a6 !important; + margin-bottom: 0px; + padding-left: 20px !important; + padding-top: 0px !important; + color: #999999 !important; + height: 80px; +} + +.Field-ar{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 20px; + padding-right: 20px !important; + padding-top: 0px !important; + color: #999999 !important; + height:80px +} \ No newline at end of file diff --git a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.spec.ts b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.spec.ts new file mode 100644 index 00000000..d11ca101 --- /dev/null +++ b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddUpdateContactComponent } from './add-update-contact.component'; + +describe('AddUpdateContactComponent', () => { + let component: AddUpdateContactComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AddUpdateContactComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AddUpdateContactComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts new file mode 100644 index 00000000..f8aaf42a --- /dev/null +++ b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts @@ -0,0 +1,2134 @@ + +import { EITTransactionsRequest } from 'src/app/eit/models/EITTransactionsReq'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { MenuEntry } from 'src/app/hmg-common/services/menu/models/menu.entry'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes'; +import { ButtonInput } from 'src/app/uI-elements/button.input'; +import { DateTimeInput } from 'src/app/uI-elements/date-time.input'; +import { DateInput } from 'src/app/uI-elements/date.input'; +import { HiddenInput } from 'src/app/uI-elements/hidden.input'; +import { NumberInput } from 'src/app/uI-elements/number.input'; +import { SelectInput } from 'src/app/uI-elements/select.input'; +import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { TimeInput } from 'src/app/uI-elements/time.input'; +import { BasicRequest } from '../models/basic.request'; +import { ProfileService } from '../service/profile.service'; +import * as moment from "moment"; +import { EIT_ACTION } from 'src/app/eit/models/submit.eit.action'; +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { DatePicker } from '@ionic-native/date-picker/ngx'; +import { ActivatedRoute } from '@angular/router'; +import { ContactRequest } from '../models/contact.request'; + + + +@Component({ + selector: 'app-add-update-contact', + templateUrl: './add-update-contact.component.html', + styleUrls: ['./add-update-contact.component.scss'], +}) +export class AddUpdateContactComponent implements OnInit { + @ViewChild("containerDiv") containerDiv: ElementRef; + @ViewChild("containerDivTwo") containerDivTwo: ElementRef; + + + getPassNotificationDetails: any; + getPassdirfromNotifiPage: boolean = false; + functionName: string = ""; + menuType: any; + private textArea: TextAreaInput; + private numberInput: NumberInput; + private textInput: TextInput; + private selectInput: SelectInput; + private dateInput: DateInput; + private timeInput: TimeInput; + private datetimeInput: DateTimeInput; + private buttonInput: ButtonInput; + private hiddenInput: HiddenInput; + private eitResponse: any; + private eitDffResponse: any; + private eitColResponse: any; + + private eitVALSettoCall: any = []; + private comtransNo: number = 0; + getPassMnuEntryObj: MenuEntry; + selMenu: MenuResponse; + eitSubmitAction: number = 0; //not submit + private basicRequest: ContactRequest; + private validateEitObj: any = []; + private ExtraObj: any = {}; + private arrValues: any = []; + selEmp: string; + respID: number; + headerTitle: string = ""; + isResubmit: boolean = false; + private updatedValues: any = []; + addEITData: any; + direction: string; + public targetValue: any; + public employeeBasicDetails: any = []; + public mutualBasicDetailsArray: any = []; + public effectiveDate: string; + public showEffectiveDate: string; + public userUpdateData: any; + public isDelete: boolean = false; + public selctedContact: any; + public endDate: any; + constructor( + public modalController: ModalController, + public cs: CommonService, + public ts: TranslatorService, + private profileService: ProfileService, + public datePicker: DatePicker, + public router: ActivatedRoute + ) { + + this.router.queryParams.subscribe(params => { + this.targetValue = params.targetValue; + console.log(this.targetValue); + }); + + var empDetails = this.cs.sharedService.getSharedData(ProfileService.EMP_CONTACT_DETAILS); + this.employeeBasicDetails = empDetails ? empDetails : []; + var isDelete = this.cs.sharedService.getSharedData(ProfileService.REMOVE_CONTACT); + this.isDelete = isDelete ? isDelete : false; + this.selctedContact = this.cs.sharedService.getSharedData(ProfileService.SELCTED_CONTACT, false); + this.direction = TranslatorService.getCurrentLanguageName(); + this.selEmp = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_EMP, + false + ); + this.respID = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_RESP_ID, + false + ); + this.selMenu = new MenuResponse(); + this.selMenu = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_DATA, + false + ); + this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false); + console.log("addEITData: " + this.addEITData); + + this.basicRequest = new ContactRequest(); + + ////*new add*///// + /**********resubmit************ */ + this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);//WARINING + this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage; + if (this.getPassdirfromNotifiPage) { + this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME; + this.menuType = "E"; + this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; + this.respID = -999; + this.validateEitObj = this.addEITData.submitEITObjList; + let msg: string = ""; + msg = this.ts.trPK("general", "update-contact"); + this.headerTitle = msg; + } else { + this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList; + this.comtransNo = this.addEITData.transNo; + this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + this.validateEitObj = this.addEITData.submitEITObjList; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.eitSubmitAction = this.cs.sharedService.getSharedData( + EITTransactionsRequest.SUBMIT_EIT_ACTION + ); + } + } + + ngOnInit() { } + + ngAfterViewInit() { + if (!this.isDelete) + this.getBasicffStructure(); + } + + public getColumnStructure() { + const body = { + P_FUNCTION_NAME: this.functionName, + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_ACTION: this.employeeBasicDetails.length > 0 ? 'UPDATE' : this.isDelete ? 'REMOVE' : 'ADD' + }; + this.profileService.getContactColumnStructure(body).subscribe((result: any) => { + this.handleBasicColStructureResult(result); + }); + } + + private getEitDffStructure() { + const body = { + P_FUNCTION_NAME: this.functionName, + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, + 'P_DESC_FLEX_CONTEXT_CODE': 'HMG_ADD_CONTACT_DETAILS' + }; + this.profileService.getContactDFFStrutre(body).subscribe((result: any) => { + this.handleDffStructureResult(result); + }); + } + handleDffStructureResult(result) { + if (result.GetContactDffStructureList != null) { + + this.eitDffResponse = result.GetContactDffStructureList; + this.drawEitFields(result.GetContactDffStructureList, true); + this.fillBasicDetailsStructure(); + } + } + private getBasicffStructure() { + const body = { + P_FUNCTION_NAME: this.functionName, + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, + P_REQUEST_TYPE: this.getPassMnuEntryObj.REQUEST_TYPE + }; + this.profileService.getBasicDFFStrutre(body).subscribe((result: any) => { + this.handleBasicDffStructureResult(result); + }); + } + + public handleBasicColStructureResult(result) { + if (result.GetContactColsStructureList != null) { + this.eitColResponse = result.GetContactColsStructureList; + // if (this.employeeBasicDetails.length > 0) { + this.getEitDffStructure(); + //} + + this.drawEitFieldsStatic(result.GetContactColsStructureList); + } + } + + public handleBasicDffStructureResult(result) { + if (result.GetBasicDetDffStructureList != null) { + this.getColumnStructure(); + this.eitResponse = result.GetBasicDetDffStructureList; + this.drawEitFields(result.GetBasicDetDffStructureList, false); + + } + } + + private drawEitFieldsStatic(feildsList) { + const containerId = "containerDivTwo"; + this.eitVALSettoCall = []; + for (let i = 0; i < feildsList.length; i++) { + let defaultVal: string = ""; + let defaultValText: string = ""; + + if (feildsList[i].DISPLAY_FLAG != "N") { + //text , date , time + if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList === null) { + // character + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList !== null) { + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + this.fillStaticDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].ObjectValuesList, + feildsList[i].APPLICATION_COLUMN_NAME + ); + } else if (feildsList[i].DATATYPE == "NUMBER") { + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].DATATYPE == "DATE") { + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + + } + } + } + + } + + public getElementsStaticValues(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = 1; + let textValue: any; + + for (let i = 0; i < this.eitColResponse.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + + if (this.eitColResponse[i].DISPLAY_FLAG != "N") { + if (this.eitColResponse[i].ObjectValuesList === null) { + let elem = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement; + let elemVal = elem !== null ? (document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement).value : ''; + textValue = elemVal; + + if (this.eitColResponse[i].DATATYPE == "VARCHAR2" || this.eitColResponse[i].DATATYPE == "NUMBER") { + elemVal = elemVal; + } else if (this.eitColResponse[i].DATATYPE == "DATE") { + // date + elemVal = this.cs.reverseFormatDate(elemVal); + } + + if (this.targetValue === 'new') { + if (this.eitColResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + } + + if (this.eitColResponse[i].DATATYPE == "DATE") { + dateValue = elemVal; + } else if (this.eitColResponse[i].DATATYPE == "NUMBER") { + numbervalue = elemVal; + } else { + varcharValue = elemVal; + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement; + + let val = x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null; + let txt = x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : null; + varcharValue = val; + textValue = txt; + + if (x !== null) { + if (this.eitColResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + } else { + let x = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement; + let val = x !== null ? x.dataset.colmText : ''; + textValue = x !== null ? x.value : ''; + + if (x !== null) { + if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + } + + + let staticValueBasicDetail = this.employeeBasicDetails.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitColResponse[i].APPLICATION_COLUMN_NAME + ); + + if (staticValueBasicDetail) { + if (this.eitColResponse[i].DATATYPE === 'VARCHAR2') { + varcharValue = staticValueBasicDetail.VARCHAR2_VALUE; + } else if (this.eitColResponse[i].DATATYPE === 'DATE') { + dateValue = staticValueBasicDetail.DATE_VALUE; + } else if (this.eitColResponse[i].DATATYPE === 'NUMBER') { + numbervalue = staticValueBasicDetail.NUMBER_VALUE; + } else { + varcharValue = val; + } + } else { + varcharValue = val; + } + + + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + } + return valuseArr; + } + + private drawEitFields(feildsList, isDff: boolean) { + const containerId = "containerDiv"; + this.eitVALSettoCall = []; + for (let i = 0; i < feildsList.length; i++) { + let defaultVal: string = ""; + let defaultValText: string = ""; + // defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + // ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + // : ""; + // defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + // ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + // : ""; + + if (feildsList[i].DISPLAY_FLAG != "N") { + //check if the field should be displayed + if (feildsList[i].VALIDATION_TYPE == "N") { + //text , date , time + if (feildsList[i].FORMAT_TYPE == "C") { + // character + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].FORMAT_TYPE == "N") { + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].FORMAT_TYPE == "X") { + // standard date + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + //constant + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } else if (feildsList[i].FORMAT_TYPE == "Y") { + // standard date time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatStandardDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + const elem = document.getElementById( + feildsList[i].APPLICATION_COLUMN_NAME + ); + } else if (feildsList[i].FORMAT_TYPE == "I") { + //time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } + } else { + if (feildsList[i].READ_ONLY == "Y") { + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else { + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + if (isDff) { + this.fillDropdownListDff( + feildsList[i].SEGMENT_NAME, + feildsList[i].E_SERVICES_VS, + feildsList[i].E_SERVICES_DV + ); + } else { + this.fillDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].E_SERVICES_VS, + feildsList[i].E_SERVICES_DV + ); + } + } + + } + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } else { + this.hiddenInput = new HiddenInput( + defaultVal, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultValText, + containerId + ); + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } + } + if (this.validateEitObj && this.validateEitObj.length > 0) { + this.fillEITStructure(); + } + + } + + addFieldToDOM( + fieldObject: any, + fieldId: any, + clickListenerEvent: any, + hasClickListener: boolean + ) { + console.log("AddFieldToDOM"); + const elemDiv = document.createElement("div"); + elemDiv.className = ""; + elemDiv.innerHTML = fieldObject.getTemplate(); + console.log(this.containerDiv.nativeElement); + + this.containerDiv.nativeElement.appendChild(elemDiv); + // document.getElementById('containerDiv').appendChild(elemDiv); + + if (hasClickListener) { + let elem = document.getElementById(fieldId); + elem.addEventListener("click", e => { + clickListenerEvent(e); + e.stopImmediatePropagation(); + }); + } + } + + closeModal() { + this.updatedValues = []; + this.modalController.dismiss(); + } + + public showDateTimePicker(elemID, maxSize) { + let elem = document.getElementById(elemID) as HTMLDivElement; + let date: any; + let value = elem.innerHTML; + if (value) date = moment(value, "YYYY/MM/DD HH:mm:ss").toDate(); + else date = new Date(); + this.datePicker + .show({ + date: date, + is24Hour: true, + mode: "datetime" + }) + .then( + date => { + let dateString: string = moment(date).format("YYYY/MM/DD HH:mm:ss"); + //remove seconds if the maximum size is 17 + if (maxSize == 17) { + elem.innerHTML = dateString.substring(0, 16); + elem.dataset.dtvalue = dateString.substring(0, 16); + } else { + elem.innerHTML = dateString; + elem.dataset.dtvalue = dateString; + } + }, + err => console.log("Error occurred while getting date: ", err) + ); + } + + public showTimePicker(elemID, maxSize) { + let elem = document.getElementById(elemID) as HTMLDivElement; + let date: any; + let value = elem.innerHTML; + if (value) { + let nowDate = moment().format("YYYY/MM/DD") + " " + value; + date = moment(nowDate, "YYYY/MM/DD HH:mm:ss").toDate(); + } else { + date = new Date(); + } + this.datePicker + .show({ + date: date, + is24Hour: true, + mode: "time" + }) + .then( + date => { + let dateString: string = moment(date).format("HH:mm:ss"); + //remove seconds if the maximum size is 5 + if (maxSize == 5) { + elem.innerHTML = dateString.substring(0, 5); + elem.dataset.dtvalue = dateString.substring(0, 5); + } else { + elem.innerHTML = dateString; + elem.dataset.dtvalue = dateString; + } + }, + err => console.log("Error occurred while getting date: ", err) + ); + } + + fillDropdownList(segmentName, optionList: any = [], DV: any = "") { + let elemID: any = ""; + let eitObj: any; + if (optionList.length > 0) { + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == segmentName) { + eitObj = this.eitResponse[i]; + if ( + this.eitResponse[i].READ_ONLY == "Y" || + this.eitResponse[i].DISPLAY_FLAG == "N" + ) { + return false; + } + elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + + if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") { + var firstoption = document.createElement("option"); + firstoption.text = this.ts.trPK("general", "choose"); + firstoption.value = ""; + select.add(firstoption); + } + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].VALUE_COLUMN_NAME; + option.value = optionList[i].ID_COLUMN_NAME; + select.add(option); + } + if (select.dataset.hiddenval) { + select.value = select.dataset.hiddenval; + } else { + select.value = DV.P_ID_COLUMN_NAME; + } + select.disabled = false; + } + } + + fillDropdownListDff(segmentName, optionList: any = [], DV: any = "") { + let elemID: any = ""; + let eitObj: any; + if (optionList.length > 0) { + for (let i = 0; i < this.eitDffResponse.length; i++) { + if (this.eitDffResponse[i].SEGMENT_NAME == segmentName) { + eitObj = this.eitDffResponse[i]; + if ( + this.eitDffResponse[i].READ_ONLY == "Y" || + this.eitDffResponse[i].DISPLAY_FLAG == "N" + ) { + return false; + } + elemID = this.eitDffResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + + if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") { + var firstoption = document.createElement("option"); + firstoption.text = this.ts.trPK("general", "choose"); + firstoption.value = ""; + select.add(firstoption); + } + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].VALUE_COLUMN_NAME; + option.value = optionList[i].ID_COLUMN_NAME; + select.add(option); + } + if (select.dataset.hiddenval) { + select.value = select.dataset.hiddenval; + } else { + select.value = DV.P_ID_COLUMN_NAME; + } + select.disabled = false; + } + } + public fillStaticDropdownList(segmentName, optionList: any = [], elemID: string) { + let eitObj: any; + if (optionList.length > 0) { + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].MEANING; + option.value = optionList[i].CODE; + select.add(option); + } + } + } + + bindHtmlElemEvents(id, obj) { + const elem = document.getElementById(id); + console.log(elem); + console.log(obj); + const elemType = elem.tagName; + let changeEvent = "ionChange"; + + if (elemType == "SELECT") changeEvent = "change"; + + try { + elem.addEventListener(changeEvent, e => { + elem.classList.remove("requiredClassElm"); + if ( + obj.CHILD_SEGMENTS_VS_Splited && + obj.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.emptyChildElement(element); + this.getValueSet(element); + }); + } + if ( + obj.CHILD_SEGMENTS_DV_Splited && + obj.CHILD_SEGMENTS_DV_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_DV_Splited; + listArray.forEach(element => { + this.emptyChildElement(element); + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == element) { + this.getDefaultValue( + this.eitResponse[i], + this.eitResponse[i].DESC_FLEX_NAME, + this.eitResponse[i].DESC_FLEX_CONTEXT_CODE, + this.eitResponse[i].SEGMENT_NAME, + this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS, + this.eitResponse[i].PARENT_SEGMENTS_DV_Splited + ); + } + } + }); + } + return false; + }); + } catch (e) { + console.log(e.status); + } + } + + public getDefaultValue( + obj, + descFlexName, + descFlexContextCode, + segmentName, + parentValue, + ParentsList + ) { + let dependenciesList: any = []; + let parentVal: any = null; + let isStandardDate: boolean = false; + let isStandardTimeDate: boolean = false; + let isStandardTime: boolean = false; + let isHidden: boolean = false; + let isReadOnlyList: boolean = false; + let isSelectElement: boolean = false; + isStandardDate = this.isStandardDate(obj); + isStandardTimeDate = this.isStandardDateTime(obj); + isStandardTime = this.isStandardTime(obj); + if (obj.DISPLAY_FLAG == "N") isHidden = true; + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") { + isReadOnlyList = true; + } + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") { + isSelectElement = true; + } + + if ( + parentValue != "" && + (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y") + ) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + if (parentValue) ParentsList.concat(parentValue); + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList + }; + + this.profileService.getDefaultValue(body).subscribe((result: any) => { + let elem = this.getElementByName(segmentName); + let obj = this.handleDefaultValueResult(result); + let val = obj.value; + let text = obj.text; + if (val == null) { val = ""; } + if (text == null) { text = ""; } + if (isStandardDate) { + console.log("isStandardDate"); + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardTimeDate) { + console.log("isStandardTimeDate"); + if (val) { + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else if (isStandardTime) { + console.log("isStandardTime"); + if (val) { + elem.dataset.dtvalue = val; + elem.innerHTML = val; + elem.value = val; + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else { + if (isSelectElement) { + let elem = this.getSelectElementByName(segmentName); + elem = document.getElementById(elem), + elem.value = val; + } else { + elem.value = val; + elem.innerText = text; + elem.setAttribute("value", val); + } + } + if (isHidden || isReadOnlyList) { + if (val) elem.dataset.colmText = val; + else elem.dataset.colmText = ""; + elem.value = text; + } + var event = new Event("ionChange"); + elem.dispatchEvent(event); + }); + } + + handleDefaultValueResult(result) { + let data = { + text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME, + value: result.GetDefaultValueList.P_ID_COLUMN_NAME + }; + return data; + } + + callValueSet() { + for (var i = 0; i < this.eitVALSettoCall.length; i++) { + this.getValueSet(this.eitVALSettoCall[i].SEGMENT_NAME); + } + } + + getParentValue(parentValue) { + if (parentValue.length == 0) { + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == parentValue[0].Name) { + if (this.eitResponse[i].VALIDATION_TYPE == "N") { + let val = (document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + return val; + } else { + let x = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (x.options.length > 0) { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + return val; + } else { + return ""; + } + } + } + } + } else { + return ""; + } + } + + public getValueSet(segmentName) { + let descFlexName: any = ""; + let descFlexContextCode: any = ""; + let parentValue: any = []; + let ParentsList: any = []; + let parentVal: any = null; + let dependenciesList: any = []; + let validationType: string = ""; + + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == segmentName) { + descFlexName = this.eitResponse[i].DESC_FLEX_NAME; + descFlexContextCode = this.eitResponse[i].DESC_FLEX_CONTEXT_CODE; + parentValue = this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS; + ParentsList = this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS; + validationType = this.eitResponse[i].VALIDATION_TYPE; + break; + } + } + if (parentValue != "" && (validationType == "D" || validationType == "Y")) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList, + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + }; + + this.profileService.getSetValue(body).subscribe((result: any) => { + if (result.GetValueSetValuesList != null) { + this.fillDropdownList(segmentName, result.GetValueSetValuesList); + } + }); + let arr: any = []; + return arr; + } + + getDependenciesParams(parentsList) { + let parentArr: any = []; + for (let i = 0; i < parentsList.length; i++) { + for (let j = 0; j < this.eitResponse.length; j++) { + if (this.eitResponse[j].SEGMENT_NAME == parentsList[i].Name) { + if (this.eitResponse[j].DISPLAY_FLAG != "N") { + if (this.eitResponse[j].VALIDATION_TYPE == "N") { + let idColName: string; + let val: any; + if ( + this.eitResponse[j].FORMAT_TYPE == "Y" || + this.eitResponse[j].FORMAT_TYPE == "I" + ) { + //standard date time or //time + let elem = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLDivElement; + val = elem.dataset.dtvalue; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.eitResponse[j].FORMAT_TYPE == "Y") + idColName = this.cs.formatStandardDate(val); + } else { + val = (document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.eitResponse[j].FORMAT_TYPE == "X") { + //date + // idColName = this.cs.formatDate(val); + idColName = this.cs.formatDateNew(val); + } + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: val, + DESCRIPTION: "", + ID_COLUMN_NAME: idColName, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + if (this.eitResponse[j].READ_ONLY != "Y") { + let x = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let text = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : ""; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : undefined; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + let x = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } else { + let x = document.getElementById( + this.eitResponse[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } + } + return parentArr; + } + + emptyChildElement(segmentName) { + let elem = this.getElementByName(segmentName); + elem.value = null; + elem.innerHTML = ""; + if ("dtvalue" in elem.dataset) { + elem.dataset.dtvalue = ""; + } + if ("colmText" in elem.dataset) { + elem.dataset.colmText = ""; + } + var event = new Event("change"); + elem.dispatchEvent(event); + elem.classList.remove("requiredClassElm"); + } + + getRequiredFilds() { + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].REQUIRED_FLAG == "Y") { + let elemVal = (document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if (elemVal == "") { + //alert(this.eitResponse[i].SEGMENT_NAME+" is required"); + break; + } + } + } + } + + getElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == segmentName) { + elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + return document.getElementById(elemID) as HTMLInputElement; + } + + getSelectElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.eitResponse.length; i++) { + if (this.eitResponse[i].SEGMENT_NAME == segmentName) { + elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME; + break; + } + } + return elemID; + } + + isStandardDate(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + // standard date + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + isStandardDateTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + isStandardTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + isStandardDateVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + // standard date + isSt = true; + // } + } + return isSt; + } + + isStandardDateTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + isSt = true; + } + return isSt; + } + + isStandardTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard time + isSt = true; + } + return isSt; + } + + public customiseDate(date: any) { + let formatedDate = date.slice(0, 9); + let newDate = formatedDate.split("/").reverse(); + const tmp = newDate[2]; + newDate[2] = newDate[1]; + newDate[1] = tmp; + newDate = newDate.join("/"); + newDate = newDate + ' 00:00:00'; + return newDate; + } + + + public fillBasicDetailsStructure() { + + this.mutualBasicDetailsArray = this.eitDffResponse.concat(this.mutualBasicDetailsArray.concat(this.eitResponse, this.eitColResponse)); + + for (let i = 0; i < this.employeeBasicDetails.length; i++) { + let val: any; + if (this.employeeBasicDetails[i].VARCHAR2_VALUE) { + val = this.employeeBasicDetails[i].VARCHAR2_VALUE; + } else if (this.employeeBasicDetails[i].DATE_VALUE) { + val = this.cs.formatDate(this.employeeBasicDetails[i].DATE_VALUE); + if (this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME === 'EFFECTIVE_DATE') { + this.effectiveDate = this.employeeBasicDetails[i].DATE_VALUE; + this.showEffectiveDate = this.employeeBasicDetails[i].SEGMENT_VALUE_DSP; + } + } else if (this.employeeBasicDetails[i].NUMBER_VALUE) { + val = this.employeeBasicDetails[i].NUMBER_VALUE; + } + const elem = document.getElementById(this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME) as HTMLInputElement; + if (elem) { + if (val) { + let feldDetails = this.mutualBasicDetailsArray.find( + + x => + x.APPLICATION_COLUMN_NAME == + this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME + ); + if (feldDetails) { + let isStandardTime = this.isStandardTimeVal(feldDetails); + if (isStandardTime) { + elem.innerHTML = val; + elem.dataset.dtvalue = val; + } else { + elem.value = val; + elem.setAttribute("value", elem.value); + } + } + } + } + } + } + + fillEITStructure() { + var obj = { peiObjVer: null, peiExtraInfoID: null }; + for (let i = 0; i < this.validateEitObj.length; i++) { + let val: any; + if (this.validateEitObj[i].VARCHAR2_VALUE) + val = this.validateEitObj[i].VARCHAR2_VALUE; + else if (this.validateEitObj[i].DATE_VALUE) + val = this.validateEitObj[i].DATE_VALUE; + else if (this.validateEitObj[i].NUMBER_VALUE) + val = this.validateEitObj[i].NUMBER_VALUE; + const elem = document.getElementById( + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER; + if (elem) { + if (val) { + let feldDetails = this.eitResponse.find( + x => + x.APPLICATION_COLUMN_NAME == + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ); + if (feldDetails) { + let isStandardDate = this.isStandardDateVal(feldDetails); + let isStandardDateTime = this.isStandardDateTimeVal(feldDetails); + let isStandardTime = this.isStandardTimeVal(feldDetails); + if (isStandardDate) { + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardDateTime) { + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + } else if (isStandardTime) { + elem.innerHTML = val; + elem.dataset.dtvalue = val; + } else { + elem.value = val; + elem.setAttribute("value", elem.value); + } + if ( + feldDetails.DISPLAY_FLAG == "N" || + (feldDetails.VALIDATION_TYPE != "N" && + feldDetails.READ_ONLY == "Y") + ) { + elem.dataset.colmText = val; + elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP; + elem.setAttribute("value", elem.value); + } + } + elem.dataset.hiddenval = val; //hide the value to set it after calling get value set + if ( + feldDetails.CHILD_SEGMENTS_VS_Splited && + feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.getValueSet(element); + }); + } + // var event = new Event('change'); + // elem.dispatchEvent(event); + } + } else { + if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == + "PEI_OBJECT_VERSION_NUMBER" + ) + obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE; + else if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID" + ) + obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE; + } + } + this.ExtraObj = obj; + } + + public getElementsValues(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = 1; + let textValue: any; + // if(this.ExtraObj.transactionNo) + // transNo=this.ExtraObj.transactionNo; + for (let i = 0; i < this.eitResponse.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + /*********set transaction No of the updated object ********/ + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + } + if (this.eitResponse[i].DISPLAY_FLAG != "N") { + if (this.eitResponse[i].VALIDATION_TYPE == "N") { + let elem = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let elemVal = (document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + textValue = elemVal; + //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value; + if ( + this.eitResponse[i].FORMAT_TYPE == "X" && + this.eitResponse[i].DISPLAY_FLAG != "N" + ) { + //date + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.eitResponse[i].FORMAT_TYPE == "Y" && + this.eitResponse[i].DISPLAY_FLAG != "N" + ) { + //standard date time + // elemVal = elem.dataset.dtvalue; + // elemVal = this.cs.formatStandardDate(elemVal); + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.eitResponse[i].FORMAT_TYPE == "I" && + this.eitResponse[i].DISPLAY_FLAG != "N" + ) { + //time + if (elemVal.length > 5) { + elemVal = elemVal.substring(11, 16); + } else { + elemVal = elemVal; + } + } + if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + // if (elemVal != 'null'){ + varcharValue = elemVal; + //} else{ + // elemVal = null; + // } + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (this.eitResponse[i].READ_ONLY == "Y") { + let text = x.value; + let val = x.dataset.colmText; + varcharValue = val; + textValue = text; + } else { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + let txt = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : null; + varcharValue = val; + textValue = txt; + } + if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } //end else + } else { + let x = document.getElementById( + this.eitResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let val = x.dataset.colmText; + textValue = x.value; + if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + let staticValueBasicDetail = this.employeeBasicDetails.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); + + if (staticValueBasicDetail) { + if (staticValueBasicDetail.DATATYPE === 'VARCHAR2') { + varcharValue = staticValueBasicDetail.VARCHAR2_VALUE; + } else if (staticValueBasicDetail.DATATYPE === 'DATE') { + dateValue = staticValueBasicDetail.DATE_VALUE; + } else if (staticValueBasicDetail.DATATYPE === 'NUMBER') { + numbervalue = staticValueBasicDetail.NUMBER_VALUE; + } else { + if (val) varcharValue = val; + } + } else { + if (val) varcharValue = val; + } + + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + let y = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue, + SEGMENT_VALUE_DSP: textValue, + APPLICATION_COLUMN_NAME: this.eitResponse[i] + .APPLICATION_COLUMN_NAME, + DATATYPE: this.eitResponse[i].DATATYPE, + DESC_FLEX_CONTEXT_CODE: this.eitResponse[i].DESC_FLEX_CONTEXT_CODE, + DESC_FLEX_NAME: this.eitResponse[i].DESC_FLEX_NAME, + DISPLAY_FLAG: this.eitResponse[i].DISPLAY_FLAG, + SEGMENT_NAME: this.eitResponse[i].SEGMENT_NAME, + SEGMENT_PROMPT: this.eitResponse[i].SEGMENT_PROMPT + }; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } + } + } // end for + + if (this.getPassdirfromNotifiPage) { + let updatedObj1 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION" + ); + let updatedObj2 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID" + ); + let updatedObj3 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER" + ); + this.updatedValues.push(updatedObj1); + this.updatedValues.push(updatedObj2); + this.updatedValues.push(updatedObj3); + valuseArr = this.fillExtraInformation( + valuseArr, + updatedObj1.VARCHAR2_VALUE, + updatedObj2.NUMBER_VALUE, + updatedObj3.NUMBER_VALUE, + transNo + ); + } else { + if (this.eitSubmitAction == EIT_ACTION.ADD) { + this.updatedValues = this.fillExtraValuesUpdated( + this.updatedValues, + "NEW_ROW", + -1, + 0, + transNo + ); + valuseArr = this.fillExtraInformation( + valuseArr, + "NEW_ROW", + -1, + 0, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "UPDATE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.DELETE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "DELETE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } + } + return valuseArr; + } // end getElementsValues + + + public getElementsValuesDff(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = 1; + let textValue: any; + // if(this.ExtraObj.transactionNo) + // transNo=this.ExtraObj.transactionNo; + for (let i = 0; i < this.eitDffResponse.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + /*********set transaction No of the updated object ********/ + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + } + if (this.eitDffResponse[i].DISPLAY_FLAG != "N") { + if (this.eitDffResponse[i].VALIDATION_TYPE == "N") { + let elem = document.getElementById( + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let elemVal = (document.getElementById( + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + textValue = elemVal; + //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value; + if ( + this.eitDffResponse[i].FORMAT_TYPE == "X" && + this.eitDffResponse[i].DISPLAY_FLAG != "N" + ) { + //date + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.eitDffResponse[i].FORMAT_TYPE == "Y" && + this.eitDffResponse[i].DISPLAY_FLAG != "N" + ) { + //standard date time + // elemVal = elem.dataset.dtvalue; + // elemVal = this.cs.formatStandardDate(elemVal); + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.eitDffResponse[i].FORMAT_TYPE == "I" && + this.eitDffResponse[i].DISPLAY_FLAG != "N" + ) { + //time + if (elemVal.length > 5) { + elemVal = elemVal.substring(11, 16); + } else { + elemVal = elemVal; + } + } + if (this.eitDffResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + // if (elemVal != 'null'){ + varcharValue = elemVal; + //} else{ + // elemVal = null; + // } + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitDffResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById( + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (this.eitDffResponse[i].READ_ONLY == "Y") { + let text = x.value; + let val = x.dataset.colmText; + varcharValue = val; + textValue = text; + } else { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + let txt = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : null; + varcharValue = val; + textValue = txt; + } + if (this.eitDffResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitDffResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } //end else + } else { + let x = document.getElementById( + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let val = x.dataset.colmText; + textValue = x.value; + if (this.eitDffResponse[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + let staticValueBasicDetail = this.employeeBasicDetails.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ); + + if (staticValueBasicDetail) { + if (staticValueBasicDetail.DATATYPE === 'VARCHAR2') { + varcharValue = staticValueBasicDetail.VARCHAR2_VALUE; + } else if (staticValueBasicDetail.DATATYPE === 'DATE') { + dateValue = staticValueBasicDetail.DATE_VALUE; + } else if (staticValueBasicDetail.DATATYPE === 'NUMBER') { + numbervalue = staticValueBasicDetail.NUMBER_VALUE; + } else { + if (val) varcharValue = val; + } + } else { + if (val) varcharValue = val; + } + + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.eitDffResponse[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.eitDffResponse[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + let y = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue, + SEGMENT_VALUE_DSP: textValue, + APPLICATION_COLUMN_NAME: this.eitDffResponse[i] + .APPLICATION_COLUMN_NAME, + DATATYPE: this.eitDffResponse[i].DATATYPE, + DESC_FLEX_CONTEXT_CODE: this.eitDffResponse[i].DESC_FLEX_CONTEXT_CODE, + DESC_FLEX_NAME: this.eitDffResponse[i].DESC_FLEX_NAME, + DISPLAY_FLAG: this.eitDffResponse[i].DISPLAY_FLAG, + SEGMENT_NAME: this.eitDffResponse[i].SEGMENT_NAME, + SEGMENT_PROMPT: this.eitDffResponse[i].SEGMENT_PROMPT + }; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } + } + } // end for + + if (this.getPassdirfromNotifiPage) { + let updatedObj1 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION" + ); + let updatedObj2 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID" + ); + let updatedObj3 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER" + ); + this.updatedValues.push(updatedObj1); + this.updatedValues.push(updatedObj2); + this.updatedValues.push(updatedObj3); + valuseArr = this.fillExtraInformation( + valuseArr, + updatedObj1.VARCHAR2_VALUE, + updatedObj2.NUMBER_VALUE, + updatedObj3.NUMBER_VALUE, + transNo + ); + } else { + if (this.eitSubmitAction == EIT_ACTION.ADD) { + this.updatedValues = this.fillExtraValuesUpdated( + this.updatedValues, + "NEW_ROW", + -1, + 0, + transNo + ); + valuseArr = this.fillExtraInformation( + valuseArr, + "NEW_ROW", + -1, + 0, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "UPDATE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.DELETE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "DELETE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } + } + return valuseArr; + } // end getElementsValues + + fillExtraValuesUpdated( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + let obj1 = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null, + SEGMENT_VALUE_DSP: "", + APPLICATION_COLUMN_NAME: "PEI_ACTION", + DATATYPE: "VARCHAR2", + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj2 = { + TRANSACTION_NUMBER: 1, + APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATATYPE: "NUMBER", + SEGMENT_VALUE_DSP: "", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj3 = { + APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID", + DATATYPE: "NUMBER", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + NUMBER_VALUE: peiExtraInfoID, + SEGMENT_NAME: "", + SEGMENT_PROMPT: "", + SEGMENT_VALUE_DSP: "", + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: null + }; + values.push(obj1); + values.push(obj2); + values.push(obj3); + return values; + } + + fillExtraInformation( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_ACTION", + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_EXTRA_INFO_ID", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiExtraInfoID, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATE_VALUE: null + }); + return values; + } + + fixTransactionNo(transactionTBL: any): any[] { + let list: any = []; + let newIndex: number = 1; + let length: number = transactionTBL.length; + if (length > 0) { + for (let i = 0; i < length; i++) { + // let item :any={}; + const item = Object.assign({}, transactionTBL[i]); + let transNo: number = item.TRANSACTION_NUMBER; + let obj: any = item; + if (i == 0) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + let prevEl: any = transactionTBL[i - 1].TRANSACTION_NUMBER; + if (transNo == prevEl) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + newIndex++; + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } + } + } + } + return list; + } + + public handledetailsResult(result) { + if (this.cs.validResponse(result)) { + this.cs.sharedService.setSharedData(this.basicRequest, BasicRequest.SHARED_DATA); + this.cs.sharedService.setSharedData(result.SubmitContactTransactionList, 'contact-details-response'); + // this.cs.sharedService.setSharedData({ isResubmit: false },"confirmAddEITData"); + this.cs.confirmContact(); + } + } + public calcDay() { + + } + public submitTransaction() { + var allStatisDynamicValues = []; + + + if (this.isDelete) { + allStatisDynamicValues.push({ + TRANSACTION_NUMBER: 1, + NAME: 'DATE_END', + VARCHAR2_VALUE: null, + NUMBER_VALUE: null, + DATE_VALUE: this.cs.formatDate(this.endDate) + }); + } else { + this.arrValues = this.getElementsValues(); + var dffvalues = this.getElementsValuesDff(); + let staticValues = this.getElementsStaticValues(); + allStatisDynamicValues = dffvalues.concat(this.arrValues.concat(staticValues)); + } + if (allStatisDynamicValues) { + this.basicRequest = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE, + P_SELECTED_RESP_ID: this.respID, + P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME, + EITTransactionTBL: allStatisDynamicValues, + P_CONTACT_RELATIONSHIP_ID: this.employeeBasicDetails.length > 0 || this.isDelete ? this.selctedContact['CONTACT_RELATIONSHIP_ID'] : null, + P_ACTION: this.employeeBasicDetails.length > 0 ? 'UPDATE' : this.isDelete ? 'DELETE' : 'ADD' + }; + console.log(this.basicRequest); + + this.profileService.submitContactTransaction(this.basicRequest).subscribe((result: any) => { + this.handledetailsResult(result); + }); + } + } + +} diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts index 20b0a474..fb51f580 100644 --- a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts +++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts @@ -10,6 +10,7 @@ import { SubmitEitModalComponent } from 'src/app/eit/submit-eit-modal/submit-eit import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { HomeComponent } from 'src/app/notification/home/home.component'; import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes'; import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq'; import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component'; @@ -62,7 +63,7 @@ export class ConfirmAddressComponent implements OnInit { indexLastObj: any = 0; filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; direction: string; - + isContact: boolean; constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService, public profileService: ProfileService) { this.direction = TranslatorService.getCurrentLanguageName() @@ -98,8 +99,17 @@ export class ConfirmAddressComponent implements OnInit { this.menuType = this.selMenu.List_Menu.MENU_TYPE; this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; this.addrespList = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA, false); - this.itemKey = this.addrespList.SubmitAddressTransactionList.P_ITEM_KEY; - this.P_TransactionID = this.addrespList.SubmitAddressTransactionList.P_TRANSACTION_ID; + + this.isContact = this.cs.sharedService.getSharedData(AddEitResponse.isContact); + if (this.isContact) { + this.itemKey = this.addrespList.SubmitPhonesTransactionList.P_ITEM_KEY; + this.P_TransactionID = this.addrespList.SubmitPhonesTransactionList.P_TRANSACTION_ID; + this.headerTitle = this.ts.trPK('general', 'contact'); + } else { + this.itemKey = this.addrespList.SubmitAddressTransactionList.P_ITEM_KEY; + this.P_TransactionID = this.addrespList.SubmitAddressTransactionList.P_TRANSACTION_ID; + } + this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; @@ -153,7 +163,11 @@ export class ConfirmAddressComponent implements OnInit { this.handleAddAttachmentResults(result); }); } else { - this.startEITApprovalProcess(); + if (this.isContact) { + this.startEITContactApprovalProcess(); + } else { + this.startEITApprovalProcess(); + } } // } } @@ -179,7 +193,11 @@ export class ConfirmAddressComponent implements OnInit { } // end for if (this.isTrue == result.AddAttSuccessList.length) { - this.startEITApprovalProcess(); + if (this.isContact) { + this.startEITContactApprovalProcess(); + } else { + this.startEITApprovalProcess(); + } } else { //stope @@ -193,6 +211,24 @@ export class ConfirmAddressComponent implements OnInit { } } + + startEITContactApprovalProcess() { + let request: any = {}; + request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + request.P_MENU_TYPE = this.menuType; + request.P_SELECTED_RESP_ID = this.respID; + request.P_TRANSACTION_ID = this.P_TransactionID; + request.P_ITEM_KEY = this.itemKey; + request.P_ACTION_MODE = this.pActionMode; + request.P_COMMENTS = this.eitComments; + this.profileService.startPhoneApprovalProcess( + request). + subscribe((result: any) => { + this.handleResults(result); + }); + } + + startEITApprovalProcess() { let request: any = {}; request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; @@ -229,12 +265,14 @@ export class ConfirmAddressComponent implements OnInit { if (this.cs.validResponse(result)) { this.isSubmitBtnClicked = true; //if(this.isResubmitEIT==false){ - let msg: string = this.ts.trPK("eit", "approval-message-success"); - this.cs.presentAlert(msg); + // let msg: string = this.ts.trPK("eit", "approval-message-success"); + // this.cs.presentAlert(msg); + this.cs.greenToastPK("eit", "approval-message-success") // } // this.navCtrl.popToRoot(); - + this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); // this.cs.openHome(); + //this.cs.setTotalNumberOfWorklistRequest(true); this.cs.openNotificationPage(); } } diff --git a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts index ef49d9e4..8b34d7f4 100644 --- a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts +++ b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts @@ -15,6 +15,7 @@ import { WorkListButtonRequest } from 'src/app/notification/models/NotificationB import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component'; import { ProfileService } from '../service/profile.service'; import { SubmitAddressModalComponent } from '../submit-eit-modal/submit-address-modal.component'; +import { HomeComponent } from 'src/app/notification/home/home.component'; @Component({ selector: 'app-confirm-basic-details', @@ -77,7 +78,7 @@ export class ConfirmBasicDetailsComponent implements OnInit { this.basicRequest = this.cs.sharedService.getSharedData(BasicRequest.SHARED_DATA, false); this.selEmp = this.basicRequest.P_SELECTED_EMPLOYEE_NUMBER; - + this.menuType = this.selMenu.List_Menu.MENU_TYPE; this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; this.basicResponseList = this.cs.sharedService.getSharedData('basic-details-response', false); @@ -87,7 +88,7 @@ export class ConfirmBasicDetailsComponent implements OnInit { // this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; this.getApproversList(); - + } getApproversList() { @@ -98,7 +99,7 @@ export class ConfirmBasicDetailsComponent implements OnInit { P_PAGE_LIMIT: 1000 } this.eitService.getApproversList(body).subscribe((result: any) => { - this.handleApproversResult(result); + this.handleApproversResult(result); }); } @@ -191,8 +192,10 @@ export class ConfirmBasicDetailsComponent implements OnInit { handleResults(result) { if (this.cs.validResponse(result)) { this.isSubmitBtnClicked = true; - let msg: string = this.ts.trPK("eit", "approval-message-success"); - this.cs.presentAlert(msg); + // let msg: string = this.ts.trPK("eit", "approval-message-success"); + // this.cs.presentAlert(msg); + this.cs.greenToastPK("eit", "approval-message-success"); + this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.cs.openNotificationPage(); } } @@ -301,7 +304,7 @@ export class ConfirmBasicDetailsComponent implements OnInit { modal.onDidDismiss() .then((data) => { - }); + }); return await modal.present(); } @@ -430,6 +433,6 @@ export class ConfirmBasicDetailsComponent implements OnInit { } catch (e) { } } - + } diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.html b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.html new file mode 100644 index 00000000..0505227b --- /dev/null +++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.html @@ -0,0 +1,128 @@ + + + + {{headerTitle}} + + + + + + + + + +
{{'general, addAttach' | translate}}
+
+ +
+ +
+
+
+ + + {{ 'general, notAttch' | translate}} + +
+ + +
+ + + + {{attachList.AttachmentID +1 }} . + + + + + {{attachList.P_FILE_NAME }} + + + + + + + +
+ +
+ +
+ + +
+
+ + {{attachRes.FILE_NAME }} + +
+ + + + +
+
+ +
+ + + +
{{'confirmAddEit, comment' | translate}}
+ + + +
+ + +
{{'confirmAddEit, approverList' | translate}}
+
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+
+ +
+
+ + + {{employee.APPROVER}} + + + {{employee.POSITION_TITLE}} + + + +
+
+
+
+
+ +
+ + +
+ + +
+ + {{ 'general, submit' | translate }} +
+
\ No newline at end of file diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss new file mode 100644 index 00000000..2ed98379 --- /dev/null +++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss @@ -0,0 +1,263 @@ +.footer-button { + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + .imgSize { + width: 22px; + height: 22px; + } + + .Header { + font-weight: bold; + color: #1a586d !important; + font-size: 10px; + } + + .tbData { + font-size: 10px; + } + + .btnBack { + background: transparent; + float: right; + } + + .attachmentDiv{ + background: #ffffff; + height: auto; + text-align: center; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + .submitNote{ + background: #ffffff; + height: 80px; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .approvalList{ + --background: #f0efef; + height: auto; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + + /************************New Design**********************************/ + .notification-list{ + background: none; + background: none; + border-radius: 32px; + ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 100%; + font-size: 16px; + font-weight: bold; + + text-align: start; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 12%; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + padding-top: 15%; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + + } + } + + + + + + + .timeline { + position: relative; + margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); + } + + .timeline:before { + + content: ''; + position: inherit !important; + top: 0; + bottom: 0; + width: 4px; + // background: #e4e4e4; + z-index: 1; + left: 35px; + /* margin-left: -10px; */ + /* z-index: 1; */ + } + + .timeline .timeline-thumb { + + border-radius: 500px; + width: 70px !important; + z-index: 2; + position: absolute; + left: 0px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; + } + + .timeline .timeline-thumb.timeline-icon { + height: 70px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); + } + + + + .timeline .timeline-item { + width: 40px; + + } + + .timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + + } + + .empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + + } + .empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; + } + + .line{ + padding-bottom:87px; + } + + .attachLable{ + position: absolute; + top: 0px; + z-index: 0; + background: #30b8c6; + color: #fff; + border-radius: 50%; + border: 0px; + width: 24px; + height: 24px; + text-align: center; + font-size: 5px; + } + + .removeLable{ + top: 0px; + z-index: 0; + background: #d8252d; + color: #fff; + border-radius: 50%; + border: 0px; + width: 20px; + height: 20px; + text-align: center; + font-size: 5px; + } + + .note-modal { + // width: 90%; + // height: 50%; + // top: 20%; + // left: 5%; + // right: 5%; + // bottom: 5%; + background: rgba(0, 0, 0, 0.5) !important; + padding: 30% 10% !important; + --height: 12cm !important; + // --width: 80% !important; + --border-radius:20px; + + } + .header-toolbar-new{ + --background: #269DB8; + } + .title{ + margin-top: -37px; + margin-left: 85px; + } + .title-ar{ + margin-top: -37px; + margin-right: 101px; + } + .confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + background-color: #269DB8; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + .approvalTitle-ar{ + font-weight: bold; + font-size: 16px; + text-align: right; + + } + .approvalTitle{ + font-weight: bold; + font-size: 16px; + text-align: left; + } + \ No newline at end of file diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts new file mode 100644 index 00000000..6a25647a --- /dev/null +++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfirmContactComponent } from './confirm-contact.component'; + +describe('ConfirmContactComponent', () => { + let component: ConfirmContactComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ConfirmContactComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfirmContactComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts new file mode 100644 index 00000000..894fb16e --- /dev/null +++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts @@ -0,0 +1,438 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { FileUploader } from 'ng2-file-upload'; +import { AddAttachComponent } from 'src/app/eit/add-attach/add-attach.component'; +import { AddEitResponse } from 'src/app/eit/models/add.eit.response'; +import { BasicRequest } from "../models/basic.request"; +import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes'; +import { EitService } from 'src/app/eit/services/eit.service'; +import { SubmitEitModalComponent } from 'src/app/eit/submit-eit-modal/submit-eit-modal.component'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes'; +import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq'; +import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component'; +import { ProfileService } from '../service/profile.service'; +import { SubmitAddressModalComponent } from '../submit-eit-modal/submit-address-modal.component'; +import { HomeComponent } from 'src/app/notification/home/home.component'; + + +@Component({ + selector: 'app-confirm-contact', + templateUrl: './confirm-contact.component.html', + styleUrls: ['./confirm-contact.component.scss'], +}) +export class ConfirmContactComponent implements OnInit { + + private P_TransactionID: number; + private basicRequest: BasicRequest; + approversList = []; + basicResponseList: any; + eitComments: string = ""; + menuType: string = ""; + selEmp: string = ""; + respID: number; + selMenu: MenuResponse; + getAttachList: any; + attachListDisplay: any = []; + headerTitle: string = ""; + isTrue: any = 0; + attachItems: any; + public isResubmitEIT: boolean = false; + private itemKey: string = ""; + private pActionMode: string = "SUBMIT"; + attachReqObj: WorkListButtonRequest = new WorkListButtonRequest(); + attachmentRes: any; + objIndex1: any; + attachListOver: any = []; + index: any = 0; + getPassNotificationDetails: any; + isSubmitBtnClicked: boolean; + // isDelete: boolean = false; + + /***Add Attchment Vars */ + isUpload: boolean = false; + inQueue: boolean = false; + addAttachmentListReq: any; + attachmentID: number = 0; + addAttachRequest: any = []; + fileData: any; + fileType: any; + dirPage: any; + TransactionID: any; + indexLastObj: any = 0; + filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; + direction: string; + + + constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService, public profileService: ProfileService) { + this.direction = TranslatorService.getCurrentLanguageName() + this.isSubmitBtnClicked = false; + this.basicRequest = new BasicRequest(); + } + + ngOnInit() { + this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.basicRequest = this.cs.sharedService.getSharedData(BasicRequest.SHARED_DATA, false); + + this.selEmp = this.basicRequest.P_SELECTED_EMPLOYEE_NUMBER; + + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.basicResponseList = this.cs.sharedService.getSharedData('contact-details-response', false); + console.log(this.basicResponseList); + this.itemKey = this.basicResponseList.P_ITEM_KEY; + this.P_TransactionID = this.basicResponseList.P_TRANSACTION_ID; + // this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; + + this.getApproversList(); + + } + + getApproversList() { + let body: any = { + P_TRANSACTION_ID: this.P_TransactionID, + P_AME_TRANSACTION_TYPE: "SSHRMS", + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + } + this.eitService.getApproversList(body).subscribe((result: any) => { + this.handleApproversResult(result); + }); + } + + handleApproversResult(result) { + if (this.cs.validResponse(result)) { + this.approversList = result.GetApprovesList; + } + } + + startEitApproval() { + if (this.attachListOver) { + let request = { + AddAttachmentList: this.attachListOver + } + + this.eitService.addAttachment( + request). + subscribe((result: any) => { + this.handleAddAttachmentResults(result); + }); + } else { + this.startContactApprovalProcess(); + } + } + + + handleAddAttachmentResults(result) { + + if (this.cs.validResponse(result)) { + this.isTrue = 0; + for (let i = 0; i < result.AddAttSuccessList.length; i++) { + if (!result.AddAttSuccessList[i].AddSuccess) { + this.attachListOver[i].isSuccess = false; + //this.attachItems[i].isSuccess = false; + // if false display cancel button with waring icon or design + }// end if + else { + // if true remove cancel and set isSuccess = true + // this.attachItems[i].isSuccess = true; + this.attachListOver[i].isSuccess = true; + this.isTrue = this.isTrue + 1; //count flag of attach status + } // end else + } // end for + + if (this.isTrue == result.AddAttSuccessList.length) { + this.startContactApprovalProcess(); + } + else { + //stope + let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; }); + this.attachListOver = filtered; + let msg: string = ""; + msg = this.ts.trPK("eit", "attach-errorMsg"); + this.cs.presentAlert(msg); + } + } + } + + startContactApprovalProcess() { + let request: any = {}; + request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + request.P_MENU_TYPE = this.menuType; + request.P_SELECTED_RESP_ID = this.respID; + request.P_TRANSACTION_ID = this.P_TransactionID; + request.P_ITEM_KEY = this.itemKey; + request.P_ACTION_MODE = this.pActionMode; + request.P_COMMENTS = this.eitComments; + this.profileService.startContactApprovalProcess( + request). + subscribe((result: any) => { + this.handleResults(result); + }); + } + cancelEitProcess() { + let body: any = { + P_TRANSACTION_ID: this.P_TransactionID + } + this.eitService.cancelHRTransaction( + body). + subscribe((result: any) => { + this.handleCancelResults(result); + }); + + } + handleCancelResults(result) { + if (this.cs.validResponse(result)) { + this.isSubmitBtnClicked = false; + } + } + handleResults(result) { + if (this.cs.validResponse(result)) { + this.isSubmitBtnClicked = true; + // let msg: string = this.ts.trPK("eit", "approval-message-success"); + // this.cs.presentAlert(msg); + this.cs.greenToastPK("eit", "approval-message-success"); + this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.cs.openNotificationPage(); + } + } + + async addAttachment(str: boolean, attachItems: any) { + //open the modal with return data + let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; + + this.cs.sharedService.setSharedData(this.P_TransactionID, 'TransactionID'); + this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj'); + + const modal = await this.modalController.create({ + component: AddAttachComponent + }); + + modal.onDidDismiss() + .then((data) => { + if (data == "cancel" || data == "undefined") { + return; + } else { + if (!str) { + this.updateFile(data, attachDocID); + } else { + console.log(data); + this.attachListDisplay = data.data; + this.attachItems = this.attachListDisplay.map(function (el) { + var o = Object.assign({}, el); + o.isSuccess = false; + return o; + }); + + this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + } + } + }); + + return await modal.present(); + } + + /*****submit modal********/ + async openSubmitModal() { + this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList'); + this.cs.sharedService.setSharedData(this.eitComments, 'eitComments'); + const modal = await this.modalController.create({ + component: SubmitAddressModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + this.startEitApproval(); + } + }); + + return await modal.present(); + } + + + + removeFile(objectitem) { + if (this.attachListOver) { + let index2 = this.attachListOver.findIndex(item => item == objectitem); + if (index2 > -1) { + this.attachListOver.splice(index2, 1); + } + } + if (this.attachmentRes) { + let index3 = this.attachmentRes.findIndex(item => item == objectitem); + if (index3 > -1) { + this.attachmentRes.splice(index3, 1); + } + } + + } + + + getAttachment(NotificationID) { + this.attachReqObj.P_NOTIFICATION_ID = NotificationID; + this.eitService.getAttach(this.attachReqObj). + subscribe((result: NotificationGetAttachResponse) => { + this.handleWorkListAttachResult(result); + }); + } + + handleWorkListAttachResult(result) { + if (this.cs.validResponse(result)) { + if (result.GetAttachementList != null) { + this.attachmentRes = result.GetAttachementList; + } // if result == null + } // valid it + + } + + async OpenAttachFiles(value, Type) { + this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage'); + const modal = await this.modalController.create({ + component: WorkListAttachViewComponent + }); + + modal.onDidDismiss() + .then((data) => { + }); + return await modal.present(); + } + + + delelteFile(attach) { + this.cs.confirmAlertDialog((data) => { + if (data == true) { + this.continueDelete(attach); + } + }, this.ts.trPK('general', 'ok'), () => { + + }, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm')); + } + + continueDelete(attach) { + let req = { + P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID + } + this.eitService.deleteAttach(req). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") { + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + let msg: string = ""; + msg = this.ts.trPK("eit", "deleteAttach"); + this.cs.presentAlert(msg); + } + } + }); + } + + updateFile(attachList, attachDocID) { + let req = { + P_ATTACHED_DOCUMENT_ID: attachDocID, + P_FILE_DATA: attachList[0].P_FILE_DATA, + P_FILE_NAME: attachList[0].P_FILE_NAME, + P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE + } + this.eitService.updateAttach(req). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.MessageStatus == 1) { + let msg: string = ""; + msg = this.ts.trPK("eit", "attachUpdate"); + this.cs.presentAlert(msg); + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + } + } + }); + } + + + ionViewWillLeave() { + if (this.P_TransactionID && this.isSubmitBtnClicked == false) + this.cancelEitProcess(); + } + + /*******************Add attchement Functions*************/ + + public uploader: FileUploader = new FileUploader({ + allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async (item) => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + onFileSelectedclick(event) { + event.target.value = ''; + } + + + + onFileSelected(input) { + + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "notSupport"); + this.cs.presentAlert(msg); + return + } // todo: show alert that you tried uploading wrong files + + else { + const file = input.target.files[0]; + this.getBase64(file).then( + data => this.pushObject(data, file.name, file.type) + ); + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); + } + + + pushObject(fileData, name, type) { + + console.log("before push: " + this.index); + try { + let array = name.split('.'); + let attachType: string = array[array.length - 1]; + this.attachListOver.push( + { + AttachmentID: this.attachListOver.length, + P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], + P_FILE_DATA: fileData.split(',')[1], + P_FILE_NAME: name,//.split('.')[0], + P_TRANSACTION_ID: this.P_TransactionID + }) + + } catch (e) { + } + } + +} diff --git a/Mohem/src/app/profile/contact/contact.component.html b/Mohem/src/app/profile/contact/contact.component.html new file mode 100644 index 00000000..8fed9814 --- /dev/null +++ b/Mohem/src/app/profile/contact/contact.component.html @@ -0,0 +1,53 @@ + +
+ + + +
+
+
+
+ +
+

+ {{ts.trPK('general','add-new-row')}} + +

+
+
+
+ + + +
+ + + +
+
+ +
+ + +
+
+
+

{{ts.trPK('general','delete')}}

+
+
+
+
+
+
+ +
+ + {{'userProfile, update' | translate}} + +
+
+ \ No newline at end of file diff --git a/Mohem/src/app/profile/contact/contact.component.scss b/Mohem/src/app/profile/contact/contact.component.scss new file mode 100644 index 00000000..d67acf74 --- /dev/null +++ b/Mohem/src/app/profile/contact/contact.component.scss @@ -0,0 +1,119 @@ +.bold{ + font-weight: bold; + font-size: 16px; +} +#containerDiv{ + + margin: 20px 0px; +} +.padding{ + padding-left:5px; + padding-right: 5px; +} +.color-black{ + color:#000; +} +.date{ + position: absolute; + font-size: 14px; + padding: 10px; + right:0; + width: 100px; + color:#969696; +} +.transaction-list{ + margin-top:20px; +} +.date-container{ + margin:0px 20px; +} +.colBold{ + font-size: 12px; +} +.label{ + font-size: 12px; + // margin-left: 15px; + color: #a2a5a6 !important; + display: block; + overflow: hidden; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + /* font-size: inherit; */ + // text-overflow: ellipsis; + // white-space: nowrap; + white-space: normal; + // padding-top: 10px; + padding: 5px 0px; + padding-left: 10px !important; + margin: 10px auto; + +} + +.Field-en{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 15px; + padding-left: 10px !important; + padding-top: 6px !important; + color: #999999 !important; +} + +.Field-ar{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 20px; + padding-right: 20px !important; + padding-top: 6px !important; + color: #999999 !important; +} +select{ + width: 85% !important; + border: none !important; + position: relative; + bottom: 5px; + background: transparent; +} +.delete-icon{ + position: absolute; + right: 20px; + bottom: -10px; + color: #d60505; + font-weight: bold; +} +.phoneContainer{ + position: relative; + margin-top: 15px; + padding: 20px; + border-radius: 10px; + box-shadow: 0px 0px 3px 0px #ccc +} +.new-row{ + + text-align: center; + color: #259CB8; + font-weight: bold; +} +.add-new-row-card{ + box-shadow: none; + background: #d6d6d652; + border: 1px solid #ccc; +} +.add-icons{ + height: 22px; + width: 22px; + display: inline-flex; + background: #259CB8; + padding: 4px; + border-radius: 5px; + top: 5px; + position: relative; +} +.icons-delete{ + height: 16px; + width: 13px; + + position: relative; + display: inline-block; +} \ No newline at end of file diff --git a/Mohem/src/app/profile/contact/contact.component.spec.ts b/Mohem/src/app/profile/contact/contact.component.spec.ts new file mode 100644 index 00000000..82fb3f20 --- /dev/null +++ b/Mohem/src/app/profile/contact/contact.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConatactComponent } from './contact.component'; + +describe('ContactComponent', () => { + let component: ConatactComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ConatactComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConatactComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/profile/contact/contact.component.ts b/Mohem/src/app/profile/contact/contact.component.ts new file mode 100644 index 00000000..e137b838 --- /dev/null +++ b/Mohem/src/app/profile/contact/contact.component.ts @@ -0,0 +1,120 @@ +import { Component, OnInit } from '@angular/core'; +import { AddEitResponse } from 'src/app/eit/models/add.eit.response'; +import { EitRequest } from 'src/app/eit/models/eit.request'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ProfileService } from '../service/profile.service'; + + +@Component({ + selector: 'app-conatact', + templateUrl: './contact.component.html', + styleUrls: ['./contact.component.scss'], +}) +export class ConatactComponent implements OnInit { + public phoneNumbers: any = []; + public objectValue: any = []; + direction: any; + selEmp: any; + respID: any; + selMenu: any; + submitrequest: any; + constructor(public cs: CommonService, public ts: TranslatorService, public profileService: ProfileService,) { + this.direction = TranslatorService.getCurrentLanguageName(); + this.selEmp = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_EMP, + false + ); + this.respID = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_SEL_RESP_ID, + false + ); + this.selMenu = new MenuResponse(); + this.selMenu = this.cs.sharedService.getSharedData( + MenuResponse.SHARED_DATA, + false + ); + + } + + + ngOnInit() { + this.phoneNumbers = this.cs.sharedService.getSharedData(ProfileService.EMP_PHONE, false); + this.setIsUpdated(); + this.direction = TranslatorService.getCurrentLanguageName(); + this.getObjectValue(); + } + setIsUpdated() { + this.phoneNumbers.forEach(element => { + element['ACTION'] = 'UPDATE_ROW'; + }); + } + + getObjectValue() { + this.profileService.getObjectValue({ + 'P_OBJECT_TYPE': 'LOOKUP', + 'P_OBJECT_NAME': 'PHONE_TYPE' + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + if (this.cs.validResponse(response)) { + console.log(response); + this.objectValue = response['GetObjectValuesList']; + } + }) + } + setIsDeletedStatus() { + this.phoneNumbers.forEach(element => { + if (element['DELETE_ROW'] == true) { + element['ACTION'] = 'DELETE_ROW'; + } + }); + } + updatePhone() { + + this.setIsDeletedStatus(); + console.log(this.phoneNumbers); + this.submitrequest = { + + P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE, + P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999, + P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME, + P_MBL_PHONES_TBL: this.phoneNumbers, + + + + }; + this.profileService.submitPhoneTransaction(this.submitrequest, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + if (this.cs.validResponse(response)) { + console.log(response); + this.handleSubmitEitResult(response); + } + }) + //} + } + + addNewRow() { + this.phoneNumbers.push({ 'PHONE_NUMBER': '', 'PHONE_TYPE': '', 'ACTION': 'NEW_ROW', 'OBJECT_VERSION_NUMBER': null, 'PHONE_ID': null }) + } + deleteRow(row) { + row['DELETE_ROW'] = true; + // this.phoneNumbers = + // this.phoneNumbers.filter(item => item !== row); + console.log(this.phoneNumbers); + + } + handleSubmitEitResult(result) { + if (this.cs.validResponse(result)) { + this.cs.sharedService.setSharedData( + this.submitrequest, + EitRequest.SHARED_DATA + ); + this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA); + this.cs.sharedService.setSharedData(true, AddEitResponse.isContact); + this.cs.sharedService.setSharedData( + { isResubmit: false }, + "confirmAddEITData" + ); + this.cs.openConfirmAddAddress(); + } + } +} diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.html b/Mohem/src/app/profile/edit-profile/edit-profile.component.html index 86ee5a08..ff85343c 100644 --- a/Mohem/src/app/profile/edit-profile/edit-profile.component.html +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.html @@ -74,6 +74,7 @@ + diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html index 96b8ea1b..cd3bbece 100644 --- a/Mohem/src/app/profile/home/home.component.html +++ b/Mohem/src/app/profile/home/home.component.html @@ -37,25 +37,32 @@

+ + +
{{ts.trPK('userProfile','note-part-1')}}
+ {{ts.trPK('userProfile','note-part-2')}}
@@ -123,10 +139,19 @@

{{personalInfo.EMPLOYMENT_CATEGORY_MEANING}}


+

{{ts.trPK('userProfile','phone-no')}}

+ +

{{personalInfo.EMPLOYEE_MOBILE_NUMBER}}

+
+ +

{{ts.trPK('userProfile','busG')}}

@@ -144,7 +169,7 @@ - +

{{ts.trPK('general','basic-details')}}

@@ -184,6 +209,42 @@
+ + + + + + +

{{ts.trPK('userProfile','phone-no')}}

+
+
+ + + + + + + +
+
+
+
+
+
+ +

{{phone.PHONE_TYPE_MEANING}}

+
+

{{phone.PHONE_NUMBER}}

+
+
+
+ +
+
+ +
+
+ @@ -235,7 +296,80 @@
+ + +
+ + + + + +

{{ts.trPK('general','dependent-title')}}

+
+
+ + + + +
+
+
+
+
+ + + +

{{data.CONTACT_NAME}}

+
+ +
+ +

{{ts.trPK('userProfile','update')}}

+
+
+
+ + +

{{data.RELATIONSHIP}}

+
+ +
+ +

{{ts.trPK('userProfile','remove')}}

+
+
+
+
+
+
- -
diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss index c824c8a6..090524b4 100644 --- a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss @@ -74,7 +74,8 @@ margin-top: 5px; margin-bottom: 10px; text-align: center; - margin-left: 74px; + // margin-left: 74px; + width: 100%; } .Text-ar{ margin: 0; @@ -167,9 +168,9 @@ } .gauge{ - transform: translate(-24px, -65px); - margin-bottom: -187px; - margin-top: -20px; + // transform: translate(-24px, -65px); + margin-bottom: -140px; + margin-top: -70px; } .gauge-ar{ diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts index a755c831..a3a61872 100644 --- a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts @@ -25,7 +25,9 @@ export class PerformanceEvaluationComponent implements OnInit { public length; public direction: string; // public showText:boolean =false; + public appraisalArr: any = []; + public static PERFORMANCE_DATA = 'perAppData'; constructor(public ts: TranslatorService, public cs: CommonService, public DS: DashboredService, @@ -53,21 +55,21 @@ export class PerformanceEvaluationComponent implements OnInit { this.getProfile(); - - this.performanceData = this.cs.sharedService.getSharedData( - PerformanceAppraisalResponse.PERFORMANCE_DATA, - true - ); - console.log(this.performanceData.length); - //i % 2 == 0 - this.length = this.performanceData.length; - - for (let i = 0; i < this.performanceData.length; i++) { - this.performanceData[i].color = this.colorScheme.domain[i]; - console.log(i + ' : ' + this.performanceData[i].name) - - } - console.log(this.performanceData[0].color) + this.showPerformanceAppraisal() + // this.performanceData = this.cs.sharedService.getSharedData( + // PerformanceAppraisalResponse.PERFORMANCE_DATA, + // true + // ); + // console.log(this.performanceData.length); + // //i % 2 == 0 + // this.length = this.performanceData.length; + + // for (let i = 0; i < this.performanceData.length; i++) { + // this.performanceData[i].color = this.colorScheme.domain[i]; + // console.log(i + ' : ' + this.performanceData[i].name) + + // } + // console.log(this.performanceData[0].color) } @@ -90,5 +92,30 @@ export class PerformanceEvaluationComponent implements OnInit { } }); } + public showPerformanceAppraisal() { + this.DS.getPerformanceAppraisal(() => { + this.showPerformanceAppraisal(); + }).subscribe((result: PerformanceAppraisalResponse) => { + this.handlePerformanceAppraisalResult(result); + }); + } + + private handlePerformanceAppraisalResult(result) { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.GetPerformanceAppraisalList)) { + this.appraisalArr = result.GetPerformanceAppraisalList; + this.performanceData = []; + for (let i = 0; i < this.appraisalArr.length; i++) { + this.performanceData.push({ name: this.appraisalArr[i].APPRAISAL_YEAR, value: parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed() }); + } + console.log('PerformanceAppraisalResponse'); + this.cs.sharedService.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA); + this.cs.openPerformanceevaluation(); + } else { + let msg: string = this.ts.trPK("userProfile", "no-appraisal"); + this.cs.presentAlert(msg); + } + } + } } diff --git a/Mohem/src/app/profile/profile.module.ts b/Mohem/src/app/profile/profile.module.ts index 42bd13b9..46faa498 100644 --- a/Mohem/src/app/profile/profile.module.ts +++ b/Mohem/src/app/profile/profile.module.ts @@ -23,6 +23,9 @@ import { ConfirmAddressComponent } from './confirm-address/confirm-address.compo import { SubmitAddressModalComponent } from './submit-eit-modal/submit-address-modal.component'; import { ConfirmBasicDetailsComponent } from './confirm-basic-details/confirm-basic-details.component'; +import { ConatactComponent } from './contact/contact.component'; +import { AddUpdateContactComponent } from './add-update-contact/add-update-contact.component'; +import { ConfirmContactComponent } from './confirm-contact/confirm-contact.component'; const routes: Routes = [ { path: '', @@ -44,6 +47,18 @@ const routes: Routes = [ { path: 'confirm-basic', component: ConfirmBasicDetailsComponent + }, + { + path: 'contact', + component: ConatactComponent + }, + { + path: 'add-update-contact', + component: AddUpdateContactComponent + }, + { + path: 'confirm-contact', + component: ConfirmContactComponent } ], }, @@ -112,11 +127,15 @@ const routes: Routes = [ EditProfileComponent, PerformanceEvaluationComponent, ConfirmAddressComponent, - SubmitAddressModalComponent, + AddBasicDetailsComponent, ConfirmAddressComponent, ConfirmBasicDetailsComponent, - AddBasicDetailsComponent], + ConatactComponent, + AddBasicDetailsComponent, + AddUpdateContactComponent, + ConfirmContactComponent + ], entryComponents: [EditDetailProfileComponent, SubmitAddressModalComponent], providers: [DatePicker] diff --git a/Mohem/src/app/profile/service/profile.service.ts b/Mohem/src/app/profile/service/profile.service.ts index 0feb9512..141d8e04 100644 --- a/Mohem/src/app/profile/service/profile.service.ts +++ b/Mohem/src/app/profile/service/profile.service.ts @@ -19,7 +19,9 @@ export class ProfileService { public static submitEit = 'Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION'; public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION'; public static startEitProcess = 'Services/ERP.svc/REST/START_ADDRESS_APPROVAL_PROCESS'; + public static startPhoneProcess = 'Services/ERP.svc/REST/START_PHONES_APPROVAL_PROCESS'; public static startBasicProcess = 'Services/ERP.svc/REST/START_BASIC_DET_APPR_PROCESS'; + public static contactApprovalProcess = 'Services/ERP.svc/REST/START_CONTACT_APPROVAL_PROCESS'; public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT'; public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT'; public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST'; @@ -32,11 +34,26 @@ export class ProfileService { public static getDiffStructure = "Services/ERP.svc/REST/GET_ADDRESS_DFF_STRUCTURE"; public static submitAddressTransactions = "Services/ERP.svc/REST/SUBMIT_ADDRESS_TRANSACTION"; public static submitBasicDetailsTransaction = "Services/ERP.svc/REST/SUBMIT_BASIC_DET_TRANSACTION"; + public static submitContactTransaction = 'Services/ERP.svc/REST/SUBMIT_CONTACT_TRANSACTION' + public static getObjectValues = "Services/ERP.svc/REST/GET_OBJECT_VALUES"; + public static getPhoneNumbers = "Services/ERP.svc/REST/GET_EMPLOYEE_PHONES"; + public static submitPhoneTransaction = "Services/ERP.svc/REST/SUBMIT_PHONES_TRANSACTION"; + public static getContactInfo = 'Services/ERP.svc/REST/GET_EMPLOYEE_CONTACTS'; + public static getContactDetails = 'Services/ERP.svc/REST/GET_CONTACT_DETAILS'; + + public static getContactDiffStructure = 'Services/ERP.svc/REST/GET_CONTACT_DFF_STRUCTURE'; + public static getContactCOLStructure = 'Services/ERP.svc/REST/GET_CONTACT_COLS_STRUCTURE'; + public static ADRESS_ENTRIES = 'address-entries'; public static EMP_ADDRESS = 'emp-address'; public static COUNTRY = 'country'; public static SELECTED_STATUS = 'selected-status'; + public static EMP_PHONE = 'emp-phone'; + public static EMP_CONTACT_DETAILS = 'emp-CONTACT_DETAILS'; + public static EMP_CONTACT = 'emp-CONTACT'; + public static SELCTED_CONTACT = 'selcted-CONTACT'; + public static REMOVE_CONTACT = 'remove-CONTACT'; constructor( public con: ConnectorService, public authService: AuthenticationService @@ -117,14 +134,80 @@ export class ProfileService { this.authService.authenticateRequest(request); return this.con.post(ProfileService.submitBasicDetailsTransaction, request, onError, errorLabel); } + public submitContactTransaction(basicDetailsRequest: any, onError?: any, errorLabel?: string): Observable { + const request = basicDetailsRequest; + this.authService.authenticateRequest(request); + return this.con.post(ProfileService.submitContactTransaction, request, onError, errorLabel); + } public startEitApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable { const request = eitProcess; this.authService.authenticateRequest(request); return this.con.post(ProfileService.startEitProcess, request, onError, errorLabel); } + public startPhoneApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable { + const request = eitProcess; + this.authService.authenticateRequest(request); + return this.con.post(ProfileService.startPhoneProcess, request, onError, errorLabel); + } + public startBasicDetailsApprovalProcess(basicDetailsProcess: any, onError?: any, errorLabel?: string): Observable { const request = basicDetailsProcess; this.authService.authenticateRequest(request); return this.con.post(ProfileService.startBasicProcess, request, onError, errorLabel); } + + + public startContactApprovalProcess(contactRequest: any, onError?: any, errorLabel?: string): Observable { + const request = contactRequest; + this.authService.authenticateRequest(request); + return this.con.post(ProfileService.contactApprovalProcess, request, onError, errorLabel); + } + public getObjectValue(request: any, onError?: any, errorLabel?: string): Observable { + + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME; + return this.con.post(ProfileService.getObjectValues, request, onError, errorLabel); + + } + public getPhoneNumbers(request: any, onError?: any, errorLabel?: string): Observable { + + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME; + return this.con.post(ProfileService.getPhoneNumbers, request, onError, errorLabel); + + } + public submitPhoneTransaction(request: any, onError?: any, errorLabel?: string): Observable { + + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME; + return this.con.post(ProfileService.submitPhoneTransaction, request, onError, errorLabel); + + } + + public getContactInfo(request: any, onError?: any, errorLabel?: string): Observable { + + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME; + return this.con.post(ProfileService.getContactInfo, request, onError, errorLabel); + + } + + public getContactDetails(request: any, onError?: any, errorLabel?: string): Observable { + + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME; + return this.con.post(ProfileService.getContactDetails, request, onError, errorLabel); + + } + public getContactDFFStrutre(BASICDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable { + const request = BASICDFFStrutreReq; + this.authService.authenticateRequest(request); + return this.con.post(ProfileService.getContactDiffStructure, request, onError, errorLabel); + } + + public getContactColumnStructure(body: any, onError?: any, errorLabel?: string): Observable { + const request = body; + this.authService.authenticateRequest(request); + return this.con.post(ProfileService.getContactCOLStructure, request, onError, errorLabel); + } } \ No newline at end of file diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html new file mode 100644 index 00000000..75fc66f0 --- /dev/null +++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html @@ -0,0 +1,31 @@ + +
+ + + +
+
+
+ +
+ + {{ 'worklist,template-name' | translate}} + + + {{ program.USER_CONCURRENT_PROGRAM_NAME}} + + +
+
+
+
+ +
+ + +
+ + {{'vacation-rule, next-label' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss new file mode 100644 index 00000000..cd9542a0 --- /dev/null +++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss @@ -0,0 +1,56 @@ +.main-container{ + padding: 10px; +} +.divider{ + height:20px +} +.check-status{ + color:rgb(0, 0, 134); + text-decoration: underline; + font-weight: 600; +} +.status{ + margin:20px; +} + + +@media screen and (min-width: 300px){ + .CreateBtn{ + --background: var(--newgreen) !important; + background: var(--newgreen) !important; + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 7px !important; + border-radius: 7px !important; + --min-height: 1.6cm !important; + width: 315px; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); +}} + +@media screen and (min-width: 1px) and (max-width:290px) { +.CreateBtn{ + --background: var(--newgreen) !important; + background: var(--newgreen) !important; + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 7px !important; + border-radius: 7px !important; + --min-height: 1.6cm !important; + width: 257px; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); +}} + +.footer{ + padding: 15px 0px; + background-color: var(--light) !important; + border: 0px !important; + box-shadow: none !important; + -webkit-box-shadow: none; +} +.Btn{ + margin: auto; text-align: center; display: block; +} \ No newline at end of file diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts new file mode 100644 index 00000000..102199fe --- /dev/null +++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConcurrentReportComponent } from './concurrent-report.component'; + +describe('ConcurrentReportComponent', () => { + let component: ConcurrentReportComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ConcurrentReportComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConcurrentReportComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts new file mode 100644 index 00000000..8fb275f0 --- /dev/null +++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts @@ -0,0 +1,1300 @@ +import { Component, ElementRef, OnInit } from '@angular/core'; +import * as moment from 'moment'; +import { EitRequest } from 'src/app/eit/models/eit.request'; +import { EIT_ACTION } from 'src/app/eit/models/submit.eit.action'; +import { EitService } from 'src/app/eit/services/eit.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { DateTimeInput } from 'src/app/uI-elements/date-time.input'; +import { DateInput } from 'src/app/uI-elements/date.input'; +import { HiddenInput } from 'src/app/uI-elements/hidden.input'; +import { NumberInput } from 'src/app/uI-elements/number.input'; +import { SelectInput } from 'src/app/uI-elements/select.input'; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { TimeInput } from 'src/app/uI-elements/time.input'; +import { ReportServiceService } from '../report-service.service'; + +@Component({ + selector: 'app-concurrent-report', + templateUrl: './concurrent-report.component.html', + styleUrls: ['./concurrent-report.component.scss'], +}) +export class ConcurrentReportComponent implements OnInit { + public selectedMenu; + public diffStructure = []; + public isUpdate: boolean; + private eitVALSettoCall: any = []; + private textInput; + private numberInput; + private dateInput; + public direction: string; + private datetimeInput; + private timeInput; + private selectInput; + private hiddenInput; + private validateEitObj: any = []; + public menuType: any; + public respID; + public selEmp; + public eitRequest; + public ExtraObj; + + selMenu: MenuResponse; + public functionName; + + public headerTitle; + getPassdirfromNotifiPage: boolean = false; + private validEitTransactionTbl: any = []; + eitSubmitAction: number = 0; + updatedValues: any = []; + comtransNo: any = 1; + programList: any = []; + public template: any; + constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, public eitService: EitService) { } + + ngOnInit() { + this.getPassdirfromNotifiPage = this.cs.sharedService.getSharedData('dirfromNotificationPage'); + this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false); + this.getConcurrentProgram(); + this.direction = TranslatorService.getCurrentLanguageName(); + // this.effectiveDate = new Date(); + this.functionName = this.selectedMenu.FUNCTION_NAME; + // this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + } + getConcurrentProgram() { + this.cs.startLoading(); + this.reports.getConcurrentProgram({ + P_REQUEST_GROUP_ID: this.selectedMenu.REQUEST_GROUP_ID + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + this.cs.stopLoading(); + this.programList = response.GetConcurrentProgramsList; + + }) + } + getCppDiffStructure(programList) { + this.cs.startLoading(); + this.reports.getCPPDiffStructure({ + P_DESC_FLEX_NAME: programList.CONCURRENT_PROGRAM_NAME + }, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => { + this.cs.stopLoading(); + this.handleDiffStructure(response); + }) + } + handleDiffStructure(result) { + if (result.GetCcpDffStructureList != null) { + this.diffStructure = result.GetCcpDffStructureList; + this.drawEitFields(result.GetCcpDffStructureList); + if (this.isUpdate) { + //this.submitAbsObjList = this.cs.sharedService.getSharedData(ProfileService.EMP_ADDRESS); + //this.fillAbsStructure(); + } + } + } + private drawEitFields(feildsList) { + const containerId = "containerDiv"; + this.eitVALSettoCall = []; + for (let i = 0; i < feildsList.length; i++) { + let defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME + : ""; + let defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME + : ""; + + + if (feildsList[i].DISPLAY_FLAG != "N") { + //check if the field should be displayed + if (feildsList[i].VALIDATION_TYPE == "N") { + //text , date , time + if (feildsList[i].FORMAT_TYPE == "C") { + // character + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].FORMAT_TYPE == "N") { + // number + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].FORMAT_TYPE == "X") { + // standard date + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + //constant + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } else if (feildsList[i].FORMAT_TYPE == "Y") { + // standard date time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatStandardDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + const elem = document.getElementById( + feildsList[i].APPLICATION_COLUMN_NAME + ); + } else if (feildsList[i].FORMAT_TYPE == "I") { + //time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } + } else { + if (feildsList[i].READ_ONLY == "Y") { + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else { + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + this.fillDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].E_SERVICES_VS, + feildsList[i].E_SERVICES_DV + ); + } + } + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } else { + this.hiddenInput = new HiddenInput( + defaultVal, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultValText, + containerId + ); + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } + } + if (this.validateEitObj && this.validateEitObj.length > 0) { + this.fillEITStructure(); + } + } + fillDropdownList(segmentName, optionList: any = [], DV: any = "") { + let elemID: any = ""; + let eitObj: any; + if (optionList.length > 0) { + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + eitObj = this.diffStructure[i]; + if ( + this.diffStructure[i].READ_ONLY == "Y" || + this.diffStructure[i].DISPLAY_FLAG == "N" + ) { + return false; + } + elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME; + break; + } + } + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") { + var firstoption = document.createElement("option"); + firstoption.text = this.ts.trPK("general", "choose"); + firstoption.value = ""; + select.add(firstoption); + } + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].VALUE_COLUMN_NAME; + option.value = optionList[i].ID_COLUMN_NAME; + select.add(option); + } + if (select.dataset.hiddenval) { + select.value = select.dataset.hiddenval; + } else { + select.value = DV.P_ID_COLUMN_NAME; + } + select.disabled = false; + } + } + bindHtmlElemEvents(id, obj) { + const elem = document.getElementById(id); + console.log(elem); + console.log(obj); + const elemType = elem.tagName; + let changeEvent = "ionChange"; + + if (elemType == "SELECT") changeEvent = "change"; + + try { + elem.addEventListener(changeEvent, e => { + elem.classList.remove("requiredClassElm"); + if ( + obj.CHILD_SEGMENTS_VS_Splited && + obj.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.emptyChildElement(element); + this.getValueSet(element); + }); + } + if ( + obj.CHILD_SEGMENTS_DV_Splited && + obj.CHILD_SEGMENTS_DV_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_DV_Splited; + listArray.forEach(element => { + this.emptyChildElement(element); + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == element) { + this.getDefaultValue( + this.diffStructure[i], + this.diffStructure[i].DESC_FLEX_NAME, + this.diffStructure[i].DESC_FLEX_CONTEXT_CODE, + this.diffStructure[i].SEGMENT_NAME, + this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS, + this.diffStructure[i].PARENT_SEGMENTS_DV_Splited + ); + } + } + }); + } + return false; + }); + } catch (e) { + console.log(e.status); + } + } + public getDefaultValue( + obj, + descFlexName, + descFlexContextCode, + segmentName, + parentValue, + ParentsList + ) { + let dependenciesList: any = []; + let parentVal: any = null; + let isStandardDate: boolean = false; + let isStandardTimeDate: boolean = false; + let isStandardTime: boolean = false; + let isHidden: boolean = false; + let isReadOnlyList: boolean = false; + let isSelectElement: boolean = false; + isStandardDate = this.isStandardDate(obj); + isStandardTimeDate = this.isStandardDateTime(obj); + isStandardTime = this.isStandardTime(obj); + if (obj.DISPLAY_FLAG == "N") isHidden = true; + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") { + isReadOnlyList = true; + } + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") { + isSelectElement = true; + } + if ( + parentValue != "" && + (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y") + ) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + if (parentValue) ParentsList.concat(parentValue); + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList + }; + + this.eitService.getDefaultValue(body).subscribe((result: any) => { + let elem = this.getElementByName(segmentName); + let obj = this.handleDefaultValueResult(result); + let val = obj.value; + let text = obj.text; + if (val == null) { val = ""; } + if (text == null) { text = ""; } + if (isStandardDate) { + console.log("isStandardDate"); + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardTimeDate) { + console.log("isStandardTimeDate"); + if (val) { + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else if (isStandardTime) { + console.log("isStandardTime"); + if (val) { + elem.dataset.dtvalue = val; + elem.innerHTML = val; + elem.value = val; + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else { + if (isSelectElement) { + let elem = this.getSelectElementByName(segmentName); + elem = document.getElementById(elem), + elem.value = val; + } else { + elem.value = val; + elem.innerText = text; + elem.setAttribute("value", val); + } + } + if (isHidden || isReadOnlyList) { + if (val) elem.dataset.colmText = val; + else elem.dataset.colmText = ""; + elem.value = text; + } + var event = new Event("ionChange"); + elem.dispatchEvent(event); + }); + } + + handleDefaultValueResult(result) { + let data = { + text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME, + value: result.GetDefaultValueList.P_ID_COLUMN_NAME + }; + return data; + } + getSelectElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME; + break; + } + } + return elemID; + } + getElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME; + break; + } + } + return document.getElementById(elemID) as HTMLInputElement; + } + + fillEITStructure() { + var obj = { peiObjVer: null, peiExtraInfoID: null }; + for (let i = 0; i < this.validateEitObj.length; i++) { + let val: any; + if (this.validateEitObj[i].VARCHAR2_VALUE) + val = this.validateEitObj[i].VARCHAR2_VALUE; + else if (this.validateEitObj[i].DATE_VALUE) + val = this.validateEitObj[i].DATE_VALUE; + else if (this.validateEitObj[i].NUMBER_VALUE) + val = this.validateEitObj[i].NUMBER_VALUE; + const elem = document.getElementById( + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER; + if (elem) { + if (val) { + let feldDetails = this.diffStructure.find( + x => + x.APPLICATION_COLUMN_NAME == + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ); + if (feldDetails) { + let isStandardDate = this.isStandardDateVal(feldDetails); + let isStandardDateTime = this.isStandardDateTimeVal(feldDetails); + let isStandardTime = this.isStandardTimeVal(feldDetails); + if (isStandardDate) { + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardDateTime) { + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + } else if (isStandardTime) { + elem.innerHTML = val; + elem.dataset.dtvalue = val; + } else { + elem.value = val; + elem.setAttribute("value", elem.value); + } + if ( + feldDetails.DISPLAY_FLAG == "N" || + (feldDetails.VALIDATION_TYPE != "N" && + feldDetails.READ_ONLY == "Y") + ) { + elem.dataset.colmText = val; + elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP; + elem.setAttribute("value", elem.value); + } + } + elem.dataset.hiddenval = val; //hide the value to set it after calling get value set + if ( + feldDetails.CHILD_SEGMENTS_VS_Splited && + feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.getValueSet(element); + }); + } + // var event = new Event('change'); + // elem.dispatchEvent(event); + } + } else { + if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == + "PEI_OBJECT_VERSION_NUMBER" + ) + obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE; + else if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID" + ) + obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE; + } + } + this.ExtraObj = obj; + } + public getValueSet(segmentName) { + let descFlexName: any = ""; + let descFlexContextCode: any = ""; + let parentValue: any = []; + let ParentsList: any = []; + let parentVal: any = null; + let dependenciesList: any = []; + let validationType: string = ""; + + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + descFlexName = this.diffStructure[i].DESC_FLEX_NAME; + descFlexContextCode = this.diffStructure[i].DESC_FLEX_CONTEXT_CODE; + parentValue = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS; + ParentsList = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS; + validationType = this.diffStructure[i].VALIDATION_TYPE; + break; + } + } + if (parentValue != "" && (validationType == "D" || validationType == "Y")) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList, + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + }; + + this.eitService.getSetValue(body).subscribe((result: any) => { + if (result.GetValueSetValuesList != null) { + this.fillDropdownList(segmentName, result.GetValueSetValuesList); + } + }); + let arr: any = []; + return arr; + } + isStandardDateVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + + isSt = true; + + } + return isSt; + } + + emptyChildElement(segmentName) { + let elem = this.getElementByName(segmentName); + elem.value = null; + elem.innerHTML = ""; + if ("dtvalue" in elem.dataset) { + elem.dataset.dtvalue = ""; + } + if ("colmText" in elem.dataset) { + elem.dataset.colmText = ""; + } + var event = new Event("change"); + elem.dispatchEvent(event); + elem.classList.remove("requiredClassElm"); + } + getDependenciesParams(parentsList) { + let parentArr: any = []; + for (let i = 0; i < parentsList.length; i++) { + for (let j = 0; j < this.diffStructure.length; j++) { + if (this.diffStructure[j].SEGMENT_NAME == parentsList[i].Name) { + if (this.diffStructure[j].DISPLAY_FLAG != "N") { + if (this.diffStructure[j].VALIDATION_TYPE == "N") { + let idColName: string; + let val: any; + if ( + this.diffStructure[j].FORMAT_TYPE == "Y" || + this.diffStructure[j].FORMAT_TYPE == "I" + ) { + //standard date time or //time + let elem = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLDivElement; + val = elem.dataset.dtvalue; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.diffStructure[j].FORMAT_TYPE == "Y") + idColName = this.cs.formatStandardDate(val); + } else { + val = (document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.diffStructure[j].FORMAT_TYPE == "X") { + //date + // idColName = this.cs.formatDate(val); + idColName = this.cs.formatDateNew(val); + } + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: val, + DESCRIPTION: "", + ID_COLUMN_NAME: idColName, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + if (this.diffStructure[j].READ_ONLY != "Y") { + let x = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let text = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : ""; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : undefined; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + let x = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } else { + let x = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } + } + return parentArr; + } + + isStandardTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard time + //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + //} + } + return isSt; + } + isStandardDateTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + //} + } + return isSt; + } + + isStandardDateTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + isStandardTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + isStandardDate(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + // standard date + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + fixTransactionNo(): any[] { + const list: any = []; + let newIndex = 1; + const length: number = this.validEitTransactionTbl.length; + for (let i = 0; i < length; i++) { + // let item :any={}; + const item = Object.assign({}, this.validEitTransactionTbl[i]); + const transNo: number = item.TRANSACTION_NUMBER; + const obj: any = item; + if (i == 0) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + const prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER; + if (transNo == prevEl) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + newIndex++; + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } + } + } + return list; + } + removeItems(transNo) { + const list = []; + for (let i = 0; i < this.validEitTransactionTbl.length; i++) { + if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo) { + list.push(this.validEitTransactionTbl[i]); + } + } + this.validEitTransactionTbl = list; + } + submitTransaction() { + // (this.elementRef.nativeElement.querySelectorAll( + // "ion-item" + // ) as HTMLElement[]).forEach(x => { + // x.classList.add("ng-touched"); + // x.classList.remove("ng-untouched"); + // }); + + // let arrValues = this.getElementsValues(); + + // if (arrValues) { + // if (!this.startDate || !this.endDate) { + // //this.common.showRequiredMsg(); + // return false; + // } + // let Sdata = moment(this.startDate).format("MM/DD/YYYY"); + // let Edata = moment(this.endDate).format("MM/DD/YYYY"); + + this.eitRequest = new EitRequest(); + const list: any = this.getElementsValues(); + this.eitRequest.EITTransactionTBL = list; + this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + this.eitRequest.P_MENU_TYPE = this.selectedMenu.MENU_TYPE; + this.eitRequest.P_SELECTED_RESP_ID = -999;// this.selectedMenu.RESP_ID; // this.selMenu.List_Menu.RESP_ID,//-999, + this.eitRequest.P_FUNCTION_NAME = this.functionName; + this.eitRequest.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME; + // this.reportSubmitRequest = {} + this.cs.startLoading(); + this.reports + .submitTransaction(this.eitRequest, {}, this.ts.trPK('general', 'retry')) + .subscribe((result: any) => { + + this.handleSubmit(result); + }); + } + + + + private handleSubmit(result) { + + if (this.cs.validResponse(result)) { + //call another API to check the response; + this.checkStatus(result); + + + } + } + checkStatus(result) { + var request: any = {}; + request.P_USER_NAME = this.selEmp; + request.P_MENU_TYPE = this.selectedMenu.MENU_TYPE; + request.P_SELECTED_RESP_ID = -999; + request.P_FUNCTION_NAME = this.functionName; + request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME; + + this.reports.getTransaction(this.eitRequest, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + this.cs.stopLoading(); + this.cs.sharedService.setSharedData(result['GetCcpTransactionsList_New'], ReportServiceService.TRANSACTION_LIST); + this.cs.sharedService.setSharedData(this.template, ReportServiceService.TEMPLATE); + this.cs.openConcurrentTransaction(); + }); + } + public getElementsValues(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = this.comtransNo; + let textValue: any; + // if(this.ExtraObj.transactionNo) + // transNo=this.ExtraObj.transactionNo; + for (let i = 0; i < this.diffStructure.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + /*********set transaction No of the updated object ********/ + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.diffStructure[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + } + if (this.diffStructure[i].DISPLAY_FLAG != "N") { + if (this.diffStructure[i].VALIDATION_TYPE == "N") { + let elem = document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let elemVal = (document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + textValue = elemVal; + //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value; + if ( + this.diffStructure[i].FORMAT_TYPE == "X" && + this.diffStructure[i].DISPLAY_FLAG != "N" + ) { + //date + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.diffStructure[i].FORMAT_TYPE == "Y" && + this.diffStructure[i].DISPLAY_FLAG != "N" + ) { + //standard date time + // elemVal = elem.dataset.dtvalue; + // elemVal = this.cs.formatStandardDate(elemVal); + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.diffStructure[i].FORMAT_TYPE == "I" && + this.diffStructure[i].DISPLAY_FLAG != "N" + ) { + //time + if (elemVal.length > 5) { + elemVal = elemVal.substring(11, 16); + } else { + elemVal = elemVal; + } + } + if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + // if (elemVal != 'null'){ + varcharValue = elemVal; + //} else{ + // elemVal = null; + // } + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (this.diffStructure[i].READ_ONLY == "Y") { + let text = x.value; + let val = x.dataset.colmText; + varcharValue = val; + textValue = text; + } else { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + let txt = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : null; + varcharValue = val; + textValue = txt; + } + if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } //end else + } else { + let x = document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let val = x.dataset.colmText; + textValue = x.value; + if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + if (val) varcharValue = val; + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.diffStructure[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.diffStructure[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + let y = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue, + SEGMENT_VALUE_DSP: textValue, + APPLICATION_COLUMN_NAME: this.diffStructure[i] + .APPLICATION_COLUMN_NAME, + DATATYPE: this.diffStructure[i].DATATYPE, + DESC_FLEX_CONTEXT_CODE: this.diffStructure[i].DESC_FLEX_CONTEXT_CODE, + DESC_FLEX_NAME: this.diffStructure[i].DESC_FLEX_NAME, + DISPLAY_FLAG: this.diffStructure[i].DISPLAY_FLAG, + SEGMENT_NAME: this.diffStructure[i].SEGMENT_NAME, + SEGMENT_PROMPT: this.diffStructure[i].SEGMENT_PROMPT + }; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } + } + } // end for + + if (this.getPassdirfromNotifiPage) { + let updatedObj1 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION" + ); + let updatedObj2 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID" + ); + let updatedObj3 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER" + ); + this.updatedValues.push(updatedObj1); + this.updatedValues.push(updatedObj2); + this.updatedValues.push(updatedObj3); + valuseArr = this.fillExtraInformation( + valuseArr, + updatedObj1.VARCHAR2_VALUE, + updatedObj2.NUMBER_VALUE, + updatedObj3.NUMBER_VALUE, + transNo + ); + } else { + if (this.eitSubmitAction == EIT_ACTION.ADD) { + this.updatedValues = this.fillExtraValuesUpdated( + this.updatedValues, + "NEW_ROW", + -1, + 0, + transNo + ); + valuseArr = this.fillExtraInformation( + valuseArr, + "NEW_ROW", + -1, + 0, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "UPDATE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.DELETE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "DELETE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } + } + return valuseArr; + } // end getElementsValues + fillExtraInformation( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_ACTION", + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_EXTRA_INFO_ID", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiExtraInfoID, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATE_VALUE: null + }); + return values; + } + fillExtraValuesUpdated( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + let obj1 = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null, + SEGMENT_VALUE_DSP: "", + APPLICATION_COLUMN_NAME: "PEI_ACTION", + DATATYPE: "VARCHAR2", + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj2 = { + TRANSACTION_NUMBER: 1, + APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATATYPE: "NUMBER", + SEGMENT_VALUE_DSP: "", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj3 = { + APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID", + DATATYPE: "NUMBER", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + NUMBER_VALUE: peiExtraInfoID, + SEGMENT_NAME: "", + SEGMENT_PROMPT: "", + SEGMENT_VALUE_DSP: "", + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: null + }; + values.push(obj1); + values.push(obj2); + values.push(obj3); + return values; + } + selectTemplates() { + this.elementRef + .nativeElement.querySelectorAll('#containerDiv')[0].innerHTML = ''; + this.getCppDiffStructure(this.template); + } + refreshStatus() { + + } +} diff --git a/Mohem/src/app/reports/report-service.service.spec.ts b/Mohem/src/app/reports/report-service.service.spec.ts new file mode 100644 index 00000000..dbf6efe5 --- /dev/null +++ b/Mohem/src/app/reports/report-service.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { ReportServiceService } from './report-service.service'; + +describe('ReportServiceService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: ReportServiceService = TestBed.get(ReportServiceService); + expect(service).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/reports/report-service.service.ts b/Mohem/src/app/reports/report-service.service.ts new file mode 100644 index 00000000..9196cb2c --- /dev/null +++ b/Mohem/src/app/reports/report-service.service.ts @@ -0,0 +1,76 @@ +import { Injectable } from '@angular/core'; +import { AuthenticationService } from '../hmg-common/services/authentication/authentication.service'; +import { CommonService } from '../hmg-common/services/common/common.service'; +import { ConnectorService } from '../hmg-common/services/connector/connector.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ReportServiceService { + public static GET_CONCURRENT_PROGRAM = 'Services/ERP.svc/REST/GET_CONCURRENT_PROGRAMS'; + public static GET_CPP_DIFF_STRUCTURE = 'Services/ERP.svc/REST/GET_CCP_DFF_STRUCTURE'; + public static SUBMIT_CPP_REQUEST = 'Services/ERP.svc/REST/SUBMIT_CCP_TRANSACTION'; + public static SUBMIT_CPP_TRANSACTION = 'Services/ERP.svc/REST/GET_CCP_TRANSACTIONS'; + public static GET_CCP_OUTPUT = 'Services/ERP.svc/REST/GET_CCP_OUTPUT'; + + public static TRANSACTION_LIST = 'transaction-list'; + public static TEMPLATE = 'template'; + constructor( + public con: ConnectorService, + private authService: AuthenticationService, + public cs: CommonService + ) { } + + getConcurrentProgram(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ReportServiceService.GET_CONCURRENT_PROGRAM, + request, + onError, + errorLabel + ); + } + getCPPDiffStructure(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ReportServiceService.GET_CPP_DIFF_STRUCTURE, + request, + onError, + errorLabel + ); + } + submitTransaction(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ReportServiceService.SUBMIT_CPP_REQUEST, + request, + onError, + errorLabel + ); + } + getTransaction(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ReportServiceService.SUBMIT_CPP_TRANSACTION, + request, + onError, + errorLabel + ); + } + + getCppOutput(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + ReportServiceService.GET_CCP_OUTPUT, + request, + onError, + errorLabel + ); + } + +} diff --git a/Mohem/src/app/reports/reports.module.ts b/Mohem/src/app/reports/reports.module.ts new file mode 100644 index 00000000..0fc1953d --- /dev/null +++ b/Mohem/src/app/reports/reports.module.ts @@ -0,0 +1,43 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { Routes, RouterModule } from '@angular/router'; + +import { IonicModule } from '@ionic/angular'; + +import { ReportsPage } from './reports.page'; +import { ConcurrentReportComponent } from './concurrent-report/concurrent-report.component'; +import { ReportServiceService } from './report-service.service'; +import { HmgCommonModule } from '../hmg-common/hmg-common.module'; +import { TransactionListComponent } from './transaction-list/transaction-list.component'; + + +const routes: Routes = [ + { + path: '', + component: ReportsPage, + children: [ + { + path: 'concurrent-report', + component: ConcurrentReportComponent + }, + { + path: 'transaction-list', + component: TransactionListComponent + }, + ], + } +]; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + RouterModule.forChild(routes), + HmgCommonModule + ], + declarations: [ReportsPage, ConcurrentReportComponent, TransactionListComponent], + providers: [ReportServiceService] +}) +export class ReportsPageModule { } diff --git a/Mohem/src/app/reports/reports.page.html b/Mohem/src/app/reports/reports.page.html new file mode 100644 index 00000000..67cbe279 --- /dev/null +++ b/Mohem/src/app/reports/reports.page.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Mohem/src/app/reports/reports.page.scss b/Mohem/src/app/reports/reports.page.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/reports/reports.page.spec.ts b/Mohem/src/app/reports/reports.page.spec.ts new file mode 100644 index 00000000..94e66db4 --- /dev/null +++ b/Mohem/src/app/reports/reports.page.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReportsPage } from './reports.page'; + +describe('ReportsPage', () => { + let component: ReportsPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ReportsPage ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ReportsPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/reports/reports.page.ts b/Mohem/src/app/reports/reports.page.ts new file mode 100644 index 00000000..13faa7bd --- /dev/null +++ b/Mohem/src/app/reports/reports.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-reports', + templateUrl: './reports.page.html', + styleUrls: ['./reports.page.scss'], +}) +export class ReportsPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.html b/Mohem/src/app/reports/transaction-list/transaction-list.component.html new file mode 100644 index 00000000..cfffd088 --- /dev/null +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.html @@ -0,0 +1,48 @@ + +
+ + + +
+
+
+ +
+ +
+ +
{{getDate(transaction.REQUEST_DATE)}}
+ + +
+

{{'transaction, request-id' | translate}}

+

+ {{transaction.REQUEST_ID}} +

+
+

{{'transaction, phase' | translate}}

+

{{transaction.CCP_PHASE}}

+
+ + +
+

{{'transaction,program-name' | translate}}

+

{{transaction.CONCURRENT_PROGRAM_NAME}}

+
+
+ + +
+

{{'transaction,output' | translate}}

+

+

+
+ +
+
+ +
+ +
+ +
diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.scss b/Mohem/src/app/reports/transaction-list/transaction-list.component.scss new file mode 100644 index 00000000..8e18b14f --- /dev/null +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.scss @@ -0,0 +1,146 @@ +.display-created{ + display: inline-block; + margin:2px; + color:#000; +} +#containerDiv{ + margin-top:20px; +} +.padding{ + padding-left:5px; + padding-right: 5px; +} +.bold{ + font-weight: bold; + font-size: 16px; +} +.color-black{ + color:#000; +} +.date{ + position: absolute; + font-size: 14px; + padding: 10px; + right:0; + width: 100px; + color:#969696; +} +.date_ar{ + position: absolute; + font-size: 14px; + padding: 10px; + left:0; + width: 100px; + color:#969696; +} +.transaction-list{ + margin-top:20px; +} +.date-container{ + margin:0px 20px; +} + +.label{ + font-size: 16px; + // margin-left: 15px; + color: #a2a5a6 !important; + display: block; + overflow: hidden; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + /* font-size: inherit; */ + // text-overflow: ellipsis; + // white-space: nowrap; + white-space: normal; + // padding-top: 10px; + padding: 5px 0px; + padding-left: 10px !important; + margin: 10px auto; + :root[dir="ltr"]{ + font-family: var(--fontFamilySemiBoldEN) !important; + } + :root[dir="rtl"]{ + font-family: var(--fontFamilyIOSAR) !important; + font-weight: bold; + } + + +} + +.Field-en{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 15px; + padding-left: 20px !important; + padding-top: 6px !important; + color: #999999 !important; +} + +.Field-ar{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 20px; + padding-right: 20px !important; + padding-top: 6px !important; + color: #999999 !important; +} +select{ + width: 300px !important; + border: none !important; +} +.padding_date{ + padding-left:5px !important; +} +.date-icon{ + font-size: 20px; + left: -1px; + position: relative; + top: 2px; +} +ion-card{ + padding:10px; + border-radius: 11px; + box-shadow: 0px 1px 2px 1px #ccc; +} +.display-inline{ + display:inline-block; + +} +.red{ +color:#CA3332; +font-weight: 600; +margin:0px 5px; +overflow: hidden; + width: 90%; + white-space: nowrap; + text-overflow: ellipsis; +} +.inline-display{ + display: inline-block; + font-weight: 600; + padding-left:8px; +} +.download{ + font-size: 26px; + margin: 0px 10px; + position: relative; + top: 5px; + color: #CA3332; +} +.refresh{ + font-size: 22px; + margin: 0px 10px; + position: relative; + top: 5px; + color: #CA3332; +} +.disabled-icon{ + pointer-events: none; + opacity: .5; +} +.output-container{ + position: relative; + bottom: 10px; +} \ No newline at end of file diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts b/Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts new file mode 100644 index 00000000..9a3a75e7 --- /dev/null +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TransactionListComponent } from './transaction-list.component'; + +describe('TransactionListComponent', () => { + let component: TransactionListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TransactionListComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TransactionListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.ts b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts new file mode 100644 index 00000000..53449f9d --- /dev/null +++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts @@ -0,0 +1,103 @@ +import { Component, ElementRef, OnInit } from '@angular/core'; +import { File } from '@ionic-native/file/ngx'; +import { Platform } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ReportServiceService } from '../report-service.service'; +import { FileOpener } from '@ionic-native/file-opener/ngx'; +@Component({ + selector: 'app-transaction-list', + templateUrl: './transaction-list.component.html', + styleUrls: ['./transaction-list.component.scss'], +}) +export class TransactionListComponent implements OnInit { + transactionList: any = []; + selectedMenu: any; + template: any; + direction: any; + constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService, private platform: Platform, private file: File, private opener: FileOpener, + ) { } + + ngOnInit() { + this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false); + this.transactionList = this.cs.sharedService.getSharedData(ReportServiceService.TRANSACTION_LIST, false); + this.template = this.cs.sharedService.getSharedData(ReportServiceService.TEMPLATE, false); + this.direction = TranslatorService.getCurrentDirection(); + } + getDate(date) { + return this.cs.evaluteDate(date); + } + getCppOutput(transaction) { + var request: any = { + P_REQUEST_ID: transaction['REQUEST_ID'] + }; + this.cs.startLoading(); + this.reports.getCppOutput(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + this.saveAndOpenPdf(result.GetCcpOutputList['P_OUTPUT_FILE'], 'report.pdf'); + + console.log(result); + this.cs.stopLoading(); + + }); + } + // saveAndOpenPdf(pdf: string, filename: string) { + + // const linkSource = `data:application/pdf;base64,${pdf}`; + // const downloadLink = document.createElement("a"); + // const fileName = "report.pdf"; + // downloadLink.href = linkSource; + // downloadLink.download = fileName; + // downloadLink.click(); + + // } + + saveAndOpenPdf(pdf: string, filename: string) { + const writeDirectory = this.platform.is('ios') ? this.file.dataDirectory : this.file.externalDataDirectory; + this.file.writeFile(writeDirectory, filename, this.convertBase64ToBlob(pdf, 'data:application/pdf;base64'), { replace: true }) + .then(() => { + this.opener.open(writeDirectory + filename, 'application/pdf') + .catch(() => { + console.log('Error opening pdf file'); + }); + }) + .catch(() => { + console.error('Error writing pdf file'); + }); + } + + convertBase64ToBlob(b64Data, contentType): Blob { + contentType = contentType || ''; + const sliceSize = 512; + b64Data = b64Data.replace(/^[^,]+,/, ''); + b64Data = b64Data.replace(/\s/g, ''); + const byteCharacters = window.atob(b64Data); + const byteArrays = []; + for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) { + const slice = byteCharacters.slice(offset, offset + sliceSize); + const byteNumbers = new Array(slice.length); + for (let i = 0; i < slice.length; i++) { + byteNumbers[i] = slice.charCodeAt(i); + } + const byteArray = new Uint8Array(byteNumbers); + byteArrays.push(byteArray); + } + return new Blob(byteArrays, { type: contentType }); + } + refresh(transaction) { + var request: any = { + P_REQUEST_ID: transaction['REQUEST_ID'] + }; + this.cs.startLoading(); + var request: any = {}; + request.P_MENU_TYPE = this.selectedMenu.MENU_TYPE; + request.P_SELECTED_RESP_ID = -999; + request.P_FUNCTION_NAME = this.selectedMenu.FUNCTION_NAME; + request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME; + + this.reports.getTransaction(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => { + this.cs.stopLoading(); + this.transactionList = result['GetCcpTransactionsList_New']; + }); + } +} diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.html b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.html new file mode 100644 index 00000000..d7e4b690 --- /dev/null +++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.html @@ -0,0 +1,123 @@ + + + + + + + + +
{{'general, addAttach' | translate}}
+
+ +
+ +
+
+
+ + + {{ 'general, notAttch' | translate}} + +
+ + +
+ + + + {{attachList.AttachmentID +1 }} . + + + + + {{attachList.P_FILE_NAME }} + + + + + + + +
+ +
+ +
+ + +
+
+ + {{attachRes.FILE_NAME }} + +
+ + + + +
+
+ +
+ + + +
{{'confirmAddEit, comment' | translate}}
+ + + +
+ + +
{{'confirmAddEit, approverList' | translate}}
+
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+
+ +
+
+ + + {{employee.APPROVER}} + + + {{employee.POSITION_TITLE}} + + + +
+
+
+
+
+ +
+ + +
+ + +
+ + {{ 'general, submit' | translate }} +
+
\ No newline at end of file diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss new file mode 100644 index 00000000..2ed98379 --- /dev/null +++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss @@ -0,0 +1,263 @@ +.footer-button { + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + .imgSize { + width: 22px; + height: 22px; + } + + .Header { + font-weight: bold; + color: #1a586d !important; + font-size: 10px; + } + + .tbData { + font-size: 10px; + } + + .btnBack { + background: transparent; + float: right; + } + + .attachmentDiv{ + background: #ffffff; + height: auto; + text-align: center; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + .submitNote{ + background: #ffffff; + height: 80px; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .approvalList{ + --background: #f0efef; + height: auto; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + + /************************New Design**********************************/ + .notification-list{ + background: none; + background: none; + border-radius: 32px; + ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 100%; + font-size: 16px; + font-weight: bold; + + text-align: start; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 12%; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + padding-top: 15%; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + + } + } + + + + + + + .timeline { + position: relative; + margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); + } + + .timeline:before { + + content: ''; + position: inherit !important; + top: 0; + bottom: 0; + width: 4px; + // background: #e4e4e4; + z-index: 1; + left: 35px; + /* margin-left: -10px; */ + /* z-index: 1; */ + } + + .timeline .timeline-thumb { + + border-radius: 500px; + width: 70px !important; + z-index: 2; + position: absolute; + left: 0px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; + } + + .timeline .timeline-thumb.timeline-icon { + height: 70px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); + } + + + + .timeline .timeline-item { + width: 40px; + + } + + .timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + + } + + .empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + + } + .empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; + } + + .line{ + padding-bottom:87px; + } + + .attachLable{ + position: absolute; + top: 0px; + z-index: 0; + background: #30b8c6; + color: #fff; + border-radius: 50%; + border: 0px; + width: 24px; + height: 24px; + text-align: center; + font-size: 5px; + } + + .removeLable{ + top: 0px; + z-index: 0; + background: #d8252d; + color: #fff; + border-radius: 50%; + border: 0px; + width: 20px; + height: 20px; + text-align: center; + font-size: 5px; + } + + .note-modal { + // width: 90%; + // height: 50%; + // top: 20%; + // left: 5%; + // right: 5%; + // bottom: 5%; + background: rgba(0, 0, 0, 0.5) !important; + padding: 30% 10% !important; + --height: 12cm !important; + // --width: 80% !important; + --border-radius:20px; + + } + .header-toolbar-new{ + --background: #269DB8; + } + .title{ + margin-top: -37px; + margin-left: 85px; + } + .title-ar{ + margin-top: -37px; + margin-right: 101px; + } + .confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + background-color: #269DB8; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + .approvalTitle-ar{ + font-weight: bold; + font-size: 16px; + text-align: right; + + } + .approvalTitle{ + font-weight: bold; + font-size: 16px; + text-align: left; + } + \ No newline at end of file diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts new file mode 100644 index 00000000..c9818fc1 --- /dev/null +++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfirmTerminationComponent } from './confirm-termination.component'; + +describe('ConfirmTerminationComponent', () => { + let component: ConfirmTerminationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ConfirmTerminationComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfirmTerminationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts new file mode 100644 index 00000000..c0de3bb0 --- /dev/null +++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts @@ -0,0 +1,433 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { FileUploader } from 'ng2-file-upload'; +import { AddAttachComponent } from 'src/app/eit/add-attach/add-attach.component'; +import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes'; +import { EitService } from 'src/app/eit/services/eit.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { HomeComponent } from 'src/app/notification/home/home.component'; +import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq'; +import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component'; +import { BasicRequest } from 'src/app/profile/models/basic.request'; +import { SubmitAddressModalComponent } from 'src/app/profile/submit-eit-modal/submit-address-modal.component'; +import { TerminationServiceService } from '../service/termination-service.service'; + +@Component({ + selector: 'app-confirm-termination', + templateUrl: './confirm-termination.component.html', + styleUrls: ['./confirm-termination.component.scss'], +}) +export class ConfirmTerminationComponent implements OnInit { + + + private P_TransactionID: number; + + approversList = []; + responseList: any; + eitComments: string = ""; + menuType: string = ""; + selEmp: string = ""; + respID: number; + selMenu: MenuResponse; + getAttachList: any; + attachListDisplay: any = []; + headerTitle: string = ""; + isTrue: any = 0; + attachItems: any; + public isResubmitEIT: boolean = false; + private itemKey: string = ""; + private pActionMode: string = "SUBMIT"; + attachReqObj: WorkListButtonRequest = new WorkListButtonRequest(); + attachmentRes: any; + objIndex1: any; + attachListOver: any = []; + index: any = 0; + getPassNotificationDetails: any; + isSubmitBtnClicked: boolean; + // isDelete: boolean = false; + + /***Add Attchment Vars */ + isUpload: boolean = false; + inQueue: boolean = false; + addAttachmentListReq: any; + attachmentID: number = 0; + addAttachRequest: any = []; + fileData: any; + fileType: any; + dirPage: any; + TransactionID: any; + indexLastObj: any = 0; + filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; + direction: string; + + + constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService, public terminationService: TerminationServiceService) { + this.direction = TranslatorService.getCurrentLanguageName() + this.isSubmitBtnClicked = false; + + } + + ngOnInit() { + this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + + + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.responseList = this.cs.sharedService.getSharedData(TerminationServiceService.SHARED_DATA, false); + this.itemKey = this.responseList.P_ITEM_KEY; + this.P_TransactionID = this.responseList.P_TRANSACTION_ID; + // this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; + + this.getApproversList(); + + } + + getApproversList() { + let body: any = { + P_TRANSACTION_ID: this.P_TransactionID, + P_AME_TRANSACTION_TYPE: "SSHRMS", + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + } + this.eitService.getApproversList(body).subscribe((result: any) => { + this.handleApproversResult(result); + }); + } + + handleApproversResult(result) { + if (this.cs.validResponse(result)) { + this.approversList = result.GetApprovesList; + } + } + + startEitApproval() { + if (this.attachListOver) { + let request = { + AddAttachmentList: this.attachListOver + } + + this.eitService.addAttachment( + request). + subscribe((result: any) => { + this.handleAddAttachmentResults(result); + }); + } else { + this.startApprovalProcess(); + } + } + + + handleAddAttachmentResults(result) { + + if (this.cs.validResponse(result)) { + this.isTrue = 0; + for (let i = 0; i < result.AddAttSuccessList.length; i++) { + if (!result.AddAttSuccessList[i].AddSuccess) { + this.attachListOver[i].isSuccess = false; + //this.attachItems[i].isSuccess = false; + // if false display cancel button with waring icon or design + }// end if + else { + // if true remove cancel and set isSuccess = true + // this.attachItems[i].isSuccess = true; + this.attachListOver[i].isSuccess = true; + this.isTrue = this.isTrue + 1; //count flag of attach status + } // end else + } // end for + + if (this.isTrue == result.AddAttSuccessList.length) { + this.startApprovalProcess(); + } + else { + //stope + let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; }); + this.attachListOver = filtered; + let msg: string = ""; + msg = this.ts.trPK("eit", "attach-errorMsg"); + this.cs.presentAlert(msg); + } + } + } + + startApprovalProcess() { + let request: any = {}; + + request.P_MENU_TYPE = this.menuType; + request.P_SELECTED_RESP_ID = this.respID; + request.P_TRANSACTION_ID = this.P_TransactionID; + request.P_ITEM_KEY = this.itemKey; + request.P_ACTION_MODE = this.pActionMode; + request.P_COMMENTS = this.eitComments; + this.terminationService.startApprovalProcess( + request). + subscribe((result: any) => { + this.handleResults(result); + }); + } + cancelEitProcess() { + let body: any = { + P_TRANSACTION_ID: this.P_TransactionID + } + this.eitService.cancelHRTransaction( + body). + subscribe((result: any) => { + this.handleCancelResults(result); + }); + + } + handleCancelResults(result) { + if (this.cs.validResponse(result)) { + this.isSubmitBtnClicked = false; + } + } + handleResults(result) { + if (this.cs.validResponse(result)) { + this.isSubmitBtnClicked = true; + // let msg: string = this.ts.trPK("eit", "approval-message-success"); + // this.cs.presentAlert(msg); + this.cs.greenToastPK("eit", "approval-message-success"); + this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.cs.openNotificationPage(); + } + } + + async addAttachment(str: boolean, attachItems: any) { + //open the modal with return data + let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; + + this.cs.sharedService.setSharedData(this.P_TransactionID, 'TransactionID'); + this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj'); + + const modal = await this.modalController.create({ + component: AddAttachComponent + }); + + modal.onDidDismiss() + .then((data) => { + if (data == "cancel" || data == "undefined") { + return; + } else { + if (!str) { + this.updateFile(data, attachDocID); + } else { + console.log(data); + this.attachListDisplay = data.data; + this.attachItems = this.attachListDisplay.map(function (el) { + var o = Object.assign({}, el); + o.isSuccess = false; + return o; + }); + + this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + } + } + }); + + return await modal.present(); + } + + /*****submit modal********/ + async openSubmitModal() { + this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList'); + this.cs.sharedService.setSharedData(this.eitComments, 'eitComments'); + const modal = await this.modalController.create({ + component: SubmitAddressModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + this.startEitApproval(); + } + }); + + return await modal.present(); + } + + + + removeFile(objectitem) { + if (this.attachListOver) { + let index2 = this.attachListOver.findIndex(item => item == objectitem); + if (index2 > -1) { + this.attachListOver.splice(index2, 1); + } + } + if (this.attachmentRes) { + let index3 = this.attachmentRes.findIndex(item => item == objectitem); + if (index3 > -1) { + this.attachmentRes.splice(index3, 1); + } + } + + } + + + getAttachment(NotificationID) { + this.attachReqObj.P_NOTIFICATION_ID = NotificationID; + this.eitService.getAttach(this.attachReqObj). + subscribe((result: NotificationGetAttachResponse) => { + this.handleWorkListAttachResult(result); + }); + } + + handleWorkListAttachResult(result) { + if (this.cs.validResponse(result)) { + if (result.GetAttachementList != null) { + this.attachmentRes = result.GetAttachementList; + } // if result == null + } // valid it + + } + + async OpenAttachFiles(value, Type) { + this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage'); + const modal = await this.modalController.create({ + component: WorkListAttachViewComponent + }); + + modal.onDidDismiss() + .then((data) => { + }); + return await modal.present(); + } + + + delelteFile(attach) { + this.cs.confirmAlertDialog((data) => { + if (data == true) { + this.continueDelete(attach); + } + }, this.ts.trPK('general', 'ok'), () => { + + }, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm')); + } + + continueDelete(attach) { + let req = { + P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID + } + this.eitService.deleteAttach(req). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") { + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + let msg: string = ""; + msg = this.ts.trPK("eit", "deleteAttach"); + this.cs.presentAlert(msg); + } + } + }); + } + + updateFile(attachList, attachDocID) { + let req = { + P_ATTACHED_DOCUMENT_ID: attachDocID, + P_FILE_DATA: attachList[0].P_FILE_DATA, + P_FILE_NAME: attachList[0].P_FILE_NAME, + P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE + } + this.eitService.updateAttach(req). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (result.MessageStatus == 1) { + let msg: string = ""; + msg = this.ts.trPK("eit", "attachUpdate"); + this.cs.presentAlert(msg); + this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); + } + } + }); + } + + + ionViewWillLeave() { + if (this.P_TransactionID && this.isSubmitBtnClicked == false) + this.cancelEitProcess(); + } + + /*******************Add attchement Functions*************/ + + public uploader: FileUploader = new FileUploader({ + allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async (item) => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + onFileSelectedclick(event) { + event.target.value = ''; + } + + + + onFileSelected(input) { + + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "notSupport"); + this.cs.presentAlert(msg); + return + } // todo: show alert that you tried uploading wrong files + + else { + const file = input.target.files[0]; + this.getBase64(file).then( + data => this.pushObject(data, file.name, file.type) + ); + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); + } + + + pushObject(fileData, name, type) { + + console.log("before push: " + this.index); + try { + let array = name.split('.'); + let attachType: string = array[array.length - 1]; + this.attachListOver.push( + { + AttachmentID: this.attachListOver.length, + P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], + P_FILE_DATA: fileData.split(',')[1], + P_FILE_NAME: name,//.split('.')[0], + P_TRANSACTION_ID: this.P_TransactionID + }) + + } catch (e) { + } + } + + +} diff --git a/Mohem/src/app/termination/service/termination-service.service.spec.ts b/Mohem/src/app/termination/service/termination-service.service.spec.ts new file mode 100644 index 00000000..f9172295 --- /dev/null +++ b/Mohem/src/app/termination/service/termination-service.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { TerminationServiceService } from './termination-service.service'; + +describe('TerminationServiceService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: TerminationServiceService = TestBed.get(TerminationServiceService); + expect(service).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/termination/service/termination-service.service.ts b/Mohem/src/app/termination/service/termination-service.service.ts new file mode 100644 index 00000000..5f2d94e1 --- /dev/null +++ b/Mohem/src/app/termination/service/termination-service.service.ts @@ -0,0 +1,63 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; + +@Injectable({ + providedIn: 'root' +}) +export class TerminationServiceService { + + public static GET_TERM_COLS_STRUCTURE = 'Services/ERP.svc/REST/GET_TERM_COLS_STRUCTURE'; + public static GET_TERM_DIFF_STRUCTURE = 'Services/ERP.svc/REST/GET_TERM_DFF_STRUCTURE'; + public static SUBMIT_TRANSACTION = 'Services/ERP.svc/REST/SUBMIT_TERM_TRANSACTION'; + public static START_APPORVAL = 'Services/ERP.svc/REST/START_TERM_APPROVAL_PROCESS'; + public static TERMINATION_PAGE = 'termination-page'; + public static SHARED_DATA = 'termination-submit-data'; + constructor( + public con: ConnectorService, + private authService: AuthenticationService, + public cs: CommonService + ) { } + getTerminationColStructure(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + TerminationServiceService.GET_TERM_COLS_STRUCTURE, + request, + onError, + errorLabel + ); + } + getTermDiffStructure(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + TerminationServiceService.GET_TERM_DIFF_STRUCTURE, + request, + onError, + errorLabel + ); + } + submitTransation(request, onError, errorLabel) { + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.postNoLoad( + TerminationServiceService.SUBMIT_TRANSACTION, + request, + onError, + errorLabel + ); + } + public startApprovalProcess(basicDetailsProcess: any, onError?: any, errorLabel?: string): Observable { + const request = basicDetailsProcess; + this.authService.authenticateRequest(request); + request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName; + return this.con.post(TerminationServiceService.START_APPORVAL, request, onError, errorLabel); + } + + + + +} diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.html b/Mohem/src/app/termination/termination-form/termination-form.component.html new file mode 100644 index 00000000..8525da97 --- /dev/null +++ b/Mohem/src/app/termination/termination-form/termination-form.component.html @@ -0,0 +1,19 @@ + +
+ + + +
+
+
+
+
+
+
+ + +
+ + {{'vacation-rule, next-label' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.scss b/Mohem/src/app/termination/termination-form/termination-form.component.scss new file mode 100644 index 00000000..652b0f19 --- /dev/null +++ b/Mohem/src/app/termination/termination-form/termination-form.component.scss @@ -0,0 +1,44 @@ +#containerDiv{ + margin:15px; +} + +@media screen and (min-width: 300px){ + .CreateBtn{ + --background: var(--newgreen) !important; + background: var(--newgreen) !important; + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 7px !important; + border-radius: 7px !important; + --min-height: 1.6cm !important; + width: 315px; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); +}} + +@media screen and (min-width: 1px) and (max-width:290px) { +.CreateBtn{ + --background: var(--newgreen) !important; + background: var(--newgreen) !important; + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 7px !important; + border-radius: 7px !important; + --min-height: 1.6cm !important; + width: 257px; + font-family: var(--fontFamilyPoppins-SemiBold, inherit); +}} + +.footer{ + padding: 15px 0px; + background-color: var(--light) !important; + border: 0px !important; + box-shadow: none !important; + -webkit-box-shadow: none; +} +.Btn{ + margin: auto; text-align: center; display: block; +} \ No newline at end of file diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.spec.ts b/Mohem/src/app/termination/termination-form/termination-form.component.spec.ts new file mode 100644 index 00000000..bb916661 --- /dev/null +++ b/Mohem/src/app/termination/termination-form/termination-form.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TerminationFormComponent } from './termination-form.component'; + +describe('TerminationFormComponent', () => { + let component: TerminationFormComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TerminationFormComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TerminationFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.ts b/Mohem/src/app/termination/termination-form/termination-form.component.ts new file mode 100644 index 00000000..a874077e --- /dev/null +++ b/Mohem/src/app/termination/termination-form/termination-form.component.ts @@ -0,0 +1,1465 @@ +import { Component, ElementRef, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import * as moment from 'moment'; +import { EITTransactionsRequest } from 'src/app/eit/models/EITTransactionsReq'; +import { EIT_ACTION } from 'src/app/eit/models/submit.eit.action'; +import { EitService } from 'src/app/eit/services/eit.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { DateTimeInput } from 'src/app/uI-elements/date-time.input'; +import { DateInput } from 'src/app/uI-elements/date.input'; +import { HiddenInput } from 'src/app/uI-elements/hidden.input'; +import { NumberInput } from 'src/app/uI-elements/number.input'; +import { SelectInput } from 'src/app/uI-elements/select.input'; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { TimeInput } from 'src/app/uI-elements/time.input'; + +import { TerminationServiceService } from '../service/termination-service.service'; + + +@Component({ + selector: 'app-termination-form', + templateUrl: './termination-form.component.html', + styleUrls: ['./termination-form.component.scss'], +}) +export class TerminationFormComponent implements OnInit { + public selectedMenu; + public diffStructure = []; + public termColStructure = []; + public isUpdate: boolean; + private eitVALSettoCall: any = []; + private textInput; + private numberInput; + private dateInput; + public direction: string; + private datetimeInput; + private timeInput; + private selectInput; + private hiddenInput; + private validateEitObj: any = []; + public menuType: any; + public respID; + public selEmp; + public eitRequest; + private ExtraObj: any = {}; + private arrValues: any = []; + selMenu: MenuResponse; + private country; + private updatedValues; + private effectiveDate; + private comtransNo; + private reportSubmitRequest = {}; + getPassdirfromNotifiPage: boolean = false; + private startDate; + private endDate; + private targetValue; + public eitSubmitAction; + constructor(public cs: CommonService, private elementRef: ElementRef, public terminationFormService: TerminationServiceService, public ts: TranslatorService, public eitService: EitService, public router: ActivatedRoute) { + this.router.queryParams.subscribe(params => { + this.targetValue = params.targetValue; + console.log(this.targetValue); + }); + + } + + ngOnInit() { + this.getPassdirfromNotifiPage = this.cs.sharedService.getSharedData('dirfromNotificationPage'); + this.selectedMenu = this.cs.sharedService.getSharedData(TerminationServiceService.TERMINATION_PAGE, false); + this.getTerminationCol(); + this.direction = TranslatorService.getCurrentLanguageName(); + this.effectiveDate = new Date(); + this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.eitSubmitAction = this.cs.sharedService.getSharedData( + EITTransactionsRequest.SUBMIT_EIT_ACTION + ); + } + getTerminationCol() { + this.cs.startLoading(); + this.terminationFormService.getTerminationColStructure({ + P_FUNCTION_NAME: this.selectedMenu.P_FUNCTION_NAME + }, () => { + + }, this.ts.trPK('general', 'retry')).subscribe((response) => { + this.termColStructure = response['GetTermColsStructureList']; + this.drawEitFieldsStatic(this.termColStructure); + this.getTermDiffStructure(); + }) + } + getTermDiffStructure() { + this.terminationFormService.getTermDiffStructure({ + P_DESC_FLEX_CONTEXT_CODE: null, + P_FUNCTION_NAME: this.selectedMenu.FUNCTION_NAME + }, () => { + this.cs.back(); + }, this.ts.trPK('general', 'retry')).subscribe((response) => { + this.cs.stopLoading(); + this.handleDiffStructure(response); + }) + } + handleDiffStructure(result) { + if (result.GetTermDffStructureList != null) { + this.diffStructure = result.GetTermDffStructureList; + this.drawEitFields(result.GetTermDffStructureList); + if (this.isUpdate) { + //this.submitAbsObjList = this.cs.sharedService.getSharedData(ProfileService.EMP_ADDRESS); + //this.fillAbsStructure(); + } + } + } + private drawEitFields(feildsList) { + const containerId = "containerDiv"; + this.eitVALSettoCall = []; + for (let i = 0; i < feildsList.length; i++) { + let defaultVal: string = ""; + let defaultValText: string = ""; + + if (feildsList[i].DISPLAY_FLAG != "N") { + //check if the field should be displayed + if (feildsList[i].VALIDATION_TYPE == "N") { + //text , date , time + if (feildsList[i].FORMAT_TYPE == "C") { + // character + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].FORMAT_TYPE == "N") { + // number + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].FORMAT_TYPE == "X") { + // standard date + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + //constant + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } else if (feildsList[i].FORMAT_TYPE == "Y") { + // standard date time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + this.cs.reverseFormatStandardDate(defaultVal), + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.datetimeInput = new DateTimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + const elem = document.getElementById( + feildsList[i].APPLICATION_COLUMN_NAME + ); + } else if (feildsList[i].FORMAT_TYPE == "I") { + //time + if ( + feildsList[i].DEFAULT_TYPE == "C" || + feildsList[i].DEFAULT_TYPE == "D" || + feildsList[i].DEFAULT_TYPE == "P" || + feildsList[i].DEFAULT_TYPE == "S" + ) { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } else { + this.timeInput = new TimeInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + } + } + } else { + if (feildsList[i].READ_ONLY == "Y") { + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else { + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + this.fillDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].E_SERVICES_VS, + feildsList[i].E_SERVICES_DV + ); + } + } + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } else { + this.hiddenInput = new HiddenInput( + defaultVal, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultValText, + containerId + ); + this.bindHtmlElemEvents( + feildsList[i].APPLICATION_COLUMN_NAME, + feildsList[i] + ); + } + } + if (this.validateEitObj && this.validateEitObj.length > 0) { + this.fillEITStructure(); + } + } + fillDropdownList(segmentName, optionList: any = [], DV: any = "") { + let elemID: any = ""; + let eitObj: any; + if (optionList.length > 0) { + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + eitObj = this.diffStructure[i]; + if ( + this.diffStructure[i].READ_ONLY == "Y" || + this.diffStructure[i].DISPLAY_FLAG == "N" + ) { + return false; + } + elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME; + break; + } + } + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") { + var firstoption = document.createElement("option"); + firstoption.text = this.ts.trPK("general", "choose"); + firstoption.value = ""; + select.add(firstoption); + } + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].VALUE_COLUMN_NAME; + option.value = optionList[i].ID_COLUMN_NAME; + select.add(option); + } + if (select.dataset.hiddenval) { + select.value = select.dataset.hiddenval; + } else { + select.value = DV.P_ID_COLUMN_NAME; + } + select.disabled = false; + } + } + bindHtmlElemEvents(id, obj) { + const elem = document.getElementById(id); + console.log(elem); + console.log(obj); + const elemType = elem.tagName; + let changeEvent = "ionChange"; + + if (elemType == "SELECT") changeEvent = "change"; + + try { + elem.addEventListener(changeEvent, e => { + elem.classList.remove("requiredClassElm"); + if ( + obj.CHILD_SEGMENTS_VS_Splited && + obj.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.emptyChildElement(element); + this.getValueSet(element); + }); + } + if ( + obj.CHILD_SEGMENTS_DV_Splited && + obj.CHILD_SEGMENTS_DV_Splited.length > 0 + ) { + let listArray: any = obj.CHILD_SEGMENTS_DV_Splited; + listArray.forEach(element => { + this.emptyChildElement(element); + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == element) { + this.getDefaultValue( + this.diffStructure[i], + this.diffStructure[i].DESC_FLEX_NAME, + this.diffStructure[i].DESC_FLEX_CONTEXT_CODE, + this.diffStructure[i].SEGMENT_NAME, + this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS, + this.diffStructure[i].PARENT_SEGMENTS_DV_Splited + ); + } + } + }); + } + return false; + }); + } catch (e) { + console.log(e.status); + } + } + public getDefaultValue( + obj, + descFlexName, + descFlexContextCode, + segmentName, + parentValue, + ParentsList + ) { + let dependenciesList: any = []; + let parentVal: any = null; + let isStandardDate: boolean = false; + let isStandardTimeDate: boolean = false; + let isStandardTime: boolean = false; + let isHidden: boolean = false; + let isReadOnlyList: boolean = false; + let isSelectElement: boolean = false; + isStandardDate = this.isStandardDate(obj); + isStandardTimeDate = this.isStandardDateTime(obj); + isStandardTime = this.isStandardTime(obj); + if (obj.DISPLAY_FLAG == "N") isHidden = true; + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") { + isReadOnlyList = true; + } + if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") { + isSelectElement = true; + } + if ( + parentValue != "" && + (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y") + ) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + if (parentValue) ParentsList.concat(parentValue); + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList + }; + + this.eitService.getDefaultValue(body).subscribe((result: any) => { + let elem = this.getElementByName(segmentName); + let obj = this.handleDefaultValueResult(result); + let val = obj.value; + let text = obj.text; + if (val == null) { val = ""; } + if (text == null) { text = ""; } + if (isStandardDate) { + console.log("isStandardDate"); + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardTimeDate) { + console.log("isStandardTimeDate"); + if (val) { + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else if (isStandardTime) { + console.log("isStandardTime"); + if (val) { + elem.dataset.dtvalue = val; + elem.innerHTML = val; + elem.value = val; + } else { + elem.dataset.dtvalue = ""; + elem.innerHTML = ""; + } + } else { + if (isSelectElement) { + let elem = this.getSelectElementByName(segmentName); + elem = document.getElementById(elem), + elem.value = val; + } else { + elem.value = val; + elem.innerText = text; + elem.setAttribute("value", val); + } + } + if (isHidden || isReadOnlyList) { + if (val) elem.dataset.colmText = val; + else elem.dataset.colmText = ""; + elem.value = text; + } + var event = new Event("ionChange"); + elem.dispatchEvent(event); + }); + } + + handleDefaultValueResult(result) { + let data = { + text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME, + value: result.GetDefaultValueList.P_ID_COLUMN_NAME + }; + return data; + } + getSelectElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME; + break; + } + } + return elemID; + } + getElementByName(segmentName) { + let elemID: any = ""; + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + elemID = this.diffStructure[i].APPLICATION_COLUMN_NAME; + break; + } + } + return document.getElementById(elemID) as HTMLInputElement; + } + + fillEITStructure() { + var obj = { peiObjVer: null, peiExtraInfoID: null }; + for (let i = 0; i < this.validateEitObj.length; i++) { + let val: any; + if (this.validateEitObj[i].VARCHAR2_VALUE) + val = this.validateEitObj[i].VARCHAR2_VALUE; + else if (this.validateEitObj[i].DATE_VALUE) + val = this.validateEitObj[i].DATE_VALUE; + else if (this.validateEitObj[i].NUMBER_VALUE) + val = this.validateEitObj[i].NUMBER_VALUE; + const elem = document.getElementById( + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER; + if (elem) { + if (val) { + let feldDetails = this.diffStructure.find( + x => + x.APPLICATION_COLUMN_NAME == + this.validateEitObj[i].APPLICATION_COLUMN_NAME + ); + if (feldDetails) { + let isStandardDate = this.isStandardDateVal(feldDetails); + let isStandardDateTime = this.isStandardDateTimeVal(feldDetails); + let isStandardTime = this.isStandardTimeVal(feldDetails); + if (isStandardDate) { + elem.value = this.cs.reverseFormatDate(val); + } else if (isStandardDateTime) { + elem.innerHTML = this.cs.reverseFormatStandardDate(val); + elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val); + } else if (isStandardTime) { + elem.innerHTML = val; + elem.dataset.dtvalue = val; + } else { + elem.value = val; + elem.setAttribute("value", elem.value); + } + if ( + feldDetails.DISPLAY_FLAG == "N" || + (feldDetails.VALIDATION_TYPE != "N" && + feldDetails.READ_ONLY == "Y") + ) { + elem.dataset.colmText = val; + elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP; + elem.setAttribute("value", elem.value); + } + } + elem.dataset.hiddenval = val; //hide the value to set it after calling get value set + if ( + feldDetails.CHILD_SEGMENTS_VS_Splited && + feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0 + ) { + let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited; + listArray.forEach(element => { + this.getValueSet(element); + }); + } + // var event = new Event('change'); + // elem.dispatchEvent(event); + } + } else { + if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == + "PEI_OBJECT_VERSION_NUMBER" + ) + obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE; + else if ( + this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID" + ) + obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE; + } + } + this.ExtraObj = obj; + } + public getValueSet(segmentName) { + let descFlexName: any = ""; + let descFlexContextCode: any = ""; + let parentValue: any = []; + let ParentsList: any = []; + let parentVal: any = null; + let dependenciesList: any = []; + let validationType: string = ""; + + for (let i = 0; i < this.diffStructure.length; i++) { + if (this.diffStructure[i].SEGMENT_NAME == segmentName) { + descFlexName = this.diffStructure[i].DESC_FLEX_NAME; + descFlexContextCode = this.diffStructure[i].DESC_FLEX_CONTEXT_CODE; + parentValue = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS; + ParentsList = this.diffStructure[i].PARENT_SEGMENTS_VS_SplitedVS; + validationType = this.diffStructure[i].VALIDATION_TYPE; + break; + } + } + if (parentValue != "" && (validationType == "D" || validationType == "Y")) { + let parvalue = this.getDependenciesParams(parentValue); + if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME; + else { + parentVal = null; + } + if (!parentVal) { + return false; + } + } + if (ParentsList != "") { + dependenciesList = this.getDependenciesParams(ParentsList); + if (!dependenciesList) { + return false; + } + } + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, + P_MENU_TYPE: this.menuType, + P_SELECTED_RESP_ID: this.respID, //-999, + P_DESC_FLEX_NAME: descFlexName, + P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode, + P_SEGMENT_NAME: segmentName, + P_PARENT_VALUE: parentVal, + GetValueSetValuesTBL: dependenciesList, + P_PAGE_NUM: 1, + P_PAGE_LIMIT: 1000 + }; + + this.eitService.getSetValue(body).subscribe((result: any) => { + if (result.GetValueSetValuesList != null) { + this.fillDropdownList(segmentName, result.GetValueSetValuesList); + } + }); + let arr: any = []; + return arr; + } + isStandardDateVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + + isSt = true; + + } + return isSt; + } + + emptyChildElement(segmentName) { + let elem = this.getElementByName(segmentName); + elem.value = null; + elem.innerHTML = ""; + if ("dtvalue" in elem.dataset) { + elem.dataset.dtvalue = ""; + } + if ("colmText" in elem.dataset) { + elem.dataset.colmText = ""; + } + var event = new Event("change"); + elem.dispatchEvent(event); + elem.classList.remove("requiredClassElm"); + } + getDependenciesParams(parentsList) { + let parentArr: any = []; + for (let i = 0; i < parentsList.length; i++) { + for (let j = 0; j < this.diffStructure.length; j++) { + if (this.diffStructure[j].SEGMENT_NAME == parentsList[i].Name) { + if (this.diffStructure[j].DISPLAY_FLAG != "N") { + if (this.diffStructure[j].VALIDATION_TYPE == "N") { + let idColName: string; + let val: any; + if ( + this.diffStructure[j].FORMAT_TYPE == "Y" || + this.diffStructure[j].FORMAT_TYPE == "I" + ) { + //standard date time or //time + let elem = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLDivElement; + val = elem.dataset.dtvalue; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.diffStructure[j].FORMAT_TYPE == "Y") + idColName = this.cs.formatStandardDate(val); + } else { + val = (document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } + idColName = val; + if (this.diffStructure[j].FORMAT_TYPE == "X") { + //date + // idColName = this.cs.formatDate(val); + idColName = this.cs.formatDateNew(val); + } + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: val, + DESCRIPTION: "", + ID_COLUMN_NAME: idColName, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + if (this.diffStructure[j].READ_ONLY != "Y") { + let x = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let text = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : ""; + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : undefined; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } else { + let x = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } else { + let x = document.getElementById( + this.diffStructure[j].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let text = x.value; + let val = x.dataset.colmText; + if ( + (val == undefined || val == "") && + parentsList[i].IsRequired == "REQUIRED" + ) { + //alert(parentsList[i].Name +" Is required"); + return false; + } else { + } + if (text == undefined) { + text = ""; + } + parentArr.push({ + SEGMENT_NAME: this.diffStructure[j].SEGMENT_NAME, + VALUE_COLUMN_NAME: text, + DESCRIPTION: "", + ID_COLUMN_NAME: val, + FLEX_VALUE_SET_NAME: this.diffStructure[j].FLEX_VALUE_SET_NAME + }); + break; + } + } + } + } + return parentArr; + } + + isStandardTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard time + //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + //} + } + return isSt; + } + isStandardDateTimeVal(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant + isSt = true; + //} + } + return isSt; + } + + isStandardDateTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "Y") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + isStandardTime(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "I") { + // standard date time + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + isStandardDate(obj: any): boolean { + let isSt: boolean = false; + if (obj.FORMAT_TYPE == "X") { + // standard date + if ( + obj.DEFAULT_TYPE == "C" || + obj.DEFAULT_TYPE == "D" || + obj.DEFAULT_TYPE == "P" || + obj.DEFAULT_TYPE == "S" + ) { + //constant + isSt = true; + } + } + return isSt; + } + + validateTransaction() { + (this.elementRef.nativeElement.querySelectorAll( + "ion-item" + ) as HTMLElement[]).forEach(x => { + x.classList.add("ng-touched"); + x.classList.remove("ng-untouched"); + }); + + + var arrValues = this.getElementsValues(); + let staticValues = this.getElementsStaticValues(); + let allStatisDynamicValues = arrValues.concat(staticValues); + if (arrValues) { + + this.reportSubmitRequest = { + + P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE, + P_SELECTED_RESP_ID: -999, + P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME, + EITTransactionTBL: allStatisDynamicValues, + + }; + this.cs.startLoading(); + this.terminationFormService + .submitTransation(this.reportSubmitRequest, {}, this.ts.trPK('general', 'retry')) + .subscribe((result: any) => { + this.handleSubmit(result); + }); + } + } + + + private handleSubmit(result) { + if (this.cs.validResponse(result)) { + this.cs.sharedService.setSharedData(result['SubmitTermTransactionList'], TerminationServiceService.SHARED_DATA); + this.cs.stopLoading(); + this.cs.confirmTermination(); + } + } + + + public getElementsValues(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = 1; + let textValue: any; + // if(this.ExtraObj.transactionNo) + // transNo=this.ExtraObj.transactionNo; + for (let i = 0; i < this.diffStructure.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + /*********set transaction No of the updated object ********/ + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.diffStructure[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + } + if (this.diffStructure[i].DISPLAY_FLAG != "N") { + if (this.diffStructure[i].VALIDATION_TYPE == "N") { + let elem = document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement; + let elemVal = (document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLInputElement).value; + textValue = elemVal; + //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value; + if ( + this.diffStructure[i].FORMAT_TYPE == "X" && + this.diffStructure[i].DISPLAY_FLAG != "N" + ) { + //date + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.diffStructure[i].FORMAT_TYPE == "Y" && + this.diffStructure[i].DISPLAY_FLAG != "N" + ) { + //standard date time + // elemVal = elem.dataset.dtvalue; + // elemVal = this.cs.formatStandardDate(elemVal); + elemVal = this.cs.formatDate(elemVal); + } else if ( + this.diffStructure[i].FORMAT_TYPE == "I" && + this.diffStructure[i].DISPLAY_FLAG != "N" + ) { + //time + if (elemVal.length > 5) { + elemVal = elemVal.substring(11, 16); + } else { + elemVal = elemVal; + } + } + if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + // if (elemVal != 'null'){ + varcharValue = elemVal; + //} else{ + // elemVal = null; + // } + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + if (this.diffStructure[i].READ_ONLY == "Y") { + let text = x.value; + let val = x.dataset.colmText; + varcharValue = val; + textValue = text; + } else { + let val = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].value + : null; + let txt = x.options[x.selectedIndex] + ? x.options[x.selectedIndex].text + : null; + varcharValue = val; + textValue = txt; + } + if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } //end else + } else { + let x = document.getElementById( + this.diffStructure[i].APPLICATION_COLUMN_NAME + ) as HTMLSelectElement; + let val = x.dataset.colmText; + textValue = x.value; + if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + //this.common.showRequiredMsg(); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + } + + if (this.getPassdirfromNotifiPage) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.diffStructure[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) { + let updatedObj = this.validateEitObj.find( + x => + x.APPLICATION_COLUMN_NAME == + this.diffStructure[i].APPLICATION_COLUMN_NAME + ); + let y = updatedObj; + y.VARCHAR2_VALUE = varcharValue; + y.NUMBER_VALUE = numbervalue; + y.DATE_VALUE = dateValue; + y.SEGMENT_VALUE_DSP = textValue; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } else { + let y = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue, + SEGMENT_VALUE_DSP: textValue, + APPLICATION_COLUMN_NAME: this.diffStructure[i] + .APPLICATION_COLUMN_NAME, + DATATYPE: this.diffStructure[i].DATATYPE, + DESC_FLEX_CONTEXT_CODE: this.diffStructure[i].DESC_FLEX_CONTEXT_CODE, + DESC_FLEX_NAME: this.diffStructure[i].DESC_FLEX_NAME, + DISPLAY_FLAG: this.diffStructure[i].DISPLAY_FLAG, + SEGMENT_NAME: this.diffStructure[i].SEGMENT_NAME, + SEGMENT_PROMPT: this.diffStructure[i].SEGMENT_PROMPT + }; + transNo = transNo; // set the transaction number for all items in the updated loop + this.updatedValues.push(y); + } + } + } // end for + + if (this.getPassdirfromNotifiPage) { + let updatedObj1 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION" + ); + let updatedObj2 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID" + ); + let updatedObj3 = this.validateEitObj.find( + x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER" + ); + this.updatedValues.push(updatedObj1); + this.updatedValues.push(updatedObj2); + this.updatedValues.push(updatedObj3); + valuseArr = this.fillExtraInformation( + valuseArr, + updatedObj1.VARCHAR2_VALUE, + updatedObj2.NUMBER_VALUE, + updatedObj3.NUMBER_VALUE, + transNo + ); + } else { + if (this.eitSubmitAction == EIT_ACTION.ADD) { + this.updatedValues = this.fillExtraValuesUpdated( + this.updatedValues, + "NEW_ROW", + -1, + 0, + transNo + ); + valuseArr = this.fillExtraInformation( + valuseArr, + "NEW_ROW", + -1, + 0, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "UPDATE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } else if (this.eitSubmitAction == EIT_ACTION.DELETE) { + valuseArr = this.fillExtraInformation( + valuseArr, + "DELETE_ROW", + this.ExtraObj.peiExtraInfoID, + this.ExtraObj.peiObjVer, + transNo + ); + } + } + return valuseArr; + } // end getElementsValues + + fillExtraValuesUpdated( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + let obj1 = { + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null, + SEGMENT_VALUE_DSP: "", + APPLICATION_COLUMN_NAME: "PEI_ACTION", + DATATYPE: "VARCHAR2", + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj2 = { + TRANSACTION_NUMBER: 1, + APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATATYPE: "NUMBER", + SEGMENT_VALUE_DSP: "", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + SEGMENT_NAME: "", + SEGMENT_PROMPT: "" + }; + let obj3 = { + APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID", + DATATYPE: "NUMBER", + DATE_VALUE: null, + DESC_FLEX_CONTEXT_CODE: "", + DESC_FLEX_NAME: "", + DISPLAY_FLAG: "N", + NUMBER_VALUE: peiExtraInfoID, + SEGMENT_NAME: "", + SEGMENT_PROMPT: "", + SEGMENT_VALUE_DSP: "", + TRANSACTION_NUMBER: transNo, + VARCHAR2_VALUE: null + }; + values.push(obj1); + values.push(obj2); + values.push(obj3); + return values; + } + + fillExtraInformation( + values: any, + peiAction: string, + peiExtraInfoID: number, + peiObjVer: number, + transNo: number + ): any { + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_ACTION", + VARCHAR2_VALUE: peiAction, + NUMBER_VALUE: null, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_EXTRA_INFO_ID", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiExtraInfoID, + DATE_VALUE: null + }); + values.push({ + TRANSACTION_NUMBER: transNo, + NAME: "PEI_OBJECT_VERSION_NUMBER", + VARCHAR2_VALUE: null, + NUMBER_VALUE: peiObjVer, + DATE_VALUE: null + }); + return values; + } + + fixTransactionNo(transactionTBL: any): any[] { + let list: any = []; + let newIndex: number = 1; + let length: number = transactionTBL.length; + if (length > 0) { + for (let i = 0; i < length; i++) { + // let item :any={}; + const item = Object.assign({}, transactionTBL[i]); + let transNo: number = item.TRANSACTION_NUMBER; + let obj: any = item; + if (i == 0) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + let prevEl: any = transactionTBL[i - 1].TRANSACTION_NUMBER; + if (transNo == prevEl) { + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } else { + newIndex++; + obj.TRANSACTION_NUMBER = newIndex; + list.push(obj); + } + } + } + } + return list; + } + + private drawEitFieldsStatic(feildsList) { + const containerId = "containerDivTwo"; + this.eitVALSettoCall = []; + for (let i = 0; i < feildsList.length; i++) { + let defaultVal: string = ""; + let defaultValText: string = ""; + + if (feildsList[i].DISPLAY_FLAG != "N") { + //text , date , time + if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList === null) { + // character + this.textInput = new TextInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + defaultValText, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList !== null) { + this.selectInput = new SelectInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + this.fillStaticDropdownList( + feildsList[i].SEGMENT_NAME, + feildsList[i].ObjectValuesList, + feildsList[i].APPLICATION_COLUMN_NAME + ); + } else if (feildsList[i].DATATYPE == "NUMBER") { + this.numberInput = new NumberInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + defaultVal, + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG + ); + } else if (feildsList[i].DATATYPE == "DATE") { + this.dateInput = new DateInput( + feildsList[i].SEGMENT_PROMPT, + feildsList[i].APPLICATION_COLUMN_NAME, + "", + containerId, + feildsList[i].MOBILE_ENABLED, + feildsList[i].DISPLAY_FLAG, + feildsList[i].REQUIRED_FLAG, + this.direction + ); + + } + } + } + + } + + public fillStaticDropdownList(segmentName, optionList: any = [], elemID: string) { + let eitObj: any; + if (optionList.length > 0) { + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + + for (let i = 0; i < optionList.length; i++) { + var option = document.createElement("option"); + option.text = optionList[i].MEANING; + option.value = optionList[i].CODE; + select.add(option); + } + } + } + + public getElementsStaticValues(): any { + this.updatedValues = []; //fill updated list + let valuseArr: any = []; + let varcharValue: any = null; + let numbervalue: any = 0; + let dateValue: any = null; + let transNo: number = 1; + let textValue: any; + + for (let i = 0; i < this.termColStructure.length; i++) { + varcharValue = null; + numbervalue = null; + dateValue = null; + + if (this.termColStructure[i].DISPLAY_FLAG != "N") { + if (this.termColStructure[i].ObjectValuesList === null) { + let elem = document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLInputElement; + let elemVal = elem !== null ? (document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLInputElement).value : ''; + textValue = elemVal; + + if (this.termColStructure[i].DATATYPE == "VARCHAR2" || this.termColStructure[i].DATATYPE == "NUMBER") { + elemVal = elemVal; + } else if (this.termColStructure[i].DATATYPE == "DATE") { + // date + elemVal = this.cs.formatDate(elemVal); + } + + if (this.targetValue === 'new') { + if (this.termColStructure[i].REQUIRED_FLAG == "Y" && !elemVal) { + elem.classList.add("requiredClassElm"); + return false; + } else { + elem.classList.remove("requiredClassElm"); + } + } + + if (this.termColStructure[i].DATATYPE == "DATE") { + dateValue = elemVal; + } else if (this.termColStructure[i].DATATYPE == "NUMBER") { + numbervalue = elemVal; + } else { + varcharValue = elemVal; + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.termColStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } else { + let x = document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement; + + let val = x.options && x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null; + let txt = x.options && x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : null; + varcharValue = val; + textValue = txt; + + if (x !== null) { + if (this.termColStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) { + x.classList.add("requiredClassElm"); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + } + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.termColStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + } else { + let x = document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement; + let val = x !== null ? x.dataset.colmText : ''; + textValue = x !== null ? x.value : ''; + + if (x !== null) { + if (this.termColStructure[i].REQUIRED_FLAG == "Y" && !val) { + x.classList.add("requiredClassElm"); + return false; + } else { + x.classList.remove("requiredClassElm"); + } + } + varcharValue = val; + + + + valuseArr.push({ + TRANSACTION_NUMBER: transNo, + NAME: this.termColStructure[i].APPLICATION_COLUMN_NAME, + VARCHAR2_VALUE: varcharValue, + NUMBER_VALUE: numbervalue, + DATE_VALUE: dateValue + }); + } + } + return valuseArr; + } + public customiseDate(date: any) { + let formatedDate = date.slice(0, 9); + let newDate = formatedDate.split("/").reverse(); + const tmp = newDate[2]; + newDate[2] = newDate[1]; + newDate[1] = tmp; + newDate = newDate.join("/"); + newDate = newDate + ' 00:00:00'; + return newDate; + } +} diff --git a/Mohem/src/app/termination/termination.module.ts b/Mohem/src/app/termination/termination.module.ts new file mode 100644 index 00000000..7302cb97 --- /dev/null +++ b/Mohem/src/app/termination/termination.module.ts @@ -0,0 +1,46 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { Routes, RouterModule } from '@angular/router'; + +import { IonicModule } from '@ionic/angular'; + +import { TerminationPage } from './termination.page'; +import { TerminationFormComponent } from './termination-form/termination-form.component'; +import { TerminationServiceService } from './service/termination-service.service'; +import { HmgCommonModule } from '../hmg-common/hmg-common.module'; +import { ConfirmTerminationComponent } from './confirm-termination/confirm-termination.component'; +import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit-address-modal.component'; + + +const routes: Routes = [ + { + path: '', + component: TerminationPage, + children: [ + { + path: 'termination-form', + component: TerminationFormComponent + }, + { + path: 'confirm-termination', + component: ConfirmTerminationComponent + }, + + ], + } +]; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + RouterModule.forChild(routes), + HmgCommonModule + ], + declarations: [TerminationPage, TerminationFormComponent, ConfirmTerminationComponent], + providers: [TerminationServiceService], + entryComponents: [SubmitAddressModalComponent] +}) +export class TerminationPageModule { } diff --git a/Mohem/src/app/termination/termination.page.html b/Mohem/src/app/termination/termination.page.html new file mode 100644 index 00000000..67cbe279 --- /dev/null +++ b/Mohem/src/app/termination/termination.page.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Mohem/src/app/termination/termination.page.scss b/Mohem/src/app/termination/termination.page.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/termination/termination.page.spec.ts b/Mohem/src/app/termination/termination.page.spec.ts new file mode 100644 index 00000000..04fa359a --- /dev/null +++ b/Mohem/src/app/termination/termination.page.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TerminationPage } from './termination.page'; + +describe('TerminationPage', () => { + let component: TerminationPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TerminationPage ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TerminationPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/termination/termination.page.ts b/Mohem/src/app/termination/termination.page.ts new file mode 100644 index 00000000..f821ad78 --- /dev/null +++ b/Mohem/src/app/termination/termination.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-termination', + templateUrl: './termination.page.html', + styleUrls: ['./termination.page.scss'], +}) +export class TerminationPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss b/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss index ef433546..5cd0e320 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss @@ -852,7 +852,7 @@ $actionBtnSize : 36px; font-size: 18px; } span{ - font-size: 11px; + font-size: 9px; } } } diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts index 638d68e0..98f15742 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts @@ -184,7 +184,7 @@ export class TimeCardDetailsComponent implements OnInit { { data: [this.absentDays, this.attendedDays], backgroundColor: [ - '#269DB8', + '#292F42', '#269DB8' ], borderWidth: 2 diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html index 15900c2a..3d8f1032 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html @@ -33,9 +33,9 @@
- + +
diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts index eeef7508..acc38009 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts @@ -26,7 +26,7 @@ import { WorkListReplacementRollComponent } from 'src/app/notification/work-list }) export class VacationTypeComponent implements OnInit { ruleTypeList: any; - index: any; + index = 'noType'; vactionRuleSelected:any =-1; notificationTypeSelected: number; notification_list: any; //// @@ -165,13 +165,11 @@ export class VacationTypeComponent implements OnInit { } - vacationRuleSel(event){ - this.vactionRuleSelected=event.detail.value; + vacationRuleSel(){ + this.vactionRuleSelected = this.index; if(this.notificationTypeShow){ - //this.notificationTypeShow = false this.notificationTypeShow = false this.notifTypeSelP2 = "*"; - //this.part3show = false } if (this.createVacationRuleShow){ this.createVacationRuleShow = false @@ -180,11 +178,6 @@ export class VacationTypeComponent implements OnInit { } - - - - - console.log("event: "+ event.detail.value); } notificationSel(event){ diff --git a/Mohem/src/assets/icon/bar-chart-outline.svg b/Mohem/src/assets/icon/bar-chart-outline.svg new file mode 100644 index 00000000..d17a6598 --- /dev/null +++ b/Mohem/src/assets/icon/bar-chart-outline.svg @@ -0,0 +1 @@ +Bar Chart \ No newline at end of file diff --git a/Mohem/src/assets/icon/bar-chart.svg b/Mohem/src/assets/icon/bar-chart.svg new file mode 100644 index 00000000..7a070f16 --- /dev/null +++ b/Mohem/src/assets/icon/bar-chart.svg @@ -0,0 +1 @@ +Bar Chart \ No newline at end of file diff --git a/Mohem/src/assets/icon/blank.svg b/Mohem/src/assets/icon/blank.svg new file mode 100644 index 00000000..458383af --- /dev/null +++ b/Mohem/src/assets/icon/blank.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Mohem/src/assets/icon/green.svg b/Mohem/src/assets/icon/green.svg new file mode 100644 index 00000000..635949a6 --- /dev/null +++ b/Mohem/src/assets/icon/green.svg @@ -0,0 +1,3 @@ + + + diff --git a/Mohem/src/assets/icon/select-all.svg b/Mohem/src/assets/icon/select-all.svg new file mode 100644 index 00000000..f053110b --- /dev/null +++ b/Mohem/src/assets/icon/select-all.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Mohem/src/assets/icon/settings-not.svg b/Mohem/src/assets/icon/settings-not.svg new file mode 100644 index 00000000..e05313cb --- /dev/null +++ b/Mohem/src/assets/icon/settings-not.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Mohem/src/assets/icon/yellow.svg b/Mohem/src/assets/icon/yellow.svg new file mode 100644 index 00000000..e146cb79 --- /dev/null +++ b/Mohem/src/assets/icon/yellow.svg @@ -0,0 +1,3 @@ + + + diff --git a/Mohem/src/assets/imgs/hr-request.png b/Mohem/src/assets/imgs/hr-request.png new file mode 100644 index 0000000000000000000000000000000000000000..c905603b82cab874185551c94467b9cf0993a790 GIT binary patch literal 10488 zcmdU#dpMNc+xOQs!;Bcal)Y@CsF3WlO~g>qP>}|0WFH}$(2TUvEt{r^5)mTGCc+rx za_4TNkVqIY)h$vOZJ4r|ca8h^`@Q$?c%I{VkN0_w_m9_cbTl*9y3Vz(Ypr#jpYwaJ zi!QtEMTO;s0RW;z2U`*V82AwbgmCb`?=ii<;C})UHbgfe_!lp9G#P$h5$50#0f1N= z{~vO7qnHBxQ7+QXJ<>JwSY-5}a9+l7+U3Z?R?1uDt;4qA>Zu~F*l{4=*T2Fa_@OliE~^W&GQWzPsO`wS z^On$r$Zi*Y|E$EJ3+coeUDB}?4mS$Z^gVAazX3}vFjrzox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*xVr5C_QS3P>@F$N`o<}WH4J6Gui(a@-F2i1VfQ#00000NkvXXu0mjf$~d*j literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/Doable.png b/Mohem/src/assets/imgs/mohemm-action/Doable.png new file mode 100644 index 0000000000000000000000000000000000000000..36d8fb2532bf3413e47d6e2bce6562d5ec9b6957 GIT binary patch literal 1371 zcmV-h1*H0kP)9fw&w28bH7j0b-E{cV$fw za1s#41i&Z?F(MI@LqKTaaqk|nny+XMFl$mapXZBCrd?-(4EsP;A`;bXhFWyuoBjY`RG%H|z*jw;bpta-;}~ql58dg?I`3ST8E95CgLk}S-$x*sB7Hl59Af= z;r=^)62>!PC?&^fe_cE$hzgv<5;Jq=cI0peObs9N?2nI+EMt1A5==A5vINIYJmWe@ z?b24LZ+j(g=a($|m>05~5eDnF@e<&rut3)B%q?Wr<&5$6a%0B_P`Bb9mzLJyI6V&k z{`5LbeE;lhN9bg12IPw^88hMByUVT(vdl8uQ?o!e6kE?+$~cmlMLO$_o!kXW+PZ-+ zaOM^%88gwp4&R$U=UzuQ2{+(I}qWX(i5o7b;?92z$CRCi|o`{fVMw=BMve4Vos37nN&sh<8x!Vc+Vu+KpczYd1sYemfbv@x@~Um9gKai`7Cl|8$Y+C(hEF_O)&^V2tN|v~kOK zUd=6bULVXk2~LGmKl7U9UEJ4`Y$hyg>z%|bJ7#+HwD0YuOn_tjuBVUQ^*rhuY1kbg z9%30&8IX7(>{$KcBN^`!xdX69Y4U8;-_O=5wc^@(^Um^!x|B)6dz-t|i{@&XU+HaL zi{G^oHhUuaM?9-m%~s1W!06UN!PaL3RqQM(9uiOTEmj%|lQW3nP!m5NezHYebySrw(~ji09Mc6*mkWi9ytL08{b3sICT z^vb26Ll^SHYLYaOyrhBJ;;NF|n2|rzuyzJyKM}sQvbnO4&UZDMt{yPg7dy_ZG4S_Z zSX86SBnsF~SL&F3*m)j-m_rFKDWMLuY=_Bm(OuOm4)w?#0>#7RaML_fDi-cj+Bo~- z3BA`T7FT4=+13=a)3*fe^x4lE`j}`H_1!{p_kUAcfSlwxPJf-JkCuKDfagG{0bRm? dT^5T?!2b}ni!c9ijadKy002ovPDHLkV1gOElj;Bf literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/More-2.png b/Mohem/src/assets/imgs/mohemm-action/More-2.png new file mode 100644 index 0000000000000000000000000000000000000000..925f6ea5b5d1e33d4860b8316aff86e4b567cd84 GIT binary patch literal 914 zcmV;D18w|?P)za-pUTUANt>E%*_yP; zYd)9sC28{e^!HwphTm%|m&-T}(Nrb`AO=8L+Q~A29k!H2VdpgGIgw~Il?ek#0vH0& zZ?l{cD*&7@VV=b$i9+_cV;m_;-IEF4bBLG`vjE19 z>ehy$l*M!tyXZ;TWkbrSJNxujl4RCJl8i1Eb2OD1)7$u8Myn*d8Wo`p4A+iZjVO)D zoXaJl*Ntnt?hFT#Acu7I3RN_k$|L~XY)V-6&>u}@CY2*sXY?^Ag4HBxI39}9mFkL9 zqO%azh2^WTl2P4DGAFP{Ri0c1M;}K7kH#||^@I-kdV71S9{2B&(&SUT3H|{UImzN5C-9b#;xGuNS zt9i`jzp2~KwFfXU*oWR=Cl)uhF}3v3(zq-Yy&LJpc>Jo`esU|0(Uu>W0dGs!!VOX{}L!7us8unJ4NZtvMMnl=kqVX&uLl~lMKtnAM+dDOA$ z#Zu9?UyGXd+~-QyT-+$4RMm~y=e4apwY|1g(tLNVsBPDa|H8=Vm{tEtSvO<>b_D!* z{bdu67T59f&tG*rTi5CLW4&0ygEy-v?Ek22D{RX09RVMvmOkOdhk~V|>{UvZv)7!u zc=u7>@I-mT6Xgw0ls8&MG~X(sIUf~f@Qy5My3EYQEVoKVXM9vvHtT?3>|#X{g`9FR zN;m%e4MQ$Mkwqm@VD&}Ty`XUpd8(b#+(&sV*qBr*K2=ewottiISk^KxiGn&LYabYr zRN?G)c591JG@_K|1nuZnl!C_{Ls62=Q2~b=FHVNV$-2+Fv}25F*4+XdaxtR{>|-Yn zP=#dD;pMFlB~ef-IrT6*OCn5@2oeqxo~Bz!?zkOKI`1V!vI!c;jh5b}XLDuVi|NTe or=H2gpiDQa#4cwhbGiWd2Z)XjnX^o=`v3p{07*qoM6N<$f(iJrN&o-= literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/More.png b/Mohem/src/assets/imgs/mohemm-action/More.png index 925f6ea5b5d1e33d4860b8316aff86e4b567cd84..005e24ba0164231310d3fa8a3bf8eef51026acc5 100644 GIT binary patch literal 1161 zcmV;41a|w0P)P34<+k?852-~2wT*w^L5&AnRHPLJ5pB|z3MGl(+p=X-H`&?5x0y6q z7+N~>-n?(VH#6_;zN$(A&*I`@^U~7N5s3DpZA4p-whpbf0CiR(e=y)T+Ap*pXk#@s zHN$mvbu(6itNT?^fn+kdA(P4UtEze&GJ8ekn8szGHwIg7!KOPNkLRbzJeFXgOr4vX z+YeD#=>n^tLHib2EiS^YI8NtXz?Rm)g4NRie5DA5 zQi}rU834Yjfd#8C@q;x4oS2wUB9Vv^kH@uzX=`g!LZOh-*}1Z%I2Y^{T)9KVRnvs4 z=9}))95W6M4l2~lo^UvHUPk4B~= zU}+*^m_QqY3c6n%3M!lh%eGH!D0Yll8#b{Gt%7A++7c^vjM)-rJjBtv1hy5JXy00v_7#F%1gryDPX?tzo7lg+OX9}MU*3r=PFI%X zfC>X_#8@r!5eHRsA+BmAQ_8Ccd-V%|wyadkkg?o#P^J3TL-o<9lo`?9K^a+rJHMms z%ZjNo>VFSbSMX$kMdeI;DwP^vBejc3RLBHSthro^WOm)Gp{mqg0DWZiLeskyQPo+n zJ5)yQnq?{l5V*T9ueLvDAOVK=!KLq(lS>0+62ZekTb1Pcir~PaY=|m4ca#Ckld$oC zvA$TCS$!Z@s}?MuM9JR(SoTW@`YUX_2$0udAN>zd&c{|fjJx<0Kp%$Eo>GGbz=yD7 z1R!sS+F}c=k?nza-pUTUANt>E%*_yP; zYd)9sC28{e^!HwphTm%|m&-T}(Nrb`AO=8L+Q~A29k!H2VdpgGIgw~Il?ek#0vH0& zZ?l{cD*&7@VV=b$i9+_cV;m_;-IEF4bBLG`vjE19 z>ehy$l*M!tyXZ;TWkbrSJNxujl4RCJl8i1Eb2OD1)7$u8Myn*d8Wo`p4A+iZjVO)D zoXaJl*Ntnt?hFT#Acu7I3RN_k$|L~XY)V-6&>u}@CY2*sXY?^Ag4HBxI39}9mFkL9 zqO%azh2^WTl2P4DGAFP{Ri0c1M;}K7kH#||^@I-kdV71S9{2B&(&SUT3H|{UImzN5C-9b#;xGuNS zt9i`jzp2~KwFfXU*oWR=Cl)uhF}3v3(zq-Yy&LJpc>Jo`esU|0(Uu>W0dGs!!VOX{}L!7us8unJ4NZtvMMnl=kqVX&uLl~lMKtnAM+dDOA$ z#Zu9?UyGXd+~-QyT-+$4RMm~y=e4apwY|1g(tLNVsBPDa|H8=Vm{tEtSvO<>b_D!* z{bdu67T59f&tG*rTi5CLW4&0ygEy-v?Ek22D{RX09RVMvmOkOdhk~V|>{UvZv)7!u zc=u7>@I-mT6Xgw0ls8&MG~X(sIUf~f@Qy5My3EYQEVoKVXM9vvHtT?3>|#X{g`9FR zN;m%e4MQ$Mkwqm@VD&}Ty`XUpd8(b#+(&sV*qBr*K2=ewottiISk^KxiGn&LYabYr zRN?G)c591JG@_K|1nuZnl!C_{Ls62=Q2~b=FHVNV$-2+Fv}25F*4+XdaxtR{>|-Yn zP=#dD;pMFlB~ef-IrT6*OCn5@2oeqxo~Bz!?zkOKI`1V!vI!c;jh5b}XLDuVi|NTe or=H2gpiDQa#4cwhbGiWd2Z)XjnX^o=`v3p{07*qoM6N<$f(iJrN&o-= diff --git a/Mohem/src/assets/imgs/mohemm-action/Skip-2.png b/Mohem/src/assets/imgs/mohemm-action/Skip-2.png new file mode 100644 index 0000000000000000000000000000000000000000..03b3c23faac3055d0056112c6cc41e72d3379e3e GIT binary patch literal 888 zcmV-;1Bd*HP)n6@7nMroc z0}COJJM%a@vorF}wQ9ABW{KyFQ2@69Of`KIKFR?00TfMLD>i$RK(g_i!NgK@J!_jv zFe(7n*k$V4T9Du5k|oIuT{opD@o@woYwB8_r}U+=@tnbWG2dm9UYK;+)U^+d3e}aR z-dqGQE1|LN;-#r;tj)go%91GiD~*Im)MmxhwY1+4BHk}TF3OmV=M3L5d_k5T-LQ(< zFyV~%%bLfSCZo3!uYxS= zRKMk-vh-wClM&D*NW? zn049GA`to*KZ-@Mo|?d1;-ScDxREku=MoRFIz5JaH?GU5t}fChsPQ{7yh}|WIW#D% z$_q%Hjidd2Sbmbgax&peU^3~*t0#GX&>G8+@5a=ZWw7zfdRgW;?wIVC(kW&(cJSlR zUukv9A2%Nbt>l|68z}G?Lh@eOilU+gJGN`dnz~l@ z#%L5GYpb~5vx}7OREdH+sp`m5@2V6Js(6DjH7h7eX1|u+EHPxf5&L=(+J;VX(p8vzo2)#YMtDvd%bIwR0kb zE|V_M>5qm7A#4I4Vxj literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/Skip.png b/Mohem/src/assets/imgs/mohemm-action/Skip.png index 03b3c23faac3055d0056112c6cc41e72d3379e3e..17e38cb3348d26db0c0675389656802ea9a9dbcf 100644 GIT binary patch delta 1297 zcmV+s1@8Lz2BZp*B!2{RLP=Bz2nYy#2xN!=00i4fL_t(&L+zVgY*a-Q$Nw|83JC^~ z7*eI(reeVd4f3KqX!}4y6OBegq7o7e-3`i{VnX1>0BSVR1V0`W+@;0`DTy)VK_x~a zR79E>3swxGBD-6GRH5A#LkqogJhO1?F5T_ky|=e}ckm`W(0`qC=KSWInKO6hTmcWy zxew4dD&&(8qE!&hCtw}~ZWRzSJ*b;hgg_%83<%%?3DGZ!_DQLBFK9!$+`d?cyXVXf z+;+v1tA!A&SmFV9QbDyM9s_X*fE7H60C?H=2#6515PH!9P zm83S;#qe3Fet##0Wylt#2@^n9Q~d{cXpZTL)V-`I)7s+b${JDoOF!KgH6S)?>JvB z3!UZO4LTHw+7C^DWzeS?bhmfCA(b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emm-action/answer.png new file mode 100644 index 0000000000000000000000000000000000000000..b73bed66e80718756c5f0f8c816989051cb423fb GIT binary patch literal 1940 zcmV;F2W$9=P)&X>3$g6h8OOlqG4wqO!H5dkX;q6)n|Zo3hOy0)o+kK-h*V zHAegcMg9;K#U;UrL6$;M3ABk8h=G|dP-viFK^9x3+ca&YAVd~hB9t=kdQR(%)Ar50 zdCSnT-emHAyt94xoO{l>_uXNjVnpmLhzer-Rb({*hrtYB5N8mI&weVzd1c`M_Zf%V z_`C%SZlDgED6swZ<)+`1>Ox-MM*Q}YC%BX>OTol&WGfZWkZ1D&-F1sLwgP4avhxRlOpY?ONCJM07zQSB0#UlwecBeH9lfefF z)ZnwC03k#VJ2(hgc8lq=t|oN@8@sD;I)<*5F(w3v{ff=Nbu4nmX4)-gn>%wSu+ce% zae~8f4m~kqa$Emd>DiW z_wUBg{NN!JH(rM==k3sR_ny2!Sqi?LVQsZxZ8gc#>PV1;9^5)L5e6V&xj~>mJW~bv zwM}xQUf*MraR@zYyNFcdG)YpxJTEQ`Hl--vDQ>x7M=#eY(A16e5_;BlhcOtaMT)Py zv^EdTea=_%Zgg3tm8v~V?IU>>lhvacCF!XU7A$>o^Mm~w+-Yrt@R0tHHsVQ1gD9la z@=ibtKGh7(U}^m&4Gs0E`|DpC+l})UzSsY1g_Qlr@stH%VBa7pdo2xu1nEksC7e}* zrEE$`hRTJfK_Dl5d$j#E(N2vREJ>PO(Ey*6S3_Te0Id$uEA17`%#-s<)i@SZgWWqb z$*V`nnsTg_iw>8!8&JYd1uJEM)8ksZC#P(=2=X=wx`E9{4@oua zO)d9ayA~<$D)EpOuaX|!!1|IQsRU7dCNC=;v_`2!Y1!`S2A0-q5$-=d4QJa(HG1o` zL`8rJC^aW)8VPrMbOS5rDVmH$N6Oo?D0z5&@~CbJOG*YcCX~q3WM98E6=aOu%oE7W zq6@B2Brh)=69LquxQBMr-TUpQ6h#PBO{e5(;&t;ZwT0vbZ-aI|?KdyOq;*&5|&!4T9W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NF|n2|rzuyzJyKM}sQvbnO4&UZDMt{yPg7dy_ZG4S_Z zSX86SBnsF~SL&F3*m)j-m_rFKDWMLuY=_Bm(OuOm4)w?#0>#7RaML_fDi-cj+Bo~- z3BA`T7FT4=+13=a)3*fe^x4lE`j}`H_1!{p_kUAcfSlwxPJf-JkCuKDfagG{0bRm? dT^5T?!2b}ni!c9ijadKy002ovPDHLkV1gOElj;Bf literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/info-old.png b/Mohem/src/assets/imgs/mohemm-action/info-old.png new file mode 100644 index 0000000000000000000000000000000000000000..7d37568e27f4aa04ce6c47f93c0e6baf9ad5ce5f GIT binary patch literal 1053 zcmV+&1mgRNP)?t0+w-mg&t>C#$FXDn=d#r+OPL{L>d#H+FZH*vQq4JV9aZP5kyOWtsHvW)9 zcC$P4<;}dAd2gogk6+}2SCup zaz4GKvu;{oE!!CcFw2lBEj6oY55OFNrE)%f*zU{Pg0*ainq~n&w%v;O=!l``+JRPv zwQQ%r)*MhRTtNg~DCg62Di4Q-8wlmA) zSe!M*t1WL>p3oO!4l2}S-A2nsJ=ZmlRs6rmV+xjT#V3!N_2}bhbaK_Fy) zOAGIIQE33)KB!<}bJujy5SHy5dHRy5Uq?|QHQDTFEmmGR{)Oe8eNT%U(78xDj1YlE zWJ#IElETC$_59uq+`K3sVl3NrI4B4#iX@xE$1akHc2|Qo{YEhxHF^(In^e$WS#xAroDXU;$s{ ztHN@+;K)=-(<7HLGk!&SkFI-7B{iue{E~YiP&AdqTHg7HjZfb^@4xwcV1$xYj~}~X zjb-d;Dc3>OVe8XH-gDGzUiq0j!PPi7?v>PskUU6^zm96P6SXp+`Nj#8Y}GSs(lbY- zBUvkLg5`fB?#($TOGdZaX0R61JS{mT>E4P~i}ws~l#G)~t#VeLu-ptXG3vi$n8{Wf zIa`Khc;xL2> zOKUkF0G&r&xIbt3qoYr+@^P0ydx?X{$RQ>MC+|%eLUD+xRl=LRDp`%1=bDkjOaT4> XSsF*S(5IC600000NkvXXu0mjfnEmu2 literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/info.png b/Mohem/src/assets/imgs/mohemm-action/info.png index 7d37568e27f4aa04ce6c47f93c0e6baf9ad5ce5f..7d8f16c61637a513dfac734440c116e438114c0f 100644 GIT binary patch delta 1286 zcmV+h1^N1&2#pGm7k@hl1^@s6#U=8y00004b3#c}2nYxWd@Su=tVW%M)l>{W17+_ociHW|D^2UQi6HPE7 z5ox#7L?dlt2tG7BEs#os0*wI`6QKJO5?U}u3l2B||FB{yJ6R(1 z957yF_}$$2Nq;M#cD5m+a{_T^)UWqvvzw8u=fL1<5V1W7xGWn`vHvHa?@4GoBJI8( z()p5>tT!;Qia_)+(duFov235**d`%hC-ZqUI3)b9RHru^_~C5x;IEc7IMHTi-M2)nc(9IinBdY{6k2 zh~O_l?xtva%c$vE5?Pk-NzUj>hxwg{J9HxCZ+&hK*@i&yH4X4!9>|XDDga;M@q1W0 zcPF#ENb@W*qAcH9M|zxxQ*s>+kLypvE)=)PdOM9bL4$pHU^=_2fVV>J`sa7Z28>hu zQ`9Y>;(utJ4*B(!xVWdk+8uLUVb1hF_}2griV@=FA$`5#eFgZq2*T4WG3vgB1&_ zVC?4K@XnF5aDL*3YO`^CxqXzG<;hC@C5g7wE`Nv{l7ye{8&+>P!GdjMN4L$L7M}U? z7~J@0#x}yXk)55{@taf7+;`kIqSBCUWaXIMw`MssRnG@W^z9>OY#p<R_(vZ*E}lil945!ibsTqdg`0_DsWGOAy#Yq|~hMAbZy zGkFYwcu zC54P&B9?g&$b^6X&q>&Qirr9p(M9=2;D0-QBd}Vj9S4B((~{#-#=ZQIe4_*WQR)KA zxKC!bgERY~QcDg1XR_~Oedp0eO`Ew;>hEV`M(fqxx*Kc?R4+$`{hVT}Fyc-mdrd1*`YRHoiJ)hjl1 z4YVVQ^(^hRxw%yM)-2gUB w@mhJEKURtYQiOv%N~jIbXcfcRvX~10Utd5J1F&4Pi~s-t07*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$M7-kKD7AtjvGX$r=G^mLASJ%gd=*X1lG(E+`vM`~`?4X+J=XcnnUqK6 zge9U<1Kt^O50?#DPC`ydA}s&=M#mC($Ms-VsFxL4CBk(JZp+vRs1fC|Wk*(tu;jvA zM9Y>e2mWa9F-ZJ1l?qkv;i1j0oUC};XJ6x*1-f>O)6YFS#2YWUJ5oE*seNjDYiz-9yR_6|l!4Dgy`B`G46+S@&Hi4a@ea>mdUUDO8;4$_7kf(`hI;Mu1q6lf`*L~JLa#=DaGikA zS56^KQ_K~rGu}{8CArii4T0ctJ0P#J^*1`nMw!H&JM>*9N6{ttey% zsARY&(&6dWYNa5u>E5=B(=H literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/mohemm-action/notDoable.png b/Mohem/src/assets/imgs/mohemm-action/notDoable.png new file mode 100644 index 0000000000000000000000000000000000000000..017070f582815407fe97dc480ecd54ce60f3dd4d GIT binary patch literal 1461 zcmV;m1xosfP)7%g5Xa~3rpVBWxCnu(2#ASDD6!S#0zE)_Kx$MWPy-S) z>H&%nqMRs)sufurX+6Ch&Dk`h$=pkiWWoc zef*!Lb?x=8*YW1f2StO!+ zG>LtO1~*sHfu}^^;l&oY<^Hv*I-?s_06P(loJ7W5?z@vHw>)s*u~K!IY1+@4yre3 z+dNPd0SyByAdEmdaPj|p;Q7akJl{~TX22`_ep*^s$n&^4Xv1b>qbGGze~&e2!@>%~ zXWn_6mKGOt9u*$$-0^bBy~mZ=+1z{iMjZZe^6|_;z-k9&?OF3IZMXaK>^f@%UD4WF z;9;v}$qHB;5q}&$nB7h~c^sc-jh?m2x>i}*XncM)b^>N5TT@su-{ubNx6Ham;Pz*> z6`htE23An&8w;zfs{@;DD2&yk2ucf{a%!m8FH+wKFc%On*Z0A_iVav z@=#`+c6Z0)Z{(_FCNt?Dumm}~>2^G^Tv0IBEy*3ZY8lZ*v(`bO7<&-KBO`*bu)vyc4d6)pcKo^WH^?{@f5(qyX$~I2D=)*b`cDhWlj&SjmIbSaV{zcYL=>0l=1bW zjPHy5fHJLpf`?y%hxgVY@@ms1HV~Mn?;4d^7J4P4(T5T9hZ`)UFCz_YuBeh+9})bd zrE5uIqZpBUYcu5TX%VLy)E7UNUte6dXZ41&s_MI%$vlTL`kh#Z?{LrD>NKPJ&@JQk;K|WpboDmbiB5Wuv|#*nDsQl}`6b z67_LnotWDlm@9WfnZJfOSyk{HzMJq1IEJ2Q#Ah^(##XhojM;h7%#Qy6ifz#pXl)iO P00000NkvXXu0mjfmK(zN literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/my-request.png b/Mohem/src/assets/imgs/my-request.png new file mode 100644 index 0000000000000000000000000000000000000000..7fdc55390a1bdd6df84317ffcda760721e10d343 GIT binary patch literal 4055 zcmeH~i&qnO7RT=lK?beFh=Qf%6$WBgUJ6L8P{2ZE1fhsbO1?AhIaVfUQwoRjmL&;9=H z@80>%@BV(1!dKU>o;%xRHUP|JVx!jqka$Z1H4B^JU3Z^iBT%ejUZ?QdO>HSawwK4g zr2ufa%KwOxB@WM_@!71H`L)pk-KLw^UUQoMtW|g#!zYA!CZ;px|u6WxDvWdv%Aj_yeNCw_3mpM0+ z6_uT|OTT+bZKyTxVFtO$%ID=f+^4UrVnDvROf#ueuhvv4b8@PCLk3Q`x>viAr`t;C z7LB?0c1wja=gdIJK*@$^kiQq9F@JHpr4UUcAp`BX(GU`5BVU@ySbJ%UTMyA+ww3(+ zk)O^c>DMc?%H3I|KP9}ufUQ8=QN3mCUtmHS>kIz9fPMM1e2brI=ThlR#iEa$H!~QWLF6UOq5_R=by1x1@_93a$R++BP(#E zJu@$n65{j$N47fq8ixN69p)1CikV@M1x3SOJYZ)}L^$Xdh_pW?7*!kgt<;1qR5=H3 ze)=%O*apoO zfpOaI`C>}8R1j%>ipGT^tr&IdFdREb$*PK5T&ERU?MOn4UBb-dL=9Y*5>SrGFC{@% zO36M3D3_4Z7YV3;M$8_c4{*zql)51LBF;nfBBkh3A1`L}c-5PfE<#L4Pwa<%eO2s(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ZWc&UBh!XoN literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/imgs/no-images.png b/Mohem/src/assets/imgs/no-images.png new file mode 100644 index 0000000000000000000000000000000000000000..e4578a1229351f2e1830c421288e9b26a6c94095 GIT binary patch literal 38816 zcmce;cT`i|w>C;qKoPKlQdJaGNDyh#RTPw}(nF|94K<;6Mc_pQR3vl|5fBoJAc4?} zNC^Z12^|CpEfguCmv4plckVdclEpn7xsMKe6|l1@C+0z$tzy0yipRpIGeaQo0c}q&u)AB^R=f6 zSG)RNqeTa9U1=+J#99`Z=JW6w6Li$}k_AQPwQopB)7M5U_ll?qgJ^RM6~p z(D3lb$~>}8-@eS2a%u85J6&B;t;fumv#9fhqJo35qyv%ZV{{*12Kmo)O7Sagh3AB^ z6dp8BoTIz*;9!M%kiDgsowPqMP`H=1tDJI)F1XFir|8eYu15ME<igl_ z-&Qj67U<|qjqUya{Pc<~<;PA1T{EMnbGN^7Fw`4lcg5CoK{i&9c#Q5&yaC!=Y2Eo& z-29d??QG21*$4U0J^uMSox(;JoVH2m$o=dVxIsiDx=8~w%UIqEuaPhP6BB7jM^|0E zqT8zXM=g~Ftla8)p0`}QN=NroBq}~Ow`%4-9o<^{YKN0Ac6HC5v8M}XQjJS$8h-jBya-SrT^hFSovS8 zX)FJ0_5XbNfAhKj?REcq&;9Sa_`lij|AFVyPWb;UhyT9c|F-&nQ#}8(eE;7)_y2%+ z{{K?v|7T+V(J!4tC)DenEs>flN!qVYBx9dn7tv-54nC^a)3WZ^x!zpwP#q^~Egoqv zr%%Vg`Eyjy)22DQYpzRLzF5#W(wLyl4Hi4{r+8YcWfg`y4aCKX+K6jxmjExas7@Ui z$ewm6F_Ml=yb@{L{%Ok?JfkS@o#MbKSqW$BS4>JTo%z7PVsvv>V6~c$YU=d7R2hSp zR@MmO1dlyq@3+1tYNpt2MCpVPt^kAv|vV)7jhEnS6m5x$Nm7d@9M?@3odIltd zZSApf9!5kf{u>m!ix%~_5o@lC`o<~AL~Uz6u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89^ z*!lM+io!1omz=xZTw+h-l_>UP!2c$J22UNM&Zg`N=PMKrw3RV;aRWa`2&M$A4LoOM3 zUQVHq_*>QT>Ltxz2d!%F_c}79L>Ikk+Oya%p7U~7hTel1c3rtu#9o6uJ6}jUU>|nJ zE`Pc=p>@%hE|<)U=?$r!`xwi4`yDj*hrnwqPjuH8T8w?5D0TpsCAz3k-S-)(T2n~- z374%Ql0X#;LShgFd}G?g(eC#5n88d*zvCZ150E;hFt0w}GB@z(?KQNE<2W_j(6`rW zjBjj|kH#*Ug$Ikx%1{NVveZ){#%B8Gt2w+EFt(JnL?FJ8-&K6gG37q@0AmDsuv0YJ z`k4OTd0ndF@crfwSM-NOd$Yqk2fdfsU-;0|;C*{2$y*3#={-l%#S)mv20N+CC)v=3j*gGgRj{6yd$2ofCG|cdg zCH~Iqbh)Eo)&&iX?z0d56U-?-ny(hR|NXjtyKFyvrBLO@O1a^#dwqdFeG@G*5`Jw} znwt~i{E!?~OKEO1V0YW8>?fPvpjzMF zSc}EETans<={yN)fTvsPFHck`y7^jX_zYGmRFZf) z&tft{QBys{XmTRVHak!n7%0vK%%qE0xI4P%VyQ}jR3DP;YZs9k({l~|*0Qq--yZ7< z%_?&xpX@98RIbvuaYD6EY671?@YL + + + + + diff --git a/Mohem/src/assets/imgs/profile-icons/family.svg b/Mohem/src/assets/imgs/profile-icons/family.svg new file mode 100644 index 00000000..7bc06a07 --- /dev/null +++ b/Mohem/src/assets/imgs/profile-icons/family.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 077e6689..1b044530 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -176,6 +176,46 @@ "check-user-text3": { "en": "will be sent to your mobile number", "ar": "سيتم ارساله الى رقم هاتفك" + }, + "current-password-validation":{ + "en":"Do not use a current password.", + "ar":"لا تستخدم كلمة المرور الحالية." + }, + "lowercase-password-validation":{ + "en":"At least one lowercase.", + "ar":"حرف صغير واحد على الأقل." + }, + "uppercase-password-validation":{ + "en":"At least one uppercase.", + "ar":"حرف كبير واحد على الأقل." + }, + "letter-password-validation":{ + "en":"At least one Letter.", + "ar":"حرف واحد على الأقل." + }, + "numerica-password-validation":{ + "en":"At least one numeric.", + "ar":"رقم واحد على الأقل." + }, + "min-password-validation":{ + "en":"Minimum 8 characters.", + "ar":"8 أحرف على الأقل." + }, + "repeating-password-validation":{ + "en":"Do not add repeating letters.", + "ar":"لا تقم بإضافة أحرف متكررة." + }, + "special-character-password-validation":{ + "en":"It should contain a special character.", + "ar":"يجب أن يحتوي على طابع خاص." + }, + "not-match-password-validation":{ + "en":"Confirm Password does not match.", + "ar":"تأكيد كلمة المرور لا يتطابق." + }, + "contain-username-password-validation":{ + "en":"The password should not contain the user name.", + "ar":"يجب ألا تحتوي كلمة المرور على اسم المستخدم." } }, "verificationcode": { @@ -209,6 +249,50 @@ } }, "general": { + "fav-showData": { + "en": "Please select an alphabet to see your favourites", + "ar": "الرجاء تحديد الأبجدية لرؤية المفضلة لديك" + }, + "fav-noData": { + "en": "No data available for favourites", + "ar": "لا توجد بيانات متاحة للمفضلة" + }, + "concurrent-report": { + "en": "Concurrent Report", + "ar": "تقرير متزامن" + }, + "update-contact": { + "en": "Update contact information", + "ar": "تحديث معلومات الاتصال" + }, + "dependent-title": { + "en": "Dependents", + "ar": "المعالين" + }, + "add-new-row": { + "en": "Add new row", + "ar": "أضف صفًا جديدًا" + }, + "contact": { + "en": "Phone Number", + "ar": "رقم الهاتف" + }, + "from-date": { + "en": "From Date", + "ar": "من التاريخ" + }, + "to-date": { + "en": "To Date", + "ar": "حتى الآن" + }, + "termination": { + "en": "Termination", + "ar": "نهاية" + }, + "pending-transaction": { + "en": "Pending Transactions", + "ar": "المعاملات المعلقة" + }, "huawei-plugin-issue": { "en": "Error while initializing Huawei Location Plugin", "ar": "خطأ أثناء تهيئة Huawei Location Plugin" @@ -1049,7 +1133,7 @@ "en": " Select the type of change you want to make.", "ar": " حدد نوع التغيير الذي تريد القيام به." }, - "try-again":{ + "try-again": { "en": "somthing went wrong please try again later", "ar": "حدث خطا الرجاء المحاولة لاحقا" }, @@ -1061,13 +1145,13 @@ "en": "Update Now", "ar": "تحديث الان" }, - "success-create":{ + "success-create": { "en": "Request has been submitted successfully", "ar": "تم تقديم الطلب بنجاح" }, - "business-card":{ - "en":"Business Card", - "ar":"بطاقة العمل" + "business-card": { + "en": "View Business Card", + "ar": "عرض بطاقة العمل" } }, "home": { @@ -1268,16 +1352,16 @@ "ar": "الوصف" }, "MyHR-request": { - "en": "MY HR REQUEST", - "ar": "طلباتي" + "en": "Mowadhafhi Request", + "ar": "طلب Mowadhafhi" }, "createHR-Request": { - "en": "CREATE HR REQUEST", - "ar": "انشاء طلب" + "en": "Create Mowadhafhi Request", + "ar": "انشاء Mowadhafhi طلب" }, "HR-Request": { - "en": "HR Request", - "ar": "HR طلبات" + "en": "Mowadhafhi", + "ar": "Mowadhafhi" }, "performance-evaluation": { "en": "Performance Evaluation", @@ -1434,6 +1518,54 @@ "postal-code": { "en": "Postal Code", "ar": "الرمز البريدي" + }, + "contact-details": { + "en": "Contact Details", + "ar": "بيانات المتصل" + }, + "family-members": { + "en": "Family Members", + "ar": "أفراد الأسرة" + }, + "profile-compitation": { + "en": "Profile Completions", + "ar": "استكمال الملف الشخصي" + }, + "work": { + "en": "Work", + "ar": "العمل" + }, + "update": { + "en": "Update", + "ar": "تعديل" + }, + "remove": { + "en": "Remove", + "ar": "حذف" + }, + "update-msg": { + "en": "Are you sure you want to update this member ?", + "ar": "هل انت متاكد من تعديل هذا العضو؟" + }, + "remove-msg": { + "en": "Are you sure you want to remove this member?", + "ar": "هل أنت متأكد أنك تريد إزالة هذا العضو؟" + }, + "update-confirm": { + "en": "member updated successfully", + "ar": "تم تعديل البيانات بنجاح" + }, + "remove-confirm": { + "en": "member removed successfully", + "ar": "تم حذف البيانات بنجاح" + }, + "note-part-1": { + "en": "Add or update information about your beneficiaries of dependants.", + "ar": "قم بإضافة أو تحديث المعلومات حول المستفيدين من المعالين." + }, + "note-part-2": { + "en": "Note: People you enter here become dependants or beneficiaries only after you complete benefits enrollment.", + "ar": "ملاحظة: الأشخاص الذين تدخلهم هنا يصبحون معالين أو مستفيدين فقط بعد إكمال تسجيل المزايا." } }, "changePassword": { @@ -1501,6 +1633,10 @@ } }, "vacation-rule": { + "effectiveDate": { + "en": "Effective Date", + "ar": "تاريخ الفعالية" + }, "vacationRule": { "en": "Vacation Rule", "ar": "الإنابة بالإجازات" @@ -1806,6 +1942,10 @@ "tickets-balance": { "en": "Ticket Balance", "ar": "رصيد التذاكر" + }, + "selectType": { + "en": "Select Type", + "ar": "اختر النوع" } }, "accrualBalances": { @@ -1878,6 +2018,18 @@ "team-stats": { "en": "Team Statistics", "ar": "إحصائيات الفريق" + }, + "subordinate-leave": { + "en": "Subordinate Leave", + "ar": "إجازة التابعيين" + }, + "select-duration": { + "en": "Select Duration", + "ar": "اختر الفترة" + }, + "no-of-days": { + "en": "No. of days", + "ar": "عدد الايام" } }, "searchForReplacment": { @@ -1982,6 +2134,18 @@ "submit": { "en": "Are you sure you want to submit?", "ar": "هل انت متاكد من ارسال الطلب؟" + }, + "cei": { + "en": "child Education", + "ar": "تعليم الطفل" + }, + "relationship-start-date": { + "en": "Relationship Start Date", + "ar": "" + }, + "relationship-end-date": { + "en": "Relationship End Date", + "ar": "" } }, "submitAbsence": { @@ -2261,23 +2425,22 @@ "en": "Favorite", "ar": "مفضل" }, - "workflow":{ - "en":"WorkFlow", - "ar":"سير العمل" + "workflow": { + "en": "WorkFlow", + "ar": "سير العمل" }, - "employee-id":{ - "en":"Employee ID", - "ar":"هوية الموظف" + "employee-id": { + "en": "Employee ID", + "ar": "هوية الموظف" }, - "employee-email":{ - "en":"Employee Email", - "ar":"البريد الإلكتروني للموظف" + "employee-email": { + "en": "Employee Email", + "ar": "البريد الإلكتروني للموظف" }, - "employee-name":{ - "en":"Employee Name", - "ar":"اسم الموظف" + "employee-name": { + "en": "Employee Name", + "ar": "اسم الموظف" } - }, "worklist": { "view": { @@ -2483,6 +2646,42 @@ "urgent": { "en": "Urgent", "ar": "عاجل" + }, + "worklist-setting": { + "en": "WORKLIST SETTINGS", + "ar": "اعدادات اشعارات" + }, + "turn-on-notification": { + "en": "Turn on notification for", + "ar": "تفعيل الاشعارات " + }, + "save-changes": { + "en": "Save Changes", + "ar": "حفظ التغيرات" + }, + "loading": { + "en": "Loading", + "ar": "يتم التحميل" + }, + "save-successfully": { + "ar": "تم حفظ التغيير بنجاح", + "en": "Your change has been saved successfully" + }, + "done-successfully": { + "ar": "تم تنفيذ الإجراء الخاص بك بنجاح!", + "en": "Your action has been executed successfully!" + }, + "save-error": { + "ar": "هناك شئ خاطئ، يرجى المحاولة فى وقت لاحق", + "en": "Something went wrong please try again later" + }, + "assignment-number": { + "ar": "رقم التخصيص ", + "en": "Assignment Number" + }, + "schedule-date": { + "ar": "تاريخ الجدول", + "en": "Schedule Date" } }, "worklistMain": { @@ -3054,10 +3253,70 @@ } }, "itemforsale": { + "slect-source-file": { + "en": "Select source file", + "ar": "حدد مصدر الملف" + }, + "from-camera": { + "en": "Use Camera", + "ar": "استخدام الكاميرا" + }, + "from-library": { + "en": "From Library", + "ar": "من ملفات الجهاز" + }, + "from-icloud": { + "en": "From iCloud Drive", + "ar": "من iCloud Drive" + }, + "warning": { + "en": "This ad will be valid for 2 week after approval", + "ar": "هذا الإعلان ساري المفعول لمدة أسبوعين بعد الموافقة" + }, + "item-deleted": { + "en": "Item deleted successfully", + "ar": "تم حذف العنصر بنجاح" + }, + "locked": { + "en": "Locked", + "ar": "مقفل" + }, "title": { "en": "Item for sale", "ar": "سلعه للبيع" }, + "region": { + "en": "Region", + "ar": "منطقة" + }, + "selling-for": { + "en": "Selling for", + "ar": "بيع مقابل" + }, + "item-condition": { + "en": "Item condition", + "ar": "حالة السلعة" + }, + "new": { + "en": "New", + "ar": "جديد" + }, + "used": { + "en": "Used", + "ar": "تستخدم" + }, + "item-price": { + "en": "Item Price", + "ar": "سعر السلعة" + }, + "item-photos": { + "en": "Item Photos", + "ar": "صور البند" + }, + "offering": { + "en": "What are you offering?", + "ar": "ما الذي تعرضه؟" + }, "related-offers": { "en": "Related offers", "ar": "العروض ذات الصلة" @@ -3086,6 +3345,10 @@ "en": "Add Details", "ar": "أضف التفاصيل" }, + "item-info": { + "en": "Item Info", + "ar": "معلومات العنصر" + }, "review-sell": { "en": "Review & Sell", "ar": "مراجعة وبيع" @@ -3097,6 +3360,10 @@ "offersdiscount": { "en": "Offers & Discount", "ar": "العروض والخصومات" + }, + "location": { + "en": "Offer Location", + "ar": "عرض الموقع" } }, "attendance-tracking": { @@ -3235,6 +3502,56 @@ "give-comments": { "en": "Please give us a comments", "ar": "من فضلك اعطنا تعليقات" + }, + "survey-success": { + "en": "Your survey has been submitted successfully", + "ar": "تم تقديم الاستبيان الخاص بك بنجاح" + }, + "erm-failed": { + "en": "Something went wrong please try again", + "ar": "حدث خطأ ما. أعد المحاولة من فضلك" + }, + "viedo-success": { + "en": "Thank you for watching this video", + "ar": "شكرا لك على مشاهدة هذا الفيديو" + } + }, + "transaction": { + "created-for": { + "en": "Created for", + "ar": "خلقت ل" + }, + "created-date": { + "en": "Created Date", + "ar": "تاريخ الإنشاء" + }, + "request-type": { + "en": "Request type", + "ar": "نوع الطلب" + }, + "request-generated": { + "en": "Your Request for report has been sent to the server, click below link to check status", + "ar": "تم إرسال طلبك عن التقرير إلى الخادم، انقر فوق الرابط أدناه للتحقق من الحالة" + }, + "check-status": { + "en": "Refresh", + "ar": "ينعش" + }, + "phase": { + "en": "Phase", + "ar": "مرحلة" + }, + "program-name": { + "en": "Program Name", + "ar": "إسم البرنامج" + }, + "request-id": { + "en": "Request ID", + "ar": "طلب معرف" + }, + "output": { + "en": "Output", + "ar": "انتاج" } } } \ No newline at end of file diff --git a/Mohem/src/index.html b/Mohem/src/index.html index 2150180d..3d607717 100644 --- a/Mohem/src/index.html +++ b/Mohem/src/index.html @@ -11,6 +11,8 @@ + diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 2d06bd96..e5217a79 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -1176,7 +1176,7 @@ border:0px } .logoHeader { - max-width: 130%; + max-width: 70%; width: 130%; border: 0px; } @@ -1561,6 +1561,15 @@ table.monthview-datetable th small { position: absolute; display: block; } + .business-card-modal-css .modal-wrapper{ + height: 500px; + width: 300px; + top: 50%; + position: absolute; + display: block; + margin-top: -250px; + } + .app-update-modal-css .modal-wrapper{ border-radius: 0px !important; } @@ -1617,3 +1626,27 @@ ion-segment-button { .top-filter svg { margin-top: 15px !important; } + +.disabledField{ + opacity: .5; + pointer-events: none; +} + +.filterClass input{ + box-shadow: none !important; + -webkit-box-shadow: none !important; + } + .select-alert .alert-radio-label{ + + font-size: 12px !important; + } + .modal-image-viewer-landscape { + --height: 35% !important; + --width: 90% !important; + --border-radius: 0.4cm; + } + .modal-image-viewer-portrait { + --height: 45% !important; + --width: 60% !important; + --border-radius: 0.4cm; + } \ No newline at end of file