Skip to content

Commit

Permalink
Can't edit encryptable after search (#775)
Browse files Browse the repository at this point in the history
* Change method to get all folders of team

* Add test for edit credial after search

* Update changelog and version
  • Loading branch information
kcinay055679 authored May 27, 2024
1 parent 448b830 commit 161c11b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3
5.3.2
20 changes: 7 additions & 13 deletions frontend/app/components/encryptable/form.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions public/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
13 changes: 13 additions & 0 deletions spec/system/search_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 161c11b

Please sign in to comment.