diff --git a/addons/api/mirage/factories/account.js b/addons/api/mirage/factories/account.js
index cc113ba54..49f270975 100644
--- a/addons/api/mirage/factories/account.js
+++ b/addons/api/mirage/factories/account.js
@@ -32,7 +32,7 @@ export default factory.extend({
case TYPE_AUTH_METHOD_PASSWORD:
return { login_name: faker.internet.userName() };
case TYPE_AUTH_METHOD_LDAP: {
- const groupsAmount = faker.datatype.number({ min: 1, max: 3 });
+ const groupsAmount = faker.datatype.number({ min: 3, max: 5 });
let groups = [];
for (let i = 0; i < groupsAmount; i++) {
groups.push(faker.random.word());
diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml
index c1f9e6723..b71e2afda 100644
--- a/addons/core/translations/form/en-us.yaml
+++ b/addons/core/translations/form/en-us.yaml
@@ -173,3 +173,6 @@ secret-editor:
edit: Click to replace this secret
created:
label: Created
+other_fields:
+ label: Other Fields
+ help: This information is provided by the server and cannot be edited in Boundary
diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml
index 4d5914ab6..5e50a8007 100644
--- a/addons/core/translations/resources/en-us.yaml
+++ b/addons/core/translations/resources/en-us.yaml
@@ -14,11 +14,23 @@ account:
types:
password: Password
oidc: OIDC
+ ldap: LDAP
titles:
new: New Account
actions:
create: Create Account
delete: Delete Account
+ form:
+ login_name:
+ label: Login Name
+ email:
+ label: Email
+ dn:
+ label: Dn
+ member_of_groups:
+ label: Group Names
+ full_name:
+ label: Full Name
auth-method:
title: Auth Method
title_plural: Auth Methods
diff --git a/ui/admin/app/components/form/account/ldap/index.hbs b/ui/admin/app/components/form/account/ldap/index.hbs
index 38ebf728f..306d67ef8 100644
--- a/ui/admin/app/components/form/account/ldap/index.hbs
+++ b/ui/admin/app/components/form/account/ldap/index.hbs
@@ -52,27 +52,64 @@
{{/if}}
+ {{#if @model.isNew}}
+
+ {{t 'form.login_name.label'}}
+ {{t 'form.login_name.help'}}
+ {{#if @model.errors.login_name}}
+
+ {{#each @model.errors.login_name as |error|}}
+ {{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+ {{/if}}
-
- {{t 'form.login_name.label'}}
- {{t 'form.login_name.help'}}
- {{#if @model.errors.login_name}}
-
- {{#each @model.errors.login_name as |error|}}
- {{error.message}}
+ {{#unless @model.isNew}}
+
+
+
+
+
{{t
+ 'form.other_fields.label'
+ }}
+
{{t
+ 'form.other_fields.help'
+ }}
+
+
+ {{t 'form.login_name.label'}}
+
+
+ {{t 'resources.account.form.email.label'}}
+
+
+ {{t 'resources.account.form.full_name.label'}}
+
+
+ {{t 'resources.account.form.dn.label'}}
+
+ {{t
+ 'resources.account.form.member_of_groups.label'
+ }}
+ {{#each @model.member_of_groups as |group|}}
+
{{/each}}
-
- {{/if}}
-
-
+
+
+ {{/unless}}
{{#if (can 'save model' @model)}}
-
-
- {{t 'form.name.label'}}
- {{t 'form.issuer.label'}}
- {{t 'form.subject.label'}}
- {{t 'form.email.label'}}
- {{t 'form.full_name.label'}}
- {{t 'form.type.label'}}
- {{t 'form.id.label'}}
-
-
-
- {{#each @model.accounts as |account|}}
-
-
- {{#if (can 'read account' account)}}
-
- {{account.accountName}}
-
- {{else}}
- {{account.accountName}}
- {{/if}}
- {{account.description}}
-
-
- {{account.issuer}}
-
-
- {{account.subject}}
-
-
- {{account.email}}
-
-
- {{account.full_name}}
-
-
-
-
-
-
+ <:body as |B|>
+
+
+ {{#if (can 'read account' B.data)}}
+
- {{account.id}}
-
-
-
- {{/each}}
-
-
+ {{B.data.accountName}}
+
+ {{else}}
+ {{B.data.accountName}}
+ {{/if}}
+ {{B.data.description}}
+
+
+ {{B.data.issuer}}
+
+
+ {{B.data.subject}}
+
+
+ {{B.data.email}}
+
+
+ {{B.data.full_name}}
+
+
+
+
+
+
+ {{B.data.account.id}}
+
+
+
+
+
+ {{else if @model.accounts.firstObject.isLDAP}}
+
+ <:body as |B|>
+
+
+ {{#if (can 'read account' B.data)}}
+
+ {{B.data.displayName}}
+
+ {{else}}
+ {{B.data.displayName}}
+ {{/if}}
+ {{B.data.description}}
+
+
+ {{B.data.email}}
+
+ {{B.data.full_name}}
+
+ {{B.data.dn}}
+
+
+ {{truncate-list 'actions.more' B.data.member_of_groups 3}}
+
+
+
+
+
{{else}}
-
-
-
- {{t 'form.name.label'}}
- {{t 'form.login_name.label'}}
- {{t 'form.type.label'}}
- {{t 'form.id.label'}}
-
-
-
- {{#each @model.accounts as |account|}}
-
-
- {{#if (can 'read account' account)}}
-
- {{account.accountName}}
-
- {{else}}
- {{account.accountName}}
- {{/if}}
- {{account.description}}
-
-
- {{account.login_name}}
-
-
-
-
-
-
+ <:body as |B|>
+
+
+ {{#if (can 'read account' B.data)}}
+
- {{account.id}}
-
-
-
- {{/each}}
-
-
+ {{B.data.accountName}}
+
+ {{else}}
+ {{B.data.accountName}}
+ {{/if}}
+ {{B.data.description}}
+
+
+ {{B.data.login_name}}
+
+
+
+
+
+
+ {{B.data.account.id}}
+
+
+
+
+
{{/if}}
{{else}}
-
item !== 'read');
await visit(urls.accounts);
- assert.notOk(find('main tbody .rose-table-header-cell:nth-child(1) a'));
+ assert.dom(ACCOUNT_SELECTOR).doesNotExist();
});
});
diff --git a/ui/admin/tests/acceptance/accounts/update-test.js b/ui/admin/tests/acceptance/accounts/update-test.js
index fcc68d4bb..609e802bd 100644
--- a/ui/admin/tests/acceptance/accounts/update-test.js
+++ b/ui/admin/tests/acceptance/accounts/update-test.js
@@ -73,6 +73,23 @@ module('Acceptance | accounts | update', function (hooks) {
assert.strictEqual(this.server.db.accounts[0].name, 'update name');
});
+ test('can update resource and save LDAP account changes', async function (assert) {
+ assert.expect(2);
+ await visit(urls.account);
+ await click('form [type="button"]', 'Activate edit mode');
+ await fillIn('[name="name"]', 'updated name');
+ await fillIn('[name="description"]', 'updated desc');
+ await click('form [type="submit"]:not(:disabled)');
+ assert.strictEqual(
+ this.server.schema.accounts.all().models[0].name,
+ 'updated name'
+ );
+ assert.strictEqual(
+ this.server.schema.accounts.all().models[0].description,
+ 'updated desc'
+ );
+ });
+
test('cannot update resource without proper authorization', async function (assert) {
assert.expect(1);
instances.account.authorized_actions =