From 63c4d670d9fb9a363d14d91f88d6d764257375c6 Mon Sep 17 00:00:00 2001 From: wenincode Date: Fri, 14 Oct 2022 14:08:40 -0600 Subject: [PATCH] Set postfix for agentless-notice storage key based on partition and dc --- .../app/components/consul/node/agentless-notice/index.js | 4 ++-- ui/packages/consul-ui/app/templates/dc/nodes/index.hbs | 2 +- .../components/consul/node/agentless-notice-test.js | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ui/packages/consul-ui/app/components/consul/node/agentless-notice/index.js b/ui/packages/consul-ui/app/components/consul/node/agentless-notice/index.js index cc7996ae81..6cc18594cf 100644 --- a/ui/packages/consul-ui/app/components/consul/node/agentless-notice/index.js +++ b/ui/packages/consul-ui/app/components/consul/node/agentless-notice/index.js @@ -11,8 +11,8 @@ export default class AgentlessNotice extends Component { constructor(owner, args) { super(owner, args); - if (this.args.dc) { - this.storageKey = `consul-nodes-agentless-notice-dismissed-${this.args.dc}`; + if (this.args.postfix) { + this.storageKey = `consul-nodes-agentless-notice-dismissed-${this.args.postfix}`; } if (window.localStorage.getItem(this.storageKey) === DISMISSED_VALUE) { diff --git a/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs b/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs index f319ad0d52..8459018cce 100644 --- a/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs +++ b/ui/packages/consul-ui/app/templates/dc/nodes/index.hbs @@ -60,7 +60,7 @@ {{/if}} - + ` + hbs`` ); assert.true( - window.localStorage.getItem.calledOnceWith('consul-nodes-agentless-notice-dismissed-dc2') + window.localStorage.getItem.calledOnceWith( + 'consul-nodes-agentless-notice-dismissed-partition' + ) ); assert