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

Add user_dashboard core extension (alpha) #27792

Merged
merged 1 commit into from Oct 12, 2023

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Oct 11, 2023

Overview

There is a hidden thing in CiviCRM called the "User Dashboard" (not to be confused with the "Home Dashboard" or any of the component dashboards like CiviEvent). There are no menu links to it so it's hard to find, but if you stumble upon it at civicrm/user a wonder of non-configurable hardcoded-ness awaits your users.

Before

The user dashboard looks exactly like this. Aside from the ability to turn panes on and off, there are no configuration options (not even hooks for developers to make changes), so if this exact screen doesn't suit your idea of a delightfully user-friendly portal for your constituents, too bad:

image

After

If you enable the new "User Dashboard" extension,civicrm/user gives you this instead. It's an Afform of Search Displays, and absolutely everything about it can be configured via the FormBuilder and SeachKit UIs.

image

Technical Details

The way this extension picks up Search Displays to go on the default version of the Afform is by tag. So any other extension could add a packaged SavedSearch simply by tagging it "User Dashboard".

Comments

This reproduces all the tables but not the self-service links so I've tagged this extension as "alpha" until we figure those out.

@civibot
Copy link

civibot bot commented Oct 11, 2023

🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷

Introduction for new contributors...
  • If this is your first PR, an admin will greenlight automated testing with the command ok to test or add to whitelist.
  • A series of tests will automatically run. You can see the results at the bottom of this page (if there are any problems, it will include a link to see what went wrong).
  • A demo site will be built where anyone can try out a version of CiviCRM that includes your changes.
  • If this process needs to be repeated, an admin will issue the command test this please to rerun tests and build a new demo site.
  • Before this PR can be merged, it needs to be reviewed. Please keep in mind that reviewers are volunteers, and their response time can vary from a few hours to a few weeks depending on their availability and their knowledge of this particular part of CiviCRM.
  • A great way to speed up this process is to "trade reviews" with someone - find an open PR that you feel able to review, and leave a comment like "I'm reviewing this now, could you please review mine?" (include a link to yours). You don't have to wait for a response to get started (and you don't have to stop at one!) the more you review, the faster this process goes for everyone 😄
  • To ensure that you are credited properly in the final release notes, please add yourself to contributor-key.yml
  • For more information about contributing, see CONTRIBUTING.md.
Quick links for reviewers...

➡️ Online demo of this PR 🔗

@eileenmcnaughton
Copy link
Contributor

As this is Alpha / disabled by default & does not affect anything outside the extension itself then merge at will @colemanw

@eileenmcnaughton
Copy link
Contributor

@colemanw note that the built in dashboard has some self-service links for events, recurrings

@colemanw
Copy link
Member Author

@eileenmcnaughton I've just added the 2 missing tables so we've got parity on all the displays now. Just missing the self-service links. Maybe not too difficult, just need to figure out how to reproduce that functionality with... something.

@eileenmcnaughton
Copy link
Contributor

@mattwire @MegaphoneJon I feel like I've seen both of you work in this area?

@allinappliadmin
Copy link
Contributor

this is a cool extension complementary to the GDPR one so all contacts really know what's known and stored about them.

@aydun
Copy link
Contributor

aydun commented Oct 12, 2023

Tried to enable this extension on the test server but got "No option list found for 'tags'"

@aydun
Copy link
Contributor

aydun commented Oct 12, 2023

test this please

@aydun
Copy link
Contributor

aydun commented Oct 12, 2023

It enables ok and looks great... until I tried disabling the Pledges component and got:

Civi\API\Exception\NotImplementedException: API (Pledge, get) does not exist (or the extension it belongs to is not enabled). in Civi\API\Request::create() (line 51 of /home/jenkins/bknix-dfl/build/core-27792-15yxa/web/sites/all/modules/civicrm/Civi/API/Request.php).
The website encountered an unexpected error. Please try again later. 

Likewise Member:

Civi\API\Exception\NotImplementedException: API (Membership, get) does not exist (or the extension it belongs to is not enabled). in Civi\API\Request::create() (line 51 of /home/jenkins/bknix-dfl/build/core-27792-15yxa/web/sites/all/modules/civicrm/Civi/API/Request.php).
The website encountered an unexpected error. Please try again later. 

@colemanw
Copy link
Member Author

@aydun do you get those on the dashboard page itself or elsewhere on the site?

@aydun
Copy link
Contributor

aydun commented Oct 12, 2023

@colemanw Just on the dashboard page

@colemanw
Copy link
Member Author

@aydun ok, that's probably due to the 'cleanup' policy of the managed entities. I've switched it to "always" and that seems to fix it.

Includes search displays to replace the user dashboard, minus the action links
@aydun
Copy link
Contributor

aydun commented Oct 12, 2023

@colemanw All looks good for the searching and display and disabling/enabling components works as expected. Could merge now or wait to add the self-service actions.

@colemanw colemanw merged commit 0255a72 into civicrm:master Oct 12, 2023
3 checks passed
@colemanw colemanw deleted the userDashboard branch October 12, 2023 23:49
@colemanw
Copy link
Member Author

Thanks @aydun aside from that it's pretty well complete so I'll merge now so people can play with it.

@composerjk
Copy link
Contributor

Just a minor note on @colemanw's statement of:

There are no configuration options at all

One can at least enable/disable the sections that are shown on the dashboard via CiviCRM > Administer > Customize Data and Screens > Display Preferences, in the Contact Dashboard section, e.g., we currently only show contributions and memberships (though we may add events as we move from to Civi for events):
image

Will be nice to see some configurability once the self-service options are added to the new user_dashboard core extension for membership renewal and events.

@colemanw
Copy link
Member Author

colemanw commented Dec 7, 2023

Thanks @composerjk for pointing that out. I did notice that option while working on this and had updated the PR code to respect that setting but forgot to update the description. Updated it now.

Comment on lines +50 to +61
// Transition note: the legacy dashboard used a setting ('user_dashboard_options')
// to control which panes are enabled.
// This new extension uses a tag.
// For the next year or so, we'll conditionally tag the searches in this extension based on that setting.
// When the transition is complete, the setting can be deleted and this class can be simplified to unconditionally
// tag all SavedSearches in this extension.
$legacySetting = Civi\Api4\Setting::get(FALSE)
->addSelect('user_dashboard_options:name')
->execute()
->first();

// If the legacy setting corresponding to this pane is enabled, tag it
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants