mirror of https://github.com/status-im/consul.git
Set postfix for agentless-notice storage key based on partition and dc
This commit is contained in:
parent
6c2ca0ba3f
commit
63c4d670d9
|
@ -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) {
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
{{/if}}
|
||||
</BlockSlot>
|
||||
<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
|
||||
@type='node'
|
||||
@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(
|
||||
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(
|
||||
window.localStorage.getItem.calledOnceWith('consul-nodes-agentless-notice-dismissed-dc2')
|
||||
window.localStorage.getItem.calledOnceWith(
|
||||
'consul-nodes-agentless-notice-dismissed-partition'
|
||||
)
|
||||
);
|
||||
|
||||
assert
|
||||
|
|
Loading…
Reference in New Issue