diff --git a/ui/app/components/secret-link.js b/ui/app/components/secret-link.js index c755e9501efb..8bf4011c76d8 100644 --- a/ui/app/components/secret-link.js +++ b/ui/app/components/secret-link.js @@ -20,6 +20,7 @@ export function linkParams({ mode, secret, queryParams }) { } export default Component.extend({ + onLinkClick() {}, tagName: '', // so that ember-test-selectors doesn't log a warning supportsDataTestProperties: true, diff --git a/ui/app/lib/attach-capabilities.js b/ui/app/lib/attach-capabilities.js index 4a32a66fa054..b85832a2755e 100644 --- a/ui/app/lib/attach-capabilities.js +++ b/ui/app/lib/attach-capabilities.js @@ -34,6 +34,7 @@ export default function attachCapabilities(modelClass, capabilities) { return ret; }, {}); + //TODO: move this to the application serializer and do it JIT instead of on app boot debug(`adding new relationships: ${capabilityKeys.join(', ')} to ${modelClass.toString()}`); modelClass.reopen(newRelationships); modelClass.reopenClass({ diff --git a/ui/app/models/auth-method.js b/ui/app/models/auth-method.js index bd70d0a00a7e..17c04e980370 100644 --- a/ui/app/models/auth-method.js +++ b/ui/app/models/auth-method.js @@ -2,19 +2,15 @@ import { alias } from '@ember/object/computed'; import { computed } from '@ember/object'; import DS from 'ember-data'; import { fragment } from 'ember-data-model-fragments/attributes'; -import { queryRecord } from 'ember-computed-query'; import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs'; import { memberAction } from 'ember-api-actions'; -import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; + +import apiPath from 'vault/utils/api-path'; +import attachCapabilities from 'vault/lib/attach-capabilities'; const { attr, hasMany } = DS; -const configPath = function configPath(strings, key) { - return function(...values) { - return `${strings[0]}${values[key]}${strings[1]}`; - }; -}; -export default DS.Model.extend({ +let Model = DS.Model.extend({ authConfigs: hasMany('auth-config', { polymorphic: true, inverse: 'backend', async: false }), path: attr('string'), accessor: attr('string'), @@ -95,29 +91,17 @@ export default DS.Model.extend({ fieldGroups: computed('formFieldGroups', function() { return fieldToAttrs(this, this.get('formFieldGroups')); }), + canDisable: alias('deletePath.canDelete'), + canEdit: alias('configPath.canUpdate'), +}); - configPathTmpl: computed('type', function() { - const type = this.get('type'); - if (type === 'aws') { - return configPath`auth/${0}/config/client`; +export default attachCapabilities(Model, { + deltePath: apiPath`sys/auth/${'id'}`, + configPath: function(context) { + if (context.type === 'aws') { + return apiPath`auth/${'id'}/config/client`; } else { - return configPath`auth/${0}/config`; + return apiPath`auth/${'id'}/config`; } - }), - - configPath: queryRecord( - 'capabilities', - context => { - const { id, configPathTmpl } = context.getProperties('id', 'configPathTmpl'); - return { - id: configPathTmpl(id), - }; - }, - 'id', - 'configPathTmpl' - ), - - deletePath: lazyCapabilities(apiPath`sys/auth/${'id'}`, 'id'), - canDisable: alias('deletePath.canDelete'), - canEdit: alias('configPath.canUpdate'), + }, }); diff --git a/ui/app/styles/components/toolbar.scss b/ui/app/styles/components/toolbar.scss index 8d0fee0854d4..6c4c558bb764 100644 --- a/ui/app/styles/components/toolbar.scss +++ b/ui/app/styles/components/toolbar.scss @@ -25,7 +25,7 @@ min-width: 190px; } - label { + label[for='namespace'] { padding: $spacing-xs; color: $grey; } diff --git a/ui/app/styles/core/breadcrumb.scss b/ui/app/styles/core/breadcrumb.scss index 2f7bd3f60108..cef86dfd5eaf 100644 --- a/ui/app/styles/core/breadcrumb.scss +++ b/ui/app/styles/core/breadcrumb.scss @@ -2,7 +2,7 @@ -ms-user-select: text; -webkit-user-select: text; user-select: text; - height: 1.5rem; + min-height: 1.5rem; margin: 0; overflow-x: auto; diff --git a/ui/app/templates/components/secret-edit.hbs b/ui/app/templates/components/secret-edit.hbs index b5e8a91fe6b5..32ecdc901ade 100644 --- a/ui/app/templates/components/secret-edit.hbs +++ b/ui/app/templates/components/secret-edit.hbs @@ -66,6 +66,7 @@ @mode="versions" @secret={{this.model.id}} @class="has-text-black has-text-weight-semibold has-bottom-shadow" + @onLinkClick={{action D.actions.close}} > View version history @@ -75,7 +76,7 @@