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

Api client service providers #115

Open
wants to merge 52 commits into
base: develop
Choose a base branch
from

Conversation

betsyecastro
Copy link
Contributor

@betsyecastro betsyecastro commented Feb 22, 2023

This PR replaces PR #110 and includes:

  1. Publications API Interface to import publications from the the Academic Analytics API, for now.
  2. AA Publications API service provider that implements the interface mentioned above
  3. In the publications-import-modal Livewire component, it fixes the collection iteration method before the data is rendered.
  4. Corrections in the jQuery selectors that contain the publication data that will be added to the editor.
  5. AA Publications API service provider mock for testing purposes.
  6. Artisan command to search and add DOI's to publications that don't have it.
  7. Feature tests:
  • Search and add academic analytics id's for the profiles that don't have it
  • Measure similarity between phrases publications titles to obtain DOI's.
  • publications-import-modal Livewire component

Local configuration required to test the feature:

  1. Add the following values to the .env file:
    DOI_REGEX = '/(10[.][0-9]{4,}[^\s"\/<>]*/[^\s"<>]+)/'
    EMAIL_ADDRESS_DOMAIN= 'utdallas.edu'

  2. Artisan command to add the DOI to existing publications:

Description:
Search the DOI to add it to the existing publications for the profiles with the first letter of their last name given.

Usage:
profiles:add-doi <starting_character>

Arguments:
starting_character - The first letter of the last name of the profiles to run command for. Not case-sensitive.

Example: php artisan profiles:add-doi "d" or php artisan profiles:add-doi "D"

betsyecastro and others added 30 commits September 30, 2022 14:26
so we can more easily read them via JS
betsyecastro and others added 10 commits February 22, 2023 16:31
… Psalm error

Method returns a ProfileData Illuminate\Database\Eloquent\Collection, rather than an empty collection.

Psalm error: ERROR: InvalidArgument - app/Providers/AAPublicationsApiServiceProvider.php:75:37 - Argument 1 of Illuminate\Database\Eloquent\Collection::push expects empty, App\ProfileData&static provided (see https://psalm.dev/004)                $publications->push($new_record);

Solution: Define type items in the collection by adding:
/** @var Collection<ProfileData> */

Co-Authored-By: Wun Chiou <[email protected]>
@betsyecastro betsyecastro requested a review from wunc March 3, 2023 14:18
@betsyecastro
Copy link
Contributor Author

Local configuration required to test the feature:

Add the following values to the .env file:
DOI_REGEX = '/(10[.][0-9]{4,}[^\s"\/<>]*/[^\s"<>]+)/'
EMAIL_ADDRESS_DOMAIN= 'utdallas.edu'

Artisan command to add the DOI to existing publications:

Description:
Search the DOI to add it to the existing publications for the profiles with the first letter of their last name given.

Usage:
profiles:add-doi <starting_character>

Arguments:
starting_character - The first letter of the last name of the profiles to run command for. Not case-sensitive.

Example: php artisan profiles:add-doi "d" or php artisan profiles:add-doi "D"

@betsyecastro betsyecastro added the ✨ enhancement New feature or request label Mar 10, 2023
@betsyecastro betsyecastro self-assigned this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants