Comments

nilesh.addweb created an issue. See original summary.

yoftahe.addweb’s picture

Status: Active » Needs review
StatusFileSize
new21.66 KB
yas’s picture

Status: Needs review » Needs work
StatusFileSize
new836.24 KB

@nileshaddweb

Thank you for the refactoring. Could you please delete the existing view?

screenshot%202020-02-24%2010.08.32.png

Since we replace from views.view.k8s_deployment_all.yml to views.view.k8s_deployment.yml by add the all view to views.view.k8s_deployment.yml and by removing views.view.k8s_deployment_all.yml, the following code needs to work.

+++ b/modules/cloud_service_providers/k8s/src/Plugin/Derivative/K8sMenuLinks.php
@@ -116,8 +116,13 @@ class K8sMenuLinks extends DeriverBase implements ContainerDeriverInterface {
           $title = $entity_definition->getLabel();
           $id = "k8s.local_tasks." . $entity_type;
           $links[$id] = $base_plugin_definition;
-          $links[$id]['title'] = $this->t('@title', ['@title' => $title . "s"]);
-          $links[$id]['route_name'] = "view.{$entity_type}_all.list";
+          $links[$id]['title'] = $this->t('@titles', ['@title' => $title]);
+          if ($entity_type == 'k8s_deployment') {
+            $links[$id]['route_name'] = "view.{$entity_type}.all";
+          }
+          else {
+            $links[$id]['route_name'] = "view.{$entity_type}_all.list";
+          }

The URL should remain /clouds/k8s/deployment.

yas’s picture

yoftahe.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new21.58 KB

@yas
I did above changes. Could you please review the patch.
Thanks

yas’s picture

Status: Needs review » Needs work

@nileshaddweb

After merging #3115573, it broke this patch. Could you re-create it?

$ git apply -v /tmp/3115567-5.patch
Checking patch modules/cloud_service_providers/k8s/config/install/views.view.k8s_deployment.yml...
Checking patch modules/cloud_service_providers/k8s/k8s.install...
Hunk #1 succeeded at 1547 (offset 15 lines).
Checking patch modules/cloud_service_providers/k8s/src/Plugin/Derivative/K8sMenuLinks.php...
error: while searching for:
          $title = $entity_definition->getLabel();
          $id = "k8s.local_tasks." . $entity_type;
          $links[$id] = $base_plugin_definition;
          $links[$id]['title'] = $this->t('@title', ['@title' => $title . "s"]);
          $links[$id]['route_name'] = "view.{$entity_type}_all.list";
          $links[$id]['menu_name'] = 'cloud.service_providers.menu.all';
          $links[$id]['parent'] = 'cloud.service_providers.menu.all';
          $links[$id]['weight'] = $weight++;

error: patch failed: modules/cloud_service_providers/k8s/src/Plugin/Derivative/K8sMenuLinks.php:116
error: modules/cloud_service_providers/k8s/src/Plugin/Derivative/K8sMenuLinks.php: patch does not apply
yoftahe.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new21.59 KB

@yas
Thanks for review the patch. Please review the recreated patch.

yas’s picture

Status: Needs review » Reviewed & tested by the community

@nileshaddweb

Thank you for the update. I tested it and looks good to me. I'll merge the patch to 8.x-1.x and 8.x-2.x and close this issue as Fixed.

  • yas committed 285dda1 on 8.x-1.x authored by nilesh.addweb
    Issue #3115567 by nilesh.addweb, yas: Refactor to merge All K8s...

  • yas committed 7a0d775 on 8.x-2.x authored by nilesh.addweb
    Issue #3115567 by nilesh.addweb, yas: Refactor to merge All K8s...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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