From 7f79727090a3cbbad14b01acc231117c4d539fd7 Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Wed, 27 Oct 2021 14:53:04 +0400 Subject: [PATCH] DEV: rename refresh action to avoid regressions in the future (#14721) --- .../discourse/app/controllers/tags-index.js | 2 +- .../discourse/app/routes/tags-index.js | 26 ++++++++++--------- .../app/templates/modal/tag-upload.hbs | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/tags-index.js b/app/assets/javascripts/discourse/app/controllers/tags-index.js index 30dfdd40c22..00553d4e51c 100644 --- a/app/assets/javascripts/discourse/app/controllers/tags-index.js +++ b/app/assets/javascripts/discourse/app/controllers/tags-index.js @@ -96,7 +96,7 @@ export default Controller.extend({ (proceed) => { if (proceed) { ajax("/tags/unused", { type: "DELETE" }) - .then(() => this.send("refresh")) + .then(() => this.send("triggerRefresh")) .catch(popupAjaxError); } } diff --git a/app/assets/javascripts/discourse/app/routes/tags-index.js b/app/assets/javascripts/discourse/app/routes/tags-index.js index 12409d95765..ede026def30 100644 --- a/app/assets/javascripts/discourse/app/routes/tags-index.js +++ b/app/assets/javascripts/discourse/app/routes/tags-index.js @@ -1,6 +1,7 @@ import DiscourseRoute from "discourse/routes/discourse"; import I18n from "I18n"; import Tag from "discourse/models/tag"; +import { action } from "@ember/object"; export default DiscourseRoute.extend({ model() { @@ -34,19 +35,20 @@ export default DiscourseRoute.extend({ }); }, - actions: { - didTransition() { - this.controllerFor("application").set("showFooter", true); - return true; - }, + @action + didTransition() { + this.controllerFor("application").set("showFooter", true); + return true; + }, - showTagGroups() { - this.transitionTo("tagGroups"); - return true; - }, + @action + showTagGroups() { + this.transitionTo("tagGroups"); + return true; + }, - refresh() { - this.refresh(); - }, + @action + triggerRefresh() { + this.refresh(); }, }); diff --git a/app/assets/javascripts/discourse/app/templates/modal/tag-upload.hbs b/app/assets/javascripts/discourse/app/templates/modal/tag-upload.hbs index 05dc32b6fdd..932318163d9 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/tag-upload.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/tag-upload.hbs @@ -1,3 +1,3 @@ {{#d-modal-body title="tagging.upload"}} - {{tags-uploader refresh=(route-action "refresh") closeModal=(route-action "closeModal")}} + {{tags-uploader refresh=(route-action "triggerRefresh") closeModal=(route-action "closeModal")}} {{/d-modal-body}}