mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This reverts commit 8b426431a4.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { observes, on } from "discourse-common/utils/decorators";
|
||||
import Component from "@ember/component";
|
||||
import I18n from "I18n";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { scheduleOnce } from "@ember/runloop";
|
||||
|
||||
export default Component.extend({
|
||||
@@ -33,7 +33,9 @@ export default Component.extend({
|
||||
}
|
||||
},
|
||||
|
||||
_updateFormattedLogsFunc: function () {
|
||||
@on("init")
|
||||
@observes("logs.[]")
|
||||
_updateFormattedLogs: discourseDebounce(function () {
|
||||
const logs = this.logs;
|
||||
if (logs.length === 0) {
|
||||
return;
|
||||
@@ -55,13 +57,7 @@ export default Component.extend({
|
||||
this.renderLogs();
|
||||
|
||||
scheduleOnce("afterRender", this, this._scrollDown);
|
||||
},
|
||||
|
||||
@on("init")
|
||||
@observes("logs.[]")
|
||||
_updateFormattedLogs() {
|
||||
discourseDebounce(this, this._updateFormattedLogsFunc, 150);
|
||||
},
|
||||
}, 150),
|
||||
|
||||
renderLogs() {
|
||||
const formattedLogs = this.formattedLogs;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { debounce, schedule } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { number } from "discourse/lib/formatter";
|
||||
import { schedule } from "@ember/runloop";
|
||||
|
||||
export default Component.extend({
|
||||
classNames: ["admin-report-chart"],
|
||||
@@ -15,7 +14,7 @@ export default Component.extend({
|
||||
this._super(...arguments);
|
||||
|
||||
this.resizeHandler = () =>
|
||||
discourseDebounce(this, this._scheduleChartRendering, 500);
|
||||
debounce(this, this._scheduleChartRendering, 500);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
@@ -35,7 +34,7 @@ export default Component.extend({
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
discourseDebounce(this, this._scheduleChartRendering, 100);
|
||||
debounce(this, this._scheduleChartRendering, 100);
|
||||
},
|
||||
|
||||
_scheduleChartRendering() {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { debounce, schedule } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { number } from "discourse/lib/formatter";
|
||||
import { schedule } from "@ember/runloop";
|
||||
|
||||
export default Component.extend({
|
||||
classNames: ["admin-report-chart", "admin-report-stacked-chart"],
|
||||
@@ -12,7 +11,7 @@ export default Component.extend({
|
||||
this._super(...arguments);
|
||||
|
||||
this.resizeHandler = () =>
|
||||
discourseDebounce(this, this._scheduleChartRendering, 500);
|
||||
debounce(this, this._scheduleChartRendering, 500);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
@@ -32,7 +31,7 @@ export default Component.extend({
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
discourseDebounce(this, this._scheduleChartRendering, 100);
|
||||
debounce(this, this._scheduleChartRendering, 100);
|
||||
},
|
||||
|
||||
_scheduleChartRendering() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Controller from "@ember/controller";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import { debounce } from "@ember/runloop";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
|
||||
const { get } = Ember;
|
||||
|
||||
@@ -34,7 +34,7 @@ export default Controller.extend({
|
||||
|
||||
actions: {
|
||||
filterReports(filter) {
|
||||
discourseDebounce(this, this._performFiltering, filter, INPUT_DELAY);
|
||||
debounce(this, this._performFiltering, filter, INPUT_DELAY);
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
export default AdminEmailLogsController.extend({
|
||||
@observes("filter.{status,user,address,type}")
|
||||
filterEmailLogs() {
|
||||
discourseDebounce(this, this.loadLogs, INPUT_DELAY);
|
||||
},
|
||||
filterEmailLogs: discourseDebounce(function () {
|
||||
this.loadLogs();
|
||||
}, INPUT_DELAY),
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import IncomingEmail from "admin/models/incoming-email";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
export default AdminEmailLogsController.extend({
|
||||
@observes("filter.{status,from,to,subject}")
|
||||
filterIncomingEmails() {
|
||||
discourseDebounce(this, this.loadLogs, IncomingEmail, INPUT_DELAY);
|
||||
},
|
||||
filterIncomingEmails: discourseDebounce(function () {
|
||||
this.loadLogs(IncomingEmail);
|
||||
}, INPUT_DELAY),
|
||||
|
||||
actions: {
|
||||
loadMore() {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import IncomingEmail from "admin/models/incoming-email";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
export default AdminEmailLogsController.extend({
|
||||
@observes("filter.{status,from,to,subject,error}")
|
||||
filterIncomingEmails() {
|
||||
discourseDebounce(this, this.loadLogs, IncomingEmail, INPUT_DELAY);
|
||||
},
|
||||
filterIncomingEmails: discourseDebounce(function () {
|
||||
this.loadLogs(IncomingEmail);
|
||||
}, INPUT_DELAY),
|
||||
|
||||
actions: {
|
||||
loadMore() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
export default AdminEmailLogsController.extend({
|
||||
@observes("filter.{status,user,address,type,reply_key}")
|
||||
filterEmailLogs() {
|
||||
discourseDebounce(this, this.loadLogs, INPUT_DELAY);
|
||||
},
|
||||
filterEmailLogs: discourseDebounce(function () {
|
||||
this.loadLogs();
|
||||
}, INPUT_DELAY),
|
||||
});
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
export default AdminEmailLogsController.extend({
|
||||
@observes("filter.{status,user,address,type}")
|
||||
filterEmailLogs() {
|
||||
discourseDebounce(this, this.loadLogs, INPUT_DELAY);
|
||||
},
|
||||
filterEmailLogs: discourseDebounce(function () {
|
||||
this.loadLogs();
|
||||
}, INPUT_DELAY),
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ import I18n from "I18n";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import ScreenedIpAddress from "admin/models/screened-ip-address";
|
||||
import bootbox from "bootbox";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { exportEntity } from "discourse/lib/export-csv";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
import { outputExportResult } from "discourse/lib/export-result";
|
||||
@@ -13,17 +13,13 @@ export default Controller.extend({
|
||||
filter: null,
|
||||
savedIpAddress: null,
|
||||
|
||||
_debouncedShow() {
|
||||
@observes("filter")
|
||||
show: discourseDebounce(function () {
|
||||
this.set("loading", true);
|
||||
ScreenedIpAddress.findAll(this.filter).then((result) => {
|
||||
this.setProperties({ model: result, loading: false });
|
||||
});
|
||||
},
|
||||
|
||||
@observes("filter")
|
||||
show() {
|
||||
discourseDebounce(this, this._debouncedShow, INPUT_DELAY);
|
||||
},
|
||||
}, INPUT_DELAY),
|
||||
|
||||
actions: {
|
||||
allow(record) {
|
||||
|
||||
@@ -3,24 +3,20 @@ import I18n from "I18n";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import Permalink from "admin/models/permalink";
|
||||
import bootbox from "bootbox";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
export default Controller.extend({
|
||||
loading: false,
|
||||
filter: null,
|
||||
|
||||
_debouncedShow() {
|
||||
@observes("filter")
|
||||
show: discourseDebounce(function () {
|
||||
Permalink.findAll(this.filter).then((result) => {
|
||||
this.set("model", result);
|
||||
this.set("loading", false);
|
||||
});
|
||||
},
|
||||
|
||||
@observes("filter")
|
||||
show() {
|
||||
discourseDebounce(this, this._debouncedShow, INPUT_DELAY);
|
||||
},
|
||||
}, INPUT_DELAY),
|
||||
|
||||
actions: {
|
||||
recordAdded(arg) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import Controller from "@ember/controller";
|
||||
import I18n from "I18n";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
@@ -112,19 +112,13 @@ export default Controller.extend({
|
||||
},
|
||||
|
||||
@observes("filter", "onlyOverridden", "model")
|
||||
filterContent() {
|
||||
discourseDebounce(
|
||||
this,
|
||||
() => {
|
||||
if (this._skipBounce) {
|
||||
this.set("_skipBounce", false);
|
||||
} else {
|
||||
this.filterContentNow(this.categoryNameKey);
|
||||
}
|
||||
},
|
||||
INPUT_DELAY
|
||||
);
|
||||
},
|
||||
filterContent: discourseDebounce(function () {
|
||||
if (this._skipBounce) {
|
||||
this.set("_skipBounce", false);
|
||||
} else {
|
||||
this.filterContentNow(this.categoryNameKey);
|
||||
}
|
||||
}, INPUT_DELAY),
|
||||
|
||||
actions: {
|
||||
clearFilter() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Controller from "@ember/controller";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import { debounce } from "@ember/runloop";
|
||||
let lastSearch;
|
||||
|
||||
export default Controller.extend({
|
||||
@@ -28,14 +28,14 @@ export default Controller.extend({
|
||||
toggleOverridden() {
|
||||
this.toggleProperty("overridden");
|
||||
this.set("searching", true);
|
||||
discourseDebounce(this, this._performSearch, 400);
|
||||
debounce(this, this._performSearch, 400);
|
||||
},
|
||||
|
||||
search() {
|
||||
const q = this.q;
|
||||
if (q !== lastSearch) {
|
||||
this.set("searching", true);
|
||||
discourseDebounce(this, this._performSearch, 400);
|
||||
debounce(this, this._performSearch, 400);
|
||||
lastSearch = q;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import CanCheckEmails from "discourse/mixins/can-check-emails";
|
||||
import Controller from "@ember/controller";
|
||||
import I18n from "I18n";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { i18n } from "discourse/lib/computed";
|
||||
|
||||
export default Controller.extend(CanCheckEmails, {
|
||||
@@ -32,9 +32,9 @@ export default Controller.extend(CanCheckEmails, {
|
||||
},
|
||||
|
||||
@observes("listFilter")
|
||||
_filterUsers() {
|
||||
discourseDebounce(this, this.resetFilters, INPUT_DELAY);
|
||||
},
|
||||
_filterUsers: discourseDebounce(function () {
|
||||
this.resetFilters();
|
||||
}, INPUT_DELAY),
|
||||
|
||||
resetFilters() {
|
||||
this._page = 1;
|
||||
|
||||
@@ -2,7 +2,7 @@ import Controller from "@ember/controller";
|
||||
import EmberObject from "@ember/object";
|
||||
import { INPUT_DELAY } from "discourse-common/config/environment";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseDebounce from "discourse/lib/debounce";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
|
||||
@@ -48,16 +48,10 @@ export default Controller.extend({
|
||||
},
|
||||
|
||||
@observes("filter")
|
||||
filterContent() {
|
||||
discourseDebounce(
|
||||
this,
|
||||
function () {
|
||||
this.filterContentNow();
|
||||
this.set("filtered", !isEmpty(this.filter));
|
||||
},
|
||||
INPUT_DELAY
|
||||
);
|
||||
},
|
||||
filterContent: discourseDebounce(function () {
|
||||
this.filterContentNow();
|
||||
this.set("filtered", !isEmpty(this.filter));
|
||||
}, INPUT_DELAY),
|
||||
|
||||
actions: {
|
||||
clearFilter() {
|
||||
|
||||
Reference in New Issue
Block a user