ANUDESH - Developed at AI4Bharat Lab
diff --git a/src/app/organizations/AddWorkspaceDialog.js b/src/app/organizations/AddWorkspaceDialog.js
new file mode 100644
index 00000000..ea3bd72b
--- /dev/null
+++ b/src/app/organizations/AddWorkspaceDialog.js
@@ -0,0 +1,92 @@
+import { Button, CircularProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, FormControlLabel, Switch, TextField } from '@mui/material'
+import React, { useState } from 'react'
+// import { useDispatch } from 'react-redux'
+// import GetWorkspacesAPI from '../../../../redux/actions/api/Dashboard/GetWorkspaces'
+// import CreateWorkspaceAPI from '../../../../redux/actions/api/WorkspaceDetails/CreateWorkspace'
+// import APITransport from '../../../../redux/actions/apitransport/apitransport'
+import CustomButton from '../components/common/Button'
+
+const AddWorkspaceDialog = ({ isOpen, dialogCloseHandler, orgId = 0 }) => {
+ const [workspaceName, setWorkspaceName] = useState('')
+ const [loading, setLoading] = useState(false);
+ // const dispatch = useDispatch();
+ const [publicanalytics, setpublicanalytics] = useState(true)
+
+ const handlepublicanalytics = async () => {
+ setLoading(true);
+ setpublicanalytics((publicanalytics) => !publicanalytics)
+ };
+
+ const addBtnClickHandler = async (event) => {
+ setWorkspaceName('');
+ dialogCloseHandler();
+ // if (!workspaceName) return;
+
+ // setLoading(true);
+ // const createWorkspaceObj = new CreateWorkspaceAPI(
+ // orgId,
+ // workspaceName,
+ // publicanalytics
+ // );
+ // const createWorkspaceRes = await fetch(createWorkspaceObj.apiEndPoint(), {
+ // method: "POST",
+ // body: JSON.stringify(createWorkspaceObj.getBody()),
+ // headers: createWorkspaceObj.getHeaders().headers,
+ // });
+
+ // const createWorkspaceRespData = await createWorkspaceRes.json();
+
+ // if (createWorkspaceRes.ok) {
+ // const workspaceObj = new GetWorkspacesAPI(1);
+ // dispatch(APITransport(workspaceObj));
+ // return createWorkspaceRespData;
+ // }
+ setLoading(false)
+ }
+
+ const handleUserDialogClose = () => {
+ setWorkspaceName('');
+ dialogCloseHandler();
+ }
+
+ const handleTextField = (e) => {
+ setWorkspaceName(e.target.value)
+ }
+
+ return (
+
+ Enter workspace details
+
+
+ }
+ labelPlacement="start"
+ label="Public Analytics"
+ checked={publicanalytics}
+ onChange={handlepublicanalytics}
+ />
+
+
+
+ Cancel
+
+
+
+ )
+ }
+ onClick={addBtnClickHandler}
+ size="small"
+ label="OK"
+ disabled={loading || !workspaceName}
+ />
+
+
+ )
+}
+
+export default AddWorkspaceDialog
\ No newline at end of file
diff --git a/src/app/organizations/page.js b/src/app/organizations/page.js
index 0833dfd4..2613eec3 100644
--- a/src/app/organizations/page.js
+++ b/src/app/organizations/page.js
@@ -1,17 +1,231 @@
'use client';
-import DetailsViewPage from "../workspace/DetailsViewPage";
-import componentType from "../../config/PageType";
-// import { useSelector } from "react-redux";
-
-const MyOrganization = () => {
- // const organizationDetails = useSelector(state=>state.fetchLoggedInUserData.data.organization);
- return (
-
- )
+import { Button, Grid, Typography, Card, Tab, Tabs, Box} from "@mui/material"
+import { useState } from 'react'
+import DatasetStyle from "@/styles/Dataset";
+import MUIDataTable from "mui-datatables";
+import Link from "next/link";
+import AddWorkspaceDialog from "./AddWorkspaceDialog";
+
+function TabPanel(props) {
+ const { children, value, index, ...other } = props;
+
+ return (
+
+ {value === index && (
+
+ {children}
+
+ )}
+
+ );
}
-export default MyOrganization;
\ No newline at end of file
+export default function Organization() {
+
+ const [value, setValue] = useState(0);
+ const handleChange = (event, newValue) => {
+ setValue(newValue);
+ };
+ const classes = DatasetStyle();
+ const [addWorkspacesDialogOpen, setAddWorkspacesDialogOpen] = useState(false);
+ const CustomButton = ({ label, buttonVariant, color, disabled = false, ...rest }) => (
+
+ {label}
+
+ );
+ const handleWorkspaceDialogClose = () => {
+ setAddWorkspacesDialogOpen(false);
+ };
+
+ const handleWorkspaceDialogOpen = () => {
+ setAddWorkspacesDialogOpen(true);
+ };
+
+ const columns = [
+ {
+ name: "id",
+ label: "Id",
+ options: {
+ filter: false,
+ sort: false,
+ align: "center",
+ setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }),
+ }
+ },
+ {
+ name: "Name",
+ label: "Name",
+ options: {
+ filter: false,
+ sort: false,
+ align: "center",
+ setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }),
+ }
+ },
+ {
+ name: "Manager",
+ label: "Manager",
+ options: {
+ filter: false,
+ sort: false,
+ align: "center",
+ display: "true",
+ setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }),
+ }
+ },
+ {
+ name: "Created By",
+ label: "Created By",
+ options: {
+ filter: false,
+ sort: false,
+ align: "center",
+ display: "true",
+ setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }),
+ }
+ },
+ {
+ name: "Actions",
+ label: "Actions",
+ options: {
+ filter: false,
+ sort: false,
+ }
+ }];
+
+ const options = {
+ textLabels: {
+ body: {
+ noMatch: "No records",
+ },
+ toolbar: {
+ search: "Search",
+ viewColumns: "View Column",
+ },
+ pagination: { rowsPerPage: "Rows per page" },
+ options: { sortDirection: "desc" },
+ },
+ // customToolbar: fetchHeaderButton,
+ displaySelectToolbar: false,
+ fixedHeader: false,
+ filterType: "checkbox",
+ download: false,
+ print: false,
+ rowsPerPageOptions: [10, 25, 50, 100],
+ // rowsPerPage: PageInfo.count,
+ filter: false,
+ // page: PageInfo.page,
+ viewColumns: false,
+ selectableRows: "none",
+ search: false,
+ jumpToPage: true,
+ };
+
+ const workspaceData = [{ "id": 1, "workspace_name": "workspace 1", "managers": [{ "username": "manager 1" }, { "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 1" } },
+ { "id": 2, "workspace_name": "workspace 2", "managers": [{ "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 2" } },
+ { "id": 3, "workspace_name": "workspace 3", "managers": [{ "username": "manager 1" }, { "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 3" } },
+ { "id": 4, "workspace_name": "workspace 4", "managers": [{ "username": "manager 1" }, { "username": "manager 3" }], "created_by": { "username": "Admin 4" } },
+ { "id": 5, "workspace_name": "workspace 5", "managers": [{ "username": "manager 1" }, { "username": "manager 3" }], "created_by": { "username": "Admin 5" } },
+ { "id": 6, "workspace_name": "workspace 6", "managers": [{ "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 6" } }]
+
+ const pageSearch = () => {
+ return workspaceData.filter((el) => {
+ return el;
+ })
+
+ }
+ const data = workspaceData && workspaceData.length > 0 ? pageSearch().map((el, i) => {
+ return [
+ el.id,
+ el.workspace_name,
+ el.managers.map((manager) => {
+ return manager.username
+ }).join(", "),
+ el.created_by && el.created_by.username,
+
+
+
+ ]
+ }) : [];
+
+ return (
+
+
+
+ AI4Bharat
+
+
+
+ Created by : Anudesh
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+ */}
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/styles/Header.js b/src/styles/Header.js
index 5a0532ce..ac12eabc 100644
--- a/src/styles/Header.js
+++ b/src/styles/Header.js
@@ -4,14 +4,14 @@ import { padding } from '@mui/system';
const headerStyle = makeStyles({
parentContainer: {
// flexGrow : 1,
- marginBottom : window.innerHeight*0.13,
- width : window.innerWidth*0.98,
+ // marginBottom : window.innerHeight*0.13,
+ // width : window.innerWidth*0.98,
},
AudioparentContainers:{
- marginBottom : window.innerHeight*0.1,
- width : window.innerWidth*0.98,
+ // marginBottom : window.innerHeight*0.1,
+ // width : window.innerWidth*0.98,
},
appBar: {
// backgroundColor: "#ffffff",