Skip to content

Commit

Permalink
replace status preview with reports preview, fix issue with api
Browse files Browse the repository at this point in the history
  • Loading branch information
tom0827 committed Dec 19, 2023
1 parent 447a9b5 commit bb643c1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions epictrack-api/src/api/services/work_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def edit_issue_update(cls, work_id, issue_id, issue_data):
if not issue_update_model:
raise ResourceNotFoundError("Issue Description doesnt exist")
if issue_update_model.is_approved:
one_of_roles = (
one_of_roles = ([
KeycloakRole.EXTENDED_EDIT.value
)
])
authorisation.check_auth(one_of_roles=one_of_roles)
issue_update_model.description = update_description.get('description')
issue_update_model.flush()
Expand Down
4 changes: 2 additions & 2 deletions epictrack-api/src/api/services/work_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def update_work_status(cls, work_status: WorkStatusModel, work_status_data: dict
"""Update an existing work status."""
# TODO Add Super user check
if work_status.is_approved:
one_of_roles = (
one_of_roles = ([
KeycloakRole.EXTENDED_EDIT.value
)
])
authorisation.check_auth(one_of_roles=one_of_roles)

work_status.update(work_status_data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { Button, Grid, Stack } from "@mui/material";
import TabPanel from "../../../shared/tab/TabPanel";
import { ThirtySixtyNinety } from "./ThirtySixtyNinety";
import { ReferralSchedule } from "./ReferralSchedule";
import { IssuesContext } from "../IssuesContext";
import { PreviewSkeleton } from "./PreviewSkeleton";
import { WorkplanContext } from "../../WorkPlanContext";

const TAB = {
THIRTY_SIXTY_NINETY: 0,
REFERRAL_SCHEDULE: 1,
};

export const ReportsPreview = () => {
const { isIssuesLoading } = React.useContext(IssuesContext);
const { loading } = React.useContext(WorkplanContext);
const [selectedTabIndex, setSelectedTabIndex] = React.useState(
TAB.THIRTY_SIXTY_NINETY
);

if (isIssuesLoading) {
if (loading) {
return <PreviewSkeleton />;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Palette } from "../../../../styles/theme";
import StatusView from "../StatusView";
import { ETTab, ETTabs } from "../../../shared/tab/Tab";
import TabPanel from "../../../shared/tab/TabPanel";
import StatusPreview from "./StatusPreview";
import StatusNotes from "./StatusNotes";
import { tabPanelStyle, tabStyle, titleStyle } from "../../common/styles";
import { ReportsPreview } from "../../issues/ReportsPreview";

const StatusContainer = () => {
const [selectedTabIndex, setSelectedTabIndex] = React.useState(0);
Expand Down Expand Up @@ -43,7 +43,7 @@ const StatusContainer = () => {
paddingLeft: 0,
...tabStyle,
}}
label="Status Preview"
label="Reports Preview"
/>
<ETTab
label="Notes"
Expand All @@ -62,15 +62,21 @@ const StatusContainer = () => {
>
<StatusView />
</Grid>
<Grid item xs={4}>
<Grid
item
xs={4}
sx={{
pt: "2rem",
}}
>
<TabPanel
index={0}
value={selectedTabIndex}
sx={{
...tabPanelStyle,
}}
>
<StatusPreview />
<ReportsPreview />
</TabPanel>
<TabPanel
index={1}
Expand Down

0 comments on commit bb643c1

Please sign in to comment.