From 161c11b522e8d7e1dade6149521d3abcf8e9f047 Mon Sep 17 00:00:00 2001 From: Yanick Minder <79108296+kcinay055679@users.noreply.github.com> Date: Mon, 27 May 2024 11:34:18 +0200 Subject: [PATCH] Can't edit encryptable after search (#775) * Change method to get all folders of team * Add test for edit credial after search * Update changelog and version --- VERSION | 2 +- frontend/app/components/encryptable/form.js | 20 +++++++------------- public/CHANGELOG.md | 3 +++ spec/system/search_system_spec.rb | 13 +++++++++++++ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/VERSION b/VERSION index d346e2ab7..84197c894 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.3 +5.3.2 diff --git a/frontend/app/components/encryptable/form.js b/frontend/app/components/encryptable/form.js index 9cbc6c522..c6fe764eb 100644 --- a/frontend/app/components/encryptable/form.js +++ b/frontend/app/components/encryptable/form.js @@ -1,13 +1,13 @@ -import {action} from "@ember/object"; +import { action } from "@ember/object"; import AccountValidations from "../../validations/encryptable"; import lookupValidator from "ember-changeset-validations"; import Changeset from "ember-changeset"; -import {inject as service} from "@ember/service"; -import {tracked} from "@glimmer/tracking"; +import { inject as service } from "@ember/service"; +import { tracked } from "@glimmer/tracking"; import BaseFormComponent from "../base-form-component"; -import {isPresent} from "@ember/utils"; -import {capitalize} from "@ember/string"; -import {A} from "@ember/array"; +import { isPresent } from "@ember/utils"; +import { capitalize } from "@ember/string"; +import { A } from "@ember/array"; export default class Form extends BaseFormComponent { @service store; @@ -90,13 +90,7 @@ export default class Form extends BaseFormComponent { } get availableFolders() { - return isPresent(this.selectedTeam) - ? this.store - .peekAll("folder") - .filter( - (folder) => folder.team.get("id") === this.selectedTeam.get("id") - ) - : []; + return this.store.query("folder", { teamId: this.selectedTeam.get("id")}) } @action diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md index 3287018c1..ff184f114 100644 --- a/public/CHANGELOG.md +++ b/public/CHANGELOG.md @@ -1,3 +1,6 @@ +## Version 5.3.2 +- Fix a bug that prevents users from editing a credential after a search. + ## Version 5.3.1 - Fix a bug that prevents users from deleting other users. diff --git a/spec/system/search_system_spec.rb b/spec/system/search_system_spec.rb index 52f07cb22..6398b1001 100644 --- a/spec/system/search_system_spec.rb +++ b/spec/system/search_system_spec.rb @@ -117,4 +117,17 @@ end end + it 'open credentials edit after search' do + login_as_user(:bob) + visit('/') + + credentials1 = encryptables(:credentials1) + + find('pzsh-banner input.search').set credentials1.name + find(".encryptable-row-icons [src$='edit.svg']").click + within '.modal-header' do + expect(page).to have_text('Edit Credentials') + end + end + end