Icu 8225 create a new link to create storage bucket (#106)
* feat: 🎸 add new link to create storage bucket ✅ Closes: ICU-8225
This commit is contained in:
1 parent
4f0b3f71fd
commit
0aedfc1147
6 files changed
+85
-3
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*/
|
||||
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeStorageBucketsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// = attributes
|
||||
/**
|
||||
* Translated breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.storage-bucket.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,9 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeStorageBucketsRoute extends Route {}
|
||||
export default class ScopesScopeStorageBucketsRoute extends Route {
|
||||
model() {
|
||||
// Temporary placeholder
|
||||
return [{ scope_id: 'sb_123456' }];
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,12 @@
|
||||
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeStorageBucketsIndexRoute extends Route {}
|
||||
export default class ScopesScopeStorageBucketsIndexRoute extends Route {
|
||||
// =methods
|
||||
|
||||
setupController(controller) {
|
||||
const scope = this.modelFor('scopes.scope');
|
||||
super.setupController(...arguments);
|
||||
controller.setProperties({ scope });
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,32 @@
|
||||
{{!
|
||||
Copyright (c) HashiCorp, Inc.
|
||||
SPDX-License-Identifier: MPL-2.0
|
||||
}}
|
||||
}}
|
||||
|
||||
<Rose::Layout::Page as |page|>
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
{{! TODO: Add valid doc link and description}}
|
||||
<h2>
|
||||
{{t 'resources.storage-bucket.title_plural'}}
|
||||
<DocLink @doc='storage-bucket' @iconSize='large' />
|
||||
</h2>
|
||||
</page.header>
|
||||
|
||||
<page.actions>
|
||||
{{! TODO: Check can create ability using correct file }}
|
||||
{{#if (can 'create model' this.scope collection='storage-buckets')}}
|
||||
{{#if @model}}
|
||||
<Hds::Button
|
||||
@route='scopes.scope.storage-buckets.new'
|
||||
@text={{t 'resources.storage-bucket.titles.new'}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</page.actions>
|
||||
|
||||
<page.body />
|
||||
</Rose::Layout::Page>
|
||||
@@ -117,6 +117,7 @@ module.exports = function (environment) {
|
||||
worker: '/workers',
|
||||
'worker.manage-workers': '/workers/manage-workers-on-hcp',
|
||||
'worker-filters': '/worker-filters',
|
||||
'storage-bucket': '/storage-buckets',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'admin/tests/helpers';
|
||||
|
||||
module('Unit | Controller | scopes/scope/storage-buckets', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/storage-buckets'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user