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

22072 Show previous correspondences + cleanup #2907

Merged
merged 9 commits into from
Jul 18, 2024

Conversation

severinbeauvais
Copy link
Collaborator

@severinbeauvais severinbeauvais commented Jul 11, 2024

Issue #: bcgov/entity#22072

Description of changes:

Commit 1:

  • app version = 2.6.51
  • imported vue-auto-resize directive for textarea
  • added typing to ContinuationApplicationTable.vue
  • separated ContinuationAuthorizationReviewResult.vue into 2 new sub-components
  • refactored continuation review object into separate review and filing objects/props
  • now use for loop for previous correspondence
  • use label for correspondences header
  • use textarea for correspondence comment
  • compute correspondence items according to review/results
  • updated Review Result dropdown items
  • reset validation when new Review Result is selected
  • renamed ContinuationReviewStatus -> ReviewStatus
  • changed ACCEPTED to APPROVED
  • updated interfaces to match API responses
  • added fetchFiling()
  • updated mocked API responses
  • added dateToPacificTime() and apiToPacificDateTime()
  • renamed misc things
  • swapped main review section icons per Andy
  • refactored data fetching
  • added return to staff dashboard on error dialog close
  • added/updated unit tests

Commit 2:

  • refactored date conversions to use Moment
  • deleted date-utils.ts

Commit 3:

  • transformed ContinuationAuthorizationReview.vue to Composition API
  • transformed ExtraprovincialRegistrationBc.vue to Composition API
  • transformed HomeJurisdictionInformation.vue to Composition API
  • transformed PreviousCorrespondence.vue to Composition API
  • transformed ReviewResult.vue to Composition API
  • misc cleanup

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-auth license (Apache 2.0).

@severinbeauvais
Copy link
Collaborator Author

severinbeauvais commented Jul 12, 2024

@severinbeauvais
Copy link
Collaborator Author

severinbeauvais commented Jul 12, 2024

Copy link
Contributor

@ArwenQin ArwenQin left a comment

Choose a reason for hiding this comment

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

I reviewed the codes, make sense to me!

Copy link

@PaulGarewal PaulGarewal left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@severinbeauvais severinbeauvais force-pushed the 22072 branch 2 times, most recently from e9f270c to 3dd0313 Compare July 15, 2024 17:29
@severinbeauvais
Copy link
Collaborator Author

severinbeauvais commented Jul 15, 2024

deleted obsolete comment related to "account-ui-ci-pr" job

@severinbeauvais
Copy link
Collaborator Author

@JohnamLane I have 2 approvals but merging is blocked. What's the process to merge this PR?

image

@@ -239,33 +202,35 @@ export default class BusinessService {
})
}

// *** TODO: this should return type "array of reviews"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ArwenQin FYI ^^

Copy link
Collaborator

@seeker25 seeker25 left a comment

Choose a reason for hiding this comment

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

Use composition-api and moment, not your own rolled date library.

We spent a whole bunch of time converting components to composition-api, you're undoing that process by writing them in class-api.

You're also introducing more tech debt by using your own date library, when we are using moment in auth-web.

Karim has written his components in composition-api, it was a requirement before merging.

@severinbeauvais
Copy link
Collaborator Author

Use composition-api and moment, not your own rolled date library.

We spent a whole bunch of time converting components to composition-api, you're undoing that process by writing them in class-api.

You're also introducing more tech debt by using your own date library, when we are using moment in auth-web.

Karim has written his components in composition-api, it was a requirement before merging.

I would like Composition API a lot more if it properly supported typing, but:

image

and then

image

It is my understanding that Composition API is not required for Vue3 (or Nuxt), so why change and take a hit along the way?

As for the date-time manipulations, this may be our own rolled up library, but it's been in use since 2019, and I'm going to dig in my heels a bit on Moment because what I've researched says to no longer use it. In fact, using Moment seems to be incurring tech debt. If we are dead-set against using native JS for date-time manipulations then we should look for a modern, light alternative to Moment.

Secondly, since our code is temporarily hosted in Auth Web, I want to make it easy to port out to another UI, so reusing the same date-time methods as the other Entity UIs seems like a good way to keep things consistent.

