Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace report preview with status preview #1482

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion epictrack-api/src/api/services/work_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def edit_issue_update(cls, work_id, issue_id, issue_data):
raise ResourceNotFoundError("Issue Description doesnt exist")
if issue_update_model.is_approved:
one_of_roles = (
KeycloakRole.EXTENDED_EDIT.value
KeycloakRole.EXTENDED_EDIT.value,
)
authorisation.check_auth(one_of_roles=one_of_roles)
issue_update_model.description = update_description.get('description')
Expand Down
2 changes: 1 addition & 1 deletion epictrack-api/src/api/services/work_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def update_work_status(cls, work_status: WorkStatusModel, work_status_data: dict
# TODO Add Super user check
if work_status.is_approved:
one_of_roles = (
KeycloakRole.EXTENDED_EDIT.value
KeycloakRole.EXTENDED_EDIT.value,
)
authorisation.check_auth(one_of_roles=one_of_roles)

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
Loading