Problem/Motivation

  • The center coordinates and the zoom ratio of the location map should be able to be changed from the settings form.

Issue fork cloud-3352343

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Ryo Yamashita created an issue. See original summary.

Ryo Yamashita’s picture

Status: Needs work » Needs review

@yas

Please review it. Thanks.

yas’s picture

Issue summary: View changes
Status: Needs review » Needs work

ryo-yamashita

Thank you for the patch. I posted my minor comments. Thanks!

yas’s picture

@ryo-yamashita

Can you replace the following screen?

BEFORE:

37.png

AFTER:

18.png

Here are my thoughs:

  • If a user leaves - None - in the Country dropdown box, the selection can be recognized as World map.
  • Also, we need to consider the default value when a user leaves - Select - in the Zoom rate dropdown box w/ an validation and error handling.
  • You can learn about how it works by checking the existing modules such as cloud, cloud_cluster, k8s, openstack and vmware.

Thanks

Ryo Yamashita’s picture

Status: Needs work » Needs review

@yas

Please review it. Thanks.

Note: Automatic determination of settings based on Drupal setting country will be done in another issue.

yas’s picture

Status: Needs review » Needs work

@ryo-yamashita

Thank you for the update. Can you fix the coding standard error?
https://www.drupal.org/pift-ci-job/2640489

Also, please check my comment in the GitLab code review.

Thanks

yas’s picture

@ryo-yamashita

cloud_geocoder JavaScript library automatically handles to get the lat / lon when we specify the country and city so that I don't think we need to introduce a new function like findPosition(). See the following code:

HTH

Ryo Yamashita’s picture

Status: Needs work » Needs review

@yas

Please review it. Thanks.

yas’s picture

Status: Needs review » Needs work

@ryo-yamashita

Thank you for the update. Please check my comment at GitLab and fix the following coding standard error:

FILE: .../cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 109 | WARNING | Unused variable $country_options.
----------------------------------------------------------------------
Ryo Yamashita’s picture

Status: Needs work » Needs review

@yas

I pushed the new patch. Thanks.

yas’s picture

Status: Needs review » Needs work

@ryo-yamashita

Please fix the white space at the end of line, too → https://git.drupalcode.org/project/cloud/-/merge_requests/1690#note_165763

yas’s picture

@ryo-yamashita

Also, please rebase the patch. The git command gives us the following error while applying the patch:

$ git apply -v /tmp/1690.diff
/tmp/1690.diff:55: trailing whitespace.
 * and zoom factor of the location map. 
Checking patch modules/cloud_dashboard/cloud_dashboard.info.yml...
Checking patch modules/cloud_dashboard/cloud_dashboard.routing.yml...
Checking patch modules/cloud_dashboard/cloud_dashboard/src/organisms/CloudServiceProviderMap.tsx...
Checking patch modules/cloud_dashboard/src/Controller/CloudDashboardConfigController.php...
Checking patch modules/cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php...
error: while searching for:

namespace Drupal\cloud_dashboard\Form\Config;

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Class Cloud Admin Settings.
 */
class CloudDashboardAdminSettings extends ConfigFormBase {

  /**
   * {@inheritdoc}
   */

error: patch failed: modules/cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php:2
error: modules/cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php: patch does not apply
Ryo Yamashita’s picture

@yas In our environment, I am able to apply the patch without any problems.
What could be the reason why the patch cannot be applied? Thanks.

Note: The current directory in the following shell is set to the directory where cloud.info.yml exists.

-> % git diff origin/5.x cloud-3352343/3352343-add-config-form-for-location-map > diff.patch
-> % git apply -v diff.patch                                                    
diff.patch:55: trailing whitespace.
 * and zoom factor of the location map. 
Checking patch modules/cloud_dashboard/cloud_dashboard.info.yml...
Checking patch modules/cloud_dashboard/cloud_dashboard.routing.yml...
Checking patch modules/cloud_dashboard/cloud_dashboard/src/organisms/CloudServiceProviderMap.tsx...
Checking patch modules/cloud_dashboard/src/Controller/CloudDashboardConfigController.php...
Checking patch modules/cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php...
Applied patch modules/cloud_dashboard/cloud_dashboard.info.yml cleanly.
Applied patch modules/cloud_dashboard/cloud_dashboard.routing.yml cleanly.
Applied patch modules/cloud_dashboard/cloud_dashboard/src/organisms/CloudServiceProviderMap.tsx cleanly.
Applied patch modules/cloud_dashboard/src/Controller/CloudDashboardConfigController.php cleanly.
Applied patch modules/cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php cleanly.
warning: 1 line adds whitespace errors.
yas’s picture

@ryo-yamashita

Thank you for the update. Now it is mergeable. Please tail the white space at https://git.drupalcode.org/project/cloud/-/merge_requests/1690#note_165763

diff.patch:55: trailing whitespace.
 * and zoom factor of the location map. 
...
modules/cloud_dashboard/src/Form/Config/CloudDashboardAdminSettings.php cleanly.
warning: 1 line adds whitespace errors.

Thanks

Ryo Yamashita’s picture

Status: Needs work » Needs review
yas’s picture

Title: Add config form for the location map in the SPA » Add a "Location map" fieldset to Cloud dashboard admin settings form
yas’s picture

Status: Needs review » Reviewed & tested by the community

@ryo-yamashita

Thank you for the update. It tested the patch and it looks good. I'll merge the patch to 4.x, 5.x and 6.x, and close this issue as Fixed.

  • yas committed 76ce4a5d on 6.x authored by Ryo Yamashita
    Issue #3352343 by Ryo Yamashita, yas: Add a "Location map" fieldset to...

  • yas committed fd2be7db on 5.x authored by Ryo Yamashita
    Issue #3352343 by Ryo Yamashita, yas: Add a "Location map" fieldset to...

  • yas committed 34abbc36 on 4.x authored by Ryo Yamashita
    Issue #3352343 by Ryo Yamashita, yas: Add a "Location map" fieldset to...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

yas’s picture

Category: Task » Feature request