bcgov / performance

Performance
Apache License 2.0
0 stars 2 forks source link

HR/Sys Admin > Goal Bank: create notification when a new individual or business unit is added to an existing goal #700

Closed Travis-A-Clark closed 1 year ago

jp-Telus commented 2 years ago

Found a way to determine the newly insert employees or organizations during the update operation,

Work Done

  1. New model created for the existing table goals_shared_with (Model called GoalSharedWith)
  2. Update the existing Model -- added the fillable and goal() function.
  3. Updated both GoalBankController in HRAdmin and SYSAdmin area
  4. Home page (DashbaordNotification) added for newly insert employees
  5. Email notification will sent out for newly insert employees when the following condition are matched a. email configuration on the system level is 'on' (PRCS_EMAIL_NOTIFICATION=on) in .env file
    b. the 'allow email message' is Yes on the remployee's organization (defined in the Access Organization under System security).
    c. the user's system preference is Yes on "Adds a new goal to my goal bank"

Deployment completed on DEV region.

Travis-A-Clark commented 2 years ago

@jp-Telus Please confirm if the process is behaving as expected in the Dev environment. If so, please push to Test so that Steffi can review. Thanks!

jp-Telus commented 2 years ago

@Travis-A-Clark

Yes, I did some test scenarios on the DEV region this morning. Worked as expected:

My test case

  1. Create a new Goal Bank for one business unit, BC Public Service Agency > Corporate Services Business Performance > Data & Insights 2, login as user (Glen.Seredynski@gov.bc.ca) who is in the organization which I will add by update function, enable the user preference to enable the Goal Bank message
  2. Update newly created Goal Bank with the new business unit BC Public Service Agency > People and Organizational Development > Strategy Management Office
  3. Check the Notification log to see whether the email sent,

Test Result: Yes, worked as expected, only 1 email sent.

Note: there is an issue when I update by specify "Individual" in DEV region but not on my local. the error

Too few arguments to function App\Http\Controllers\HRAdmin\GoalBankController::updategoalone(), 1 passed in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php on line 54 and exactly 2 expected

I have requested to migrate to TEST region. The above issue may just happen in DEV only. Thank you.

steffipravasi commented 2 years ago

@jp-Telus The test site is giving a 500 server error when I am trying to add a goal through System Admin -> Goal Bank for a business unit User: sysadmin1@example.com, pswd: sysadmin1@2022Screen Shot 2022-09-06 at 10.48.26 AM.png

jp-Telus commented 2 years ago

@steffipravasi and @Travis-A-Clark

Thank you for reporting this issue. This 500 issue was caused by migration issue, this ticket require to use the new user preference email setiing (ticket #636) which is not yet migrate to test region.

May I request to bundle #636 + #700 for TEST migration ?

Travis-A-Clark commented 2 years ago

@jp-Telus Yes, that works for me. Thanks!

jp-Telus commented 2 years ago

Migrated to TST with dependence #636

steffipravasi commented 2 years ago

@jp-Telus Test status: Pass Env: Test 1) Pass Email syntax error. Issue occurring for any individual. Issue occurring only when Sys Admin creates a goal Test case: Goal added by sysadmin, Goal name: WorkGoalTesting, Updated individual: Achari,Jaivin Goal type: Work, Suggested. Email received but there is one error, the name of the recipient must be displayed after word Hello, but right now an id is displayed which is not the employee id of the user. Screen Shot 2022-09-14 at 3.29.32 PM.png

2) Users not receiving the email. Issue is for a sys admin only. works fine when an HR admin creates the same goal type. In-app notifications are received. Test case: Goal added by SysAdmin, Goal name: Career_BU_Testing, Mandatory goal Add business unit :BC Pension Corp -> Executive -> CEO Update goal: Advanced Education and Skills Training -> Workforce Development and Skills Training Division -> Labour Market Analytics, Forecasting, and Information Branch -> Forecasting (Prov) The users: Wang,Man and Bruce,Nicole must receive the email. The receive an email in account preference is on for both and also from the system security. There is no entry in the notification log. Screen Shot 2022-09-14 at 4.41.49 PM.png Screen Shot 2022-09-14 at 4.43.53 PM.png

3) Pass Email error. The test case is the same as number 2 above with only difference that the HR admin is creating the goal. The emails are received by the user, but the names are missing after Hello. Issue occurring only when HR Admin creates a goal Screen Shot 2022-09-14 at 4.59.39 PM.png

4) Individuals are receiving email right when the goal is created. Expected result is to send out emails to individuals when a goal is updated. Issue occurring when goal is created by both SysAdmin and HrAdmin. Test case. Create a goal by HR with name: Career_Individual_HRAdminGoa. Individuals added when creating a goal are: Train,Brian and Noble,Wade. They both received emails when goal was created. Screen Shot 2022-09-14 at 5.22.38 PM.png Screen Shot 2022-09-14 at 5.22.38 PM.png

jp-Telus commented 2 years ago

Item 1 and 3 were resolved and the name was display correctly. Item 2, there is no email send out since the 'BC Pernsion Corp" is not allow login in the access organizations page. Item 4: No sure the problem and trouble to replicate in the local region.

steffipravasi commented 2 years ago

Test fail Issue number 2 is not fixed. Issue occurs when the generic organization is selected without selecting the levels. Users not receiving the email when a new organization is added to an existing goal. Issue is for a sys admin only. works fine when an HR admin creates the same goal type. In-app notifications are received. Test case: i) Login as SysAdmin ii) Create a new goal in the goal bank and add the organization "Agriculture and Food". Don't select anything in the other levels. The employees receive an email when goal is created. iii) Go to Manage Goals in Goal Bank iv) Find the added goal and select it v) Add "Advanced Education and Skills Training" organization to the goal. Don't select anything in the other levels. vi) Expected results is that the employees in Advanced Education and Skills Training must receive an email. Actual result is that none of the Advanced Education and Skills Training employee receive an email. The receive an email in account preference is on and also from the system security. There is no entry in the notification log.

