-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/UI retrieve reserve identifiers #63
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
base: main
Are you sure you want to change the base?
Feature/UI retrieve reserve identifiers #63
Conversation
…er might be deprecated (codecheckers#48)
… Identifier Selects (codecheckers/issues/48)
…tes like users or submission codecheckers#48)
|
I now merged main into the UI branch @nuest |
nuest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re file structure and naming: the folder "classes/RetrieveReserveIdentifiers/" is not consistent with the code in it, there is also code about venue types and names; suggest to rename, maybe to "classes/Register" ?
See this file for examples on how to use localised strings in a .vue file: https://github.com/codecheckers/ojs-codecheck/blob/main/resources/js/Components/CodecheckMetadataForm.vue
| class CodecheckApiHandler | ||
| { | ||
| private JsonResponse $response; | ||
| private array $roles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding: where do we assign the required roles? Or is this handled by OJS core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far the roles are in this array:
$this->roles = [
Role::ROLE_ID_MANAGER,
Role::ROLE_ID_SUB_EDITOR,
Role::ROLE_ID_ASSISTANT,
Role::ROLE_ID_AUTHOR
];and they are assigned to each route. I think it would also be possible to assign different Roles to different routes, if that is desirable and if we need it.
The roles are then checked on validity when a endpoint is calles in the authorize method:
// Check if the user that accesses this resource has at least one valid Role and if user exists
$user = $this->request->getUser() ?? null;
$contextId = $this->request->getContext()->getId();
if(!($user && $user->hasRole($this->roles, $contextId))) {
$this->response->response([
'success' => false,
'error' => "User has no assigned Role or doesn't have the right roles assigned to access this resource"
], 400);
return;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to distinguish between write and read access > @dxL1nus creates an issue.
resources/js/Components/CodecheckDataAndSoftwareAvailability.vue
Outdated
Show resolved
Hide resolved
Then I would call it |
I am aware on how to use localised strings, have I forgotten to do that soemwhere in the code? If so, then I am sorry and I will fix it |
nuest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are very open open change requests.
Also, the question about uploading and downloading files for the manifest remains - should we discuss that in our meeting?
|
To avoid challenges with PRs that are based on each other, and still give me an opportunity to give feedback or review, you can also create a PR within your own fork: This makes the edits "on top of the other PR" readily accessible. I think I should be able to comment/review when you make me a collaborator on your repo. |
classes/RetrieveReserveIdentifiers/CertificateIdentifierList.php
Outdated
Show resolved
Hide resolved
resources/js/Components/CodecheckDataAndSoftwareAvailability.vue
Outdated
Show resolved
Hide resolved
…ApiCaller now extends my new CurlApiClient codecheckers#47, codecheckers#48, codecheckers#64
…dxL1nus/ojs-codecheck into feature/ui-retrieve-reserve-identifiers
Closes: #47, closes: #48, closes: #64;
IMPORTANT:
This needs to be merged after #58, as it utilized the Vue refactor form the branch that #58 is based on. So any changes made through #58 should also be in this PR afterwards.
Added The features to retrieve and reserve identifiers via the UI. At this point in time, this is only in the submission form, but once the other PRs are merged, I will also implement this in our editorial workflow pages.
Click
Reserve Identifier:Get Alert once Identifier has been reserved and new issue was created inside: https://github.com/codecheckers/testing-dev-register/issues
When Identifier is reserved, the UI now looks like this:
When the identifier gets deleted, it now looks like this:
It it correctly displayed in the created YAML file:
