From 616819957af6e7a1c02d57843eb456c4e0e10167 Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Mon, 11 Mar 2024 13:45:40 -0700 Subject: [PATCH 1/7] =?UTF-8?q?Revert=20"feat:=20add=20alert=20to=20link?= =?UTF-8?q?=20to=20hcp=20modal=20to=20ask=20a=20user=20refresh=20a=20page;?= =?UTF-8?q?=20up=E2=80=A6=20(#20682)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd833d9a3649402e23ced070121e0d0c131f610e. --- .../consul-ui/app/components/link-to-hcp-modal/index.hbs | 5 +---- .../consul-ui/app/components/link-to-hcp-modal/index.scss | 4 ---- .../tests/integration/components/link-to-hcp-modal-test.js | 6 ------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs b/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs index 623049fdf16f..312a16b7ffc7 100644 --- a/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs +++ b/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs @@ -20,7 +20,7 @@ |G|> Select cluster access mode before linking Control the level of access that HCP Consul Central has to your linked cluster. - Learn more @@ -89,9 +89,6 @@ {{/if}} {{/if}} - - After you link your cluster to HCP, close this modal and refresh the page. - diff --git a/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.scss b/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.scss index 75af67613d42..9850cac56bfc 100644 --- a/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.scss +++ b/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.scss @@ -7,10 +7,6 @@ &__no-acls-alert { margin-bottom: 16px; } - &__refresh-page-alert { - margin-top: 16px; - margin-bottom: 8px; - } &__generate-token { display: flex; flex-direction: column; diff --git a/ui/packages/consul-ui/tests/integration/components/link-to-hcp-modal-test.js b/ui/packages/consul-ui/tests/integration/components/link-to-hcp-modal-test.js index f7ed600d0e33..746317bfddc5 100644 --- a/ui/packages/consul-ui/tests/integration/components/link-to-hcp-modal-test.js +++ b/ui/packages/consul-ui/tests/integration/components/link-to-hcp-modal-test.js @@ -14,7 +14,6 @@ import { BlockingEventSource as RealEventSource } from 'consul-ui/utils/dom/even import { ACCESS_LEVEL } from 'consul-ui/components/link-to-hcp-modal'; const modalSelector = '[data-test-link-to-hcp-modal]'; -const modalRefreshPageAlertSelector = '[data-test-link-to-hcp-modal-refresh-page-alert]'; const modalNoACLsAlertSelector = '[data-test-link-to-hcp-modal-no-acls-alert]'; const modalOptionReadOnlySelector = '#accessMode-readonly'; const modalOptionReadOnlyErrorSelector = '[data-test-link-to-hcp-modal-access-level-options-error]'; @@ -89,7 +88,6 @@ module('Integration | Component | link-to-hcp-modal', function (hooks) { assert.dom(modalSelector).exists({ count: 1 }); assert.dom(`${modalSelector} ${modalNoACLsAlertSelector}`).doesNotExist(); - assert.dom(`${modalSelector} ${modalRefreshPageAlertSelector}`).isVisible(); // select read-only await click(`${modalSelector} ${modalOptionReadOnlySelector}`); @@ -188,8 +186,6 @@ module('Integration | Component | link-to-hcp-modal', function (hooks) { assert.dom(modalSelector).exists({ count: 1 }); assert.dom(`${modalSelector} ${modalNoACLsAlertSelector}`).doesNotExist(); - assert.dom(`${modalSelector} ${modalRefreshPageAlertSelector}`).isVisible(); - // select read-only await click(`${modalSelector} ${modalOptionReadOnlySelector}`); @@ -217,8 +213,6 @@ module('Integration | Component | link-to-hcp-modal', function (hooks) { assert.dom(modalSelector).exists({ count: 1 }); assert.dom(`${modalSelector} ${modalNoACLsAlertSelector}`).isVisible(); - assert.dom(`${modalSelector} ${modalRefreshPageAlertSelector}`).isVisible(); - // select read-only await click(`${modalSelector} ${modalOptionReadOnlySelector}`); From e18bc65775106eae527473045a1695f8d96aaa83 Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Mon, 11 Mar 2024 13:46:02 -0700 Subject: [PATCH 2/7] Revert "chor: change cluster name param to have datacenter.name as default value (#20644)" This reverts commit 8425cd0f9017f640cce711dc32e0fa0d136899d8. --- .../app/components/hcp-nav-item/index.js | 1 + .../components/link-to-hcp-banner/index.js | 1 + .../components/link-to-hcp-modal/index.hbs | 4 +-- .../app/components/link-to-hcp-modal/index.js | 18 +++++----- .../app/helpers/hcp-authentication-link.js | 15 ++++++-- .../consul-ui/app/services/hcp-link-modal.js | 6 +++- .../tests/acceptance/link-to-hcp-test.js | 11 ++++++ .../components/link-to-hcp-modal-test.js | 3 ++ .../helpers/hcp-authentication-link-test.js | 36 ++++++++++++++----- 9 files changed, 71 insertions(+), 24 deletions(-) diff --git a/ui/packages/consul-ui/app/components/hcp-nav-item/index.js b/ui/packages/consul-ui/app/components/hcp-nav-item/index.js index b1fb989bec55..1bbc1c6c72c3 100644 --- a/ui/packages/consul-ui/app/components/hcp-nav-item/index.js +++ b/ui/packages/consul-ui/app/components/hcp-nav-item/index.js @@ -53,6 +53,7 @@ export default class HcpLinkItemComponent extends Component { @action onLinkToConsulCentral() { + this.hcpLinkModal.setResourceId(this.args.linkData?.resourceId); this.hcpLinkModal.show(); } } diff --git a/ui/packages/consul-ui/app/components/link-to-hcp-banner/index.js b/ui/packages/consul-ui/app/components/link-to-hcp-banner/index.js index 22574aed52ab..3f96ac261f0e 100644 --- a/ui/packages/consul-ui/app/components/link-to-hcp-banner/index.js +++ b/ui/packages/consul-ui/app/components/link-to-hcp-banner/index.js @@ -22,6 +22,7 @@ export default class LinkToHcpBannerComponent extends Component { } @action onClusterLink() { + this.hcpLinkModal.setResourceId(this.args.linkData?.resourceId); this.hcpLinkModal.show(); } } diff --git a/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs b/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs index 312a16b7ffc7..bdabe3b2e52e 100644 --- a/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs +++ b/ui/packages/consul-ui/app/components/link-to-hcp-modal/index.hbs @@ -45,7 +45,7 @@ {{#if (and this.isReadOnlyAccessLevelSelected (can "read acls") (can "create tokens"))}}