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

Checklist Prototypes #5930

Merged
merged 7 commits into from
Sep 28, 2024
Merged

Checklist Prototypes #5930

merged 7 commits into from
Sep 28, 2024

Conversation

pmattmann
Copy link
Member

@pmattmann pmattmann commented Sep 16, 2024

  • Entity
  • Repository
  • Migration
  • Security
  • Fixture
  • UnitTest

I had to cheat within PurgeHttpCacheListener.php. Better solutions are very much welcome!
-> done in 1ef322e

Comment on lines +299 to +313
if (is_iterable($operation->getUriVariables())) {
// UriVariable is Link, toProperty is set, fromClass is a entity
foreach ($operation->getUriVariables() as $uriVariable) {
if (is_a($uriVariable, Link::class)
&& is_string($uriVariable->getToProperty())
&& is_a($uriVariable->getFromClass(), HasId::class, true)
) {
// value of toProperty is NULL; Read of its ID will throw Exception
// -> invalid
if (null == $entity->{$uriVariable->getToProperty()}) {
return false;
}
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@usu:
Please also direct your focus here

@pmattmann pmattmann requested review from a team and usu September 18, 2024 19:42
api/src/Entity/Checklist.php Outdated Show resolved Hide resolved
api/src/State/ChecklistCreateProcessor.php Outdated Show resolved Hide resolved
api/src/Entity/Checklist.php Outdated Show resolved Hide resolved
Copy link
Contributor

@BacLuc BacLuc left a comment

Choose a reason for hiding this comment

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

Tested the api from the browser, it works.
You can use the following script in your local browser against localhost:3004:
https://gist.github.com/BacLuc/8d34ecc1d1544e2e52d6db3895b46903

You need to change the CheckListItemRepository in the following way:

        $checklistQry->join(UserCamp::class, 'uc', Join::WITH, 'c.camp = uc.camp OR (c.camp IS NULL AND c.isPrototype = true)');

that an ADMIN can create a nested checklist item for a prototype

api/src/Entity/Checklist.php Outdated Show resolved Hide resolved
@pmattmann pmattmann requested a review from usu September 28, 2024 07:46
@usu usu added this pull request to the merge queue Sep 28, 2024
Merged via the queue into ecamp:devel with commit 6886735 Sep 28, 2024
34 checks passed
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.

3 participants