mirror of https://github.com/hashicorp/consul
Set postfix for agentless-notice storage key based on partition and dc
parent
6c2ca0ba3f
commit
63c4d670d9
|
@ -11,8 +11,8 @@ export default class AgentlessNotice extends Component {
|
||||||
constructor(owner, args) {
|
constructor(owner, args) {
|
||||||
super(owner, args);
|
super(owner, args);
|
||||||
|
|
||||||
if (this.args.dc) {
|
if (this.args.postfix) {
|
||||||
this.storageKey = `consul-nodes-agentless-notice-dismissed-${this.args.dc}`;
|
this.storageKey = `consul-nodes-agentless-notice-dismissed-${this.args.postfix}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.localStorage.getItem(this.storageKey) === DISMISSED_VALUE) {
|
if (window.localStorage.getItem(this.storageKey) === DISMISSED_VALUE) {
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</BlockSlot>
|
</BlockSlot>
|
||||||
<BlockSlot @name='content'>
|
<BlockSlot @name='content'>
|
||||||
<Consul::Node::AgentlessNotice @items={{items}} @filteredItems={{filtered}} @dc={{route.params.dc}} />
|
<Consul::Node::AgentlessNotice @items={{items}} @filteredItems={{filtered}} @postfix={{concat route.params.partition route.params.dc}} />
|
||||||
<DataCollection
|
<DataCollection
|
||||||
@type='node'
|
@type='node'
|
||||||
@sort={{sort.value}}
|
@sort={{sort.value}}
|
||||||
|
|
|
@ -89,14 +89,16 @@ module('Integration | Component | consul node agentless-notice', function (hooks
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
window.localStorage.setItem('consul-nodes-agentless-notice-dismissed-dc2', 'true');
|
window.localStorage.setItem('consul-nodes-agentless-notice-dismissed-partition', 'true');
|
||||||
|
|
||||||
await render(
|
await render(
|
||||||
hbs`<Consul::Node::AgentlessNotice @items={{this.nodes}} @filteredItems={{this.filteredNodes}} @dc="dc2" />`
|
hbs`<Consul::Node::AgentlessNotice @items={{this.nodes}} @filteredItems={{this.filteredNodes}} @postfix="partition" />`
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.true(
|
assert.true(
|
||||||
window.localStorage.getItem.calledOnceWith('consul-nodes-agentless-notice-dismissed-dc2')
|
window.localStorage.getItem.calledOnceWith(
|
||||||
|
'consul-nodes-agentless-notice-dismissed-partition'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
|
|
Loading…
Reference in New Issue