Skip to content

Conversation

@mvolkmann
Copy link
Collaborator

No description provided.

const handleLaunchDateChange = (val, period) => {
const newDate = val?.$d;
const isoDate = newDate.toISOString() ?? null;
const isoDate = newDate?.toISOString() ?? null;
Copy link
Collaborator Author

@mvolkmann mvolkmann May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no launch date was specified, the ? here prevents an error from trying to call toISOString.

}
};

const validateReviewPeriod = period => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function implements review period validation that must hold in order to "REQUEST APPROVAL".

);
};

const approvalButton = () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function determines whether to render a button and what text should be on the button.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without knowing off hand how many ReviewStatus potentials there are could this have been a ternary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are currently five ReviewStatus values, so I'm thinking there will be other button labels in the future.


import { AddCircle, Archive, Delete, Unarchive } from '@mui/icons-material';
import {
Alert,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using for validation error messages.

const handleCloseDateChange = (val, period) => {
const newDate = val?.$d;
const isoDate = newDate.toISOString() ?? null;
const isoDate = newDate?.toISOString() ?? null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no launch date was specified, the ? here prevents an error from trying to call toISOString.

const handleSelfReviewDateChange = (val, period) => {
const newDate = val?.$d;
const isoDate = newDate.toISOString() ?? null;
const isoDate = newDate?.toISOString() ?? null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no launch date was specified, the ? here prevents an error from trying to call toISOString.

{approvalButton()}
</div>
)}
{validationMessage && (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a validation error message, display it in an Alert.

Copy link
Contributor

@vhscom vhscom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@jackkeller jackkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment, not a dealbreaker.

@mvolkmann mvolkmann merged commit 9b31970 into develop May 14, 2024
@mkimberlin mkimberlin deleted the feature-2290-confirm-review-period branch August 27, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants