Skip to content

Commit

Permalink
Merge pull request #542 from AI4Bharat/develop2
Browse files Browse the repository at this point in the history
Develop2
  • Loading branch information
Shruti1229 authored Jan 23, 2024
2 parents f9b6017 + 10d8420 commit e03be39
Show file tree
Hide file tree
Showing 14 changed files with 446 additions and 18 deletions.
30 changes: 20 additions & 10 deletions src/common/TableDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { themeDefault } from "theme";

//Components
import {
Box,
Button,
Dialog,
DialogActions,
Expand All @@ -20,6 +21,7 @@ const TableDialog = ({
message,
response,
columns,
taskId,
}) => {
const options = {
pagination: false,
Expand Down Expand Up @@ -57,18 +59,26 @@ const TableDialog = ({
>
<DialogContent>
<DialogContentText id="alert-dialog-description">
<Typography variant="body1" sx={{ mb: 3 }}>
{message}
</Typography>
{taskId && (
<Typography
variant="body1"
sx={{ fontWeight: "bold", textDecoration: "underline" }}
>
Task Id: {taskId}
</Typography>
)}
<Typography variant="body1">{message}</Typography>

{response && (
<ThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={response}
columns={columns}
options={options}
/>
</ThemeProvider>
<Box sx={{ mt: 3 }}>
<ThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={response}
columns={columns}
options={options}
/>
</ThemeProvider>
</Box>
)}
</DialogContentText>
</DialogContent>
Expand Down
9 changes: 8 additions & 1 deletion src/config/projectConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import AppRegistrationIcon from "@mui/icons-material/AppRegistration";
import UploadIcon from "@mui/icons-material/Upload";
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
import LockOpenOutlinedIcon from "@mui/icons-material/LockOpenOutlined";
import LockResetIcon from "@mui/icons-material/LockReset";

export const genderOptions = [
{
Expand Down Expand Up @@ -151,6 +152,12 @@ export const buttonConfig = [
icon: <VisibilityIcon />,
key: "Preview",
},
{
title: "Regenerate",
color: "primary",
icon: <LockResetIcon />,
key: "Regenerate",
},
{
title: "Delete",
color: "error",
Expand Down Expand Up @@ -205,4 +212,4 @@ export const bgMusicOptions = [
label: "No",
value: "false",
},
];
];
4 changes: 4 additions & 0 deletions src/config/tableColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import moment from "moment";
import statusColor from "../utils/getStatusColor";

export const projectColumns = [
{
name: "id",
label: "Id"
},
{
name: "title",
label: "Name",
Expand Down
13 changes: 11 additions & 2 deletions src/containers/Organization/MyOrganization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ const MyOrganization = () => {
organization: { organization_owner },
} = userData;

console.log(organization_owner,'organization_owner tetete');

setOrgOwnerId(organization_owner.id);
}
// eslint-disable-next-line
Expand Down Expand Up @@ -228,6 +226,17 @@ const MyOrganization = () => {
Add New Project
</Button>

<Button
style={{ marginRight: "10px" }}
className={classes.projectButton}
onClick={() =>
navigate(`/my-organization/${id}/create-bulk-projects`)
}
variant="contained"
>
Create Bulk Projects from Template
</Button>

{organizationDetails.enable_upload && (
<Button
style={{ marginLeft: "10px" }}
Expand Down
16 changes: 16 additions & 0 deletions src/containers/Organization/OrgLevelTaskList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import {
FetchVoiceoverExportTypesAPI,
FetchpreviewTaskAPI,
GenerateTranslationOutputAPI,
RegenerateResponseAPI,
ReopenTaskAPI,
UploadToYoutubeAPI,
clearComparisonTable,
Expand Down Expand Up @@ -227,6 +228,7 @@ const OrgLevelTaskList = () => {
break;

case "GET_TASK_FAIL_INFO":
dispatch(setSnackBar({ open: false }));
handleDialogOpen("tableDialog");
setTableDialogColumn(failInfoColumns);
setTableDialogMessage(data.message);
Expand All @@ -250,6 +252,14 @@ const OrgLevelTaskList = () => {
setDeleteMsg(data.message);
setDeleteResponse(data.error_report);
}

if (apiType === "GET_TASK_FAIL_INFO") {
dispatch(setSnackBar({ open: false }));
handleDialogOpen("tableDialog");
setTableDialogColumn([]);
setTableDialogMessage(data.message);
setTableDialogResponse(null);
}
}
}

Expand Down Expand Up @@ -640,6 +650,11 @@ const OrgLevelTaskList = () => {
dispatch(APITransport(apiObj));
break;

case "Regenerate":
const obj = new RegenerateResponseAPI(id);
dispatch(APITransport(obj));
break;

default:
break;
}
Expand Down Expand Up @@ -1255,6 +1270,7 @@ const OrgLevelTaskList = () => {
message={tableDialogMessage}
response={tableDialogResponse}
columns={tableDialogColumn}
taskId={currentTaskDetails.id}
/>
)}
</>
Expand Down
Loading

0 comments on commit e03be39

Please sign in to comment.