Rename simple-list component to avoid conflict with core

Rename simple-list component to avoid conflict with core

diff --git a/javascripts/discourse/templates/components/custom-simple-list.hbs b/javascripts/discourse/templates/components/custom-simple-list.hbs
new file mode 100644
index 0000000..b605a59
--- /dev/null
+++ b/javascripts/discourse/templates/components/custom-simple-list.hbs
@@ -0,0 +1,47 @@
+{{#if collection}}
+  <div class='values'>
+    {{#each collection as |value index|}}
+      <div class='value' data-index={{index}}>
+        {{d-button
+          action=(action "removeValue")
+          actionParam=value
+          icon="times"
+          class="remove-value-btn btn-small"
+        }}
+
+        {{input
+          title=value
+          value=value
+          class="value-input"
+          focus-out=(action "changeValue" index)
+        }}
+      </div>
+    {{/each}}
+  </div>
+{{/if}}
+
+<div class="simple-list-input">
+  {{text-field value=newValue
+               placeholderKey=placeholderKey
+               class="add-value-input"
+               autocomplete="discourse"
+               autocorrect="off"
+               autocapitalize="off"}}
+
+  {{#if newValue}}
+    {{d-button
+      action=(action "addValue")
+      actionParam=newValue
+      icon="plus"
+      class="add-value-btn btn-small"
+    }}
+  {{else}}
+    {{#if hasVideoUploader}}
+      {{video-uploader refresh=(action "addUploadUrl")}}
+    {{/if}}
+
+    {{#if hasVTTUploader}}
+      {{vtt-uploader refresh=(action "addUploadUrl")}}
+    {{/if}}
+  {{/if}}
+</div>
\ No newline at end of file
diff --git a/javascripts/discourse/templates/components/custom-simple-list.js.es6 b/javascripts/discourse/templates/components/custom-simple-list.js.es6
new file mode 100644
index 0000000..a873c36
--- /dev/null
+++ b/javascripts/discourse/templates/components/custom-simple-list.js.es6
@@ -0,0 +1,80 @@
+import discourseComputed from "discourse-common/utils/decorators";
+import { makeArray } from "discourse-common/lib/helpers";
+import { empty, reads } from "@ember/object/computed";
+import Component from "@ember/component";
+import { on } from "discourse-common/utils/decorators";
+
+export default Component.extend({
+  classNameBindings: [":value-list"],
+  inputInvalid: empty("newValue"),
+  inputDelimiter: null,
+  newValue: "",
+  collection: null,
+  values: null,
+  placeholderKey: empty("placeholderKey")
+    ? themePrefix("simple_list_placeholder")
+    : reads("placeholderKey"),
+
+  @on("didReceiveAttrs")
+  _setupCollection() {
+    const values = this.values;
+    this.set(
+      "collection",
+      this._splitValues(values, this.inputDelimiter || "\n")
+    );
+  },
+
+  keyUp(e) {
+    if (e.keyCode === 13) {
+      this.send("addValue", this.newValue);
+    }
+  },
+
+  actions: {
+    changeValue(index, newValue) {
+      this._replaceValue(index, newValue);
+    },
+
+    addValue(newValue) {
+      if (this.inputInvalid) return;
+
+      this.set("newValue", null);
+      this._addValue(newValue);
+    },
+
+    removeValue(value) {
+      this._removeValue(value);
+    },
+    addUploadUrl(value) {
+      this.set("newValue", null);
+      this._addValue(value);
+    }
+  },
+
+  _addValue(value) {
+    this.collection.addObject(value);
+    this._saveValues();
+  },
+
+  _removeValue(value) {
+    this.collection.removeObject(value);
+    this._saveValues();
+  },
+
+  _replaceValue(index, newValue) {
+    this.collection.replace(index, 1, [newValue]);
+    this._saveValues();
+  },
+
+  _saveValues() {
+    this.set("values", this.collection.join(this.inputDelimiter || "\n"));
+  },
+
+  _splitValues(values, delimiter) {
+    if (values && values.length) {
+      return values.split(delimiter).filter(x => x);
+    } else {
+      return [];
+    }
+  }
+});
diff --git a/javascripts/discourse/templates/components/simple-list.hbs b/javascripts/discourse/templates/components/simple-list.hbs
deleted file mode 100644
index b605a59..0000000
--- a/javascripts/discourse/templates/components/simple-list.hbs
+++ /dev/null
@@ -1,47 +0,0 @@
-{{#if collection}}
-  <div class='values'>
-    {{#each collection as |value index|}}
-      <div class='value' data-index={{index}}>
-        {{d-button
-          action=(action "removeValue")
-          actionParam=value
-          icon="times"
-          class="remove-value-btn btn-small"
-        }}
-
-        {{input
-          title=value
-          value=value
-          class="value-input"
-          focus-out=(action "changeValue" index)
-        }}
-      </div>
-    {{/each}}
-  </div>
-{{/if}}
-
-<div class="simple-list-input">
-  {{text-field value=newValue
-               placeholderKey=placeholderKey
-               class="add-value-input"
-               autocomplete="discourse"
-               autocorrect="off"
-               autocapitalize="off"}}
-
-  {{#if newValue}}
-    {{d-button
-      action=(action "addValue")
-      actionParam=newValue
-      icon="plus"
-      class="add-value-btn btn-small"
-    }}
-  {{else}}
-    {{#if hasVideoUploader}}
-      {{video-uploader refresh=(action "addUploadUrl")}}
-    {{/if}}
-
-    {{#if hasVTTUploader}}
-      {{vtt-uploader refresh=(action "addUploadUrl")}}
-    {{/if}}
-  {{/if}}
-</div>
\ No newline at end of file
diff --git a/javascripts/discourse/templates/components/simple-list.js.es6 b/javascripts/discourse/templates/components/simple-list.js.es6
deleted file mode 100644
index a873c36..0000000
--- a/javascripts/discourse/templates/components/simple-list.js.es6
+++ /dev/null
@@ -1,80 +0,0 @@
-import discourseComputed from "discourse-common/utils/decorators";
-import { makeArray } from "discourse-common/lib/helpers";
-import { empty, reads } from "@ember/object/computed";
-import Component from "@ember/component";
-import { on } from "discourse-common/utils/decorators";
-
-export default Component.extend({
-  classNameBindings: [":value-list"],
-  inputInvalid: empty("newValue"),
-  inputDelimiter: null,
-  newValue: "",
-  collection: null,
-  values: null,
-  placeholderKey: empty("placeholderKey")
-    ? themePrefix("simple_list_placeholder")
-    : reads("placeholderKey"),
-
-  @on("didReceiveAttrs")
-  _setupCollection() {
-    const values = this.values;
-    this.set(
-      "collection",
-      this._splitValues(values, this.inputDelimiter || "\n")
-    );
-  },
-
-  keyUp(e) {
-    if (e.keyCode === 13) {
-      this.send("addValue", this.newValue);
-    }
-  },
-
-  actions: {
-    changeValue(index, newValue) {
-      this._replaceValue(index, newValue);
-    },
-
-    addValue(newValue) {
-      if (this.inputInvalid) return;
-
-      this.set("newValue", null);
-      this._addValue(newValue);
-    },
-
-    removeValue(value) {
-      this._removeValue(value);
-    },
-    addUploadUrl(value) {
-      this.set("newValue", null);
-      this._addValue(value);
-    }
-  },
-
-  _addValue(value) {
-    this.collection.addObject(value);
-    this._saveValues();
-  },
-
-  _removeValue(value) {
-    this.collection.removeObject(value);
-    this._saveValues();
-  },
-
-  _replaceValue(index, newValue) {
-    this.collection.replace(index, 1, [newValue]);
-    this._saveValues();
-  },
-
-  _saveValues() {
-    this.set("values", this.collection.join(this.inputDelimiter || "\n"));
-  },
-
-  _splitValues(values, delimiter) {
-    if (values && values.length) {
-      return values.split(delimiter).filter(x => x);
-    } else {
-      return [];
-    }
-  }
-});
diff --git a/javascripts/discourse/templates/modal/insert-video.hbs b/javascripts/discourse/templates/modal/insert-video.hbs
index 5c23a2d..6e1aec8 100644
--- a/javascripts/discourse/templates/modal/insert-video.hbs
+++ b/javascripts/discourse/templates/modal/insert-video.hbs
@@ -4,7 +4,7 @@
       {{theme-i18n "modal.video_title"}}
     </label>
 
-    {{simple-list
+    {{custom-simple-list
       values=sources
       hasVideoUploader=true
     }}
@@ -23,7 +23,7 @@
       {{theme-i18n "modal.vtt_title"}}
     </label>
 
-    {{simple-list
+    {{custom-simple-list
       values=tracks

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

GitHub sha: 8b41f5f9e8c10498f8c63d180103c97d965cc0aa