DEV: address PR feedback

This commit is contained in:
Kelvin Tan 2023-11-23 12:26:24 +08:00
parent e9f6566474
commit fd6bfdc082
No known key found for this signature in database
GPG Key ID: 49C85DCE965C53EF
4 changed files with 8 additions and 14 deletions

View File

@ -26,7 +26,7 @@
{{#if n.can_delete}}
<span class="controls">
<DButton
@action={{(fn this.removeNote n)}}
@action={{fn this.removeNote n}}
@icon="far-trash-alt"
@class="btn-small btn-danger"
@title="user_notes.remove"

View File

@ -10,17 +10,11 @@ export default class UserNotesModal extends Component {
@service store;
@tracked newNote;
@tracked userId;
@tracked userId = this.args.model.userId;
@tracked saving = false;
postId;
callback;
postId = this.args.model.postId;
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() {
if (this.callback) {
this.callback(this.args.model.note.length);

View File

@ -1,5 +1,5 @@
<DButton
@class="btn btn-default show-user-notes-btn"
class="btn-default show-user-notes-btn"
@action={{@show}}
@icon="pencil-alt"
@translatedLabel={{this.label}}

View File

@ -41,15 +41,15 @@ acceptance("User Notes", function (needs) {
test("creates note from user's profile", async function (assert) {
await visit("/admin/users/1/eviltrout");
const modalClass = ".user-notes-modal .d-modal__container";
const modalClass = ".user-notes-modal";
assert
.dom(".user-controls .show-user-notes-btn")
.hasText(I18n.t("user_notes.title"));
assert.dom(modalClass).isNotVisible();
assert.dom(modalClass).doesNotExist();
await click(".user-controls .show-user-notes-btn");
assert.dom(modalClass).isVisible();
assert.dom(modalClass).exists();
await fillIn(`${modalClass} textarea`, "Helpful user");