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

Api product association #25

Merged
merged 28 commits into from
Jun 18, 2018
Merged

Conversation

peterserfozo
Copy link
Contributor

No description provided.

@peterserfozo peterserfozo requested review from tamasd and mxr576 June 6, 2018 23:21
@@ -73,6 +73,9 @@ public static function create(ContainerInterface $container) {

/**
* {@inheritdoc}
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

':link' => Url::fromRoute('apigee_edge.settings')->toString(),
]);
}
// It's necessary to add a wrapper, because if the ID is added to the
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary comma.

}
// 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).
Copy link
Contributor

Choose a reason for hiding this comment

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

s/is/gets/g

]);
}
// 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.


$form['api_product']['default_api_product_multiple'] = [
$form['api_product']['default_api_product_multiple_container']['default_api_product_multiple'] = [
'#type' => 'checkboxes',
Copy link
Contributor

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 :)

Copy link
Contributor Author

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).

* @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'];
Copy link
Contributor

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

@@ -58,5 +58,11 @@ services:
depends_on:
- php

Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Péter Serfőző and others added 5 commits June 14, 2018 08:03
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.)
@googlebot
Copy link

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 cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@mxr576 mxr576 force-pushed the api-product-association branch from 4a04148 to 01e6746 Compare June 18, 2018 10:41
mxr576 added 2 commits June 18, 2018 16:46
…ciation

# Conflicts:
#	src/Form/AppSettingsForm.php
#	tests/src/Functional/ApigeeEdgeFunctionalTestBase.php
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.

4 participants