Merge branch 'main' into sessions
This commit is contained in:
8 files changed
+197
-27
No files matched your search
@@ -11,7 +11,7 @@ export default class ScopesScopeHostCatalogsRoute extends Route {
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service session;
|
||||
|
||||
@service can;
|
||||
// =methods
|
||||
|
||||
/**
|
||||
@@ -26,8 +26,13 @@ export default class ScopesScopeHostCatalogsRoute extends Route {
|
||||
* @return {Promise{[HostCatalogModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
return this.store.query('host-catalog', { scope_id });
|
||||
const scope = this.modelFor('scopes.scope');
|
||||
const { id: scope_id } = scope;
|
||||
if (
|
||||
this.can.can('list collection', scope, { collection: 'host-catalogs' })
|
||||
) {
|
||||
return this.store.query('host-catalog', { scope_id });
|
||||
}
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeHostCatalogsIndexRoute extends Route {}
|
||||
export default class ScopesScopeHostCatalogsIndexRoute extends Route {
|
||||
setupController(controller) {
|
||||
const scope = this.modelFor('scopes.scope');
|
||||
super.setupController(...arguments);
|
||||
controller.setProperties({ scope });
|
||||
}
|
||||
}
|
||||
@@ -81,10 +81,12 @@
|
||||
<Rose::Icon @name='flight-icons/crosshair-16' @size='medium' />
|
||||
{{t 'resources.target.title_plural'}}
|
||||
</nav.link>
|
||||
<nav.link @route='scopes.scope.host-catalogs'>
|
||||
<Rose::Icon @name='flight-icons/collections-16' @size='medium' />
|
||||
{{t 'resources.host-catalog.title_plural'}}
|
||||
</nav.link>
|
||||
{{#if (can 'navigate collection' @model collection='host-catalogs')}}
|
||||
<nav.link @route='scopes.scope.host-catalogs'>
|
||||
<Rose::Icon @name='flight-icons/collections-16' @size='medium' />
|
||||
{{t 'resources.host-catalog.title_plural'}}
|
||||
</nav.link>
|
||||
{{/if}}
|
||||
{{#if (feature-flag 'credential-store')}}
|
||||
<nav.link @route='scopes.scope.credential-stores'>
|
||||
<Rose::Icon @name='flight-icons/key-16' @size='medium' />
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
</page.header>
|
||||
|
||||
<page.actions>
|
||||
{{#if @model}}
|
||||
<Rose::LinkButton
|
||||
@route='scopes.scope.host-catalogs.new'
|
||||
@style='primary'
|
||||
>
|
||||
{{t 'titles.new'}}
|
||||
</Rose::LinkButton>
|
||||
{{#if (can 'create collection' this.scope collection='host-catalogs')}}
|
||||
{{#if @model}}
|
||||
<Rose::LinkButton
|
||||
@route='scopes.scope.host-catalogs.new'
|
||||
@style='primary'
|
||||
>
|
||||
{{t 'titles.new'}}
|
||||
</Rose::LinkButton>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</page.actions>
|
||||
|
||||
@@ -82,12 +84,35 @@
|
||||
as |message|
|
||||
>
|
||||
<message.description>
|
||||
{{t 'resources.host-catalog.description'}}
|
||||
{{#if
|
||||
(can 'list collection' this.scope collection='host-catalogs')
|
||||
}}
|
||||
{{! can list (at least): show default welcome message}}
|
||||
{{t 'resources.host-catalog.description'}}
|
||||
{{else if (can
|
||||
'create collection' this.scope collection='host-catalogs'
|
||||
)}}
|
||||
{{! can create (only): show create-but-not-list welcome message}}
|
||||
{{t
|
||||
'descriptions.create-but-not-list'
|
||||
resource=(t 'resources.host-catalog.title_plural')
|
||||
}}
|
||||
{{else}}
|
||||
{{! can neither list nor create }}
|
||||
{{t
|
||||
'descriptions.neither-list-nor-create'
|
||||
resource=(t 'resources.host-catalog.title_plural')
|
||||
}}
|
||||
{{/if}}
|
||||
</message.description>
|
||||
<message.link @route='scopes.scope.host-catalogs.new'>
|
||||
<Rose::Icon @name='flight-icons/plus-circle-16' />
|
||||
{{t 'titles.new'}}
|
||||
</message.link>
|
||||
{{#if
|
||||
(can 'create collection' this.scope collection='host-catalogs')
|
||||
}}
|
||||
<message.link @route='scopes.scope.host-catalogs.new'>
|
||||
<Rose::Icon @name='flight-icons/plus-circle-16' />
|
||||
{{t 'titles.new'}}
|
||||
</message.link>
|
||||
{{/if}}
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
|
||||
Reference in new issue
Block a user