Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve navigation accessibility and usability #544

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cef144f
Navbar: Make more consistent, remove unnecessary nav element
thewildmage Oct 4, 2022
dc43b0f
Use updated navbar, move filters closer to filtered content
thewildmage Oct 4, 2022
b36fece
Rename "navbar" to "navigation"
thewildmage Oct 5, 2022
5bcb501
Fix indentation
thewildmage Oct 5, 2022
f59febe
Use hidden attribute instead of display none
thewildmage Oct 12, 2022
d3a5239
Simplify for loops
thewildmage Oct 12, 2022
f33a559
Rearrange script
thewildmage Oct 12, 2022
3e73602
Use generic names for generic functions
thewildmage Oct 12, 2022
4ab2070
Remove filter submit button
thewildmage Oct 12, 2022
da51241
Update filter HTML
thewildmage Oct 12, 2022
a63293f
Remove excess article element
thewildmage Oct 12, 2022
cdd33f4
Remove extra namespace list status
thewildmage Oct 12, 2022
d8db797
First pass at filter status updates
thewildmage Oct 12, 2022
2945979
Remove listener for now non-existent button
thewildmage Oct 14, 2022
bcf251d
Handle case where filter starts non-empty
thewildmage Oct 14, 2022
74e05ad
Don't use input type=search
thewildmage Oct 14, 2022
130a4cd
Fewer announcements, handle same announcements back to back
thewildmage Oct 14, 2022
1b46199
Add explanatory comments
thewildmage Oct 14, 2022
bdc9657
Filter script: Consolidate editing outputs
thewildmage Oct 19, 2022
476fcda
Update form hide if no filterable entries found
thewildmage Oct 19, 2022
65f94fc
Filter.js: Consolidate variables, update comments, test HTML presence
thewildmage Oct 20, 2022
727b12f
Convert filter.js to module, extract common utilities
thewildmage Oct 20, 2022
8d3f615
Add main.js with setJavascriptAvailable function
thewildmage Oct 20, 2022
8c45c25
Handle no JavaScript situation
thewildmage Oct 20, 2022
597a457
Make filter context consistent across pages
thewildmage Oct 20, 2022
abeda70
Only add filter if more than 1 entry
thewildmage Oct 20, 2022
ed59ebd
Hide Glossary link when it's not on page
thewildmage Oct 21, 2022
df71552
Update filter styling
thewildmage Oct 21, 2022
b959393
Hide "Limit results" link if only namespace
thewildmage Oct 22, 2022
876400d
go fmt fixes
thewildmage Oct 22, 2022
bd3b14f
Merge branch 'master' into thewildmage/improve-navigation
thewildmage Oct 22, 2022
5af190a
Update tests
thewildmage Oct 23, 2022
b3ef858
Update tests
thewildmage Oct 23, 2022
38648a0
Merge branch 'master' into thewildmage/improve-navigation
thewildmage Oct 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
go fmt fixes
  • Loading branch information
thewildmage committed Oct 22, 2022
commit 876400d81a93eb878a413b445694ad806f64fb9b
6 changes: 3 additions & 3 deletions pkg/dashboard/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package helpers

import (
"reflect"

"github.com/google/uuid"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -132,10 +132,10 @@ func GetUUID() string {
func HasField(v interface{}, name string) bool {
rv := reflect.ValueOf(v)
if rv.Kind() == reflect.Ptr {
rv = rv.Elem()
rv = rv.Elem()
}
if rv.Kind() != reflect.Struct {
return false
return false
}
return rv.FieldByName(name).IsValid()
}
6 changes: 3 additions & 3 deletions pkg/dashboard/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package dashboard

import (
"k8s.io/klog/v2"
"net/http"
"path"
"k8s.io/klog/v2"

packr "github.com/gobuffalo/packr/v2"
"github.com/gorilla/mux"
Expand Down Expand Up @@ -70,13 +70,13 @@ func GetRouter(setters ...Option) *mux.Router {
// root
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// catch all other paths that weren't matched
if r.URL.Path != "/" && r.URL.Path != opts.basePath && r.URL.Path != opts.basePath + "/" {
if r.URL.Path != "/" && r.URL.Path != opts.basePath && r.URL.Path != opts.basePath+"/" {
klog.Infof("404: %s", r.URL.Path)
http.NotFound(w, r)
return
}

klog.Infof("redirecting to %v",path.Join(opts.basePath, "/namespaces"))
klog.Infof("redirecting to %v", path.Join(opts.basePath, "/namespaces"))
// default redirect on root path
http.Redirect(w, r, path.Join(opts.basePath, "/namespaces"), http.StatusMovedPermanently)
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/dashboard/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func getTemplate(name string, includedTemplates ...string) (*template.Template,
"getStatusRange": helpers.GetStatusRange,
"resourceName": helpers.ResourceName,
"getUUID": helpers.GetUUID,
"hasField": helpers.HasField,
"hasField": helpers.HasField,
})

// join the default templates and included templates
Expand Down