Skip to content

Commit 9a3320f

Browse files
committed
Add main contribution to author schema
Issue: documentacao-e-tarefas/desenvolvimento_e_infra#994 Signed-off-by: Thiago Brasil <thiago@lepidus.com.br>
1 parent d8204a3 commit 9a3320f

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

ThothPlugin.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public function addToSchema()
127127
HookRegistry::register('Schema::get::eventLog', [$thothSchema, 'addReasonToSchema']);
128128
HookRegistry::register('Schema::get::submission', [$thothSchema, 'addWorkIdToSchema']);
129129
HookRegistry::register('Schema::get::publication', [$thothSchema, 'addToPublicationSchema']);
130+
HookRegistry::register('Schema::get::author', [$thothSchema, 'addToAuthorSchema']);
130131
HookRegistry::register('Submission::getSubmissionsListProps', [$thothSchema, 'addToSubmissionsListProps']);
131132
}
132133

classes/schema/ThothSchema.inc.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ public function addToPublicationSchema($hookName, $args)
6363
return false;
6464
}
6565

66+
public function addToAuthorSchema($hookName, $args)
67+
{
68+
$schema = & $args[0];
69+
70+
$schema->properties->{'mainContribution'} = (object) [
71+
'type' => 'boolean',
72+
'apiSummary' => true,
73+
'validation' => ['nullable'],
74+
];
75+
76+
return false;
77+
}
78+
6679
public function addToSubmissionsListProps($hookName, $args)
6780
{
6881
$props = & $args[0];

0 commit comments

Comments
 (0)