Skip to content

Commit

Permalink
added new pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarika-padmanaban committed Jan 26, 2024
1 parent d5f13b3 commit 7b84c44
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/app/ui/pages/admin/UserDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const UserDetail = (props) => {
console.log(UserDetail);
const apiLoading = useSelector((state) => state.apiStatus.loading);
const SearchUserDetail = useSelector(
(state) => state.searchProjectCard?.data
(state) => state.searchProjectCard?.searchValue
);
const getUserDetail = () => {
setLoading(true);
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/pages/dataset/DatasetCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DatasetCards = (props) => {
const [loading, setLoading] = useState(false);
const [rowsPerPage, setRowsPerPage] = useState(9);
// const apiLoading = useSelector(state => state.apiStatus.loading);
const SearchDataset = useSelector((state) => state.searchProjectCard?.data);
const SearchDataset = useSelector((state) => state.searchProjectCard?.searchValue);
console.log(SearchDataset);
const [anchorEl, setAnchorEl] = useState(null);
const popoverOpen = Boolean(anchorEl);
Expand Down Expand Up @@ -48,7 +48,7 @@ const DatasetCards = (props) => {

const pageSearch = () => {
return datasetList.filter((el) => {
if (SearchDataset == ""||SearchDataset == undefined) {
if (SearchDataset == "") {
return el;
} else if (
el.dataset_type?.toLowerCase().includes(SearchDataset?.toLowerCase())
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/pages/dataset/DatasetCardList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const DatasetCardList = (props) => {
/* eslint-disable react-hooks/exhaustive-deps */

const { datasetList,selectedFilters,setsSelectedFilters } = props;
const SearchDataset = useSelector((state) => state.searchProjectCard?.data);
const SearchDataset = useSelector((state) => state.searchProjectCard?.searchValue);
const [anchorEl, setAnchorEl] = useState(null);
const popoverOpen = Boolean(anchorEl);
const filterId = popoverOpen ? "simple-popover" : undefined;
Expand All @@ -28,7 +28,7 @@ const DatasetCardList = (props) => {

const pageSearch = () => {
return datasetList.filter((el) => {
if (SearchDataset == ""||SearchDataset ==undefined) {
if (SearchDataset == "") {
return el;
} else if (
el.dataset_type?.toLowerCase().includes(SearchDataset?.toLowerCase())
Expand Down
8 changes: 4 additions & 4 deletions src/app/ui/pages/workspace/ProjectTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ const ProjectTable = (props) => {
(state) => state.getWorkspaceProjectData.data
);
console.log(workspacesproject);
// const SearchWorkspaceProjects = useSelector(
// (state) => state.searchProjectCard?.data
// );
const SearchWorkspaceProjects = useSelector(
(state) => state.searchProjectCard?.searchValue
);


const pageSearch = () => {
return workspacesproject.filter((el) => {
if (SearchWorkspaceProjects == ""||SearchWorkspaceProjects == undefined) {
if (SearchWorkspaceProjects == "") {
return el;
} else if (
el.title?.toLowerCase().includes(SearchWorkspaceProjects?.toLowerCase())
Expand Down
4 changes: 2 additions & 2 deletions src/components/Project/MembersTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ const MembersTable = (props) => {
const ProjectDetails = useSelector((state) => state.getProjectDetails.data);
const apiLoading = useSelector((state) => state.apiStatus.loading);
const SearchWorkspaceMembers = useSelector(
(state) => state.searchProjectCard?.data
(state) => state.searchProjectCard?.searchValue
);
const loggedInUserData = useSelector(
(state) => state.getLoggedInData.data
);
const pageSearch = () => {
return dataSource.filter((el) => {
if (SearchWorkspaceMembers == ""||SearchWorkspaceMembers == undefined) {
if (SearchWorkspaceMembers == "") {
return el;
} else if (
el.username
Expand Down
4 changes: 2 additions & 2 deletions src/components/Project/ProjectCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Projectcard = (props) => {

const { projectData, selectedFilters, setsSelectedFilters } = props;
const classes = DatasetStyle();
const SearchProject = useSelector((state) => state.searchProjectCard?.data);
const SearchProject = useSelector((state) => state.searchProjectCard?.searchValue);
const [page, setPage] = useState(0);

const [rowsPerPage, setRowsPerPage] = useState(9);
Expand All @@ -47,7 +47,7 @@ const Projectcard = (props) => {
};
const pageSearch = () => {
return projectData.filter((el) => {
if (SearchProject == ""||SearchProject == undefined) {
if (SearchProject == "") {
return el;
} else if (
el.project_type?.toLowerCase().includes(SearchProject?.toLowerCase())
Expand Down
4 changes: 2 additions & 2 deletions src/components/Project/ProjectCardList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ProjectCardList = (props) => {
const popoverOpen = Boolean(anchorEl);
const filterId = popoverOpen ? "simple-popover" : undefined;

const SearchProject = useSelector((state) => state.searchProjectCard?.data);
const SearchProject = useSelector((state) => state.searchProjectCard?.searchValue);

const handleShowFilter = (event) => {
setAnchorEl(event.currentTarget);
Expand All @@ -31,7 +31,7 @@ const ProjectCardList = (props) => {

const pageSearch = () => {
return projectData.filter((el) => {
if (SearchProject == ""||SearchProject == undefined) {
if (SearchProject == "") {
return el;
} else if (
el.project_type?.toLowerCase().includes(SearchProject?.toLowerCase())
Expand Down
4 changes: 2 additions & 2 deletions src/components/Tabs/AnnotatorTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AnnotatorsTable = (props) => {
});

const orgId = useSelector(state => state.getWorkspaceProjectData?.data?.[0]?.organization_id);
const SearchWorkspaceMembers = useSelector((state) => state.searchProjectCard?.data);
const SearchWorkspaceMembers = useSelector((state) => state.searchProjectCard?.searchValue);


const workspaceAnnotators = useSelector(state => state.getWorkspacesAnnotatorsData.data);
Expand Down Expand Up @@ -101,7 +101,7 @@ const AnnotatorsTable = (props) => {

return workspaceAnnotators.filter((el) => {

if (SearchWorkspaceMembers == ""||SearchWorkspaceMembers == undefined) {
if (SearchWorkspaceMembers == "") {

return el;
} else if (
Expand Down
4 changes: 2 additions & 2 deletions src/components/Tabs/ManagersTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ManagersTable = (props) => {
},[]);

const workspaceManagers = useSelector(state=>state.getWorkspacesManagersData.data);
const SearchWorkspaceManagers = useSelector((state) => state.searchProjectCard?.data);
const SearchWorkspaceManagers = useSelector((state) => state.searchProjectCard?.searchValue);

const handleRemoveWorkspaceManager = async(userid)=>{

Expand Down Expand Up @@ -76,7 +76,7 @@ const handleRemoveWorkspaceManager = async(userid)=>{

return workspaceManagers.filter((el) => {

if (SearchWorkspaceManagers == ""||SearchWorkspaceManagers == undefined) {
if (SearchWorkspaceManagers == "") {

return el;
} else if (
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Search = (props) => {

const dispatch = useDispatch();

const SearchProject = useSelector((state) => state.searchProjectCard?.data);
const SearchProject = useSelector((state) => state.searchProjectCard?.searchValue);
const [searchValue, setSearchValue] = useState("");


Expand Down
5 changes: 3 additions & 2 deletions src/components/common/WorkspaceTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const WorkspaceTable = (props) => {
const dispatch = useDispatch();
const { showManager, showCreatedBy } = props;
const workspaceData = useSelector(state => state.GetWorkspace.data);
const SearchWorkspace = useSelector((state) => state.searchProjectCard?.data);
const SearchWorkspace = useSelector((state) => state.searchProjectCard?.searchValue);
console.log(SearchWorkspace);


const [currentPageNumber, setCurrentPageNumber] = useState(1);
Expand All @@ -46,7 +47,7 @@ const WorkspaceTable = (props) => {

return workspaceData.filter((el) => {

if (SearchWorkspace == "" ||SearchWorkspace == undefined ) {
if (SearchWorkspace == "" ) {

return el;
} else if (
Expand Down
4 changes: 2 additions & 2 deletions src/components/datasets/DatasetProjectsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export default function DatasetProjectsTable({ datasetId }) {
}
}
const SearchWorkspaceMembers = useSelector(
(state) => state.searchProjectCard.data
(state) => state.searchProjectCard?.searchValue
);
const pageSearch = () => {
return datasetProjects.filter((el) => {
if (SearchWorkspaceMembers == ""|| SearchWorkspaceMembers == undefined) {
if (SearchWorkspaceMembers == "") {
return el;
} else if (
el.title
Expand Down
8 changes: 4 additions & 4 deletions src/utils/UserMappedByProjectStage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Typography } from "@mui/material"

const UserMappedByProjectStage = (roleId) => {
if(roleId == 1){
return {id: roleId, name : "Annotation", element : <Typography variant="caption" sx={{p:1, backgroundColor:"rgb(34, 134, 202 ,0.2)", color:"rgb(34, 134, 202 )", borderRadius : 2, fontWeight: 600 }}>Annotation</Typography>}
return {id: roleId, name : "Annotation", element : <Typography variant="caption" sx={{p:1, backgroundColor:"rgb(0, 102, 51 ,0.2)", color:"rgb(0, 102, 51)", borderRadius : 2, fontWeight: 600 }}>Annotation</Typography>}
} else if(roleId == 2){
return {id: roleId, name : "Review", element : <Typography variant="caption" sx={{p:1, backgroundColor:"rgb(230, 126, 34 ,0.2)", color:"rgb(230, 126, 34 )", borderRadius : 2, fontWeight: 600 }}>Review</Typography>}
return {id: roleId, name : "Review", element : <Typography variant="caption" sx={{p:1, backgroundColor:"rgb(204, 0, 0 ,0.2)", color:"rgb(204, 0, 0)", borderRadius : 2, fontWeight: 600 }}>Review</Typography>}
} else if(roleId == 3){
return {id: roleId, name : "Supercheck", element : <Typography variant="caption" sx={{p:1, backgroundColor:"rgb(142, 68, 173,0.2)", color:"rgb(142, 68, 173 )", borderRadius : 2, fontWeight: 600 }}>Supercheck</Typography>}
return {id: roleId, name : "Supercheck", element : <Typography variant="caption" sx={{p:1, backgroundColor:"rgb(204, 204, 0 ,0.1)", color:"rgb(0, 153, 0)", borderRadius : 2, fontWeight: 600 }}>Supercheck</Typography>}
}

}

export default UserMappedByProjectStage;
export default UserMappedByProjectStage;

0 comments on commit 7b84c44

Please sign in to comment.