Skip to content

Conversation

@vani-walvekar1494
Copy link

@vani-walvekar1494 vani-walvekar1494 commented Jun 17, 2025

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:

  • Ready.
  • Work in Progress.
  • Hold.

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:

image

Notes:

getUserFavorites,
addFavorite,
removeFavorite,
} from '../../../dashboard/src/api/favouritesApi';
Copy link
Member

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.

"react-error-boundary": "^4.0.13",
"react-hook-form": "^7.51.3",
"react-hook-form-antd": "^1.1.0",
"react-icons": "^5.5.0",
Copy link
Member

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.

name="django.contrib.sitemaps.views.sitemap",
),

#URL for Favourites
Copy link
Member

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
Copy link
Member

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.

Copy link
Author

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.

@vani-walvekar1494 vani-walvekar1494 force-pushed the feat/react-dashboard-utils branch from e543b8e to 9698ff4 Compare June 27, 2025 20:47
Copy link
Member

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.

Copy link
Author

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 (
Copy link
Member

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.

Copy link
Author

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
Copy link
Member

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.

Copy link
Author

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';
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

The "favorites' switch is causing the sidebar to overflow its allotted space, and the font size has become tiny:
image
Please update the styling so that it matches the production site.

Copy link
Author

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

@vani-walvekar1494 vani-walvekar1494 requested a review from fnets July 21, 2025 19:41
Copy link
Contributor

@fnets fnets left a 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%' }}>
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

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?

Copy link
Author

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.

@jarosenb
Copy link
Member

jarosenb commented Aug 1, 2025

Closing this PR- dashboard changes have been consolidated into #1612

@jarosenb jarosenb closed this Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants