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

OBPIH-6329 Add details step of full outbound import form #4656

Merged
merged 9 commits into from
Jun 11, 2024

Conversation

kchelstowski
Copy link
Collaborator

Screenshot from 2024-06-07 13-42-31

@kchelstowski kchelstowski self-assigned this Jun 7, 2024
@drodzewicz drodzewicz added the warn: do not squash Apply to any pull request whose commits shouldn't be squashed upon merging label Jun 10, 2024
Comment on lines 46 to 50
if (showTimeSelect) {
return moment(new Date(dateToFormat), DateFormat.MMM_DD_YYYY_HH_MM_SS);
}

return moment(new Date(dateToFormat), DateFormat.MMM_DD_YYYY);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It can be reduced using ternary operator

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would say it doesn't reduce much, and it's just a matter of preference, as it's a simple one if statement.
Anyway, changed to ternary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I would move this component to OuboundImportHeader.jsx, basically this one is short and has no logic, so I don't see any benefits of separating those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

Comment on lines +10 to +21
const getDefaultValues = () => ({
description: undefined,
origin: undefined,
destination: undefined,
requestedBy: undefined,
dateRequested: undefined,
dateShipped: moment(new Date()).format(DateFormat.MMM_DD_YYYY_HH_MM_SS),
shipmentType: undefined,
trackingNumber: undefined,
comments: undefined,
expectedDeliveryDate: undefined,
packingList: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are those undefined necessary to use these values as defaults?

Copy link
Collaborator Author

@kchelstowski kchelstowski Jun 11, 2024

Choose a reason for hiding this comment

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

For now yeah, the eventual adjustments (if we will even support the "edit" functionality for this feature), should be dealt with in the "integrate backend & frontend" ticket.

Comment on lines 1 to 14
import moment from 'moment';

/**
* Method to if picked date is from the future
* @return true if the date is not from the future; false if the date is from the future
* @param pickedDate
*/
const validateFutureDate = (pickedDate) => {
const date = moment(pickedDate);
const today = moment(new Date());
return date.startOf('day').isSameOrBefore(today.startOf('day'));
};

export default validateFutureDate;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I would move it to form-utils.js instead of creating the next "utils" file

@awalkowiak awalkowiak merged commit dd8070f into develop Jun 11, 2024
2 checks passed
@awalkowiak awalkowiak deleted the OBPIH-6329 branch June 11, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
warn: do not squash Apply to any pull request whose commits shouldn't be squashed upon merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants