From 1b367925e3d11215410f10ad4eb2f5bc18e934c0 Mon Sep 17 00:00:00 2001 From: Yanick Minder Date: Mon, 24 Jun 2024 14:13:40 +0200 Subject: [PATCH 1/3] set current folder in navservice --- frontend/app/components/folder/show.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/app/components/folder/show.js b/frontend/app/components/folder/show.js index 1f91cf27d..ddcfbb3f4 100644 --- a/frontend/app/components/folder/show.js +++ b/frontend/app/components/folder/show.js @@ -37,6 +37,7 @@ export default class ShowComponent extends Component { @action toggleEncryptableCredentialCreating() { + this.navService.selectedFolder = this.args.folder; this.isNewEncryptableCredential = !this.isNewEncryptableCredential; } From 86a15c987c3b00d1809fb3db595730968d29a35d Mon Sep 17 00:00:00 2001 From: Yanick Minder Date: Mon, 24 Jun 2024 16:32:12 +0200 Subject: [PATCH 2/3] add tests for preset and update changelog --- .../components/encryptable/form-test.js | 49 +++++++++++++++++-- public/CHANGELOG.md | 3 ++ 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/frontend/tests/integration/components/encryptable/form-test.js b/frontend/tests/integration/components/encryptable/form-test.js index 942d654b5..04267290f 100644 --- a/frontend/tests/integration/components/encryptable/form-test.js +++ b/frontend/tests/integration/components/encryptable/form-test.js @@ -28,8 +28,26 @@ const navServiceStub = Service.extend({ return 2; } } - ] + ], /* eslint-enable ember/avoid-leaking-state-in-ember-objects */ + selectedFolder: { + id: 1, + name: "bbt", + teamId: 1, + team: { + id: 1, + name: "bbteam", + get() { + return 1; + } + }, + get(property) { + if (property === "team") { + return this.team; + } + return this[property]; + } + } }); const userServiceStub = Service.extend({ @@ -115,7 +133,7 @@ module("Integration | Component | encryptable/form", function (hooks) { this.element .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), - "Team Select a Team" + "Team bbteam" ); await selectChoose( @@ -179,7 +197,7 @@ module("Integration | Component | encryptable/form", function (hooks) { this.element .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), - "Team Wähle ein Team aus" + "Team bbteam" ); await selectChoose( @@ -243,7 +261,7 @@ module("Integration | Component | encryptable/form", function (hooks) { this.element .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), - "Team Wähl äs Team us" + "Team bbteam" ); await selectChoose( @@ -314,7 +332,7 @@ module("Integration | Component | encryptable/form", function (hooks) { this.element .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), - "Équipe Choisissez une équipe" + "Équipe bbteam" ); await selectChoose( @@ -543,4 +561,25 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.ok(this.element.textContent.trim().includes("Team")); assert.ok(this.element.textContent.trim().includes("bob")); }); + + + test("Check prefill of team and folder", async function (assert) { + setLocale("en"); + + await render(hbs``); + + assert.equal( + this.element + .querySelector("#team-power-select .ember-power-select-selected-item") + .innerText.replace(/\s+/g, " "), + "bbteam" + ); + + assert.equal( + this.element + .querySelector("#folder-power-select .ember-power-select-selected-item") + .innerText.replace(/\s+/g, " "), + "bbt" + ); + }); }); diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md index 15e7beb87..aa0af09e8 100644 --- a/public/CHANGELOG.md +++ b/public/CHANGELOG.md @@ -1,3 +1,6 @@ +## Version 5.3.4 +- Team and folder are now preset after user search. + ## Version 5.3.4 - Fix a bug that prevents users from editing a credential after a search. From 093622d3779eb143b74a89f5bdae78cf0a5acd50 Mon Sep 17 00:00:00 2001 From: Mountain Star <655627+mtnstar@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:43:22 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- public/CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md index aa0af09e8..15e7beb87 100644 --- a/public/CHANGELOG.md +++ b/public/CHANGELOG.md @@ -1,6 +1,3 @@ -## Version 5.3.4 -- Team and folder are now preset after user search. - ## Version 5.3.4 - Fix a bug that prevents users from editing a credential after a search.