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

Enrich local data via the OpenAIRE Graph #1562

Merged
merged 49 commits into from
Dec 18, 2023
Merged

Conversation

LucaGiamminonni
Copy link
Contributor

@LucaGiamminonni LucaGiamminonni commented Mar 17, 2022

References

Description

The features included in this PR are the result of the OpenAIRE Call Innovation funded project "Enrich local data via the OpenAIRE Graph” awarded by 4Science (https://www.openaire.eu/open-call-winner-phase-1-4science). It provides a closer integration between DSpace and two OpenAIRE services, the Notification Broker and the OpenAIRE REST API.
Detailed documentation about the aims of the project, the implementation and the configuration options is available at https://4science.github.io/oaire-eld/#/
This PR regarding only the data correction section. The publication claim will be migrated with other PR.

How to Use / Test

Video: https://github.com/DSpace/DSpace/assets/483997/6db3dd92-1e26-416c-b130-9f5677f7acaa

  1. Start up frontend & backend
  2. Import a valid JSON OpenAIRE Graph JSON file using the import-openaire-events Process (in the Processes Admin UI)
  3. Assuming import is successful, this will create several Notifications on the Admin menu -> Notifications -> Quality Assurance page. (The exact number/type of Notifications is defined in the JSON file you imported)
  4. From that page, you can now use the "Actions" button to view each notification and decide whether to Accept/Ignore/Reject each.
    • Accepting will apply the change.
    • Ignoring will delete the change without applying
    • Reject will delete the change without applying and send a notification back to the service.

@lgtm-com
Copy link

lgtm-com bot commented Mar 17, 2022

This pull request introduces 5 alerts when merging a4718b6 into 3ecb3c2 - view on LGTM.com

new alerts:

  • 5 for Unused variable, import, function or class

Copy link
Contributor

@paulo-graca paulo-graca left a comment

Choose a reason for hiding this comment

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

Thank you @LucaGiamminonni! I've just noticed some missing typescript docs. They can be useful if someone tries to override this code to better understand what is the purpose.

selector: 'ds-admin-notifications-broker-source-page-component',
templateUrl: './admin-notifications-broker-source-page.component.html',
})
export class AdminNotificationsBrokerSourcePageComponent {}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing typescript docs

selector: 'ds-notification-broker-page',
templateUrl: './admin-notifications-broker-topics-page.component.html'
})
export class AdminNotificationsBrokerTopicsPageComponent {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing typescript docs

selector: 'ds-notifications-broker-events-page',
templateUrl: './admin-notifications-broker-events-page.component.html'
})
export class AdminNotificationsBrokerEventsPageComponent {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing typescript docs

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@LucaGiamminonni : I'm no longer able to test this as the backend doesn't compile & this PR has merge conflicts. But, I did give this a code review today. Overall the code looks well commented & well designed. Obviously we'll need to rename many of these classes eventually to move from "notification broker" (NB) to "quality assurance" (QA) as decided in a dev meeting. Beyond that, I just have a few other inline comments.

Once this & the backend are ready for testing again, I'll gladly give this a test so that I can comment on the UI, user experience, etc.

);
}

protected computePIDHref(event: OpenaireBrokerEventMessageObject) {
Copy link
Member

Choose a reason for hiding this comment

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

This method has many hardcoded URL prefixes which sites may need to occasionally change. I'm wondering if there's a way to move this logic to the backend where it could be more easily configurable? Is there a reason why the prefix needs to be added here in the UI, instead of just making sure the full URL can be sent by the backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I will modify the rest side resource to include the url in the OpenaireBrokerEventMessageObject

@@ -0,0 +1,21 @@
.button-rows {
Copy link
Member

Choose a reason for hiding this comment

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

This file name has an extra s before component. It says .scomponent.scss

templateUrl: './notifications-broker-source.component.html',
styleUrls: ['./notifications-broker-source.component.scss']
})
export class NotificationsBrokerSourceComponent implements OnInit {
Copy link
Member

Choose a reason for hiding this comment

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

Please add TypeDocs

@tdonohue
Copy link
Member

tdonohue commented Jun 8, 2022

Moving this PR to 7.4 as it won't be possible to review/approve in time for 7.3. We'll instead work to get this merged just after the 7.3 release.

@lgtm-com
Copy link

lgtm-com bot commented Jul 6, 2022

This pull request introduces 6 alerts when merging a7d2278 into fae355a - view on LGTM.com

new alerts:

