Skip to content

Commit

Permalink
Merge pull request #280 from defstat/i9268-migrate-schema
Browse files Browse the repository at this point in the history
[orcidPlugin][main] #9268 Add orcidProfile plugin's schema properties to codebase
  • Loading branch information
asmecher authored Sep 5, 2023
2 parents 6a4b875 + f71271a commit c3375e3
Showing 1 changed file with 0 additions and 83 deletions.
83 changes: 0 additions & 83 deletions OrcidProfilePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,89 +144,6 @@ public function register($category, $path, $mainContextId = null)

Hook::add('ThankReviewerForm::thankReviewer', $this->handleThankReviewer(...));

// Add more ORCiD fields to author Schema
Hook::add('Schema::get::author', function ($hookName, $args) {
$schema = &$args[0];

$schema->properties->orcidSandbox = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessToken = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessScope = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidRefreshToken = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessExpiresOn = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessDenied = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidEmailToken = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidWorkPutCode = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
});

// Add more ORCiD fields to user Schema
Hook::add('Schema::get::user', function ($hookName, $args) {
$schema = &$args[0];

$schema->properties->orcidAccessToken = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessScope = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidRefreshToken = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessExpiresOn = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidAccessDenied = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
$schema->properties->orcidReviewPutCode = (object)[
'type' => 'string',
'apiSummary' => true,
'validation' => ['nullable']
];
});
Services::get('schema')->get(PKPSchemaService::SCHEMA_USER, true);

Hook::add('Mailer::Mailables', $this->addMailable(...));
Hook::add('Author::edit', $this->handleAuthorFormExecute(...));
Hook::add('Form::config::before', $this->addOrcidFormFields(...));
Expand Down

0 comments on commit c3375e3

Please sign in to comment.