Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !2184

Consistent custom dashboards

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Pablo Brasero requested to merge github/fork/pablobm/consistent-custom-dashboards into main Apr 28, 2022
  • Overview 5
  • Commits 4
  • Pipelines 0
  • Changes 7

Working on https://github.com/thoughtbot/administrate/pull/1941, I noticed that model-less dashboards (also known as "custom dashboards") do not behave very consistently. Eventually I found myself having to fix this before I could work on the former PR.

There are some twists and turns in the code that handles them:

  1. There doesn't seem to be a way to have the navigation show a singular name for the dashboard. So for instance in the example app we have "Stats", but I couldn't create one with the name "Home".
  2. When used with Punditize, it requires the policy to use a plural name (HomesPolicy) instead of singular like for any other resource.
  3. The example StatsDashboard declares resource "Stats", which is a weird mix of singular and plural (in the end it doesn't seem to matter which one you use here).
  4. Internally this complicates things when working with authorization.

This PR introduces consistency, not fixing point 1 but at least addressing the other points and allowing me to proceed with my work at #1941. Original I was going to bundle it as part of the larger PR, but I thought it deserved scrutiny enough to have its own one.

As for the issue with singular names, this looks like a larger problem that should be looked into with more time, and it's probably related to how we currently can't generate dashboards for singular resources.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pablobm/consistent-custom-dashboards