From d397d49acdafa061e252a803790407e749806eb7 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 29 Apr 2020 13:06:34 +0200 Subject: dashboard/app: remove old namespace redirects We kept redirects from old URLs for more than a year. It's time to remove them. Old links, if they still exist, need to be updated sooner or later. --- dashboard/app/handler.go | 25 ------------------------- dashboard/app/main.go | 4 ---- dashboard/app/templates.html | 15 +++------------ 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/dashboard/app/handler.go b/dashboard/app/handler.go index c779f82a9..62294811c 100644 --- a/dashboard/app/handler.go +++ b/dashboard/app/handler.go @@ -97,7 +97,6 @@ type uiHeader struct { Subpage string Namespace string Namespaces []uiNamespace - Redirects []uiRedirect } type uiNamespace struct { @@ -139,7 +138,6 @@ func commonHeader(c context.Context, r *http.Request, w http.ResponseWriter, ns h := commonHeaderRaw(c, r) const adminPage = "admin" isAdminPage := r.URL.Path == "/"+adminPage - isBugPage := r.URL.Path == "/bug" found := false for ns1, cfg := range config.Namespaces { if accessLevel < cfg.AccessLevel { @@ -155,29 +153,6 @@ func commonHeader(c context.Context, r *http.Request, w http.ResponseWriter, ns Name: ns1, Caption: cfg.DisplayTitle, }) - // This handles redirects from old URL scheme to new scheme. - // This this should be removed at some point (Apr 5, 2019). - // Also see handling of "fixed" parameter in handleMain. - if isBugPage { - continue - } - h.Redirects = append(h.Redirects, uiRedirect{ - From: "#" + ns1, - To: "/" + ns1, - }) - fragments := []string{"managers", "open", "pending"} - for _, reporting := range cfg.Reporting { - if !reporting.moderation || accessLevel < reporting.AccessLevel { - continue - } - fragments = append(fragments, reporting.Name) - } - for _, frag := range fragments { - h.Redirects = append(h.Redirects, uiRedirect{ - From: "#" + ns1 + "-" + frag, - To: "/" + ns1 + "#" + frag, - }) - } } sort.Slice(h.Namespaces, func(i, j int) bool { return h.Namespaces[i].Caption < h.Namespaces[j].Caption diff --git a/dashboard/app/main.go b/dashboard/app/main.go index 1196d29b7..4e6c81a2f 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -204,10 +204,6 @@ type uiJob struct { // handleMain serves main page. func handleMain(c context.Context, w http.ResponseWriter, r *http.Request) error { - if ns := r.FormValue("fixed"); ns != "" { - http.Redirect(w, r, fmt.Sprintf("/%v/fixed", ns), http.StatusFound) - return nil - } hdr, err := commonHeader(c, r, w, "") if err != nil { return err diff --git a/dashboard/app/templates.html b/dashboard/app/templates.html index 30f1f4590..1e030ed8e 100644 --- a/dashboard/app/templates.html +++ b/dashboard/app/templates.html @@ -11,15 +11,6 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{/* Common page head part, invoked with *uiHeader */}} {{define "head"}} - {{if .Redirects}} - - {{end}} {{if .AnalyticsTrackingID}} @@ -40,11 +31,11 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the

syzbot

-- cgit mrf-deployment