Skip to content

Commit

Permalink
merging dev in
Browse files Browse the repository at this point in the history
  • Loading branch information
tom0827 committed Oct 23, 2023
1 parent c7e1755 commit 7971a79
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
7 changes: 3 additions & 4 deletions epictrack-api/src/api/models/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ class Work(BaseModelVersioned):

id = Column(Integer, primary_key=True, autoincrement=True)
title = Column(String(80), nullable=False)
short_description = Column(String(2000))
long_description = Column(Text)
is_pecp_required = Column(Boolean, default=False, nullable=False)
report_description = Column(String(2000))
epic_description = Column(Text)
is_cac_recommended = Column(Boolean, default=False, nullable=False)
is_active = Column(Boolean, default=True, nullable=False)
is_completed = Column(Boolean, default=False, nullable=False)
is_watched = Column(Boolean, default=False, nullable=False)
is_high_priority = Column(Boolean, default=False, nullable=False)
work_status_stoplight = Column(String(6))
is_deleted = Column(Boolean(), default=False, nullable=False)
project_tracking_number = Column(String(255), nullable=True, default=None)
Expand Down
1 change: 1 addition & 0 deletions epictrack-api/src/api/resources/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def get(work_id):
@profiletime
def put(work_id):
"""Update and return a work."""
print("-----HERE------\n\n")
req.WorkIdPathParameterSchema().load(request.view_args)
request_json = req.WorkBodyParameterSchema().load(API.payload)
work = WorkService.update_work(work_id, request_json)
Expand Down
15 changes: 6 additions & 9 deletions epictrack-api/src/api/schemas/request/work_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class WorkBodyParameterSchema(RequestBodyParameterSchema):
required=True,
)

short_description = fields.Str(
metadata={"description": "Short description of work"},
report_description = fields.Str(
metadata={"description": "Report description of work"},
validate=validate.Length(max=500),
required=True,
)
long_description = fields.Str(
metadata={"description": "Long description of work"},
epic_description = fields.Str(
metadata={"description": "EPIC description of work"},
validate=validate.Length(max=2000),
allow_none=True,
load_default=None,
Expand Down Expand Up @@ -101,15 +101,12 @@ class WorkBodyParameterSchema(RequestBodyParameterSchema):
)

is_active = fields.Bool(metadata={"description": "Active state of the work"})
is_watched = fields.Bool(
metadata={"description": "Watched state of the work"}, default=False
is_high_priority = fields.Bool(
metadata={"description": "Is a high priority work"}, default=False
)
is_cac_recommended = fields.Bool(
metadata={"description": "Is CAC recommended for the work"}, default=False
)
is_pecp_required = fields.Bool(
metadata={"description": "Is PCP recommended for the work"}, default=False
)


class WorkExistenceQueryParamSchema(RequestQueryParameterSchema):
Expand Down
20 changes: 12 additions & 8 deletions epictrack-web/src/components/work/WorkForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const schema = yup.object<Work>().shape({
},
}),
substitution_act_id: yup.number(),
eao_team_id: yup.number().required("EAO team is required"),
responsible_epd_id: yup.number().required("Responsible EPD is required"),
work_lead_id: yup.number().required("Work Lead is required."),
decision_by_id: yup.number().required("Decision Maker is required"),
});

const InfoIcon: React.FC<IconProps> = Icons["InfoIcon"];
Expand Down Expand Up @@ -288,9 +292,9 @@ export default function WorkForm({ ...props }) {
fullWidth
multiline
rows={2}
error={!!errors?.short_description?.message}
helperText={errors?.short_description?.message?.toString()}
{...register("short_description")}
error={!!errors?.report_description?.message}
helperText={errors?.report_description?.message?.toString()}
{...register("report_description")}
/>
</Grid>
<Grid item xs={12}>
Expand All @@ -300,9 +304,9 @@ export default function WorkForm({ ...props }) {
fullWidth
multiline
rows={4}
error={!!errors?.long_description?.message}
helperText={errors?.long_description?.message?.toString()}
{...register("long_description")}
error={!!errors?.epic_description?.message}
helperText={errors?.epic_description?.message?.toString()}
{...register("epic_description")}
/>
</Grid>
<Grid item xs={12}>
Expand Down Expand Up @@ -428,8 +432,8 @@ export default function WorkForm({ ...props }) {
<Grid item xs={4} sx={{ paddingTop: "30px !important" }}>
<ControlledSwitch
sx={{ paddingLeft: "0px", marginRight: "10px" }}
defaultChecked={(ctx.item as Work)?.is_watched}
{...register("is_watched")}
defaultChecked={(ctx.item as Work)?.is_high_priority}
{...register("is_high_priority")}
/>
<ETFormLabel id="is_watched">High Priority</ETFormLabel>
<Tooltip
Expand Down
7 changes: 3 additions & 4 deletions epictrack-web/src/models/work.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { MasterBase } from "./type";
export interface Work extends MasterBase {
id: number;
title: string;
short_description: string;
long_description: string;
is_pecp_required: boolean;
report_description: string;
epic_description: string;
is_cac_recommended: boolean;
is_active: boolean;
is_complete: boolean;
is_watched: boolean;
is_high_priority: boolean;
is_deleted: boolean;
start_date: string;
anticipated_decision_date: string;
Expand Down

0 comments on commit 7971a79

Please sign in to comment.