Problem/Motivation

After editing the Dashboard layout, users are redirected to the Admin > Structure > Dashboard page.

They should be redirected back to where they were (i.e. to the Dashboard page, not in structure).

Steps to reproduce

  • Login as admin
  • Go to /admin/dashboard
  • Click on + Edit layout
  • Either change and save or do nothing and discard, it does not matter
  • Submit (or discard and confirm)
  • Result: you are redirected to /admin/structure/dashboard
  • Expectation: being redirected back to the Dashboard page you were before clicking on "Edit layout"

Proposed resolution

Redirect to the Dashboard page after the Layout edit form was submitted.

Maybe as simple as setting the ?redirect query string in the Edit layout button 🤷.

CommentFileSizeAuthor
#11 simplescreenrecord.mkv699.6 KBkoustav_mondal

Issue fork dashboard-3500368

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

matthieuscarset created an issue. See original summary.

phenaproxima’s picture

Project: Drupal CMS development repository » Dashboard
Version: » 2.0.0
Component: Track: Dashboard » Code

This seems to be squarely in Dashboard's wheelhouse; moving to their issue queue.

tim.plunkett’s picture

Title: Wrong redirect after Dashboard layout edition » Wrong redirect after editing Dashboard layout
sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Working on it.

sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned
Status: Active » Needs review

Made the requested changes. Please review.

penyaskito’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

penyaskito’s picture

sayan_k_dutta’s picture

Status: Needs work » Needs review

Made the changes and added tests. Please review.

koustav_mondal’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new699.6 KB

Installed the module and checked in local. After editing the Dashboard layout it is now redirected back to the Dashboard page( admin/dashboard) , not in structure(admin/structure/dashboard). Attaching a video for referance. LGTM+

penyaskito’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs tests

After a new review this makes lots of sense. I misread the MR.

However, we can just do this in \Drupal\dashboard\Plugin\SectionStorage\DashboardSectionStorage::getRedirectUrl

Something like this should work.

  public function getRedirectUrl() {
    return Url::fromRoute('entity.dashboard.canonical', ['dashboard' => $this->getStorageId()]);
  }

Other changes should not be necessary, aside of the added test.

sayan_k_dutta’s picture

Status: Needs work » Needs review
penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

This LGTM. Would love @plopesc to verify it too.

penyaskito’s picture

Title: Wrong redirect after editing Dashboard layout » Redirect to the edited dashboard and not the listing after editing Dashboard layout
Assigned: Unassigned » plopesc

plopesc made their first commit to this issue’s fork.

plopesc’s picture

Assigned: plopesc » Unassigned
Status: Reviewed & tested by the community » Fixed

It looks good to me!

Took the freedom to merge it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.