Commit 7f0374c0 authored by Tomotaka Hosomi's avatar Tomotaka Hosomi Committed by Yas Naoi
Browse files

Issue #3325936 by hosomitm, yas, Ryo Yamashita: Add the function to delete...

Issue #3325936 by hosomitm, yas, Ryo Yamashita: Add the function to delete OpenStack router in the SPA
parent 7a7de09e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -24,6 +24,18 @@ const OPENSTACK_NETWORK_TEMPLATE: EntityFormTemplate[] = [
        ]
      }
    ]
  },
  {
    cloudServiceProvider: 'openstack',
    entityName: 'router',
    actionType: 'delete',
    entityRecords: [
      {
        type: 'label',
        text: 'Are you sure you want to delete the {{entityName}} {{name}}?'
      },
    ],
    submitButtonLabel: 'Delete'
  }
]

+14 −0
Original line number Diff line number Diff line
@@ -1311,6 +1311,20 @@ entity.openstack_router.external_gateway_network_ids:
  options:
    perm: 'add openstack router'

entity.openstack_router.delete:
  path: '/cloud_dashboard/openstack/{cloud_context}/openstack_router/{entity_id}/delete'
  defaults:
    _controller: '\Drupal\openstack\Controller\ApiController::operateEntity'
    entity_type_id: openstack_router
    command: delete
  methods: [POST]
  requirements:
    # Use custom access that will check for cloud_context and the desired permission.
    # Desired permission is passed as an option in the "perm" variable
    _custom_access: '\Drupal\cloud\Controller\CloudConfigController::access'
  options:
    perm: 'delete any openstack router+delete own openstack router'

entity.openstack_router.add_form:
  path: '/clouds/openstack/{cloud_context}/router/add'
  defaults:
+4 −0
Original line number Diff line number Diff line
@@ -826,6 +826,10 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
        $method_name = 'createOpenStackRouter';
        break;

      case 'delete_openstack_router':
        $method_name = 'deleteOpenStackRouter';
        break;

    }

    // Execute the process.