  • 6 for Unused variable, import, function or class

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@LucaGiamminonni and @frabacche : Gave this a code review today. Overall, it looks great! I found some minor issues and a few questions/suggestions (see inline comments below).

I also wanted to note that some of the bugs I reported in the backend PR are actually frontend issues (e.g. the accessibility issues). So, those will need to be addressed in this PR. See this review for those minor bugs: DSpace/DSpace#8184 (review)

Overall, this looks great. Just minor cleanup necessary and then I'll be +1. Some of this feedback is optional to address...so feel free to let me know if there's anything here you cannot address easily.

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@frabacche ; I gave this another look today. My prior feedback has been resolved, but there are a few small suggestions I have for the new configurations you've added (see inline below).

I believe the only remaining feedback to address is to try to fix the small bugs mentioned in my review of the backend. The following bugs still exist from that prior report:

  1. Breadcrumbs are not working properly. They always only have one level. It should be possible to move from a Topic back to the list of topics using the breadcrumbs. (This is visible in the screenshot below where that page doesn't have a parent page in the breadcrumbs)
  2. All small action buttons (Accept/Ignore/Reject) on a topic page have no accessibility text. This can be easily seen by performing a scan of the page using a browser accessibility plugin like "axe DevTools". See the screenshot.
    button-text-is-empty
  3. I believe the same accessibility issue also exists with the "Actions" buttons on the "Quality Assurance" page. The accessibility text on those buttons is just a number.
  4. When I visit the page for a topic (like in the screenshot above), I see data logged to my Console window (in Chrome's DevTools). Something looks to be sending all the JSON data to console.log?
    ...
    6. The ordering of the "Current Topics" on the initial "Quality Assurance" page (/admin/notifications/quality-assurance/openaire) is unclear & seems to randomly change at times. (WE AGREED it should be alphabetical) FIXED NOW ON BACKEND
    ...
    9. Finally, ... it'd be nice if there was a way to disable this feature altogether. (By this, I mean that the OpenAIRE quality assurance page should not appear if OpenAIRE integration is somehow disabled. It could be via a boolean setting in qaevents.cfg or maybe it just checks to see if the qaevents.openaire.broker-url is specified. If so, it's enabled, if not it's disabled.) FIXED NOW ON BACKEND

All other feedback was addressed. You mentioned the above are being "worked on", so this is just a reminder that I'm waiting on these before giving a +1 vote. Overall, this is nearly ready. The sooner you can get to these changes, the sooner we can get this merged!

src/config/quality-assurance.config.ts Outdated Show resolved Hide resolved
src/config/quality-assurance.config.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@paulo-graca paulo-graca left a comment

Choose a reason for hiding this comment

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

Thank you, @LucaGiamminonni, for addressing my comments. I'm currently heavily involved in our local projects, and I don't have much time right now, and until the end of the year, to do thorough reviews. Please excuse me for that.

I just want to share with you some concerns I have and what I'm expecting the result to be for this PR:

I expect to have a consistent interface that doesn't break with what the user is used to. So, I expect the site navigation to be consistent.

I also expect the user to be content source-aware. It should be clear at any time that the suggested content came from a specific source (we can have others than OpenAIRE).

This is mainly an admin feature, so perhaps this comment doesn't make sense, but I didn't see themed components. Not sure if needed.

This feature should be source-agnostic, but I saw some references to OpenAIRE (properties, methods).

I'm not intending to block this PR. If @tdonohue understands that this PR can go as is, he can have my +1, and issues can be addressed later on.

@frabacche frabacche requested a review from tdonohue December 18, 2023 11:55
@tdonohue
Copy link
Member

tdonohue commented Dec 18, 2023

@frabacche : This appears to have 3 lint errors after the recent updates. Run yarn lint locally to see them. You may also be able to run yarn lint --fix to try to fix them automatically (doesn't always work).

In the meantime, I'll give it a test in the next few hours and verify everything looks good.

@tdonohue tdonohue added the integration: QA Notifications Related to QA (Quality Assurance) notifications from external sources label Dec 18, 2023
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @frabacche , @FrancescoMolinaro and @LucaGiamminonni ! This all looks good to me now. I gave it another test/review and verified my prior feedback has all been addressed. I also checked @paulo-graca 's feedback and it also looks to be addressed, except for a request for making all components themeable. But, in my opinion, that can be addressed in a later PR as more features will need to be built on this initial PR.

@tdonohue tdonohue added this to the 8.0 milestone Dec 18, 2023
@tdonohue
Copy link
Member

Merging, as this has a +1 from myself, and a prior +1 from @paulo-graca . I've also verified that all of @paulo-graca 's feedback appears to be addressed except for the themed components. But those can be added in later PRs

Thanks again to @frabacche , @FrancescoMolinaro , @LucaGiamminonni and the entire 4Science team for their hard work on this new feature!

@tdonohue tdonohue merged commit 92a10ce into DSpace:main Dec 18, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority integration: OpenAIRE Related to integration with OpenAIRE integration: QA Notifications Related to QA (Quality Assurance) notifications from external sources
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

6 participants