Implement Pinned Apps feature on dashboard homepage#5324
Conversation
Bubballoo3
left a comment
There was a problem hiding this comment.
I think this is a nice feature that people will appreciate, there are two main points that I think require further planning or breaking this into multiple steps.
First, UserSettingsStore is currently only used for user-level settings that are configured by admins, so we likely want a new or at least forward-thinking and well planned approach to handle user-provided user-level settings. That's not to say 100% that this isn't the right place, just that it will take us some careful consideration to determine.
Second, I think you can use some of the system provided partials and functionality to accomplish what you are trying to do. There are other places we use modals, for example, so you should be able to use that for some of your styles and html to avoid duplication.
Since we are very busy with the final stages of the 4.2 release, it may be some time before we are able to put in the time necessary to fully review this. But if you get a chance to look into these points and find ways to make it simpler in the mean time, that will speed things up down the road.
| path_selector_parent_directory: 親ディレクトリ | ||
| pinned_apps_caption_html: <a href="%{all_apps_url}">すべての利用可能なアプリ</a>の中から特集されたサブセット | ||
| pinned_apps_category: アプリ | ||
| pinned_apps_clear_all: Clear All |
There was a problem hiding this comment.
You only need to update en.yml with new internationalizations. We have automations to handle updating other languages.
There was a problem hiding this comment.
Good to know, thanks.
Ok, sounds good I am thinking that some sort of similar architecture (just another
Yes, that makes a lot of sense, I'll go back through and see where I can reuse code from across other modals.
Overall sounds great, thank you for taking the time to look this over; I really appreciate it! I'll keep adding work here so hopefully when we come back to it the code will be in a good state to merge/discuss further. |
Summary
I am requesting to add a “Pinned Apps” widget editor to the dashboard homepage. Users can open an editor popup from the Pinned Apps section, search/select apps to pin, select all, clear all, reset to system defaults, and save or cancel changes. The widget maintains a max height with overflow scrolling, and keeps all of the original/existing OOD app card styling/launch behavior.
Implementation
Files:
apps/dashboard/app/controllers/application_controller.rb: Resolve@pinned_appsfromuser_settings[:custom_pinned_apps]when present; otherwise use@user_configuration.pinned_apps.apps/dashboard/app/controllers/pinned_apps_controller.rb: New controller to update (PATCH /pinned_apps) and reset (DELETE /pinned_apps) which acts as the per-user pinned apps override. The submitted tokens are filtered to make sure they are valid navigation app cards.apps/dashboard/app/models/concerns/user_setting_store.rb: Addedclear_user_settinghelper to remove a single key from the user settings YAML which persists.apps/dashboard/app/helpers/dashboard_helper.rb: Added helpers for editor options/selection andpinned_apps_widget_visible?so the widget editor remains accessible even when the saved selection is empty.apps/dashboard/app/views/widgets/_pinned_apps.html.erb: Header now includes an Edit button and also the pinned apps list is wrapped in a max-height scroll container in case users choose a lot of apps to pin.apps/dashboard/app/views/dashboard/index.html.erb: Added a Bootstrap modal that provides the pinned apps editor UI (search, select all, clear all, reset, save/cancel).apps/dashboard/app/javascript/pinned_apps.js: Added popup behaviors (search filtering, select/clear visible items) and kept the existing launcher spinner behavior.apps/dashboard/app/assets/stylesheets/pinned_apps.scss: Added styling for header layout, scrollable grid/modal list, and fixed checkbox clipping inside the modal list.apps/dashboard/config/routes.rb: Added resource:pinned_appsroutes.apps/dashboard/config/locales/{en,ja_JP,zh-CN}.yml: Added strings for the editor UI.Tests
test/integration/pinned_apps_test.rbduring development.)What still needs to be implemented
apps/dashboard/config/locales/ja_JP.ymlandapps/dashboard/config/locales/zh-CN.ymlcurrently have placeholder values.Results
Initial landing screen on the Tufts Cluster:

Clicking the "Edit" button to bring up the popup:

Keyword filtering:

Saving new pinned apps and a display of app overflow:

No pinned apps selected:

Confirmation to reset to system default:
