Skip to content

feat: add create and edit contract form components and fix authentication bugs (EN-267)

Minh Thang Cao requested to merge feat/create-edit-contract-view into dev

Summary

Create the main component for create and edit contract form and fix several important bugs related to application details and authentication

Changes

  • add @date-io/moment library for MaterialUI date picker and react-number-format to handle loan amount input
  • add layout, form handle change and validation for create and edit contract form
  • add unit tests for the component
  • add API call in ApplicationDetails to get the application info which will be used in the cards (for now, main purpose is to pass needed id variables to create and edit contract form)
  • make changes to the application info model to not shorten properties' names
  • recover missing code created by Sarah for the skeleton page and submit buttons for this form
  • connect the submit button ("Save and Create Contract") in application layout (created by Sarah), to the form by using ref
  • fix bugs related to authentication:
    • mismatch API endpoint for refresh-tokens (was refresh before)
    • add proper authentication steps based on backend changes: add access token variable separately (there was only refresh token) which produce incorrect behaviors
    • incorrect property get from API response of refresh token (res.data.tokens.refresh.token not res.data.refresh.token)
  • remove unnecessary tokens passed into child components (AdminHomePage and Login) of Apps.tsx. Instead, use localStorage to get them from child components

Merge request reports