DEV: address PR feedback
This commit is contained in:
parent
e9f6566474
commit
fd6bfdc082
|
@ -26,7 +26,7 @@
|
||||||
{{#if n.can_delete}}
|
{{#if n.can_delete}}
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<DButton
|
<DButton
|
||||||
@action={{(fn this.removeNote n)}}
|
@action={{fn this.removeNote n}}
|
||||||
@icon="far-trash-alt"
|
@icon="far-trash-alt"
|
||||||
@class="btn-small btn-danger"
|
@class="btn-small btn-danger"
|
||||||
@title="user_notes.remove"
|
@title="user_notes.remove"
|
||||||
|
|
|
@ -10,17 +10,11 @@ export default class UserNotesModal extends Component {
|
||||||
@service store;
|
@service store;
|
||||||
|
|
||||||
@tracked newNote;
|
@tracked newNote;
|
||||||
@tracked userId;
|
@tracked userId = this.args.model.userId;
|
||||||
@tracked saving = false;
|
@tracked saving = false;
|
||||||
postId;
|
postId = this.args.model.postId;
|
||||||
callback;
|
callback = this.args.model.callback;
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super(...arguments);
|
|
||||||
this.userId = this.args.model.userId;
|
|
||||||
this.callback = this.args.model.callback;
|
|
||||||
this.postId = this.args.model.postId;
|
|
||||||
}
|
|
||||||
#refreshCount() {
|
#refreshCount() {
|
||||||
if (this.callback) {
|
if (this.callback) {
|
||||||
this.callback(this.args.model.note.length);
|
this.callback(this.args.model.note.length);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<DButton
|
<DButton
|
||||||
@class="btn btn-default show-user-notes-btn"
|
class="btn-default show-user-notes-btn"
|
||||||
@action={{@show}}
|
@action={{@show}}
|
||||||
@icon="pencil-alt"
|
@icon="pencil-alt"
|
||||||
@translatedLabel={{this.label}}
|
@translatedLabel={{this.label}}
|
||||||
|
|
|
@ -41,15 +41,15 @@ acceptance("User Notes", function (needs) {
|
||||||
test("creates note from user's profile", async function (assert) {
|
test("creates note from user's profile", async function (assert) {
|
||||||
await visit("/admin/users/1/eviltrout");
|
await visit("/admin/users/1/eviltrout");
|
||||||
|
|
||||||
const modalClass = ".user-notes-modal .d-modal__container";
|
const modalClass = ".user-notes-modal";
|
||||||
assert
|
assert
|
||||||
.dom(".user-controls .show-user-notes-btn")
|
.dom(".user-controls .show-user-notes-btn")
|
||||||
.hasText(I18n.t("user_notes.title"));
|
.hasText(I18n.t("user_notes.title"));
|
||||||
assert.dom(modalClass).isNotVisible();
|
assert.dom(modalClass).doesNotExist();
|
||||||
|
|
||||||
await click(".user-controls .show-user-notes-btn");
|
await click(".user-controls .show-user-notes-btn");
|
||||||
|
|
||||||
assert.dom(modalClass).isVisible();
|
assert.dom(modalClass).exists();
|
||||||
|
|
||||||
await fillIn(`${modalClass} textarea`, "Helpful user");
|
await fillIn(`${modalClass} textarea`, "Helpful user");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue