Context
In Timesheet.tsx, there's a calculated variable disabled, which determines if a user is able to edit and submit the timesheet.
// use this to control whether the timesheet is disabled or not
const disabled = false;
Right now, cases where they will not be able to disable it are:
- A supervisor cannot edit or submit before an associate has submitted their timesheet
- A user cannot submit the timesheet once the corresponding deadline has passed
Currently, only the TimeTable component is controlled by the disabled state. We need to add a way to switch the SubmitCard to a custom disabled state.
Description
When the timesheet should be disabled, the SubmitCard should still display information about the current status of the timesheet. However, the 'submit' button should be greyed out.
Most likely, the solution for this will be to add in a disabled field into the props for the SubmitCard component.
Conditions of Satisfaction
Context
In
Timesheet.tsx, there's a calculated variabledisabled, which determines if a user is able to edit and submit the timesheet.Right now, cases where they will not be able to disable it are:
Currently, only the
TimeTablecomponent is controlled by the disabled state. We need to add a way to switch the SubmitCard to a custom disabled state.Description
When the timesheet should be disabled, the SubmitCard should still display information about the current status of the timesheet. However, the 'submit' button should be greyed out.
Most likely, the solution for this will be to add in a
disabledfield into the props for theSubmitCardcomponent.Conditions of Satisfaction
SubmitCardis not disabled, the user is able to click the 'Submit' button.SubmitCardis meant to be disabled, the 'Submit' button should still appear but be greyed out. All status text should still be displayed within the component.SubmitCardcomponent's disabled/enabled state can be set from an outside source.