I agree with you on the goal of modern, simple code, but I think changing to Composition API and Moment are not a step ahead right now. If your research proves me wrong, please let me know. I am making my decisions based on what I know but I'm happy to learn more and come up with better solutions.

@seeker25
Copy link
Collaborator

seeker25 commented Jul 16, 2024

The requirements aren't up for discussion, unfortunately - composition-api and moment (consistent with the rest of the repo) or this isn't getting merged

@severinbeauvais
Copy link
Collaborator Author

The requirements aren't up for discussion, unfortunately - composition-api and moment (consistent with the rest of the repo) or this isn't getting merged

Please provide a reference to the requirements. Thank you.

@seeker25
Copy link
Collaborator

Here they are: Composition-api and moment

@bcgov bcgov deleted a comment from bcregistry-sre Jul 16, 2024
@severinbeauvais
Copy link
Collaborator Author

@seeker25 So this is the library that you want me to use for date/time manipulations, even though it's a legacy project, now in maintenance mode, and they say we should choose a different library?

image

@seeker25
Copy link
Collaborator

seeker25 commented Jul 17, 2024

Yeah we're using Luxon for Vue3 FAS-UI, it's fairly straight forward to convert...

const apiToPacificDateTime = (apiDateTime: string): string => {
  if (!apiDateTime) return apiDateTime
  return DateTime.fromISO(apiDateTime).setZone('America/Vancouver').toFormat('fff')
}

image

- imported vue-auto-resize directive for textarea
- added typing to ContinuationApplicationTable.vue
- separated ContinuationAuthorizationReviewResult.vue into 2 new sub-components
- refactored continuation review object into separate review and filing objects/props
- now use 'for' loop for previous correspondence
- use label for correspondences header
- use textarea for correspondence comment
- compute correspondence items according to review/results
- updated Review Result dropdown items
- reset validation when new Review Result is selected
- renamed ContinuationReviewStatus -> ReviewStatus
- changed ACCEPTED to APPROVED
- updated interfaces to match API responses
- added fetchFiling()
- replaced mocked API responses with actual responses
- added dateToPacificTime() and apiToPacificDateTime()
- renamed misc things
- swapped main review section icons per Andy
- refactored data fetching
- added return to staff dashboard on error dialog close
- added/updated unit tests
- replaced mocked submitContinuationReviewResult() with real Axios call
@bcgov bcgov deleted a comment from bcregistry-sre Jul 18, 2024
@severinbeauvais
Copy link
Collaborator Author

severinbeauvais commented Jul 18, 2024

I'll fix the unit test errors tomorrow! fixed!

@bcgov bcgov deleted a comment from bcregistry-sre Jul 18, 2024
Severin Beauvais added 4 commits July 18, 2024 09:35
- changed get -> computed
- changed America/Vancouver conversion from toLocaleString() to tz()
- fixed unit tests
@bcgov bcgov deleted a comment from bcregistry-sre Jul 18, 2024
@severinbeauvais
Copy link
Collaborator Author

/gcbrun

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Jul 18, 2024

Temporary Url for review: https://bcregistry-account-dev--pr-2907-cwo0803q.web.app

SB says, go to https://bcregistry-account-dev--pr-2907-cwo0803q.web.app/staff/dashboard/active and View/Review any of the Continuation Applications listed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

@bcgov bcgov deleted a comment from bcregistry-sre Jul 18, 2024
@severinbeauvais
Copy link
Collaborator Author

@seeker25 Ready for re-review and hopefully, merging :)

ContinuationApplicationTable
}
})
export default class ContinuationApplications extends Vue {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

still class-api?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Arwen worked on this component. I'll ask her to transform it to Composition API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Can I do it in ticket #21983 (the enhanced table ticket I'm working on)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a pretty simple one, lets just merge I caused you enough side tracking

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Arwen - yes, do it in 21983. Perfect.

Copy link
Collaborator

@seeker25 seeker25 left a comment

Choose a reason for hiding this comment

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

LGTM

@severinbeauvais severinbeauvais merged commit 7076b5b into bcgov:main Jul 18, 2024
4 of 5 checks passed
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.

5 participants