DEV: Rename files, functions and DB entries plus two small fixes

DEV: Rename files, functions and DB entries plus two small fixes

  1. Shows the full list of notes for a user in the admin report (instead of just the first note).

  2. Fixes a UI-only warning when adding or removing a note from the user card.

diff --git a/assets/javascripts/discourse-staff-notes/connectors/admin-user-controls-after/add-staff-notes-button.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/admin-user-controls-after/add-staff-notes-button.js.es6
deleted file mode 100644
index c7bce70..0000000
--- a/assets/javascripts/discourse-staff-notes/connectors/admin-user-controls-after/add-staff-notes-button.js.es6
+++ /dev/null
@@ -1,4 +0,0 @@
-import connector from "discourse/plugins/discourse-user-notes/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile";
-
-// Same as other connector
-export default connector;
diff --git a/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6
deleted file mode 100644
index 125534f..0000000
--- a/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6
+++ /dev/null
@@ -1,26 +0,0 @@
-import { showStaffNotes } from "discourse/plugins/discourse-user-notes/discourse-staff-notes/lib/staff-notes";
-import { getOwner } from "discourse-common/lib/get-owner";
-
-export default {
-  shouldRender(args, component) {
-    return component.siteSettings.user_notes_enabled;
-  },
-
-  setupComponent(args, component) {
-    let model = args.flaggedPost.get("user");
-    component.set(
-      "staffNotesCount",
-      model.get("custom_fields.staff_notes_count") || 0
-    );
-  },
-
-  actions: {
-    showStaffNotes() {
-      const store = getOwner(this).lookup("store:main");
-      const user = this.get("args.flaggedPost.user");
-      showStaffNotes(store, user.get("id"), count =>
-        this.set("staffNotesCount", count)
-      );
-    }
-  }
-};
diff --git a/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6
deleted file mode 100644
index 1356bc2..0000000
--- a/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6
+++ /dev/null
@@ -1,34 +0,0 @@
-import { showStaffNotes } from "discourse/plugins/discourse-user-notes/discourse-staff-notes/lib/staff-notes";
-import { getOwner } from "discourse-common/lib/get-owner";
-import { emojiUrlFor } from "discourse/lib/text";
-
-export default {
-  shouldRender(args, component) {
-    const { siteSettings, currentUser } = component;
-    return siteSettings.user_notes_enabled && currentUser && currentUser.staff;
-  },
-
-  setupComponent(args, component) {
-    const { user } = args;
-    const count =
-      user.get("staff_notes_count") ||
-      user.get("custom_fields.staff_notes_count") ||
-      0;
-    component.set("staffNotesCount", count);
-    component.set("emojiEnabled", component.siteSettings.enable_emoji);
-    component.set("emojiUrl", emojiUrlFor("pencil"));
-    component.set("user", user);
-    component.set("staffNotesTitle", I18n.t("staff_notes.show", { count }));
-  },
-
-  actions: {
-    showStaffNotes() {
-      this.parentView.parentView._close();
-      const store = getOwner(this).lookup("store:main");
-      const user = this.get("args.user");
-      showStaffNotes(store, user.get("id"), count =>
-        this.set("staffNotesCount", count)
-      );
-    }
-  }
-};
diff --git a/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6
deleted file mode 100644
index 27e4a9c..0000000
--- a/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6
+++ /dev/null
@@ -1,29 +0,0 @@
-import { showStaffNotes } from "discourse/plugins/discourse-user-notes/discourse-staff-notes/lib/staff-notes";
-import { getOwner } from "discourse-common/lib/get-owner";
-
-export default {
-  shouldRender(args, component) {
-    const { siteSettings, currentUser } = component;
-    return siteSettings.user_notes_enabled && currentUser && currentUser.staff;
-  },
-
-  setupComponent(args, component) {
-    const { model } = args;
-    component.set(
-      "staffNotesCount",
-      model.get("staff_notes_count") ||
-        model.get("custom_fields.staff_notes_count") ||
-        0
-    );
-  },
-
-  actions: {
-    showStaffNotes() {
-      const store = getOwner(this).lookup("store:main");
-      const user = this.get("args.model");
-      showStaffNotes(store, user.get("id"), count =>
-        this.set("staffNotesCount", count)
-      );
-    }
-  }
-};
diff --git a/assets/javascripts/discourse-staff-notes/lib/staff-notes.js.es6 b/assets/javascripts/discourse-staff-notes/lib/staff-notes.js.es6
deleted file mode 100644
index 59d75c5..0000000
--- a/assets/javascripts/discourse-staff-notes/lib/staff-notes.js.es6
+++ /dev/null
@@ -1,21 +0,0 @@
-import showModal from "discourse/lib/show-modal";
-import loadScript from "discourse/lib/load-script";
-
-export function showStaffNotes(store, userId, callback, opts) {
-  opts = opts || {};
-
-  return loadScript("defer/html-sanitizer-bundle").then(() => {
-    return store.find("staff-note", { user_id: userId }).then(model => {
-      const controller = showModal("staff-notes", {
-        model,
-        title: "staff_notes.title",
-        addModalBodyView: true
-      });
-      controller.reset();
-      controller.set("userId", userId);
-      controller.set("callback", callback);
-      controller.set("postId", opts.postId);
-      return controller;
-    });
-  });
-}
diff --git a/assets/javascripts/discourse-staff-notes/templates/connectors/admin-user-controls-after/add-staff-notes-button.hbs b/assets/javascripts/discourse-staff-notes/templates/connectors/admin-user-controls-after/add-staff-notes-button.hbs
deleted file mode 100644
index 15c8b7b..0000000
--- a/assets/javascripts/discourse-staff-notes/templates/connectors/admin-user-controls-after/add-staff-notes-button.hbs
+++ /dev/null
@@ -1 +0,0 @@
-{{show-staff-notes show="showStaffNotes" count=staffNotesCount}}
diff --git a/assets/javascripts/discourse-staff-notes/templates/connectors/flagged-post-controls/show-staff-notes-on-flags.hbs b/assets/javascripts/discourse-staff-notes/templates/connectors/flagged-post-controls/show-staff-notes-on-flags.hbs
deleted file mode 100644
index b04de64..0000000
--- a/assets/javascripts/discourse-staff-notes/templates/connectors/flagged-post-controls/show-staff-notes-on-flags.hbs
+++ /dev/null
@@ -1,3 +0,0 @@
-{{#if staffNotesCount}}
-  {{show-staff-notes show="showStaffNotes" count=staffNotesCount}}
-{{/if}}
diff --git a/assets/javascripts/discourse-staff-notes/templates/connectors/user-card-post-names/show-staff-notes-on-card.hbs b/assets/javascripts/discourse-staff-notes/templates/connectors/user-card-post-names/show-staff-notes-on-card.hbs
deleted file mode 100644
index 3243569..0000000
--- a/assets/javascripts/discourse-staff-notes/templates/connectors/user-card-post-names/show-staff-notes-on-card.hbs
+++ /dev/null
@@ -1,9 +0,0 @@
-{{#if staffNotesCount}}
-  <a href {{action "showStaffNotes"}} title="{{staffNotesTitle}}">
-    {{#if emojiEnabled}}
-      <img src={{emojiUrl}} title={{staffNotesTitle}} alt="pencil" class="emoji">
-    {{else}}
-      {{d-icon "sticky-note"}}
-    {{/if}}
-  </a>
-{{/if}}
diff --git a/assets/javascripts/discourse-staff-notes/templates/connectors/user-profile-controls/show-notes-on-profile.hbs b/assets/javascripts/discourse-staff-notes/templates/connectors/user-profile-controls/show-notes-on-profile.hbs
deleted file mode 100644
index fa4c53d..0000000
--- a/assets/javascripts/discourse-staff-notes/templates/connectors/user-profile-controls/show-notes-on-profile.hbs
+++ /dev/null
@@ -1 +0,0 @@
-<li>{{show-staff-notes show="showStaffNotes" count=staffNotesCount}}</li>

[... diff too long, it was truncated ...]

GitHub sha: 03366e34