mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:50:00 +08:00
FIX: don’t break browser history on dashboard visit (#6186)
This commit is contained in:
parent
a74024b1c9
commit
330cf78c83
|
@ -2,8 +2,6 @@ import computed from "ember-addons/ember-computed-decorators";
|
|||
import PeriodComputationMixin from "admin/mixins/period-computation";
|
||||
|
||||
export default Ember.Controller.extend(PeriodComputationMixin, {
|
||||
exceptionController: Ember.inject.controller("exception"),
|
||||
|
||||
@computed
|
||||
flagsStatusOptions() {
|
||||
return {
|
||||
|
|
|
@ -6,7 +6,7 @@ const AdminDashboardNext = Discourse.Model.extend({});
|
|||
|
||||
AdminDashboardNext.reopenClass({
|
||||
fetch() {
|
||||
return ajax("/admin/dashboard-next.json").then(json => {
|
||||
return ajax("/admin/dashboard.json").then(json => {
|
||||
const model = AdminDashboardNext.create();
|
||||
model.set("version_check", json.version_check);
|
||||
return model;
|
||||
|
|
|
@ -5,19 +5,5 @@ export default Discourse.Route.extend({
|
|||
this.controllerFor("admin-dashboard-next").fetchProblems();
|
||||
this.controllerFor("admin-dashboard-next").fetchDashboard();
|
||||
scrollTop();
|
||||
},
|
||||
|
||||
afterModel(model, transition) {
|
||||
if (transition.targetName === "admin.dashboardNext.index") {
|
||||
this.transitionTo("admin.dashboardNext.general");
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
willTransition(transition) {
|
||||
if (transition.targetName === "admin.dashboardNext.index") {
|
||||
this.transitionTo("admin.dashboardNext.general");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,8 +3,11 @@ export default function() {
|
|||
this.route("dashboard", { path: "/dashboard-old" });
|
||||
|
||||
this.route("dashboardNext", { path: "/" }, function() {
|
||||
this.route("general", { path: "/dashboard/general" });
|
||||
this.route("moderation", { path: "/dashboard/moderation" });
|
||||
this.route("general", { path: "/" });
|
||||
this.route("admin.dashboardNextModeration", {
|
||||
path: "/dashboard/moderation",
|
||||
resetNamespace: true
|
||||
});
|
||||
});
|
||||
|
||||
this.route(
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{/link-to}}
|
||||
</li>
|
||||
<li class="navigation-item moderation">
|
||||
{{#link-to "admin.dashboardNext.moderation" class="navigation-link"}}
|
||||
{{#link-to "admin.dashboardNextModeration" class="navigation-link"}}
|
||||
{{i18n "admin.dashboard.moderation_tab"}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
border-bottom: 10px solid $secondary;
|
||||
}
|
||||
|
||||
&.moderation .navigation-item.moderation {
|
||||
&.dashboard-next-moderation .navigation-item.moderation {
|
||||
@include active-navigation-item;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ class Admin::DashboardNextController < Admin::AdminController
|
|||
render json: data
|
||||
end
|
||||
|
||||
def moderation
|
||||
end
|
||||
|
||||
def general
|
||||
data = AdminDashboardNextGeneralData.fetch_cached_stats
|
||||
|
||||
|
|
|
@ -236,9 +236,11 @@ Discourse::Application.routes.draw do
|
|||
|
||||
get "version_check" => "versions#show"
|
||||
|
||||
get "dashboard-next" => "dashboard_next#index"
|
||||
get "dashboard-old" => "dashboard#index"
|
||||
get "dashboard" => "dashboard_next#index"
|
||||
get "dashboard/general" => "dashboard_next#general"
|
||||
get "dashboard/moderation" => "dashboard_next#moderation"
|
||||
|
||||
get "dashboard-old" => "dashboard#index"
|
||||
|
||||
resources :dashboard, only: [:index] do
|
||||
collection do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export default {
|
||||
"/admin/dashboard-next.json": {
|
||||
"/admin/dashboard.json": {
|
||||
updated_at: "2018-04-25T08:06:11.292Z"
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user