-
Notifications
You must be signed in to change notification settings - Fork 46
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
Api product association #25
Conversation
@@ -73,6 +73,9 @@ public static function create(ContainerInterface $container) { | |||
|
|||
/** | |||
* {@inheritdoc} | |||
* | |||
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException |
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.
I am little bit sceptical whether we should document all possible exceptions that Phpstorm offers for us. If we know for sure that an exception should not be thrown in normal circumstances (confidence lvl 99%) then we should not document it, because it could be misleading.
Ex.: \Drupal\Component\Plugin\Exception\PluginNotFoundException
should never be thrown because "api_product" entity always exists in our module.
@@ -208,38 +209,38 @@ protected function actions(array $form, FormStateInterface $form_state) { | |||
|
|||
/** | |||
* {@inheritdoc} | |||
* | |||
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException |
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.
Same as above.
src/Form/AppSettingsForm.php
Outdated
':link' => Url::fromRoute('apigee_edge.settings')->toString(), | ||
]); | ||
} | ||
// It's necessary to add a wrapper, because if the ID is added to the |
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.
Unnecessary comma.
src/Form/AppSettingsForm.php
Outdated
} | ||
// It's necessary to add a wrapper, because if the ID is added to the | ||
// checkboxes form element, then that will not be properly rendered | ||
// (the label is duplicated). |
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.
s/is/gets/g
src/Form/AppSettingsForm.php
Outdated
]); | ||
} | ||
// It's necessary to add a wrapper, because if the ID is added to the | ||
// checkboxes form element, then that will not be properly rendered |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
$form['api_product']['default_api_product_multiple'] = [ | ||
$form['api_product']['default_api_product_multiple_container']['default_api_product_multiple'] = [ | ||
'#type' => 'checkboxes', |
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.
You could have tried to use multiple checkbox form element if "checkboxes" that problematic :)
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.
But I should create custom validation for the multiple checkbox form element approach (must choose at least one product if user_select is unchecked).
src/Form/AppSettingsForm.php
Outdated
* @see https://www.drupal.org/project/drupal/issues/2855139 | ||
*/ | ||
public function apiProductListCallback(array &$form, FormStateInterface $form_state) : array { | ||
return $form['api_product']['default_api_product_multiple_container']; |
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.
I prefer if AJAX commands gets returned, like ReplaceCommand, instead of render elements directly.
https://api.drupal.org/api/drupal/core%21core.api.php/group/ajax/8.5.x
…nto api-product-association
…gee-edge-drupal into api-product-association
…nto api-product-association
@@ -58,5 +58,11 @@ services: | |||
depends_on: | |||
- php | |||
|
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.
This line is missing from the definition of the PHP container: https://github.com/mxr576/my-webdev-docker-setup/blob/master/docker-compose.yml#L52
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.
Fixed.
* @throws \ReflectionException | ||
* If the class or object do not exist. | ||
*/ | ||
public static function getInvisibleProperty($object, $property_name) { |
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.
Do you still need this?
If not now then in the next sprint we can probably replace it with \PHPUnit\Framework\Assert::readAttribute.
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.
I agree. I will improve the existing tests in the next sprint.
* App settings form tests. | ||
* | ||
* @group apigee_edge | ||
* @group apigee_edge_developer_app |
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.
Maybe introducing a apigee_edge_javascript
group would not be a bad idea for JS tests.
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.
This is the reason why this failed: https://travis-ci.org/peterserfozo/apigee-edge-drupal/jobs/391985870#L2311
which is also the reason of the failing tests. We are not leveraging MINK_DRIVER_CLASS anymore so we do not need this patch. (The patch needs an update to fix regression bugs that it caused.)
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
4a04148
to
01e6746
Compare
…ciation # Conflicts: # src/Form/AppSettingsForm.php # tests/src/Functional/ApigeeEdgeFunctionalTestBase.php
No description provided.