mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
UI: Fix Expected a stable identifier error when leaving & reentering a route (#22483)
This commit is contained in:
@@ -8,10 +8,9 @@ import { computed } from '@ember/object';
|
|||||||
import { alias } from '@ember/object/computed';
|
import { alias } from '@ember/object/computed';
|
||||||
import IdentityModel from './_base';
|
import IdentityModel from './_base';
|
||||||
import apiPath from 'vault/utils/api-path';
|
import apiPath from 'vault/utils/api-path';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
|
||||||
import lazyCapabilities from 'vault/macros/lazy-capabilities';
|
import lazyCapabilities from 'vault/macros/lazy-capabilities';
|
||||||
|
|
||||||
const Model = IdentityModel.extend({
|
export default IdentityModel.extend({
|
||||||
formFields: computed(function () {
|
formFields: computed(function () {
|
||||||
return ['name', 'disabled', 'policies', 'metadata'];
|
return ['name', 'disabled', 'policies', 'metadata'];
|
||||||
}),
|
}),
|
||||||
@@ -45,15 +44,12 @@ const Model = IdentityModel.extend({
|
|||||||
inheritedGroupIds: attr({
|
inheritedGroupIds: attr({
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
}),
|
}),
|
||||||
|
updatePath: lazyCapabilities(apiPath`identity/entity/id/${'id'}`, 'id'),
|
||||||
canDelete: alias('updatePath.canDelete'),
|
canDelete: alias('updatePath.canDelete'),
|
||||||
canEdit: alias('updatePath.canUpdate'),
|
canEdit: alias('updatePath.canUpdate'),
|
||||||
canRead: alias('updatePath.canRead'),
|
canRead: alias('updatePath.canRead'),
|
||||||
|
aliasPath: lazyCapabilities(apiPath`identity/entity-alias`),
|
||||||
canAddAlias: alias('aliasPath.canCreate'),
|
canAddAlias: alias('aliasPath.canCreate'),
|
||||||
policyPath: lazyCapabilities(apiPath`sys/policies`),
|
policyPath: lazyCapabilities(apiPath`sys/policies`),
|
||||||
canCreatePolicies: alias('policyPath.canCreate'),
|
canCreatePolicies: alias('policyPath.canCreate'),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default attachCapabilities(Model, {
|
|
||||||
updatePath: apiPath`identity/entity/id/${'id'}`,
|
|
||||||
aliasPath: apiPath`identity/entity-alias`,
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import Model, { attr } from '@ember-data/model';
|
|||||||
import fieldToAttrs from 'vault/utils/field-to-attrs';
|
import fieldToAttrs from 'vault/utils/field-to-attrs';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import apiPath from 'vault/utils/api-path';
|
import apiPath from 'vault/utils/api-path';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
import lazyCapabilities from 'vault/macros/lazy-capabilities';
|
||||||
|
|
||||||
const ModelExport = Model.extend({
|
export default Model.extend({
|
||||||
backend: attr({ readOnly: true }),
|
backend: attr({ readOnly: true }),
|
||||||
scope: attr({ readOnly: true }),
|
scope: attr({ readOnly: true }),
|
||||||
role: attr({ readOnly: true }),
|
role: attr({ readOnly: true }),
|
||||||
@@ -33,8 +33,10 @@ const ModelExport = Model.extend({
|
|||||||
|
|
||||||
return fieldToAttrs(this, groups);
|
return fieldToAttrs(this, groups);
|
||||||
}),
|
}),
|
||||||
});
|
deletePath: lazyCapabilities(
|
||||||
|
apiPath`${'backend'}/scope/${'scope'}/role/${'role'}/credentials/revoke`,
|
||||||
export default attachCapabilities(ModelExport, {
|
'backend',
|
||||||
deletePath: apiPath`${'backend'}/scope/${'scope'}/role/${'role'}/credentials/revoke`,
|
'scope',
|
||||||
|
'role'
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Model, { attr } from '@ember-data/model';
|
|||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
import apiPath from 'vault/utils/api-path';
|
import apiPath from 'vault/utils/api-path';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
import lazyCapabilities from 'vault/macros/lazy-capabilities';
|
||||||
|
|
||||||
export const COMPUTEDS = {
|
export const COMPUTEDS = {
|
||||||
operationFields: computed('newFields', function () {
|
operationFields: computed('newFields', function () {
|
||||||
@@ -34,7 +34,7 @@ export const COMPUTEDS = {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
const ModelExport = Model.extend(COMPUTEDS, {
|
export default Model.extend(COMPUTEDS, {
|
||||||
useOpenAPI: true,
|
useOpenAPI: true,
|
||||||
backend: attr({ readOnly: true }),
|
backend: attr({ readOnly: true }),
|
||||||
scope: attr({ readOnly: true }),
|
scope: attr({ readOnly: true }),
|
||||||
@@ -85,8 +85,6 @@ const ModelExport = Model.extend(COMPUTEDS, {
|
|||||||
fields: computed('defaultFields', function () {
|
fields: computed('defaultFields', function () {
|
||||||
return expandAttributeMeta(this, this.defaultFields);
|
return expandAttributeMeta(this, this.defaultFields);
|
||||||
}),
|
}),
|
||||||
});
|
|
||||||
|
|
||||||
export default attachCapabilities(ModelExport, {
|
updatePath: lazyCapabilities(apiPath`${'backend'}/scope/${'scope'}/role/${'id'}`, 'backend', 'scope', 'id'),
|
||||||
updatePath: apiPath`${'backend'}/scope/${'scope'}/role/${'id'}`,
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,18 +6,15 @@
|
|||||||
import Model, { attr } from '@ember-data/model';
|
import Model, { attr } from '@ember-data/model';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import apiPath from 'vault/utils/api-path';
|
import apiPath from 'vault/utils/api-path';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
|
||||||
|
|
||||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
|
import lazyCapabilities from 'vault/macros/lazy-capabilities';
|
||||||
|
|
||||||
const ModelExport = Model.extend({
|
export default Model.extend({
|
||||||
name: attr('string'),
|
name: attr('string'),
|
||||||
backend: attr({ readOnly: true }),
|
backend: attr({ readOnly: true }),
|
||||||
attrs: computed(function () {
|
attrs: computed(function () {
|
||||||
return expandAttributeMeta(this, ['name']);
|
return expandAttributeMeta(this, ['name']);
|
||||||
}),
|
}),
|
||||||
});
|
updatePath: lazyCapabilities(apiPath`${'backend'}/scope/${'id'}`, 'id'),
|
||||||
|
|
||||||
export default attachCapabilities(ModelExport, {
|
|
||||||
updatePath: apiPath`${'backend'}/scope/${'id'}`,
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,9 +5,8 @@
|
|||||||
|
|
||||||
import Model, { attr } from '@ember-data/model';
|
import Model, { attr } from '@ember-data/model';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import { apiPath } from 'vault/macros/lazy-capabilities';
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
||||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
|
||||||
|
|
||||||
// these arrays define the order in which the fields will be displayed
|
// these arrays define the order in which the fields will be displayed
|
||||||
// see
|
// see
|
||||||
@@ -38,7 +37,7 @@ const TWEAK_SOURCE = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const ModelExport = Model.extend({
|
export default Model.extend({
|
||||||
name: attr('string', {
|
name: attr('string', {
|
||||||
// CBS TODO: make this required for making a transformation
|
// CBS TODO: make this required for making a transformation
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
@@ -97,8 +96,5 @@ const ModelExport = Model.extend({
|
|||||||
backend: attr('string', {
|
backend: attr('string', {
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
}),
|
}),
|
||||||
});
|
updatePath: lazyCapabilities(apiPath`${'backend'}/transformation/${'id'}`, 'id'),
|
||||||
|
|
||||||
export default attachCapabilities(ModelExport, {
|
|
||||||
updatePath: apiPath`${'backend'}/transformation/${'id'}`,
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,11 +5,10 @@
|
|||||||
|
|
||||||
import Model, { attr } from '@ember-data/model';
|
import Model, { attr } from '@ember-data/model';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import { apiPath } from 'vault/macros/lazy-capabilities';
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
|
||||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
|
|
||||||
const M = Model.extend({
|
export default Model.extend({
|
||||||
idPrefix: 'alphabet/',
|
idPrefix: 'alphabet/',
|
||||||
idForNav: computed('id', 'idPrefix', function () {
|
idForNav: computed('id', 'idPrefix', function () {
|
||||||
const modelId = this.id || '';
|
const modelId = this.id || '';
|
||||||
@@ -32,8 +31,5 @@ const M = Model.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
backend: attr('string', { readOnly: true }),
|
backend: attr('string', { readOnly: true }),
|
||||||
});
|
updatePath: lazyCapabilities(apiPath`${'backend'}/alphabet/${'id'}`, 'backend', 'id'),
|
||||||
|
|
||||||
export default attachCapabilities(M, {
|
|
||||||
updatePath: apiPath`${'backend'}/alphabet/${'id'}`,
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,11 +5,10 @@
|
|||||||
|
|
||||||
import Model, { attr } from '@ember-data/model';
|
import Model, { attr } from '@ember-data/model';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import { apiPath } from 'vault/macros/lazy-capabilities';
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
||||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
|
||||||
|
|
||||||
const ModelExport = Model.extend({
|
export default Model.extend({
|
||||||
// used for getting appropriate options for backend
|
// used for getting appropriate options for backend
|
||||||
idPrefix: 'role/',
|
idPrefix: 'role/',
|
||||||
// the id prefixed with `role/` so we can use it as the *secret param for the secret show route
|
// the id prefixed with `role/` so we can use it as the *secret param for the secret show route
|
||||||
@@ -40,8 +39,5 @@ const ModelExport = Model.extend({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
backend: attr('string', { readOnly: true }),
|
backend: attr('string', { readOnly: true }),
|
||||||
});
|
updatePath: lazyCapabilities(apiPath`${'backend'}/role/${'id'}`, 'backend', 'id'),
|
||||||
|
|
||||||
export default attachCapabilities(ModelExport, {
|
|
||||||
updatePath: apiPath`${'backend'}/role/${'id'}`,
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,11 +5,10 @@
|
|||||||
|
|
||||||
import Model, { attr } from '@ember-data/model';
|
import Model, { attr } from '@ember-data/model';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import { apiPath } from 'vault/macros/lazy-capabilities';
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
||||||
import attachCapabilities from 'vault/lib/attach-capabilities';
|
|
||||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
|
|
||||||
const M = Model.extend({
|
export default Model.extend({
|
||||||
idPrefix: 'template/',
|
idPrefix: 'template/',
|
||||||
idForNav: computed('id', 'idPrefix', function () {
|
idForNav: computed('id', 'idPrefix', function () {
|
||||||
const modelId = this.id || '';
|
const modelId = this.id || '';
|
||||||
@@ -47,8 +46,5 @@ const M = Model.extend({
|
|||||||
writeAttrs: computed(function () {
|
writeAttrs: computed(function () {
|
||||||
return expandAttributeMeta(this, ['name', 'pattern', 'alphabet']);
|
return expandAttributeMeta(this, ['name', 'pattern', 'alphabet']);
|
||||||
}),
|
}),
|
||||||
});
|
updatePath: lazyCapabilities(apiPath`${'backend'}/template/${'id'}`, 'backend', 'id'),
|
||||||
|
|
||||||
export default attachCapabilities(M, {
|
|
||||||
updatePath: apiPath`${'backend'}/template/${'id'}`,
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user