dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

add import of missing Angular interfaces

Open saschaszott opened this issue 1 year ago • 7 comments

Description

This PR adds imports of missing Angular interfaces, e.g. OnInit, OnDestroy etc.

@tdonohue , is it possible to add an appropriate lint check?

saschaszott avatar Mar 20 '24 11:03 saschaszott

@saschaszott : I would recommend setting this aside for a bit. We are doing some major refactoring of dspace-angular in #2343 , #2750 and #2752 . This will surely result in major conflicts with this PR until that work is complete.

I don't know the answer to your question about adding a lint rule, but I know lint rules were recently updated by @ybnd in #2343... so, it's possible @ybnd would know the right approach. In any case, this PR won't be reviewed or merged until after all other code refactoring is completed.. so, I'd wait to do more major work on this.

tdonohue avatar Mar 20 '24 14:03 tdonohue

Hi @saschaszott, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Mar 20 '24 14:03 github-actions[bot]

Looks like we can use this rule: https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-lifecycle-interface.md

ybnd avatar Mar 20 '24 14:03 ybnd

@tdonohue , maybe the best way of handling this issue (missing imports of Angular lifecycle interfaces) in the ongoing development efforts is the adoption of an additional lint rule as suggested by @ybnd .

saschaszott avatar Mar 20 '24 16:03 saschaszott

Small nitpick, could this be rebased and squashed into one commit to keep our git log neat and tidy? Thanks!

alanorth avatar Mar 21 '24 13:03 alanorth

Small nitpick, could this be rebased and squashed into one commit to keep our git log neat and tidy? Thanks!

@alanorth should I open a new PR or do you plan to squash all the commits at merge time?

saschaszott avatar Mar 21 '24 17:03 saschaszott

Hi @saschaszott, we could rebase/squash on GitHub when merging if we remember, but it would be easy for you to do in your branch as well. Assuming you have a git remote for the upstream DSpace repository you could do:

$ git rebase -i upstream/dspace-7_x

Then you will get a list of commits with actions to be performed. You change everything after the first one from pick to squash and git will combine them all into the first commit and let you enter a new commit message after saving:

pick 6dc2ea3 added missing interfaces
squash 8bce1d8 added missing OnInit interface                                                                                                          
squash fee794b added missing interface OnInit
...

alanorth avatar Mar 21 '24 20:03 alanorth

Hi @saschaszott, we could rebase/squash on GitHub when merging if we remember, but it would be easy for you to do in your branch as well. Assuming you have a git remote for the upstream DSpace repository you could do:

$ git rebase -i upstream/dspace-7_x

Then you will get a list of commits with actions to be performed. You change everything after the first one from pick to squash and git will combine them all into the first commit and let you enter a new commit message after saving:

pick 6dc2ea3 added missing interfaces
squash 8bce1d8 added missing OnInit interface                                                                                                          
squash fee794b added missing interface OnInit
...

@alanorth , this does not work as expected. I get tons of merge conflicts. Any ideas how to handle this situation?

saschaszott avatar May 14 '24 22:05 saschaszott

@saschaszott Ah, in my comment I suggested rebasing on top of dspace-7_x, but your pull request is against main so you should rebase (and squash) on top of that instead. If your commits apply clean, then a squashed version of the commits should as well (the only difference is one large commit instead of many small ones).

alanorth avatar May 15 '24 05:05 alanorth

@alanorth , thank you. This does not work either - I'm lost in merge conflicts after running git rebase -i upstream main. I will try another approach and create a new PR (with one commit).

saschaszott avatar May 15 '24 08:05 saschaszott

@alanorth , @tdonohue : you can find the squashed version of this PR in https://github.com/DSpace/dspace-angular/pull/3048 - I'll close this PR

saschaszott avatar May 15 '24 08:05 saschaszott