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 Ember from 'ember';
|
||||||
|
import DS from 'ember-data';
|
||||||
|
|
||||||
const MODEL_FROM_PARAM = {
|
const MODEL_FROM_PARAM = {
|
||||||
entities: 'entity',
|
entities: 'entity',
|
||||||
|
@ -8,8 +9,11 @@ const MODEL_FROM_PARAM = {
|
||||||
export default Ember.Route.extend({
|
export default Ember.Route.extend({
|
||||||
model(params) {
|
model(params) {
|
||||||
let model = MODEL_FROM_PARAM[params.item_type];
|
let model = MODEL_FROM_PARAM[params.item_type];
|
||||||
|
if (!model) {
|
||||||
//TODO 404 behavior;
|
const error = new DS.AdapterError();
|
||||||
|
Ember.set(error, 'httpStatus', 404);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
return model;
|
return model;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default Ember.Route.extend(UnloadModelRoute, UnsavedModelRoute, {
|
||||||
model() {
|
model() {
|
||||||
let policyType = this.policyType();
|
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.transitionTo('vault.cluster.policies', policyType);
|
||||||
}
|
}
|
||||||
return this.store.createRecord(`policy/${policyType}`, {});
|
return this.store.createRecord(`policy/${policyType}`, {});
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default Ember.Route.extend(ClusterRoute, {
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldReturnEmptyModel(policyType, version) {
|
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) {
|
model(params) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ export default Ember.Route.extend(ClusterRoute, {
|
||||||
if (!ALLOWED_TYPES.includes(policyType)) {
|
if (!ALLOWED_TYPES.includes(policyType)) {
|
||||||
return this.transitionTo('vault.cluster.policies', ALLOWED_TYPES[0]);
|
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 this.transitionTo('vault.cluster.policies', policyType);
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
|
|
@ -22,6 +22,8 @@ export default Service.extend({
|
||||||
|
|
||||||
hasDRReplication: hasFeature('DR Replication'),
|
hasDRReplication: hasFeature('DR Replication'),
|
||||||
|
|
||||||
|
hasSentinel: hasFeature('Sentinel'),
|
||||||
|
|
||||||
isEnterprise: computed.match('version', /\+\w+$/),
|
isEnterprise: computed.match('version', /\+\w+$/),
|
||||||
|
|
||||||
isOSS: computed.not('isEnterprise'),
|
isOSS: computed.not('isEnterprise'),
|
||||||
|
|
|
@ -23,12 +23,12 @@
|
||||||
<nav class="tabs sub-nav">
|
<nav class="tabs sub-nav">
|
||||||
<ul>
|
<ul>
|
||||||
{{#link-to "vault.cluster.access.identity.index" tagName="li"}}
|
{{#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)}}
|
{{capitalize (pluralize identityType)}}
|
||||||
</a>
|
</a>
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{#link-to "vault.cluster.access.identity.aliases.index" tagName="li"}}
|
{{#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
|
Aliases
|
||||||
</a>
|
</a>
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{#tool-tip renderInPlace=true as |d|}}
|
{{#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
|
{{i-con
|
||||||
glyph="information-reversed"
|
glyph="information-reversed"
|
||||||
class="auto-width"
|
class="auto-width"
|
||||||
|
|
Loading…
Reference in New Issue