Organization_Management : Organization Hierarchy #443
| @ -21,8 +21,6 @@ import { | |||||||
| import { useSelectedProject } from "../../slices/apiDataManager"; | import { useSelectedProject } from "../../slices/apiDataManager"; | ||||||
| 
 | 
 | ||||||
| const Teams = () => { | const Teams = () => { | ||||||
|   // const {projectId} = useParams() |  | ||||||
|   // const projectId = useSelector((store)=>store.localVariables.projectId) |  | ||||||
|   const projectId = useSelectedProject(); |   const projectId = useSelectedProject(); | ||||||
|   const dispatch = useDispatch(); |   const dispatch = useDispatch(); | ||||||
| 
 | 
 | ||||||
| @ -136,7 +134,6 @@ const Teams = () => { | |||||||
|   useEffect(() => { |   useEffect(() => { | ||||||
|     if (projectEmployees) { |     if (projectEmployees) { | ||||||
|       setEmployees(projectEmployees); |       setEmployees(projectEmployees); | ||||||
|       //setFilteredEmployees(projectEmployees?.filter((emp) => emp.isActive)); |  | ||||||
|       const filtered = projectEmployees.filter((emp) => emp.isActive); |       const filtered = projectEmployees.filter((emp) => emp.isActive); | ||||||
|       setFilteredEmployees(filtered); |       setFilteredEmployees(filtered); | ||||||
|     } |     } | ||||||
| @ -179,13 +176,6 @@ const Teams = () => { | |||||||
| 
 | 
 | ||||||
|   const handleFilterEmployee = (e) => { |   const handleFilterEmployee = (e) => { | ||||||
|     const filterValue = e.target.value; |     const filterValue = e.target.value; | ||||||
|     // if (filterValue === "true") { |  | ||||||
|     //   setActiveEmployee(true); |  | ||||||
|     //   setFilteredEmployees(employees.filter((emp) => emp.isActive)); |  | ||||||
|     // } else { |  | ||||||
|     //   setFilteredEmployees(employees.filter((emp) => !emp.isActive)); |  | ||||||
|     //   setActiveEmployee(false); |  | ||||||
|     // } |  | ||||||
|     setActiveEmployee(filterValue === "true"); |     setActiveEmployee(filterValue === "true"); | ||||||
|     setSearchTerm(""); |     setSearchTerm(""); | ||||||
|   }; |   }; | ||||||
| @ -274,6 +264,27 @@ const Teams = () => { | |||||||
|                   onChange={handleSearch} |                   onChange={handleSearch} | ||||||
|                 /> |                 /> | ||||||
|               </div> |               </div> | ||||||
|  |                {/* Services-Dropdown */} | ||||||
|  | 
 | ||||||
|  |               <div | ||||||
|  |                 className="dataTables_length text-start py-2 px-2" | ||||||
|  |                 id="DataTables_Table_0_length" | ||||||
|  |               > | ||||||
|  |                 <label> | ||||||
|  |                   <select | ||||||
|  |                     name="DataTables_Table_0_length" | ||||||
|  |                     aria-controls="DataTables_Table_0" | ||||||
|  |                     className="form-select form-select-sm" | ||||||
|  |                     // onChange={handleFilterEmployee} | ||||||
|  |                     // value={false} | ||||||
|  |                     aria-label="" | ||||||
|  |                     defaultValue="true" | ||||||
|  |                   > | ||||||
|  |                     <option value="true">Fire-Fitting</option> | ||||||
|  |                     <option value="false">Weilding</option> | ||||||
|  |                   </select> | ||||||
|  |                 </label> | ||||||
|  |               </div> | ||||||
|             </div> |             </div> | ||||||
|             <div className="col-md-6 col-12 d-flex justify-content-end align-items-center"> |             <div className="col-md-6 col-12 d-flex justify-content-end align-items-center"> | ||||||
|               <div |               <div | ||||||
| @ -295,11 +306,13 @@ const Teams = () => { | |||||||
|                   </select> |                   </select> | ||||||
|                 </label> |                 </label> | ||||||
|               </div> |               </div> | ||||||
|  | 
 | ||||||
|  |               | ||||||
|  | 
 | ||||||
|               <button |               <button | ||||||
|                 type="button" |                 type="button" | ||||||
|                 className={`link-button btn-primary btn-sm ${ |                 className={`link-button btn-primary btn-sm ${HasAssignUserPermission ? "" : "d-none" | ||||||
|                   HasAssignUserPermission ? "" : "d-none" |                   }`} | ||||||
|                 }`} |  | ||||||
|                 data-bs-toggle="modal" |                 data-bs-toggle="modal" | ||||||
|                 data-bs-target="#user-model" |                 data-bs-target="#user-model" | ||||||
|               > |               > | ||||||
| @ -319,6 +332,7 @@ const Teams = () => { | |||||||
|                       <th> |                       <th> | ||||||
|                         <div className="text-start ms-5">Name</div> |                         <div className="text-start ms-5">Name</div> | ||||||
|                       </th> |                       </th> | ||||||
|  |                       <th>Organization</th> | ||||||
|                       <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> | ||||||
| @ -334,7 +348,7 @@ const Teams = () => { | |||||||
|                               <Avatar |                               <Avatar | ||||||
|                                 firstName={item.firstName} |                                 firstName={item.firstName} | ||||||
|                                 lastName={item.lastName} |                                 lastName={item.lastName} | ||||||
|                               ></Avatar> |                               /> | ||||||
|                               <div className="d-flex flex-column"> |                               <div className="d-flex flex-column"> | ||||||
|                                 <a |                                 <a | ||||||
|                                   onClick={() => |                                   onClick={() => | ||||||
| @ -352,18 +366,16 @@ const Teams = () => { | |||||||
|                               </div> |                               </div> | ||||||
|                             </div> |                             </div> | ||||||
|                           </td> |                           </td> | ||||||
|  | 
 | ||||||
|  |                           <td>{item.organizationName || "N/A"}</td> | ||||||
|  | 
 | ||||||
|                           <td> |                           <td> | ||||||
|                             {" "} |                             {moment(item.allocationDate).format("DD-MMM-YYYY")} | ||||||
|                             {moment(item.allocationDate).format( |  | ||||||
|                               "DD-MMM-YYYY" |  | ||||||
|                             )}{" "} |  | ||||||
|                           </td> |                           </td> | ||||||
|                           {!activeEmployee && ( |                           {!activeEmployee && ( | ||||||
|                             <td> |                             <td> | ||||||
|                               {item.reAllocationDate |                               {item.reAllocationDate | ||||||
|                                 ? moment(item.reAllocationDate).format( |                                 ? moment(item.reAllocationDate).format("DD-MMM-YYYY") | ||||||
|                                     "DD-MMM-YYYY" |  | ||||||
|                                   ) |  | ||||||
|                                 : "Present"} |                                 : "Present"} | ||||||
|                             </td> |                             </td> | ||||||
|                           )} |                           )} | ||||||
| @ -373,7 +385,7 @@ const Teams = () => { | |||||||
|                             </span> |                             </span> | ||||||
|                           </td> |                           </td> | ||||||
|                           <td> |                           <td> | ||||||
|                             {item.isActive && ( |                             {item.isActive ? ( | ||||||
|                               <button |                               <button | ||||||
|                                 aria-label="Delete" |                                 aria-label="Delete" | ||||||
|                                 type="button" |                                 type="button" | ||||||
| @ -381,27 +393,26 @@ const Teams = () => { | |||||||
|                                 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 | ||||||
|                                     className="spinner-border spinner-border-sm text-primary" |                                     className="spinner-border spinner-border-sm text-primary" | ||||||
|                                     role="status" |                                     role="status" | ||||||
|                                   > |                                   > | ||||||
|                                     <span className="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> | ||||||
|                                 )} |                                 )} | ||||||
|                               </button> |                               </button> | ||||||
|  |                             ) : ( | ||||||
|  |                               <span>Not in project</span> | ||||||
|                             )} |                             )} | ||||||
|                             {!item.isActive && <span>Not in project</span>} |  | ||||||
|                           </td> |                           </td> | ||||||
|                         </tr> |                         </tr> | ||||||
|                       ))} |                       ))} | ||||||
|                   </tbody> |                   </tbody> | ||||||
|                 </table> |                 </table> | ||||||
|  | 
 | ||||||
|               )} |               )} | ||||||
|             {!employeeLodaing && filteredEmployees.length === 0 && ( |             {!employeeLodaing && filteredEmployees.length === 0 && ( | ||||||
|               <div className="text-center text-muted py-3"> |               <div className="text-center text-muted py-3"> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user