Skip to content

[feat] Enhance NewForm and useNewForm with event type utilities, date validation, and backend integration #55

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

Merged
merged 8 commits into from
Jan 17, 2025

Conversation

Aloento
Copy link
Member

@Aloento Aloento commented Jan 17, 2025

Summary of the Pull Request

This pull request introduces several improvements and new features to the NewForm component and the useNewForm hook, focusing on enhancing functionality, user experience, and maintainability. The changes include the following:

Key Changes:

  1. Loading State for Submission

    • Added a loading state to the NewForm submission button to improve user feedback during event submission.
  2. Backend Integration for Event Submission

    • Updated useNewForm to handle event submissions with integration to the backend API.
  3. Event Type and Impact Utility Functions

    • Implemented utility functions to retrieve event types based on impact values and vice versa, centralizing and simplifying event type logic for better code maintainability.
  4. Refactor Event Type Determination

    • Leveraged the GetEventType utility function for cleaner and more consistent event type determination.
  5. Date Formatting and Localization

    • Updated NewForm to use dayjs for datetime formatting.
    • Added clear labels for CET time zone in displayed date fields.
  6. Enhanced Date Validation Logic

    • Improved date validation logic in useNewForm, ensuring that end dates reset appropriately when the event type changes.

Copy link

@anton-sidelnikov anton-sidelnikov left a comment

Choose a reason for hiding this comment

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

Looks good

@Aloento Aloento added the gate Merge PR label Jan 17, 2025
@otc-zuul otc-zuul bot merged commit 0f63084 into main Jan 17, 2025
6 checks passed
@otc-zuul otc-zuul bot deleted the feat_new branch January 17, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gate Merge PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants