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

pkp/pkp-lib#8887 REST API for dashboard views #9469

Merged
merged 11 commits into from
Nov 13, 2023

Conversation

Vitaliy-1
Copy link
Collaborator

No description provided.

}

/** @copydoc DAO::get() */
public function get(int $id): ?ReviewAssignment
Copy link
Member

@asmecher asmecher Nov 2, 2023

Choose a reason for hiding this comment

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

Please add a second (optional) $submisisonId parameter; the SchemaDAO::get() function supports the concept of a parent ID, and this can be used to ensure that calling code verifies that the ID belongs to the expected submission. (I'll tag a couple of examples with a link to this comment in a sec.)

Likewise for Repository::exists.

$errors = $this->schemaService->formatValidationErrors($validator->errors());
}

Hook::call('Category::validate', [&$errors, $object, $props, $allowedLocales, $primaryLocale]);
Copy link
Member

Choose a reason for hiding this comment

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

Wrong hook name.

Copy link
Member

@asmecher asmecher Nov 2, 2023

Choose a reason for hiding this comment

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

Also, for new hooks, please use the ::run conventions (#8089). (Here and elsewhere)

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, (hopefully) one more request related to hooks :) Can you document the hooks that got removed in the issue, along with anything else that should go into the Release Notebook, and then drop a link to that comment into #9276 where we track these things?

Copy link
Member

Choose a reason for hiding this comment

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

One more :) When this code gets linted, you should see the pre-commit hook come in to add hook self-documentation in the function self-docs for the new hooks. If that doesn't happen, can you check whether your pre-commit hooks are running as expected?

* Update the status of the review round an assignment is attached to. This
* should be fired whenever a reviewer assignment is modified.
*/
protected function updateReviewRoundStatus(ReviewAssignment $reviewAssignment): bool
Copy link
Member

Choose a reason for hiding this comment

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

I suspect functions like this would be better placed in the DAO, but since it's protected, no biggie if we decide to rearrange things later.

/**
* Filter by review round ids
*/
public function filterByReviewRoundIds(?array $reviewRoundIds): self
Copy link
Member

Choose a reason for hiding this comment

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

Better to type-hint a static return type, rather than self, I think: https://wiki.php.net/rfc/static_return_type

@@ -0,0 +1,298 @@
<?php
/**
* @file classes/submission/reviewAssignment/Collector.php
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 very nice and clean and demonstrates very well the latest features we want to add throughout the codebase -- thanks!

Copy link
Member

@asmecher asmecher left a comment

Choose a reason for hiding this comment

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

I just made a few comments, @Vitaliy-1; it's excellent to start to see this stuff coming into the newer coding conventions, and will lead to many downstream improvements!

@Vitaliy-1 Vitaliy-1 force-pushed the i8887_views_counts branch 2 times, most recently from 80367df to 83b6b67 Compare November 9, 2023 12:41
@Vitaliy-1 Vitaliy-1 merged commit c35ac64 into pkp:main Nov 13, 2023
1 check passed
@Vitaliy-1 Vitaliy-1 deleted the i8887_views_counts branch November 13, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants