FIX: rename events-calendar to upcoming-events-calendar

FIX: rename events-calendar to upcoming-events-calendar

This was causing a name clashing with discourse-envets.

diff --git a/assets/javascripts/discourse/components/events-calendar.js.es6 b/assets/javascripts/discourse/components/events-calendar.js.es6
deleted file mode 100644
index a16a6f3..0000000
--- a/assets/javascripts/discourse/components/events-calendar.js.es6
+++ /dev/null
@@ -1,77 +0,0 @@
-import { Promise } from "rsvp";
-import { isNotFullDayEvent } from "discourse/plugins/discourse-calendar/lib/guess-best-date-format";
-import { formatEventName } from "discourse/plugins/discourse-calendar/helpers/format-event-name";
-import loadScript from "discourse/lib/load-script";
-import Component from "@ember/component";
-import { schedule } from "@ember/runloop";
-
-export default Component.extend({
-  tagName: "",
-  events: null,
-
-  init() {
-    this._super(...arguments);
-
-    this._calendar = null;
-  },
-
-  willDestroyElement() {
-    this._super(...arguments);
-
-    this._calendar && this._calendar.destroy();
-    this._calendar = null;
-  },
-
-  didInsertElement() {
-    this._super(...arguments);
-
-    this._loadCalendar().then(() => {
-      const calendarNode = document.getElementById("events-calendar");
-
-      if (calendarNode) {
-        this._calendar = new window.FullCalendar.Calendar(calendarNode, {});
-      }
-    });
-  },
-
-  didReceiveAttrs() {
-    this._super(...arguments);
-
-    this._renderCalendar();
-  },
-
-  _renderCalendar() {
-    if (!this._calendar) {
-      return;
-    }
-
-    (this.events || []).forEach(event => {
-      const { starts_at, ends_at, post } = event;
-      this._calendar.addEvent({
-        title: formatEventName(event),
-        start: starts_at,
-        end: ends_at || starts_at,
-        allDay: !isNotFullDayEvent(moment(starts_at), moment(ends_at)),
-        url: Discourse.getURL(`/t/-/${post.topic.id}/${post.post_number}`)
-      });
-    });
-
-    this._calendar.render();
-  },
-
-  _loadCalendar() {
-    return new Promise(resolve => {
-      loadScript(
-        "/plugins/discourse-calendar/javascripts/fullcalendar-with-moment-timezone.min.js"
-      ).then(() => {
-        schedule("afterRender", () => {
-          if (this.isDestroying || this.isDestroyed) {
-            return;
-          }
-
-          resolve();
-        });
-      });
-    });
-  }
-});
diff --git a/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6 b/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6
new file mode 100644
index 0000000..7825768
--- /dev/null
+++ b/assets/javascripts/discourse/components/upcoming-events-calendar.js.es6
@@ -0,0 +1,77 @@
+import { Promise } from "rsvp";
+import { isNotFullDayEvent } from "discourse/plugins/discourse-calendar/lib/guess-best-date-format";
+import { formatEventName } from "discourse/plugins/discourse-calendar/helpers/format-event-name";
+import loadScript from "discourse/lib/load-script";
+import Component from "@ember/component";
+import { schedule } from "@ember/runloop";
+
+export default Component.extend({
+  tagName: "",
+  events: null,
+
+  init() {
+    this._super(...arguments);
+
+    this._calendar = null;
+  },
+
+  willDestroyElement() {
+    this._super(...arguments);
+
+    this._calendar && this._calendar.destroy();
+    this._calendar = null;
+  },
+
+  didInsertElement() {
+    this._super(...arguments);
+
+    this._loadCalendar().then(() => {
+      const calendarNode = document.getElementById("upcoming-events-calendar");
+
+      if (calendarNode) {
+        this._calendar = new window.FullCalendar.Calendar(calendarNode, {});
+      }
+    });
+  },
+
+  didReceiveAttrs() {
+    this._super(...arguments);
+
+    this._renderCalendar();
+  },
+
+  _renderCalendar() {
+    if (!this._calendar) {
+      return;
+    }
+
+    (this.events || []).forEach(event => {
+      const { starts_at, ends_at, post } = event;
+      this._calendar.addEvent({
+        title: formatEventName(event),
+        start: starts_at,
+        end: ends_at || starts_at,
+        allDay: !isNotFullDayEvent(moment(starts_at), moment(ends_at)),
+        url: Discourse.getURL(`/t/-/${post.topic.id}/${post.post_number}`)
+      });
+    });
+
+    this._calendar.render();
+  },
+
+  _loadCalendar() {
+    return new Promise(resolve => {
+      loadScript(
+        "/plugins/discourse-calendar/javascripts/fullcalendar-with-moment-timezone.min.js"
+      ).then(() => {
+        schedule("afterRender", () => {
+          if (this.isDestroying || this.isDestroyed) {
+            return;
+          }
+
+          resolve();
+        });
+      });
+    });
+  }
+});
diff --git a/assets/javascripts/discourse/templates/components/events-calendar.hbs b/assets/javascripts/discourse/templates/components/events-calendar.hbs
deleted file mode 100644
index 207feef..0000000
--- a/assets/javascripts/discourse/templates/components/events-calendar.hbs
+++ /dev/null
@@ -1 +0,0 @@
-<div id="events-calendar"></div>
diff --git a/assets/javascripts/discourse/templates/components/upcoming-events-calendar.hbs b/assets/javascripts/discourse/templates/components/upcoming-events-calendar.hbs
new file mode 100644
index 0000000..7ae9ae1
--- /dev/null
+++ b/assets/javascripts/discourse/templates/components/upcoming-events-calendar.hbs
@@ -0,0 +1 @@
+<div id="upcoming-events-calendar"></div>
diff --git a/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs b/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs
index 24c80cc..057a4d2 100644
--- a/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs
+++ b/assets/javascripts/discourse/templates/discourse-post-event-upcoming-events-index.hbs
@@ -1,3 +1,3 @@
 <div class="discourse-post-event-upcoming-events">
-  {{events-calendar events=events}}
+  {{upcoming-events-calendar events=events}}
 </div>
diff --git a/assets/stylesheets/common/events-calendar.scss b/assets/stylesheets/common/events-calendar.scss
deleted file mode 100644
index 0f22533..0000000
--- a/assets/stylesheets/common/events-calendar.scss
+++ /dev/null
@@ -1,132 +0,0 @@
-#events-calendar {
-  &.fc-unthemed {
-    tbody,
-    thead,
-    tr {
-      border: none;
-    }
-
-    .fc-basic-view .fc-day-top .fc-day-number {
-      float: left;
-    }
-
-    .fc-bg td.fc-today {
-      background-color: $highlight-medium;
-      border-style: solid;
-    }
-
-    .fc-month-view .fc-widget-content,
-    .fc-basicWeek-view .fc-widget-content,
-    .fc-head-container {
-      padding: 0;
-    }
-
-    .fc-bg tbody {
-      border-width: 0;
-    }
-
-    .fc-header-toolbar {
-      margin: 1em 0 0.5em 0;
-    }
-
-    .fc-title {
-      // TODO: use @include ellipsis after stable is 2.4+
-      overflow: hidden;
-      white-space: nowrap;
-      text-overflow: ellipsis;
-
-      display: block;
-    }
-
-    .fc-widget-header span {
-      padding: 3px 3px 3px 0.5em;
-    }
-
-    .fc-center {
-      display: none;
-    }
-
-    .fc-button {
-      border-radius: 0;
-      box-shadow: none;
-      background: $primary-low;
-      text-transform: capitalize;
-      color: $primary;
-      text-shadow: none;
-      border: none;
-
-      padding: 6px 12px;
-
-      &:hover {
-        background: $primary-medium;
-        color: $secondary;
-      }
-
-      &.fc-state-active {
-        background: $tertiary;
-        color: $secondary;
-      }
-      margin: 0.3em 0 0.3em 0.5em;
-    }
-
-    .fc-button-group {
-      margin: 0.3em 0 0.3em 0.5em;
-      // margin-right: 0;
-      .fc-button {
-        margin: 0;
-      }
-    }
-
-    .fc-divider,
-    .fc-list-empty,
-    .fc-list-heading td,
-    .fc-popover .fc-header {
-      background: $primary-low;
-    }
-
-    .fc-content,
-    .fc-divider,
-    .fc-list-heading td,
-    .fc-list-view,
-    .fc-popover,
-    .fc-row,
-    tbody,
-    td,
-    th,
-    thead {
-      border-color: $primary-low;
-    }
-  }
-
-  .fc-event,
-  .fc-event-dot {
-    color: $secondary;
-    background-color: $tertiary;

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

GitHub sha: fdabeb07