From ea43f04c8e030713d82f0c08379fe9c3eab9fcb3 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 4 Jul 2018 15:58:09 +0100 Subject: [PATCH] Move deleting to a top level feature --- ui-v2/app/templates/dc/intentions/-form.hbs | 2 +- ui-v2/app/templates/dc/intentions/index.hbs | 2 +- ui-v2/app/templates/dc/kv/-form.hbs | 2 +- ui-v2/package.json | 2 +- ui-v2/tests/acceptance/dc/acls/delete.feature | 32 ----------------- ui-v2/tests/acceptance/dc/kvs/delete.feature | 16 --------- ui-v2/tests/acceptance/deleting.feature | 34 +++++++++++++++++++ .../acceptance/steps/dc/kvs/delete-steps.js | 10 ------ .../delete-steps.js => deleting-steps.js} | 9 ++--- 9 files changed, 43 insertions(+), 66 deletions(-) delete mode 100644 ui-v2/tests/acceptance/dc/acls/delete.feature delete mode 100644 ui-v2/tests/acceptance/dc/kvs/delete.feature create mode 100644 ui-v2/tests/acceptance/deleting.feature delete mode 100644 ui-v2/tests/acceptance/steps/dc/kvs/delete-steps.js rename ui-v2/tests/acceptance/steps/{dc/acls/delete-steps.js => deleting-steps.js} (50%) diff --git a/ui-v2/app/templates/dc/intentions/-form.hbs b/ui-v2/app/templates/dc/intentions/-form.hbs index a00d1d5ca..6a4507cc8 100644 --- a/ui-v2/app/templates/dc/intentions/-form.hbs +++ b/ui-v2/app/templates/dc/intentions/-form.hbs @@ -64,7 +64,7 @@ {{# if (and item.ID (not-eq item.ID 'anonymous')) }} {{#confirmation-dialog message='Are you sure you want to delete this Intention?'}} {{#block-slot 'action' as |confirm|}} - + {{/block-slot}} {{#block-slot 'dialog' as |execute cancel message|}}

diff --git a/ui-v2/app/templates/dc/intentions/index.hbs b/ui-v2/app/templates/dc/intentions/index.hbs index 946524d05..edbb49d6f 100644 --- a/ui-v2/app/templates/dc/intentions/index.hbs +++ b/ui-v2/app/templates/dc/intentions/index.hbs @@ -58,7 +58,7 @@ Edit

  • - Delete + Delete
  • {{/action-group}} diff --git a/ui-v2/app/templates/dc/kv/-form.hbs b/ui-v2/app/templates/dc/kv/-form.hbs index 9b859c5a1..fa188f9d4 100644 --- a/ui-v2/app/templates/dc/kv/-form.hbs +++ b/ui-v2/app/templates/dc/kv/-form.hbs @@ -33,7 +33,7 @@ {{#confirmation-dialog message='Are you sure you want to delete this key?'}} {{#block-slot 'action' as |confirm|}} - + {{/block-slot}} {{#block-slot 'dialog' as |execute cancel message|}}

    diff --git a/ui-v2/package.json b/ui-v2/package.json index 5dd0dee53..70be6565b 100644 --- a/ui-v2/package.json +++ b/ui-v2/package.json @@ -2,7 +2,7 @@ "name": "consul-ui", "version": "2.2.0", "private": true, - "description": "The web ui for Consul, by HashiCorp.", + "description": "The web UI for Consul, by HashiCorp.", "directories": { "doc": "doc", "test": "tests" diff --git a/ui-v2/tests/acceptance/dc/acls/delete.feature b/ui-v2/tests/acceptance/dc/acls/delete.feature deleted file mode 100644 index 4842b2c71..000000000 --- a/ui-v2/tests/acceptance/dc/acls/delete.feature +++ /dev/null @@ -1,32 +0,0 @@ -@setupApplicationTest -Feature: dc / acls / delete: ACL Delete - Scenario: Deleting an ACL from the ACL listing page - Given 1 datacenter model with the value "datacenter" - And 1 acl model from yaml - --- - Name: something - ID: key - --- - When I visit the acls page for yaml - --- - dc: datacenter - --- - And I click actions on the acls - And I click delete on the acls - And I click confirmDelete on the acls - Then a PUT request is made to "/v1/acl/destroy/key?dc=datacenter" - Scenario: Deleting an ACL from the ACL detail page - Given 1 datacenter model with the value "datacenter" - And 1 acl model from yaml - --- - Name: something - ID: key - --- - When I visit the acl page for yaml - --- - dc: datacenter - acl: something - --- - And I click delete - And I click confirmDelete - Then a PUT request is made to "/v1/acl/destroy/something?dc=datacenter" diff --git a/ui-v2/tests/acceptance/dc/kvs/delete.feature b/ui-v2/tests/acceptance/dc/kvs/delete.feature deleted file mode 100644 index 324240b9c..000000000 --- a/ui-v2/tests/acceptance/dc/kvs/delete.feature +++ /dev/null @@ -1,16 +0,0 @@ -@setupApplicationTest -Feature: dc / kvs / delete: KV Delete - Scenario: Delete ACL - Given 1 datacenter model with the value "datacenter" - And 1 kv model from yaml - --- - - key-name - --- - When I visit the kvs page for yaml - --- - dc: datacenter - --- - And I click actions on the kvs - And I click delete on the kvs - And I click confirmDelete on the kvs - Then a DELETE request is made to "/v1/kv/key-name?dc=datacenter" diff --git a/ui-v2/tests/acceptance/deleting.feature b/ui-v2/tests/acceptance/deleting.feature new file mode 100644 index 000000000..30808f77c --- /dev/null +++ b/ui-v2/tests/acceptance/deleting.feature @@ -0,0 +1,34 @@ +@setupApplicationTest +Feature: deleting: Deleting form the listing and the detail page with confirmation + Scenario: Deleting a [Model] from the [Model] listing page + Given 1 datacenter model with the value "datacenter" + And 1 [Model] model from json + --- + [Data] + --- + When I visit the [Model]s page for yaml + --- + dc: datacenter + --- + And I click actions on the [Model]s + And I click delete on the [Model]s + And I click confirmDelete on the [Model]s + Then a [Method] request is made to "[URL]" + When I visit the [Model] page for yaml + --- + dc: datacenter + [Slug] + --- + And I click delete + And I click confirmDelete + Then a [Method] request is made to "[URL]" + Where: + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + | Model | Method | URL | Data | Slug | + | acl | PUT | /v1/acl/destroy/something?dc=datacenter | {"Name": "something", "ID": "something"} | acl: something | + | kv | DELETE | /v1/kv/key-name?dc=datacenter | ["key-name"] | kv: key-name | + | intention | DELETE | /v1/connect/intentions/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=datacenter | {"SourceName": "name", "ID": "ee52203d-989f-4f7a-ab5a-2bef004164ca"} | intention: ee52203d-989f-4f7a-ab5a-2bef004164ca | + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +@ignore + Scenario: Sort out the wide tables ^ + Then ok diff --git a/ui-v2/tests/acceptance/steps/dc/kvs/delete-steps.js b/ui-v2/tests/acceptance/steps/dc/kvs/delete-steps.js deleted file mode 100644 index a7eff3228..000000000 --- a/ui-v2/tests/acceptance/steps/dc/kvs/delete-steps.js +++ /dev/null @@ -1,10 +0,0 @@ -import steps from '../../steps'; - -// step definitions that are shared between features should be moved to the -// tests/acceptance/steps/steps.js file - -export default function(assert) { - return steps(assert).then('I should find a file', function() { - assert.ok(true, this.step); - }); -} diff --git a/ui-v2/tests/acceptance/steps/dc/acls/delete-steps.js b/ui-v2/tests/acceptance/steps/deleting-steps.js similarity index 50% rename from ui-v2/tests/acceptance/steps/dc/acls/delete-steps.js rename to ui-v2/tests/acceptance/steps/deleting-steps.js index a7eff3228..6e459ed1f 100644 --- a/ui-v2/tests/acceptance/steps/dc/acls/delete-steps.js +++ b/ui-v2/tests/acceptance/steps/deleting-steps.js @@ -1,10 +1,11 @@ -import steps from '../../steps'; +import steps from './steps'; // step definitions that are shared between features should be moved to the // tests/acceptance/steps/steps.js file export default function(assert) { - return steps(assert).then('I should find a file', function() { - assert.ok(true, this.step); - }); + return steps(assert) + .then('I should find a file', function() { + assert.ok(true, this.step); + }); }