From 21dad02503be68a9dd99aa73af60dfe13ebbe8e8 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 24 Jul 2023 12:32:17 +0100 Subject: [PATCH] FIX: Correct router service call from some admin controllers (#22757) 72edb727 updated these to point to the router service, but the method name also needed to be changed from replaceRoute -> replaceWith --- .../admin/addon/controllers/admin-customize-colors-show.js | 4 ++-- .../admin/addon/controllers/admin-customize-colors.js | 2 +- .../admin/addon/controllers/admin-customize-themes-edit.js | 6 +++--- .../admin/addon/controllers/admin-dashboard-general.js | 2 +- .../javascripts/admin/addon/controllers/admin-dashboard.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js index b3ca28d9587..e92f513e208 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js @@ -59,7 +59,7 @@ export default class AdminCustomizeColorsShowController extends Controller { ); newColorScheme.save().then(() => { this.allColors.pushObject(newColorScheme); - this.router.replaceRoute("adminCustomize.colors.show", newColorScheme); + this.router.replaceWith("adminCustomize.colors.show", newColorScheme); }); } @@ -80,7 +80,7 @@ export default class AdminCustomizeColorsShowController extends Controller { didConfirm: () => { return this.model.destroy().then(() => { this.allColors.removeObject(this.model); - this.router.replaceRoute("adminCustomize.colors"); + this.router.replaceWith("adminCustomize.colors"); }); }, }); diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js index 59c23df9ae8..209f9dfcc39 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js @@ -38,7 +38,7 @@ export default class AdminCustomizeColorsController extends Controller { newColorScheme.save().then(() => { this.model.pushObject(newColorScheme); newColorScheme.set("savingStatus", null); - this.router.replaceRoute("adminCustomize.colors.show", newColorScheme); + this.router.replaceWith("adminCustomize.colors.show", newColorScheme); }); } diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js index 403391f1898..82079543641 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js @@ -51,7 +51,7 @@ export default class AdminCustomizeThemesEditController extends Controller { @action fieldAdded(target, name) { - this.router.replaceRoute( + this.router.replaceWith( this.editRouteName, this.get("model.id"), target, @@ -68,7 +68,7 @@ export default class AdminCustomizeThemesEditController extends Controller { (f) => f.edited ); - this.router.replaceRoute( + this.router.replaceWith( this.editRouteName, this.get("model.id"), firstTarget.name, @@ -80,6 +80,6 @@ export default class AdminCustomizeThemesEditController extends Controller { @action goBack() { - this.router.replaceRoute(this.showRouteName, this.model.id); + this.router.replaceWith(this.showRouteName, this.model.id); } } diff --git a/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js b/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js index 2d17c41e043..b4373cb8ac7 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js @@ -140,7 +140,7 @@ export default class AdminDashboardGeneralController extends Controller.extend( }) .catch((e) => { this.exceptionController.set("thrown", e.jqXHR); - this.router.replaceRoute("exception"); + this.router.replaceWith("exception"); }) .finally(() => this.set("isLoading", false)); } diff --git a/app/assets/javascripts/admin/addon/controllers/admin-dashboard.js b/app/assets/javascripts/admin/addon/controllers/admin-dashboard.js index 4b5e940c427..abe340f2eea 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-dashboard.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-dashboard.js @@ -91,7 +91,7 @@ export default class AdminDashboardController extends Controller { }) .catch((e) => { this.exceptionController.set("thrown", e.jqXHR); - this.router.replaceRoute("exception"); + this.router.replaceWith("exception"); }) .finally(() => { this.set("isLoading", false);