Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ICU-15718] Add worker filter route, template for empty state #2576

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions addons/core/translations/resources/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,15 @@ credential-store:
messages:
welcome:
title: Welcome to Credential Stores
no-filter:
title: No worker filter added
description: You haven't added a worker filter yet
titles:
new: New Credential Store
worker-filter: Worker Filter
actions:
delete: Delete Credential Store
add: Add worker filter
types:
vault: Vault
static: Static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
{{t 'titles.details'}}
</nav.link>
{{#if @model.isVault}}
{{#if (feature-flag 'vault-worker-filter')}}
<nav.link
@route='scopes.scope.credential-stores.credential-store.worker-filter'
>
{{t 'resources.credential-store.titles.worker-filter'}}
</nav.link>
{{/if}}
{{#if (can 'navigate model' @model collection='credential-libraries')}}
<nav.link
@route='scopes.scope.credential-stores.credential-store.credential-libraries'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/

import Controller, { inject as controller } from '@ember/controller';

export default class ScopesScopeCredentialStoresCredentialStoreWorkerFilterController extends Controller {
@controller('scopes/scope/credential-stores/index') credentialStores;
}
1 change: 1 addition & 0 deletions ui/admin/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Router.map(function () {
function () {},
);
});
this.route('worker-filter');
},
);
this.route('new');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/

import Route from '@ember/routing/route';

export default class ScopesScopeCredentialStoresCredentialStoreWorkerFilterRoute extends Route {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}

{{page-title (t 'resources.credential-store.titles.worker-filter')}}

<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<Breadcrumbs::Container />
</page.breadcrumbs>

<page.header>
<CredentialStores::CredentialStore::Header @model={{@model}} />
</page.header>

<page.navigation>
<CredentialStores::CredentialStore::Nav @model={{@model}} />
</page.navigation>

<page.actions>
<CredentialStores::CredentialStore::Actions
@model={{@model}}
@delete={{fn this.credentialStores.delete @model}}
/>
</page.actions>

<page.body>
laurenolivia marked this conversation as resolved.
Show resolved Hide resolved
<Rose::Layout::Centered>
laurenolivia marked this conversation as resolved.
Show resolved Hide resolved
<Hds::ApplicationState as |A|>
<A.Header
@title={{t 'resources.credential-store.messages.no-filter.title'}}
/>
<A.Body
@text={{t
'resources.credential-store.messages.no-filter.description'
}}
/>
<A.Footer as |F|>
<F.LinkStandalone
@icon='plus-circle'
@text={{t 'resources.credential-store.actions.add'}}
@route='scopes.scope.credential-stores.credential-store.index'
laurenolivia marked this conversation as resolved.
Show resolved Hide resolved
/>
</A.Footer>
</Hds::ApplicationState>
</Rose::Layout::Centered>
</page.body>
</Rose::Layout::Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/

import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

module(
'Unit | Controller | scopes/scope/credential-stores/credential-store/worker-filter',
function (hooks) {
setupTest(hooks);

test('it exists', function (assert) {
let controller = this.owner.lookup(
'controller:scopes/scope/credential-stores/credential-store/worker-filter',
);
assert.ok(controller);
assert.ok(controller.credentialStores);
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/

import { module, test } from 'qunit';
import { setupTest } from 'admin/tests/helpers';

module(
'Unit | Route | scopes/scope/credential-stores/credential-store/worker-filter',
function (hooks) {
setupTest(hooks);

test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/credential-stores/credential-store/worker-filter',
);
assert.ok(route);
});
},
);