-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCHR-2395: Fix admin self leave request popup #1999
PCHR-2395: Fix admin self leave request popup #1999
Conversation
df49841
to
c6a2944
Compare
c6a2944
to
7a7ef9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initTestController({
contactId: leaveRequest.contact_id, // staff's contact id
isSelfRecord: true,
leaveRequest: leaveRequest
});
I see spec files have been amended to include the isSelfRecord: true
option, but are there any note worthy test cases for isSelfRecord: false
?
this.managedContacts = _.remove(contacts.list, function (contact) { | ||
// Removes the manager/admin from the list of managees | ||
return contact.id !== self.directiveOptions.contactId; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}.bind(this));
is being used above, it should be used here instead of var self = this
, etc.
Any place in tests with var directiveOptions = {
contactId: adminID, // admin's ID
... // not specifying isSelfRecord tests if it is false
}; However, I added a test to make sure Admin does not appear in the list of managees. |
c0ddb3e
to
56a3774
Compare
}); | ||
|
||
it('loads exactly one contact', function () { | ||
expect(_.find($ctrl.managedContacts, { 'id': adminId })).toBeUndefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the statement is it loads exactly one contact
shouldn't the test be something like expect($ctrl.managedContacts.length).toBe(1)
or maybe the statement needs to change to something like it does not include admin on contact list
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
56a3774
to
726cf8a
Compare
Overview
There are some issues with the Leave Request popup:
This PR fixes these issues.
Before
After
Technical Details
Earlier in order to check if you record for yourself the system was checking if you are Staff. This is logically wrong, since Admin or Manager can also record for themselves via My Leave page, but they are not Staff.
this.isSelfRecord
. If this param is TRUE it indicates that you create/edit a request for yourself. For example:Currently logged in admin is removed from the their managees list.
The flickering is fixed by adding an additional condition to HTML.
Comments
this.isSelfRecord
through itself.