Skip to content
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

Rc/2023 08 22/sprint 59 c1 #2096

Merged
merged 35 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f585c80
Merge branch 'rc/2023-08-08/Sprint-58-c1' into bug/enhancement/Leaf-3…
Aug 14, 2023
eb45708
LEAF-3939 add class name
aerinkayne Aug 16, 2023
1726bca
Leaf 3902 - Update groups, both service and user
Aug 16, 2023
1865bc8
Leaf 3902 - remove error logging
Aug 16, 2023
d7e5100
Merge branch 'rc/2023-08-15/Sprint-58-c2' into bug/enhancement/Leaf-3…
Aug 16, 2023
dccc314
Leaf 3902 - PR comments update
Aug 16, 2023
f17f286
Leaf 3902 - too many connects error
Aug 17, 2023
50294b4
Leaf 3902 - disappearing backups
Aug 18, 2023
c7e09db
Leaf 3902 - History update
Aug 18, 2023
12cac0a
LEAF 3947 get record userID not logged user for notify requestor events
aerinkayne Aug 18, 2023
108b224
LEAF-3951 - Remove the json stuff and swap back with the unserialize,…
Aug 21, 2023
183d2ed
Merge pull request #2088 from department-of-veterans-affairs/bug/enha…
Pelentan Aug 22, 2023
d082604
Merge pull request #2087 from department-of-veterans-affairs/issue/LE…
Pelentan Aug 22, 2023
92b439d
Merge pull request #2095 from department-of-veterans-affairs/issue/LE…
Pelentan Aug 23, 2023
bf500da
Merge pull request #2094 from department-of-veterans-affairs/issue/LE…
Pelentan Aug 23, 2023
e3cc8c8
Leaf 3902 - update to sysadmin and elt
Aug 23, 2023
92c8a4c
Merge pull request #2099 from department-of-veterans-affairs/Leaf-390…
Pelentan Aug 23, 2023
c31057b
Push errors addressed
Aug 24, 2023
8775abd
Merge updated
Aug 24, 2023
0e4c552
query switched back
Aug 24, 2023
b3f6985
DB Fix
pete-nerantzinis Aug 24, 2023
fe8396b
removing services to start
Aug 24, 2023
668c54c
Merge branch 'push_errors_addressed' of https://github.com/department…
Aug 24, 2023
19a61ac
locallyManaged kept
Aug 24, 2023
391eb21
Merge pull request #2102 from department-of-veterans-affairs/push_err…
Pelentan Aug 24, 2023
e941c21
sysadmins stay
Aug 24, 2023
5342d47
service chiefs locallymanaged
Aug 24, 2023
64b3959
keeping elt groups
Aug 24, 2023
013941b
oops
Aug 24, 2023
f3425b6
Merge pull request #2103 from department-of-veterans-affairs/push_err…
Pelentan Aug 24, 2023
b964723
locally managed sc
Aug 24, 2023
4a0b73e
dont delete chiefs
Aug 24, 2023
e5496f2
Merge pull request #2104 from department-of-veterans-affairs/push_err…
Pelentan Aug 24, 2023
312cf81
async false needed
Aug 25, 2023
cd4163a
Merge pull request #2105 from department-of-veterans-affairs/Hotfix_s…
Pelentan Aug 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LEAF_Nexus/sources/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ public function importFromNational($userName)
$cacheHash = "lookupLogin{$userName}";
unset($this->cache[$cacheHash]);

$db_nat = new \Leaf\Db(DIRECTORY_HOST, DIRECTORY_USER, DIRECTORY_PASS, DIRECTORY_DB);
$db_nat = new Db(DIRECTORY_HOST, DIRECTORY_USER, DIRECTORY_PASS, DIRECTORY_DB);
$login_nat = new Login($db_nat, $db_nat);

$natEmployee = new NationalEmployee($db_nat, $login_nat);
Expand Down
22 changes: 22 additions & 0 deletions LEAF_Nexus/sources/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,26 @@ public function getAll()

return $res;
}

/**
* @param int $id
* @param string $tag
*
* @return array
*
* Created at: 8/16/2023, 8:57:05 AM (America/New_York)
*/
public function groupIsTagged(int $id, string $tag): array
{
$vars = array(':groupID' => $id,
':tag' => $tag);
$sql = 'SELECT `groupID`, `tag`
FROM `group_tags`
WHERE `groupID` = :groupID
AND `tag` = :tag';

$return_value = $this->db->pdo_select_query($sql, $vars);

return $return_value;
}
}
2 changes: 2 additions & 0 deletions LEAF_Request_Portal/admin/ajaxIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function checkToken()

break;
case 'remove_user_old':
// this should be deprecated as of 8/18/2023
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to track deprecations via GitHub Issues. Example: #2062

