"Action" Buttons Should Not Be Visible to Users Without Required Rights in Teams Pages #203
@ -58,8 +58,7 @@ const Teams = ({ project }) => {
|
||||
ProjectRepository.manageProjectAllocation(items)
|
||||
.then((response) => {
|
||||
fetchEmployees();
|
||||
if ( added )
|
||||
{
|
||||
if (added) {
|
||||
showToast("Employee Assigned Successfully", "success");
|
||||
} else {
|
||||
showToast("Removed Employee Successfully", "success");
|
||||
@ -156,8 +155,7 @@ const Teams = ({ project }) => {
|
||||
|
||||
const handleFilterEmployee = (e) => {
|
||||
const filterValue = e.target.value;
|
||||
if ( filterValue === "true" )
|
||||
{
|
||||
if (filterValue === "true") {
|
||||
setActiveEmployee(true)
|
||||
setFilteredEmployees(employees.filter((emp) => emp.isActive));
|
||||
} else {
|
||||
@ -166,8 +164,7 @@ const Teams = ({ project }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const deleteModalOpen = (item) =>
|
||||
{
|
||||
const deleteModalOpen = (item) => {
|
||||
setDeleteEmplyee(item)
|
||||
setIsDeleteModal(true)
|
||||
}
|
||||
@ -243,8 +240,7 @@ const Teams = ({ project }) => {
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className={`link-button btn-sm m-1 ${
|
||||
HasAssignUserPermission ? "" : "d-none"
|
||||
className={`link-button btn-sm m-1 ${HasAssignUserPermission ? "" : "d-none"
|
||||
}`}
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#user-model"
|
||||
@ -264,7 +260,8 @@ const Teams = ({ project }) => {
|
||||
<th>Assigned Date</th>
|
||||
{!activeEmployee && <th>Release Date</th>}
|
||||
<th>Project Role</th>
|
||||
<th>Actions</th>
|
||||
{/* <th>Actions</th> */}
|
||||
{HasAssignUserPermission && <th>Actions</th>}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="table-border-bottom-0">
|
||||
@ -311,7 +308,7 @@ const Teams = ({ project }) => {
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{item.isActive && (
|
||||
{item.isActive && HasAssignUserPermission && (
|
||||
<button
|
||||
aria-label="Delete"
|
||||
type="button"
|
||||
@ -319,15 +316,12 @@ const Teams = ({ project }) => {
|
||||
className="btn p-0 dropdown-toggle hide-arrow"
|
||||
onClick={() => deleteModalOpen(item)}
|
||||
>
|
||||
{" "}
|
||||
{removingEmployeeId === item.id ? (
|
||||
<div
|
||||
class="spinner-border spinner-border-sm text-primary"
|
||||
className="spinner-border spinner-border-sm text-primary"
|
||||
role="status"
|
||||
>
|
||||
<span class="visually-hidden">
|
||||
Loading...
|
||||
</span>
|
||||
<span className="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
) : (
|
||||
<i className="bx bx-trash me-1 text-danger"></i>
|
||||
@ -336,6 +330,7 @@ const Teams = ({ project }) => {
|
||||
)}
|
||||
{!item.isActive && <span>Not in project</span>}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user