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