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

feat:#712 migrate angular 17 #731

Merged
merged 44 commits into from
Jan 8, 2025
Merged

Conversation

ianliuwk1019
Copy link
Collaborator

@ianliuwk1019 ianliuwk1019 commented Dec 27, 2024

Admin:

  • Add angular config 'allowedCommonJsDependencies' for 'leaflet' to ignore/hide commonjs warnning for now (won't replace leaflet in this case from my assumption).
  • Upgrade Angular from 15 to 17 and upgrade related libs and adjust impacted code.
  • Minor upgrade aws-amplify to 5.3.27 (can't upgrade to v6, breaking changes)
  • Replace 'moment' (commonJs) to 'luxon'.
  • Upgrade exisiting 'remeda' and use it for replacing 'lodash' (commonJs).
  • Replace 'file-saver'(commonJs) to 'file-saver-es'

Public:

  • Add angular config 'allowedCommonJsDependencies' for "leaflet", "leaflet.markercluster", "object-hash" to ignore commonjs warnning for now.
  • Upgrade Angular from 15 to 17 and upgrade related libs and adjust impacted code.
  • Replace 'moment' (commonJs) to 'luxon'.
  • Upgrade exisiting 'remeda' and use it for replacing 'lodash' (commonJs).
  • Replace 'file-saver'(commonJs) to 'file-saver-es'
  • Remove 'ngx-dropzone'; not in use.

// -------------------------------------------------------------
Note:

  • Code scanning warnings can be ignored for now. There is a plan later to upgrade to Angular 18 then the warnings will be resolved.
  • Stage 2 FOM Angular upgrade to v18 is in this ticket: FOM Upgrades - Migrate to Angular 18 #732

Thanks for the PR!

Any successful deployments (not always required) will be available below.

Once merged, code will be promoted and handed off to following workflow run.


Thanks for the PR!

Any successful deployments (not always required) will be available below.

Once merged, code will be promoted and handed off to following workflow run.

…ing moment from fom-add-edit compoent with luxon.
@ianliuwk1019 ianliuwk1019 changed the title feat:/ #712 migrate angular 17 feat:#712 migrate angular 17 Dec 27, 2024
@ianliuwk1019 ianliuwk1019 requested a review from basilv December 31, 2024 00:34
@ianliuwk1019 ianliuwk1019 marked this pull request as ready for review December 31, 2024 07:31
@ianliuwk1019 ianliuwk1019 requested a review from craigyu January 6, 2025 17:15
@ianliuwk1019 ianliuwk1019 mentioned this pull request Jan 6, 2025
2 tasks
Copy link
Collaborator

@craigyu craigyu left a comment

Choose a reason for hiding this comment

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

LGTM, lots of work! i noticed 3 files are deleted, were they not being used or did you move the code to somewhere else

@ianliuwk1019
Copy link
Collaborator Author

LGTM, lots of work! i noticed 3 files are deleted, were they not being used or did you move the code to somewhere else

Thanks for noticing that! Yes, I noticed those files are from pre-FOM era and not being used during upgrading. It will be headache in the future so decided to remove them.

@@ -10,7 +11,7 @@ export class InteractionDetailForm implements Pick<InteractionRequest, typeof UP

@required()
@prop()
communicationDate: string = '';
communicationDatePickerDate: Date; // for datePicker only
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed? Maybe expand on this comment a bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi Basil, I renamed this field and comment is added for more detail.
When replacing library moment with 'luxon`, I found previously moment was TOO smart that it was both good with init with string type and date type. However, when switching to 'luxon', it did not work anymore for this field. So I decided to rename this field and specifically gave it a 'Date' type, that's what datePicker will set and to avoid confusion with setting to 'body' field for 'communicationDate' which only accepts 'string' type.

private fomFilters: Map<string, IFilter | IMultiFilter>;
public fomNumberFilter = new Filter<number>({ filter: { queryParam: 'fomNumber', value: null }});
public forestClientNameFilter = new Filter<string>({ filter: { queryParam: 'fcName', value: null }});
public commentStatusFilters: MultiFilter<boolean>; // For 'Commenting Open' or 'Commenting Closed'.
public postedOnAfterFilter = new Filter<Date>({ filter: { queryParam: 'pdOnAfter', value: null } });
readonly minDate = moment('2018-03-23').toDate(); // first app created
readonly maxDate = moment().toDate(); // today
readonly minDate = DateTime.fromISO('2018-03-23').toJSDate(); // first app created
Copy link
Collaborator

Choose a reason for hiding this comment

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

This date is not correct (too far in the past), so I question whathever this logic is for...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @basilv, This date was not changed this time, but I did not know why this date was set as such. Seems it was already like this when FOM was copying over from previous project... Do you want to change this? But I don't see it will actually affect anything, it is a minimum date in the past for datePicker you can pick for "postedOnAfter".

Copy link
Collaborator

@basilv basilv 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 couple comments...

@basilv
Copy link
Collaborator

basilv commented Jan 7, 2025

Overall looks good. My main concerns from a testing perspective:

  • testing anything related to dates - e.g. commenting open/close and public notice periods.
  • reviewing UI look & feel.

@basilv
Copy link
Collaborator

basilv commented Jan 7, 2025

@ianliuwk1019 almost forgot - your comment at the top mentions removing ngx-bootstrap, but I'm pretty sure I still saw it listed as a dependency.

@ianliuwk1019
Copy link
Collaborator Author

@ianliuwk1019 almost forgot - your comment at the top mentions removing ngx-bootstrap, but I'm pretty sure I still saw it listed as a dependency.

Right! Thanks @basilv, that was a mistake in the comment. I meant to say removing 'ngx-dropzone' from 'public' project module. I adjusted the comment.

@ianliuwk1019 ianliuwk1019 merged commit d76492a into main Jan 8, 2025
22 of 29 checks passed
@ianliuwk1019 ianliuwk1019 deleted the feat/712-migrate-angular-17 branch January 8, 2025 00:42
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.

3 participants