UI - first RC feedback (#4278)
* add hasSentinel to the version service * use hasSentinel instead of features directly * type='button' strikes again * pass url param in tab links to ensure hrefs are updated * 404 when the item_type is invalid for the identity route
This commit is contained in:
parent
3dd3247006
commit
3a734d7cb4
|
@ -0,0 +1,5 @@
|
|||
import Trigger from 'ember-basic-dropdown/components/basic-dropdown/trigger';
|
||||
|
||||
export default Trigger.extend({
|
||||
attributeBindings: ['type'],
|
||||
});
|
|
@ -1,4 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
const MODEL_FROM_PARAM = {
|
||||
entities: 'entity',
|
||||
|
@ -8,8 +9,11 @@ const MODEL_FROM_PARAM = {
|
|||
export default Ember.Route.extend({
|
||||
model(params) {
|
||||
let model = MODEL_FROM_PARAM[params.item_type];
|
||||
|
||||
//TODO 404 behavior;
|
||||
if (!model) {
|
||||
const error = new DS.AdapterError();
|
||||
Ember.set(error, 'httpStatus', 404);
|
||||
throw error;
|
||||
}
|
||||
return model;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ export default Ember.Route.extend(UnloadModelRoute, UnsavedModelRoute, {
|
|||
model() {
|
||||
let policyType = this.policyType();
|
||||
|
||||
if (!this.get('version.features').includes('Sentinel') && policyType !== 'acl') {
|
||||
if (!this.get('version.hasSentinel') && policyType !== 'acl') {
|
||||
return this.transitionTo('vault.cluster.policies', policyType);
|
||||
}
|
||||
return this.store.createRecord(`policy/${policyType}`, {});
|
||||
|
|
|
@ -15,7 +15,7 @@ export default Ember.Route.extend(ClusterRoute, {
|
|||
},
|
||||
|
||||
shouldReturnEmptyModel(policyType, version) {
|
||||
return policyType !== 'acl' && (version.get('isOSS') || !version.get('features').includes('Sentinel'));
|
||||
return policyType !== 'acl' && (version.get('isOSS') || !version.get('hasSentinel'));
|
||||
},
|
||||
|
||||
model(params) {
|
||||
|
|
|
@ -16,7 +16,7 @@ export default Ember.Route.extend(ClusterRoute, {
|
|||
if (!ALLOWED_TYPES.includes(policyType)) {
|
||||
return this.transitionTo('vault.cluster.policies', ALLOWED_TYPES[0]);
|
||||
}
|
||||
if (!this.get('version.features').includes('Sentinel') && policyType !== 'acl') {
|
||||
if (!this.get('version.hasSentinel') && policyType !== 'acl') {
|
||||
return this.transitionTo('vault.cluster.policies', policyType);
|
||||
}
|
||||
return {};
|
||||
|
|
|
@ -22,6 +22,8 @@ export default Service.extend({
|
|||
|
||||
hasDRReplication: hasFeature('DR Replication'),
|
||||
|
||||
hasSentinel: hasFeature('Sentinel'),
|
||||
|
||||
isEnterprise: computed.match('version', /\+\w+$/),
|
||||
|
||||
isOSS: computed.not('isEnterprise'),
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
<nav class="tabs sub-nav">
|
||||
<ul>
|
||||
{{#link-to "vault.cluster.access.identity.index" tagName="li"}}
|
||||
<a href={{href-to "vault.cluster.access.identity.index"}}>
|
||||
<a href={{href-to "vault.cluster.access.identity.index" (pluralize identityType)}}>
|
||||
{{capitalize (pluralize identityType)}}
|
||||
</a>
|
||||
{{/link-to}}
|
||||
{{#link-to "vault.cluster.access.identity.aliases.index" tagName="li"}}
|
||||
<a href={{href-to "vault.cluster.access.identity.aliases.index"}}>
|
||||
<a href={{href-to "vault.cluster.access.identity.aliases.index" (pluralize identityType)}}>
|
||||
Aliases
|
||||
</a>
|
||||
{{/link-to}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#tool-tip renderInPlace=true as |d|}}
|
||||
{{#d.trigger tagName="button" class=(concat "tool-tip-trigger button") data-test-tool-tip-trigger=true}}
|
||||
{{#d.trigger tagName="button" type="button" class=(concat "tool-tip-trigger button") data-test-tool-tip-trigger=true}}
|
||||
{{i-con
|
||||
glyph="information-reversed"
|
||||
class="auto-width"
|
||||
|
|
Loading…
Reference in New Issue