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

EWPP-842: Allow chart and racing services for webtols chart widget. #152

Merged
merged 2 commits into from
Apr 12, 2021

Conversation

22Alexandra
Copy link
Contributor

No description provided.

sergepavle
sergepavle previously approved these changes Mar 18, 2021
upchuk
upchuk previously requested changes Mar 19, 2021
@@ -46,7 +46,7 @@ public function validate($value, Constraint $constraint) {
}

// Add violation in case incorrect services.
if (!isset($snippet['service']) || $snippet['service'] !== $widget_types[$constraint->widgetType]['service']) {
if (!isset($snippet['service']) || !in_array($snippet['service'], $widget_types[$constraint->widgetType]['services'])) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also BC issue here. Check for the presence of services and if not, case service to an array and use that. This is in case someone extended the source class.

@@ -125,6 +125,7 @@ public function getWidgetTypes() {
'chart' => [
'name' => $this->t('Chart'),
'service' => 'charts',
'services' => ['chart', 'racing'],
Copy link
Contributor

Choose a reason for hiding this comment

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

If service is deprecated then need to provide services parameter for each widget type as was done in the first commits.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, all of them need to get services

@22Alexandra 22Alexandra force-pushed the EWPP-842 branch 3 times, most recently from c727c21 to e2dab98 Compare March 19, 2021 12:27
sergepavle
sergepavle previously approved these changes Mar 19, 2021
yenyasinn
yenyasinn previously approved these changes Mar 23, 2021
@upchuk upchuk dismissed their stale review April 12, 2021 07:15

Was reviewed

@upchuk upchuk merged commit ccf79e8 into master Apr 12, 2021
@upchuk upchuk deleted the EWPP-842 branch April 12, 2021 08:21
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