jp-Telus commented 2 years ago

@steffipravasi

Finally, I can replicate your issue on my local region. I did extractly your steps and noticed that only few email sent out but this is much less than my expectation.

I noticed that when the form submit, the submit data "select_org_nodes" are rare, the input "id"s are not the organization_trees's id, only between 1 to 4250. But the most of the ids are totally difference, greater than 4250.

image.png image.png

@Dennis, when you have time, could you please kindly check the value on "select_org_nodes" before you submit ? Thank you.

jp-Telus commented 1 year ago

The previous issues resolved, the selected business unit data were stored correctly on the table. The program updated for creating in-app message :

  1. When the new goal added to individual or business, in-app message created
  2. When the new "indivduals" added to the existing goal, the in-app message only created for the newly added individuals by comparing the previous data..
  3. When the new "business unit" added to the existing goal, in-app message only created for the employee only newly added by comparing the previous data.

@Travis, currently, only In-app notification created, do we need the email notification sent out also ? Thanks.

Status: WIP

jp-Telus commented 1 year ago

I have requested Kunal to implement "background job queue" in DEV region. The email notification will also sent out to the reciptient who have enabled the "Adds a new goal to my goal bank" option in User Preference and also the "Alloe email message" selected on the organization under "Access Organization".

Status: Deployed on DEV region

jp-Telus commented 1 year ago

Test done on DEV region

  1. Login as Amy Lee (Amy.Y.Lee@gov.bc.ca), and checked on 'Adds a new goal to my goal bank', and logout

image.png

  1. Login as SysAdmin1, Add a new Goal and assigned to Amy Lee

  2. Verified that both InApp and Email notification sent out

image.png

steffipravasi commented 1 year ago

Test data has been setup to test this ticket https://bcgov.sharepoint.com/:w:/r/teams/02915/_layouts/15/Doc.aspx?action=edit&sourcedoc=%7B8c43f42e-09c5-403b-9bd7-fbc1da473e0b%7D&wdOrigin=TEAMS-ELECTRON.teamsSdk.openFilePreview&wdExp=TEAMS-CONTROL&web=1

steffipravasi commented 1 year ago

This ticket can be validated once ticket 944 and 945 are fixed as those issues are making testing difficult and its hard to differentiate the notifications.

steffipravasi commented 1 year ago

1) Receiving 504 error very often when trying to edit the goal. 2) Goal bank page takes time to load or doesn't load at all 3) The organization does not load when clicked on filter Screenshot 2023-04-13 at 2.29.45 AM.png Screenshot 2023-04-13 at 2.31.02 AM.pngScreenshot 2023-04-13 at 1.38.22 AM.png Somehow Added employee 000648| Robinson,Caro to goal Growing shareholder value. Caro didn't receive a notification. Screenshot 2023-04-13 at 2.08.37 AM.png Cannot test adding organization to existing goal due to the errors.

jp-Telus commented 1 year ago

@jp-Telus

I believe Robinson,Caro doesn't receive notification because he didn't specify to receive notificaton when 'Adds a new goal to my goal bank' under account preferneces. Hope this helps,

image.png

steffipravasi commented 1 year ago

When editing/updating the goal, the pages take time to load and at last gives a 504 Gateway time-out error when the Save Changes button is clicked hence making testing difficult. Holding the testing until the page is stable with less or no errors.

steffipravasi commented 1 year ago

Update: Testing blocked due to the errors for Sys and Hr admin

steffipravasi commented 1 year ago

@jp-Telus Test status: Fail User: Judy.Harringa@gov.bc.ca 001818, Harringa,Judy K belongs to Citizens Services, did not receive any in-app notification when -a new goal was added to the goal bank -Citizen Services was added to an existing goal -Judy was added as an existing goal Have received the emails though.

jp-Telus commented 1 year ago

@steffipravasi

Checked the test region, the organization "Citizen Services" doesn't have Allow In-App Message" option checked at the moment I checked. And also "Allow Email Message" is also unchecked. But interesting, you got some email on Apr 28, 2023 per the notification logs. May I have sometime to test this together on TEST region since I can't replicate on my local. Thank you.

image.png

image.png

jp-Telus commented 1 year ago

@steffipravasi

Finally, found an issue, fixed on my local and push to DEV and Test regions for retest..

steffipravasi commented 1 year ago

1) Trying to add/edit a goal through Sys Admin and Hr admin but receiving the Time out error on frond end. Goal is still added in the background. Screenshot 2023-05-04 at 5.32.14 PM.png 2) Wondering why The name of the user does not appear in the recipient or notify user column for email notifications Screenshot 2023-05-04 at 7.05.58 PM.png

Receiving email and in-app notifications for new goal added or updated.

steffipravasi commented 1 year ago

@telusdcinco We receive a 504 Time out error while adding a new goal and updating a goal too for a business unit from the goal bank Screenshot 2023-06-01 at 12.00.10 PM.png User: Mark Bakusko (sys admin) The goal is added/updated in the background process but on the front-end, user receives an time-out error

telusdcinco commented 1 year ago

@steffipravasi 504 error fixed when creating/updating goals for ministries with large employee list.

steffipravasi commented 1 year ago

Issues related to this ticket are fixed and validated on Test. Others issues related to Goal Bank are addressed in tickets in Product Backlog. Moving for PO review.

telusdcinco commented 1 year ago

@jp-Telus Just FYI on additional changes for Goal Bank Notifications.