checkToken();

$deleteList = Leaf\XSSHelpers::scrubObjectOrArray(json_decode($_POST['json'], true));
Expand All @@ -72,6 +73,7 @@ function checkToken()

break;
case 'remove_user':
// this should be deprecated as of 8/18/2023
checkToken();

$group = new Portal\Group($db, $login);
Expand Down
2 changes: 1 addition & 1 deletion LEAF_Request_Portal/admin/templates/main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<section class="usa-banner bg-orange-topbanner" aria-label="Official government website">
<header class="usa-banner__header">
<div class="grid-col-fill tablet:grid-col-auto">
<p class="usa-banner__header-text text-white">
<p class="usa-banner__header-text text-white lf-alert">
&nbsp;Do not enter PHI/PII
</p>
</div>
Expand Down
78 changes: 55 additions & 23 deletions LEAF_Request_Portal/admin/templates/mod_groups.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,18 @@ function pruneMember(groupID, userID) {
});
}

function reactivateMember(groupID, userID) {
$.ajax({
type: 'POST',
url: "../api/group/" + groupID + "/members/_" + userID + "/reactivate",
data: {'CSRFToken': '<!--{$CSRFToken}-->'},
fail: function(err) {
console.log(err);
},
cache: false
});
}

function addNexusMember(groupID, empUID) {
$.ajax({
type: 'POST',
Expand Down Expand Up @@ -383,31 +395,36 @@ function toTitleCase(str) {
}

function addAdmin(userID) {
$.ajax({
type: 'POST',
url: "ajaxIndex.php?a=add_user",
data: {'userID': userID,
'groupID': 1,
'CSRFToken': '<!--{$CSRFToken}-->'},
success: function(response) {
getMembers(1);
},
cache: false
});
if (userID === '') {
return;
} else {
$.ajax({
type: 'POST',
url: "../api/group/" + 1 + "/members",
data: {'userID': userID,
'CSRFToken': '<!--{$CSRFToken}-->'},
success: function(response) {
getMembers(1);
},
cache: false
});
}
}

function removeAdmin(userID) {
$.ajax({
type: 'POST',
url: "ajaxIndex.php?a=remove_user",
data: {'userID': userID,
'groupID': 1,
'CSRFToken': '<!--{$CSRFToken}-->'},
success: function(response) {
getMembers(1);
},
cache: false
});
if (userID === '') {
return;
} else {
$.ajax({
type: 'DELETE',
url: "../api/group/" + 1 + "/members/_" + userID + "?" +
$.param({'CSRFToken': '<!--{$CSRFToken}-->'}),
success: function(response) {
getMembers(1);
},
cache: false
});
}
}

function unsetPrimaryAdmin() {
Expand Down Expand Up @@ -515,7 +532,12 @@ function getGroupList() {
actions += '</td>';
employee_table += `<tr>${employeeName}${employeeUserName}${backups}${isLocal}${isRegional}${actions}</tr>`;
} else {
let pruneMemberButton = `<td style="font-size: 0.8em; text-align: center;"><button id="pruneMember_${counter}" class="usa-button usa-button--secondary leaf-btn-small leaf-font0-8rem" style="font-size: 0.8em; display: inline-block; float: left; margin: auto; min-width: 4rem;" title="Prune this user from this group">Prune</button>`;
let pruneMemberButton = '';
if (res[i].regionallyManaged === false) {
pruneMemberButton = `<td style="font-size: 0.8em; text-align: center;"><button id="pruneMember_${counter}" class="usa-button usa-button--secondary leaf-btn-small leaf-font0-8rem" style="font-size: 0.8em; display: inline-block; float: left; margin: auto; min-width: 4rem;" title="Prune this user from this group">Prune</button>`;
} else {
pruneMemberButton = `<td style="font-size: 0.8em; text-align: center;"><button id="reActivateMember_${counter}" class="usa-button usa-button leaf-btn-small leaf-font0-8rem" style="font-size: 0.8em; display: inline-block; float: left; margin: auto; min-width: 4rem;" title="Reactivate this user for this group">Reactivate</button>`;
}
let actions = `${pruneMemberButton}`;
actions += '</td>';
inactive_table += `<tr>${employeeName}${employeeUserName}${backups}${isLocal}${isRegional}${actions}</tr>`;
Expand Down Expand Up @@ -570,6 +592,16 @@ function getGroupList() {
});
dialog_confirm.show();
});

$('#reActivateMember_' + counter).on('click', function () {
dialog_confirm.setContent('Are you sure you want to Reactivate this member?');
dialog_confirm.setSaveHandler(function () {
reactivateMember(groupID, res[i].userName);
dialog_confirm.hide();
dialog.hide();
});
dialog_confirm.show();
});
}
counter++;
}
Expand Down
Loading