From cea8acf88669e1204bb780a27a893e23b7469ad2 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 7 Oct 2020 09:28:34 -0400 Subject: [PATCH 1/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20favicon=20and?= =?UTF-8?q?=20genericize=20SVG=20references?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/core/app/index.html | 2 ++ ui/core/app/templates/application.hbs | 8 ++++---- ui/core/app/templates/scopes/scope.hbs | 2 +- ui/core/app/templates/scopes/scope/-sidebar.hbs | 8 ++++---- ui/core/app/templates/scopes/scope/orgs/index.hbs | 2 +- ui/core/app/templates/scopes/scope/projects/index.hbs | 2 +- .../templates/scopes/scope/projects/project/-sidebar.hbs | 6 +++--- .../{boundary-icons => app-icons}/action-session.svg | 0 .../public/{boundary-icons => app-icons}/auth-method.svg | 0 ui/core/public/{boundary-icons => app-icons}/gear.svg | 0 ui/core/public/{boundary-icons => app-icons}/group.svg | 0 .../{boundary-icons => app-icons}/host-catalogs.svg | 0 ui/core/public/{boundary-icons => app-icons}/org.svg | 0 ui/core/public/{boundary-icons => app-icons}/project.svg | 0 ui/core/public/{boundary-icons => app-icons}/roles.svg | 0 ui/core/public/{boundary-icons => app-icons}/target.svg | 0 .../public/{boundary-icons => app-icons}/user-profile.svg | 0 ui/core/public/{boundary-icons => app-icons}/users.svg | 0 ui/core/public/{logo-boundary.svg => logo-app.svg} | 0 ui/core/public/{logo-hashi.svg => logo-company.svg} | 0 ui/core/public/logo.svg | 1 - 21 files changed, 16 insertions(+), 15 deletions(-) rename ui/core/public/{boundary-icons => app-icons}/action-session.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/auth-method.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/gear.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/group.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/host-catalogs.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/org.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/project.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/roles.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/target.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/user-profile.svg (100%) rename ui/core/public/{boundary-icons => app-icons}/users.svg (100%) rename ui/core/public/{logo-boundary.svg => logo-app.svg} (100%) rename ui/core/public/{logo-hashi.svg => logo-company.svg} (100%) delete mode 100644 ui/core/public/logo.svg diff --git a/ui/core/app/index.html b/ui/core/app/index.html index 21cb16f81..248478b1f 100644 --- a/ui/core/app/index.html +++ b/ui/core/app/index.html @@ -12,6 +12,8 @@ + + {{content-for "head-footer"}} diff --git a/ui/core/app/templates/application.hbs b/ui/core/app/templates/application.hbs index ac4f0eac3..6db0e5baa 100644 --- a/ui/core/app/templates/application.hbs +++ b/ui/core/app/templates/application.hbs @@ -5,13 +5,13 @@ - + {{#if this.session.isAuthenticated}} {{#if this.session.data.authenticated.isGlobal}} @@ -35,7 +35,7 @@ {{t 'actions.change-password'}} @@ -59,7 +59,7 @@ - + {{company-copyright}} {{app-name}} diff --git a/ui/core/app/templates/scopes/scope.hbs b/ui/core/app/templates/scopes/scope.hbs index 2d7d21026..908b13f16 100644 --- a/ui/core/app/templates/scopes/scope.hbs +++ b/ui/core/app/templates/scopes/scope.hbs @@ -6,7 +6,7 @@ {{t "resources.project.title_plural"}} diff --git a/ui/core/app/templates/scopes/scope/-sidebar.hbs b/ui/core/app/templates/scopes/scope/-sidebar.hbs index 27852d3ec..45780e932 100644 --- a/ui/core/app/templates/scopes/scope/-sidebar.hbs +++ b/ui/core/app/templates/scopes/scope/-sidebar.hbs @@ -1,25 +1,25 @@ {{t "resources.user.title_plural"}} {{t "resources.group.title_plural"}} {{t "resources.role.title_plural"}} {{t "resources.auth-method.title_plural"}} diff --git a/ui/core/app/templates/scopes/scope/orgs/index.hbs b/ui/core/app/templates/scopes/scope/orgs/index.hbs index efe5f0a59..b888817fb 100644 --- a/ui/core/app/templates/scopes/scope/orgs/index.hbs +++ b/ui/core/app/templates/scopes/scope/orgs/index.hbs @@ -35,7 +35,7 @@ @title={{org.name}} @description={{org.description}} @id={{org.id}} - @icon="boundary-icons/org" + @icon="app-icons/org" @route="scopes.scope" @model={{org.id}} /> diff --git a/ui/core/app/templates/scopes/scope/projects/index.hbs b/ui/core/app/templates/scopes/scope/projects/index.hbs index fca7f0fae..ebf9e2e21 100644 --- a/ui/core/app/templates/scopes/scope/projects/index.hbs +++ b/ui/core/app/templates/scopes/scope/projects/index.hbs @@ -35,7 +35,7 @@ @title={{project.name}} @description={{project.description}} @id={{project.id}} - @icon="boundary-icons/project" + @icon="app-icons/project" @route="scopes.scope.projects.project" @model={{project.id}} /> diff --git a/ui/core/app/templates/scopes/scope/projects/project/-sidebar.hbs b/ui/core/app/templates/scopes/scope/projects/project/-sidebar.hbs index 5f7845697..e82349443 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/-sidebar.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/-sidebar.hbs @@ -1,19 +1,19 @@ {{t "resources.session.title_plural"}} {{t "resources.target.title_plural"}} {{t "resources.host-catalog.title_plural"}} diff --git a/ui/core/public/boundary-icons/action-session.svg b/ui/core/public/app-icons/action-session.svg similarity index 100% rename from ui/core/public/boundary-icons/action-session.svg rename to ui/core/public/app-icons/action-session.svg diff --git a/ui/core/public/boundary-icons/auth-method.svg b/ui/core/public/app-icons/auth-method.svg similarity index 100% rename from ui/core/public/boundary-icons/auth-method.svg rename to ui/core/public/app-icons/auth-method.svg diff --git a/ui/core/public/boundary-icons/gear.svg b/ui/core/public/app-icons/gear.svg similarity index 100% rename from ui/core/public/boundary-icons/gear.svg rename to ui/core/public/app-icons/gear.svg diff --git a/ui/core/public/boundary-icons/group.svg b/ui/core/public/app-icons/group.svg similarity index 100% rename from ui/core/public/boundary-icons/group.svg rename to ui/core/public/app-icons/group.svg diff --git a/ui/core/public/boundary-icons/host-catalogs.svg b/ui/core/public/app-icons/host-catalogs.svg similarity index 100% rename from ui/core/public/boundary-icons/host-catalogs.svg rename to ui/core/public/app-icons/host-catalogs.svg diff --git a/ui/core/public/boundary-icons/org.svg b/ui/core/public/app-icons/org.svg similarity index 100% rename from ui/core/public/boundary-icons/org.svg rename to ui/core/public/app-icons/org.svg diff --git a/ui/core/public/boundary-icons/project.svg b/ui/core/public/app-icons/project.svg similarity index 100% rename from ui/core/public/boundary-icons/project.svg rename to ui/core/public/app-icons/project.svg diff --git a/ui/core/public/boundary-icons/roles.svg b/ui/core/public/app-icons/roles.svg similarity index 100% rename from ui/core/public/boundary-icons/roles.svg rename to ui/core/public/app-icons/roles.svg diff --git a/ui/core/public/boundary-icons/target.svg b/ui/core/public/app-icons/target.svg similarity index 100% rename from ui/core/public/boundary-icons/target.svg rename to ui/core/public/app-icons/target.svg diff --git a/ui/core/public/boundary-icons/user-profile.svg b/ui/core/public/app-icons/user-profile.svg similarity index 100% rename from ui/core/public/boundary-icons/user-profile.svg rename to ui/core/public/app-icons/user-profile.svg diff --git a/ui/core/public/boundary-icons/users.svg b/ui/core/public/app-icons/users.svg similarity index 100% rename from ui/core/public/boundary-icons/users.svg rename to ui/core/public/app-icons/users.svg diff --git a/ui/core/public/logo-boundary.svg b/ui/core/public/logo-app.svg similarity index 100% rename from ui/core/public/logo-boundary.svg rename to ui/core/public/logo-app.svg diff --git a/ui/core/public/logo-hashi.svg b/ui/core/public/logo-company.svg similarity index 100% rename from ui/core/public/logo-hashi.svg rename to ui/core/public/logo-company.svg diff --git a/ui/core/public/logo.svg b/ui/core/public/logo.svg deleted file mode 100644 index 2a28cc024..000000000 --- a/ui/core/public/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From d3738f58589b179845351ae20a9bc5a8ed451b14 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 7 Oct 2020 09:58:12 -0400 Subject: [PATCH 2/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20missing=20pag?= =?UTF-8?q?e=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/core/app/templates/scopes/scope/auth-methods.hbs | 2 ++ .../scope/auth-methods/auth-method/accounts/account.hbs | 4 +++- .../auth-method/accounts/account/set-password.hbs | 2 ++ .../project/host-catalogs/host-catalog/host-sets/host-set.hbs | 4 +++- .../project/host-catalogs/host-catalog/hosts/host.hbs | 4 +++- .../templates/scopes/scope/roles/role/principals/-header.hbs | 4 ++-- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ui/core/app/templates/scopes/scope/auth-methods.hbs b/ui/core/app/templates/scopes/scope/auth-methods.hbs index c24cd6895..fb4d78b4a 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods.hbs @@ -1 +1,3 @@ +{{title (t "resources.auth-method.title_plural")}} + {{outlet}} diff --git a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account.hbs b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account.hbs index e2147cab0..d66e83390 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account.hbs @@ -1 +1,3 @@ -{{outlet}} \ No newline at end of file +{{title @model.displayName}} + +{{outlet}} diff --git a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password.hbs b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password.hbs index eba48df37..315877a6f 100644 --- a/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password.hbs +++ b/ui/core/app/templates/scopes/scope/auth-methods/auth-method/accounts/account/set-password.hbs @@ -1,3 +1,5 @@ +{{title (t 'actions.set-password')}} +

{{t "resources.role.principal.description"}}

- {{@model.id}} + {{@model.role.id}} From a5811f0ea7bc4ce0541d8fd9aad2c222465f31a4 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 7 Oct 2020 10:08:07 -0400 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=F0=9F=90=9B=20ensure=20password=20r?= =?UTF-8?q?eset=20is=20always=20called?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on occassion it could break if axe is running, which is probably only an issue when developing the UI, but to be safe... --- .../form/account/password/change-password/index.hbs | 2 +- .../form/account/password/change-password/index.js | 13 +++++++------ .../form/account/password/set-password/index.hbs | 2 +- .../form/account/password/set-password/index.js | 10 +++++----- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/core/app/components/form/account/password/change-password/index.hbs b/ui/core/app/components/form/account/password/change-password/index.hbs index 24548e843..954da26c1 100644 --- a/ui/core/app/components/form/account/password/change-password/index.hbs +++ b/ui/core/app/components/form/account/password/change-password/index.hbs @@ -1,6 +1,6 @@ this.resetPasswords()); - fn(currentPassword, newPassword); + submit(fn, currentPassword, newPassword) { + console.log(currentPassword, newPassword); + run(() => this.resetPasswords()); + run(() => fn(currentPassword, newPassword)); } /** diff --git a/ui/core/app/components/form/account/password/set-password/index.hbs b/ui/core/app/components/form/account/password/set-password/index.hbs index b77d6b659..9008a9094 100644 --- a/ui/core/app/components/form/account/password/set-password/index.hbs +++ b/ui/core/app/components/form/account/password/set-password/index.hbs @@ -1,5 +1,5 @@ this.resetPassword()); - fn(password); + submit(fn, password) { + run(() => this.resetPassword()); + run(() => fn(password)); } } From 139bf7a437e08e0a4ef91ac664de32122c2acf69 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 7 Oct 2020 10:16:40 -0400 Subject: [PATCH 4/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20console.lo?= =?UTF-8?q?g=20statement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form/account/password/change-password/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/core/app/components/form/account/password/change-password/index.js b/ui/core/app/components/form/account/password/change-password/index.js index ba61219ab..e2dcd0bac 100644 --- a/ui/core/app/components/form/account/password/change-password/index.js +++ b/ui/core/app/components/form/account/password/change-password/index.js @@ -55,7 +55,6 @@ export default class FormAccountPasswordChangePasswordIndexComponent extends Com */ @action submit(fn, currentPassword, newPassword) { - console.log(currentPassword, newPassword); run(() => this.resetPasswords()); run(() => fn(currentPassword, newPassword)); } From d1fcab4712dbf7569dae9599f727e239f35263a7 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 7 Oct 2020 10:33:09 -0400 Subject: [PATCH 5/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20cleanup=20tone=20in?= =?UTF-8?q?=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/models/group.js | 4 ---- addons/api/addon/models/role.js | 4 ---- addons/api/addon/models/target.js | 4 ---- addons/api/addon/models/user.js | 4 ---- 4 files changed, 16 deletions(-) diff --git a/addons/api/addon/models/group.js b/addons/api/addon/models/group.js index 4b6535065..59a87a180 100644 --- a/addons/api/addon/models/group.js +++ b/addons/api/addon/models/group.js @@ -46,8 +46,6 @@ export default class GroupModel extends GeneratedGroupModel { memberIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { @@ -71,8 +69,6 @@ export default class GroupModel extends GeneratedGroupModel { memberIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { diff --git a/addons/api/addon/models/role.js b/addons/api/addon/models/role.js index 9e37867ad..adc7778f5 100644 --- a/addons/api/addon/models/role.js +++ b/addons/api/addon/models/role.js @@ -53,8 +53,6 @@ export default class RoleModel extends GeneratedRoleModel { principalIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { @@ -78,8 +76,6 @@ export default class RoleModel extends GeneratedRoleModel { principalIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { diff --git a/addons/api/addon/models/target.js b/addons/api/addon/models/target.js index 086f95f79..c5f80ae4e 100644 --- a/addons/api/addon/models/target.js +++ b/addons/api/addon/models/target.js @@ -52,8 +52,6 @@ export default class TargetModel extends GeneratedTargetModel { hostSetIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { @@ -77,8 +75,6 @@ export default class TargetModel extends GeneratedTargetModel { hostSetIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { diff --git a/addons/api/addon/models/user.js b/addons/api/addon/models/user.js index c2be5cfb0..567ebd81c 100644 --- a/addons/api/addon/models/user.js +++ b/addons/api/addon/models/user.js @@ -33,8 +33,6 @@ export default class UserModel extends GeneratedUserModel { accountIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { @@ -58,8 +56,6 @@ export default class UserModel extends GeneratedUserModel { accountIDs, }; // There is no "deep merge" in ES. - // All of this nonsense is here to ensure we get - // a decent merge of `adapterOptions`. return this.save({ ...options, adapterOptions: { From ce08ae3001785292e2f09c2fe6244a0ea7888a1d Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 7 Oct 2020 10:53:53 -0400 Subject: [PATCH 6/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20empty=20strings=20s?= =?UTF-8?q?hould=20be=20serialized=20as=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/serializers/application.js | 5 ++++- .../tests/unit/serializers/application-test.js | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/api/addon/serializers/application.js b/addons/api/addon/serializers/application.js index 2819231fa..e4531c7fe 100644 --- a/addons/api/addon/serializers/application.js +++ b/addons/api/addon/serializers/application.js @@ -37,8 +37,11 @@ export default class ApplicationSerializer extends RESTSerializer { * @param {String} key * @param {Object} attribute */ - serializeAttribute(snapshot, json, key, { options }) { + serializeAttribute(snapshot, json, key, attribute) { + const { type, options } = attribute; let value = super.serializeAttribute(...arguments); + // Convert empty strings to null. + if (type === 'string' && json[key] === '') json[key] = null; // Do not serialize read-only attributes. if (options.readOnly) delete json[key]; // Version is sent only if it has a non-nullish value diff --git a/addons/api/tests/unit/serializers/application-test.js b/addons/api/tests/unit/serializers/application-test.js index 10de9d4fb..014d80377 100644 --- a/addons/api/tests/unit/serializers/application-test.js +++ b/addons/api/tests/unit/serializers/application-test.js @@ -70,6 +70,21 @@ module('Unit | Serializer | application', function (hooks) { }); }); + test('it serializes empty strings to null', function (assert) { + assert.expect(1); + const store = this.owner.lookup('service:store'); + const record = store.createRecord('user', { + name: '', + description: '', + version: null, + }); + let serializedRecord = record.serialize(); + assert.deepEqual(serializedRecord, { + name: null, + description: null, + }); + }); + test('it serializes non-nullish version fields', function (assert) { assert.expect(2); const store = this.owner.lookup('service:store');