Skip to content

add import of missing Angular interfaces (squashed version) - #3048

Merged
tdonohue merged 5 commits into
DSpace:mainfrom
saschaszott:patch-21-squashed
Aug 8, 2024
Merged

add import of missing Angular interfaces (squashed version)#3048
tdonohue merged 5 commits into
DSpace:mainfrom
saschaszott:patch-21-squashed

Conversation

@saschaszott

Copy link
Copy Markdown
Contributor

Description

This PR is a replacement of #2870 where all commits were squashed into one commit as suggested by @alanorth .

It is synced with the latest changes in main branch.

@saschaszott

Copy link
Copy Markdown
Contributor Author

Should I open an issue for the adoption of an additional lint rule as suggested by @ybnd in #2870 (comment) ?

@saschaszott

Copy link
Copy Markdown
Contributor Author

One test is failing, but it is not related to the proposed changes:

1) Edit Item > Edit Metadata tab
       should pass accessibility tests:
     AssertionError: 1 accessibility violation was detected: expected 1 to equal 0
      at Context.eval (webpack://dspace-angular/./node_modules/cypress-axe/dist/index.js:100:0)

@tdonohue

Copy link
Copy Markdown
Member

@saschaszott : We've had random failures from that "Edit Item" e2e test. It's not specific to this PR. I've restarted the tests, as usually it passes after rerunning the tests.

@tdonohue tdonohue added code task 1 APPROVAL pull request only requires a single approval to merge labels May 15, 2024
@tdonohue
tdonohue requested a review from atarix83 May 15, 2024 14:06
@tdonohue tdonohue added this to the 8.0 milestone May 15, 2024
@alanorth

Copy link
Copy Markdown
Contributor

Thanks @saschaszott. I tested this by doing an item submission and searching with the sandbox.dspace.org instance as a backend. All working fine. Passing all tests too. Happy to merge this as it's 1 APPROVAL pull request only requires a single approval to merge .

I'm curious what the issue is here, though? If these interfaces were missing and everything was already working, what problem is this solving? 😄

@saschaszott

Copy link
Copy Markdown
Contributor Author

I'm curious what the issue is here, though? If these interfaces were missing and everything was already working, what problem is this solving? 😄

https://www.reddit.com/r/Angular2/comments/ge3evp/comment/fpmzpah/

@ybnd

ybnd commented May 24, 2024

Copy link
Copy Markdown
Member

@alanorth everything will still work if we don't implement those interfaces, but this way the intent is a lot more clear and it can serve as a sort of spell-check too

https://v17.angular.io/guide/styleguide#implement-lifecycle-hook-interfaces

same time, sorry

@saschaszott

Copy link
Copy Markdown
Contributor Author

@alanorth , to enforce the import of Angular lifecycle interfaces a lint rule should be added as suggested by @ybnd in #2870 (comment)

@alanorth

alanorth commented May 24, 2024

Copy link
Copy Markdown
Contributor

Awesome, thanks for the explanations. This sounds reasonable to me, but I will let someone familiar with Angular give the final approval.

@tdonohue

Copy link
Copy Markdown
Member

@ybnd : Since you seem to agree with this direction... I wanted to see if you're interested in reviewing this? If you approve of this & have tested it yourself, then I think this can be merged. I do agree with @alanorth that'd it'd be nice to have another "Angular expert" at a different institution from @saschaszott to approve this. But, in my opinion, you'd qualify for that, @ybnd if you have time :)

In general, I agree with the direction here (and thank you to @saschaszott !). I just have not had time to get to myself yet (as I have a lot on my plate). So, it's only waiting for someone to have time to give it a code review.

@ybnd
ybnd self-requested a review May 24, 2024 15:06

@ybnd ybnd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes that you've made so far are all good, but it looks that there's a few more files that should be updated.

Can you add "@angular-eslint/use-lifecycle-interface": "error" to .eslintrc.json and run yarn lint --fix?

This should fix the remaining problems and cover any upcoming ones as well.

@saschaszott

saschaszott commented Jun 13, 2024

Copy link
Copy Markdown
Contributor Author

@ybnd , @tdonohue : yarn lint --quiet is now reporting 21 new problems due to missing imports of Angular lifecycle interfaces. I will create one new commit that fixes these problems.

@saschaszott
saschaszott requested a review from ybnd June 13, 2024 12:14
@saschaszott

Copy link
Copy Markdown
Contributor Author

@ybnd , this PR is ready for review.

@tdonohue tdonohue removed this from the 8.0 milestone Jun 24, 2024
@tdonohue tdonohue added the port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release label Aug 8, 2024
@tdonohue tdonohue added this to the 9.0 milestone Aug 8, 2024
@tdonohue

tdonohue commented Aug 8, 2024

Copy link
Copy Markdown
Member

Merging with one approval. Looks good to me too. Thanks again @saschaszott !

@dspace-bot

Copy link
Copy Markdown
Contributor

Successfully created backport PR for dspace-8_x:

@tdonohue tdonohue removed the port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge code task

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants