Skip to content

Add in 'disabled' state to SubmitCard component that will disable the ability for a user to submit their timesheet #19

@izzyconner

Description

@izzyconner

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

  • When the SubmitCard is not disabled, the user is able to click the 'Submit' button.
  • When the SubmitCard is meant to be disabled, the 'Submit' button should still appear but be greyed out. All status text should still be displayed within the component.
  • The SubmitCard component's disabled/enabled state can be set from an outside source.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions