Merge branch 'main' into feat-host-catalog-integration
This commit is contained in:
commit
cbda678a65
12 files changed
+118
-55
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import HostCatalogAbility from 'api/abilities/host-catalog';
|
||||
|
||||
export default class OverrideHostCatalogAbility extends HostCatalogAbility {
|
||||
/**
|
||||
* Navigating to a resource is allowed if either list or create grants
|
||||
* are present, except in the following case. Navigating to hosts directly
|
||||
* from a dynamic host catalog is not allowed, since this might present more
|
||||
* hosts than is practical or useful.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get canNavigate() {
|
||||
const { isPlugin } = this.model;
|
||||
const isHostsCollection = this.collection === 'hosts';
|
||||
const isDynamicHostsNavigation = isPlugin && isHostsCollection;
|
||||
return !isDynamicHostsNavigation && (this.canList || this.canCreate);
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
<nav.link @route='scopes.scope.host-catalogs.host-catalog.index'>
|
||||
{{t 'titles.details'}}
|
||||
</nav.link>
|
||||
{{#if (can 'navigate model' @model collection='hosts')}}
|
||||
{{#if (can 'navigate host-catalog' @model collection='hosts')}}
|
||||
<nav.link @route='scopes.scope.host-catalogs.host-catalog.hosts'>
|
||||
{{t 'resources.host.title_plural'}}
|
||||
</nav.link>
|
||||
{{/if}}
|
||||
{{#if (can 'navigate model' @model collection='host-sets')}}
|
||||
{{#if (can 'navigate host-catalog' @model collection='host-sets')}}
|
||||
<nav.link @route='scopes.scope.host-catalogs.host-catalog.host-sets'>
|
||||
{{t 'resources.host-set.title_plural'}}
|
||||
</nav.link>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<row.cell>
|
||||
{{#if hostSet.isStatic}}
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host-set.types.' hostSet.type)}}
|
||||
{{t (concat 'resources.host-set.types.' hostSet.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{else}}
|
||||
<Rose::Badge
|
||||
@@ -37,7 +37,7 @@
|
||||
'-color-16'
|
||||
}}
|
||||
>
|
||||
{{hostSet.compositeType}}
|
||||
{{t (concat 'resources.host-set.types.' hostSet.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
</row.cell>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<row.cell>
|
||||
{{#if host.isStatic}}
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host.types.' host.type)}}
|
||||
{{t (concat 'resources.host.types.' host.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{else}}
|
||||
<Rose::Badge
|
||||
@@ -39,7 +39,7 @@
|
||||
'-color-16'
|
||||
}}
|
||||
>
|
||||
{{host.compositeType}}
|
||||
{{t (concat 'resources.host.types.' host.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
</row.cell>
|
||||
|
||||
Reference in new issue
Block a user