-
Notifications
You must be signed in to change notification settings - Fork 17
Feat/react dashboard utils #1570
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
Feat/react dashboard utils #1570
Conversation
…react-dashboard-utils
| getUserFavorites, | ||
| addFavorite, | ||
| removeFavorite, | ||
| } from '../../../dashboard/src/api/favouritesApi'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the comment about moving the API calls into the _hooks module, we need to be careful about imports between modules. If the Workspace imports Dashboard components and the Dashboard imports Workspace components, then we could end up with circular dependencies. I think the solution here is to set up module boundaries (https://nx.dev/features/enforce-module-boundaries) so that Dashboard can import from workspace but not the other way around.
client/package.json
Outdated
| "react-error-boundary": "^4.0.13", | ||
| "react-hook-form": "^7.51.3", | ||
| "react-hook-form-antd": "^1.1.0", | ||
| "react-icons": "^5.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have existing FontAwesome icons that we can probably use for this feature. I don't think we need this additional dependency. We can discuss on a case-by-case basis.
designsafe/urls.py
Outdated
| name="django.contrib.sitemaps.views.sitemap", | ||
| ), | ||
|
|
||
| #URL for Favourites |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is probably unnecessary. We have existing URL configuration to support /api/datafiles paths.
| @@ -0,0 +1,17 @@ | |||
| # Generated by Django 4.2.15 on 2025-06-23 15:09 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this filemeta migration. It doesn't relate to any of the dashboard features. I'll need to check with the DesignSafe team to understand whether this migration is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve removed the filemeta migration. I believe it was created accidentally when running the migration.
e543b8e to
9698ff4
Compare
…act-dashboard-utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes to package-lock.json should be reverted, since there aren't any corresponding changes to package.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted package-lock.json.
| from django.urls import re_path as url | ||
| from designsafe.apps.api.datafiles.views import DataFilesView, TransferFilesView, MicrosurveyView | ||
| from django.urls import re_path as url, path | ||
| from designsafe.apps.api.datafiles.views import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert any formatting changes to files in api/datafiles. In general, it's good practice to look over the changes in each PR and make sure that you're changing the minimum possible amount of code to accomplish the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted formatting changes in api/datafiles.
| <ul className={styles.favoriteList}> | ||
| {resolvedFavorites.map((tool) => ( | ||
| <li className={styles.favoriteItem} key={tool.key}> | ||
| <a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking on the tool name in the Favorites panel doesn't navigate to the tool. You might need to remove the onClick handler if it's preventing the click event from propagating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking on the tool name now correctly opens the tool as expected.
| import { NavLink } from 'react-router-dom'; | ||
| import { TAppCategory, TPortalApp } from '@client/hooks'; | ||
| import { useGetAppParams } from '../utils'; | ||
| import { getUserFavorites, addFavorite, removeFavorite } from '@client/hooks'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor the side nav code to use the Tanstack-Query hooks instead of these utility functions.
| const linkLabel = app.shortLabel || app.label || app.bundle_label; | ||
| const switchControl = ( | ||
| <span onClick={(e) => e.stopPropagation()} style={{ marginLeft: 6 }}> | ||
| <Switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the styling to prevent sidebar overflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's some changes to be made here to bring it more in-line with the other code we've written in the portal. Please don't hesitate to ask questions of us or your fellow SGX teammates.
| <QueryClientProvider client={queryClient}> | ||
| <div style={{ display: 'flex' }}> | ||
| <Quicklinks /> | ||
| <div style={{ marginLeft: '200px', padding: '10px', width: '100%' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like there's some lines that are handling styling in the JSX, but also there is styling being applied from the CSS. I think they could be consolidated. Especially lines like width: '100%'.
There also seems like a lot of repetition here. It might be more readable if it was written similar to how you wrote out Quicklinks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styles consolidated into CSS modules and collapsible sections refactored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping in mind what Jake said about module boundaries, I think this should be refactored to use existing schema and types, similar to how useAppsListing and useGetAppParams work. You probably don't need to reinvent the wheel with a tool_id and version when app_id and version already exist.
Again keeping in mind what Jake said about module boundaries, I think you also can probably handle some of these functions with existing code. Does handleClickOutside need to be used when you can use code similar to PreviewModal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated code now uses existing app_id and version types consistently, it also removes the unnecessary handleClickOutside logic, relying on React state and Ant Design components for UI control.
|
Closing this PR- dashboard changes have been consolidated into #1612 |

Overview:
This PR adds three new features to the DesignSafe UI dashboard:
A ticket list interface with filtering, toggle between open/resolved tickets, and quick actions.
A Recently Accessed tools component that shows recent user tools from localStorage.
A Recent Projects tabular card displaying the user’s last 3 projects on the dashboard.
PR Status:
Related Jira tickets:
Summary of Changes:
Implemented a ticket list view with client-side filtering and status toggle.
Added quick reply and close actions with confirmation modal in ticket list.
Created a Recently Accessed component fixed to bottom-right showing recent tools with clickable links.
Designed a Recent Projects card showing the last 3 projects in a tabular layout on the dashboard.
Applied styling and modularized CSS for better maintainability.
Testing Steps:
Navigate to the dashboard page.
Verify that the ticket list loads with open tickets by default.
Use the toggle button to switch between open and resolved tickets.
Test filtering tickets by subject or ID.
Click reply and close buttons; verify confirmation on close and that the list refreshes.
Check the Recently Accessed section at the bottom-right for correct tool links.
Verify the Recent Projects card shows exactly 3 most recent projects with clickable titles.
UI Photos:
Notes: