Skip to content

Conversation

@dxL1nus
Copy link
Contributor

@dxL1nus dxL1nus commented Oct 30, 2025

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:

grafik

Get Alert once Identifier has been reserved and new issue was created inside: https://github.com/codecheckers/testing-dev-register/issues

grafik

When Identifier is reserved, the UI now looks like this:

grafik

When the identifier gets deleted, it now looks like this:

grafik

It it correctly displayed in the created YAML file:
grafik

dxL1nus added 25 commits October 8, 2025 21:40
@dxL1nus dxL1nus mentioned this pull request Nov 14, 2025
@dxL1nus dxL1nus marked this pull request as ready for review December 12, 2025 16:51
@dxL1nus dxL1nus requested a review from nuest December 12, 2025 16:52
@dxL1nus
Copy link
Contributor Author

dxL1nus commented Dec 12, 2025

I now merged main into the UI branch @nuest

@dxL1nus dxL1nus mentioned this pull request Dec 18, 2025
Copy link
Member

@nuest nuest left a 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

$this->endpoints = [
'GET' => [
[
'route' => 'getVenueData',
Copy link
Member

Choose a reason for hiding this comment

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

The route should not contain a verb - that is what the GET in the HTTP operation is for. Also, the "Data" is redundant, we always want to retrieve data via an API, or if we want something else (more specific), we can add sub-resources (e.g., venue/location or venue/image).

So please rename this route to venue.

The function name can stay the same, there the verb and the detail about the value of the returned result make sense.

*
* @return void
*/
public function downloadFile(): void
Copy link
Member

Choose a reason for hiding this comment

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

Please clarify what this upload and download is used for. The manifest is primarily metadata and IIRC we are currently not implementing the case that a manifest file is actually uploaded to OJS. I understand this may be useful in the future where an author may be able to privately share manifest files this way, but first we handle the case of a check based on an external code/data repository.

I'm not saying we need to take these functions out, but they are probably dormant for now.

'roles' => $this->roles,
],
[
'route' => 'yaml',
Copy link
Member

Choose a reason for hiding this comment

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

Good route name!

class CodecheckApiHandler
{
private JsonResponse $response;
private array $roles;
Copy link
Member

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?

],
'POST' => [
[
'route' => 'reserveIdentifier',
Copy link
Member

Choose a reason for hiding this comment

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

Similarly as above, we avoid verbs in routes, so this can simply be POST identifier and then it is not a concern of the caller of the API what kind of "creation" this means, so in this case an external system is used to "reserve something", but it could also be a local random string generator. From the API perspective, we just say "call this endpoint when you want to create a new identifier".

}

let codecheckApiUrl = pkp.context.apiBaseUrl.replace(/\/api\/v1\/?$/, '');
codecheckApiUrl += '/codecheck_api';
Copy link
Member

Choose a reason for hiding this comment

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

The same code is in lines 89 and 90 > define the API endpoint only once.

Also, in the regex for matching requests in the API handler https://github.com/codecheckers/ojs-codecheck/pull/63/changes#diff-b807d8c7cd429d2b42ac67336f8803632abdc50a1675f4109979b3850760e819 the API URL is only /codecheck/.

codecheckApiUrl += '/codecheck_api';

try {
const response = await fetch(`${codecheckApiUrl}/reserveIdentifier`, {
Copy link
Member

Choose a reason for hiding this comment

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

Rename endpoint as described in handler class.

if (data.success) {
identifier.value = data.identifier;
issueUrl.value = data.issueUrl;
alert(`Added new issue with identifier: ${data.identifier}`);
Copy link
Member

Choose a reason for hiding this comment

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

This is fine for now, but please create an issue to add a nicer user notification than a plain JS alert.

Comment on lines 143 to 146
console.error('Error:', data.error);
}
} catch (error) {
console.error('Request failed:', error);
Copy link
Member

Choose a reason for hiding this comment

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

Same here: fine for now, but create issues to add proper user notifications.

<textarea
:value="dataSoftwareAvail"
@input="onInput"
placeholder="Describe how your data and code are available..."
Copy link
Member

Choose a reason for hiding this comment

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

Localise placeholder.

@dxL1nus
Copy link
Contributor Author

dxL1nus commented Dec 22, 2025

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" ?

Then I would call it classes/CodecheckRegister, because register in of itsself is a bit confusing, as it could e.g. also mean that there are special scripts inside that help the plugin get registered in OJS or something else

@dxL1nus
Copy link
Contributor Author

dxL1nus commented Dec 22, 2025

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

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

@dxL1nus
Copy link
Contributor Author

dxL1nus commented Dec 29, 2025

i fixed the final requests for this PR in 3932030, so maybe it can now be merged @nuest. It would be nice, if you could review it again and take a look at my answers and solutions :)

@dxL1nus dxL1nus requested a review from nuest December 29, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants