UI: Show unsupported screen if replication unsupported (#23178) (#23213)

This commit is contained in:
Chelsea Shaw 2023-09-21 11:35:48 -05:00 committed by GitHub
parent 0596707993
commit 0d6f76b98e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 18 deletions

View File

@ -1,25 +1,23 @@
<section class="section"> <section class="section">
<div class="container is-widescreen"> <div class="container is-widescreen">
{{#if this.model.replicationIsInitializing}} {{#if (eq this.model.mode "unsupported")}}
<PageHeader as |p|>
<p.levelLeft>
<h1 class="title is-3 has-text-grey" data-test-replication-title>
Replication unsupported
</h1>
</p.levelLeft>
</PageHeader>
<EmptyState @title="The current cluster configuration does not support replication" />
{{else if this.model.replicationIsInitializing}}
<LayoutLoading /> <LayoutLoading />
{{else}} {{else}}
{{#if (eq this.model.mode "unsupported")}} <ReplicationSummary
<PageHeader as |p|> @cluster={{this.model}}
<p.levelLeft> @showModeSummary={{true}}
<h1 class="title is-3 has-text-grey"> @onEnable={{action "onEnable"}}
Replication unsupported @onDisable={{action "onDisable"}}
</h1> />
</p.levelLeft>
</PageHeader>
<EmptyState @title="The current cluster configuration does not support replication" />
{{else}}
<ReplicationSummary
@cluster={{this.model}}
@showModeSummary={{true}}
@onEnable={{action "onEnable"}}
@onDisable={{action "onDisable"}}
/>
{{/if}}
{{/if}} {{/if}}
</div> </div>
</section> </section>

View File

@ -0,0 +1,33 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { setupMirage } from 'ember-cli-mirage/test-support';
import authPage from 'vault/tests/pages/auth';
import { visit } from '@ember/test-helpers';
module('Acceptance | Enterprise | replication unsupported', function (hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);
hooks.beforeEach(async function () {
this.server.get('/sys/replication/status', function () {
return {
data: {
mode: 'unsupported',
},
};
});
return authPage.login();
});
test('replication page when unsupported', async function (assert) {
await visit('/vault/replication');
assert
.dom('[data-test-replication-title]')
.hasText('Replication unsupported', 'it shows the unsupported view');
});
});