Skip to content

Aditya-feat: Phase 2 Interactive list of open issues for BM Dashboard (integrates #3683)#4800

Open
Aditya-gam wants to merge 42 commits intodevelopmentfrom
fix/Create_an_interactive_list_of_open_issues
Open

Aditya-feat: Phase 2 Interactive list of open issues for BM Dashboard (integrates #3683)#4800
Aditya-gam wants to merge 42 commits intodevelopmentfrom
fix/Create_an_interactive_list_of_open_issues

Conversation

@Aditya-gam
Copy link
Contributor

@Aditya-gam Aditya-gam commented Feb 6, 2026

Description

This PR implements Phase 2: Create an interactive list of open issues for the BM Dashboard. It adds a filterable, paginated table of open issues with tag, date range, and project filters, and row actions (Rename, Delete, Close Issue). The list is integrated into the Weekly Project Summary under the "Issue Tracking" section and uses the backend open-issues API with filter support. It also integrates feedback and resolves conflicts from PR #3683.

IssueDescription FrontendRequirements

Related PRs (if any):

Main changes explained:

Created/Updated Files:

  • src/components/BMDashboard/Issues/IssuesList.jsx

    • New React component that fetches and displays open issues in a table.
    • Columns: Issue Name, Tag (clickable), Open Since (days), Cost (USD), Person (name + role), Action (Options dropdown).
    • Tag filtering: Clicking a tag filters the table to that tag; toggle again to clear. The reset button clears the tag, date, and project filters.
    • Filters: Date range picker (react-datepicker, range) and multi-select Projects (react-select) above the table. Filters are sent to the API (projectIds, startDate, endDate, tag).
    • Action dropdown: Options → Rename (inline edit + submit), Delete (with confirmation modal), Close Issue (PATCH status: 'closed'). Uses Bootstrap Dropdown and a custom modal for deletion.
    • API usage: ENDPOINTS.BM_GET_ISSUE_PROJECTS, ENDPOINTS.BM_GET_OPEN_ISSUES(projectIds, startDate, endDate, tag), ENDPOINTS.BM_ISSUE_UPDATE(id) for PATCH (rename/close) and DELETE.
    • UX: Loading spinner, empty state message (contextual when filters applied vs no issues), toast notifications (react-toastify) for success/error, validation for empty rename, graceful handling of missing person/tag (Unassigned, No tag). Open Since computed from issueDate (days). Pagination (5 per page) with first/last page buttons and page number group.
    • Helpers: isValidIssue, formatDateForAPI, getErrorMessage; JSDoc on component and helpers. Redux theme selector for dark mode.
  • src/components/BMDashboard/Issues/IssuesList.css

    • Styles for table, header, cells, tag buttons, dropdown toggle/menu, rename input, filter row, datepicker wrapper, and pagination.
    • Full dark theme support: .dark-theme for container, table, thead/tbody, dropdown, datepicker, react-select (custom-select), and react-datepicker calendar (.dark-theme-calendar).
    • Responsive layout for filters and table on small screens (e.g., column stacking, full-width buttons).
    • Modal backdrop and dialog for delete confirmation.
  • src/utils/URL.js

    • New endpoints: BM_GET_OPEN_ISSUES(projectIds, startDate, endDate, tag)GET /api/bm/issues/open?projectIds=...&startDate=...&endDate=...&tag=... (params only added when provided).
    • BM_GET_ISSUE_PROJECTSGET /api/bm/issues/projects.
    • BM_ISSUE_UPDATE(issueId) → base for PATCH /api/bm/issues/:issueId and DELETE /api/bm/issues/:issueId.
  • src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.jsx

    • Import IssueList from ../Issues/IssuesList.
    • Under "Issue Tracking" tab: render <IssueList /> in the first card and <IssueCharts /> in a second card (unchanged chart component), so the interactive list appears above the charts.
  • src/reducers/bmdashboard/issueReducer.js

    • Exported reducer as named export: const issueReducerexport const issueReducer (for consistency with store usage).
  • src/reducers/index.js

    • Reordered bmIssues: issueReducer in localReducers (no functional change; aligns with other reducer ordering).
  • src/components/TeamLocations/TeamLocations.jsx, src/components/TeamLocations/TestSafeMarkerCluster.jsx, src/components/__tests__/TagsSearch.test.jsx

    • Minor updates (e.g., lint/test fixes or safe defaults); not core to the issues list feature.

Key Implementation Details:

  • Backend-driven filtering: All filtering (date range, projects, tag) is done via query params on GET /api/bm/issues/open. The frontend does not filter the response array; it refetches when filters change and resets to page 1.
  • Date handling: Dates sent as YYYY-MM-DD via date.toISOString().split('T')[0]. "Open Since" is computed client-side from issue.issueDate as integer days.
  • Rename payload: Backend expects issueTitle as an array; PATCH body is { issueTitle: [trimmedName] }.
  • Close issue: PATCH with { status: 'closed' }; list refetches so closed issues disappear.
  • Delete: DELETE to BM_ISSUE_UPDATE(id); confirmation modal before calling API; toasts and refetch on success/error.
  • Data shape: Expects API to return issues with _id, issueTitle (array), tag, issueDate, cost, person (e.g., { name, role }). Invalid or missing issueTitle entries are filtered out via isValidIssue.
  • Theme: darkMode from Redux state.theme.darkMode; applied to container and passed to DatePicker/Select/table/dropdown/modal via class names and CSS.

How to test:

  1. Check out the current branch: fix/Create_an_interactive_list_of_open_issues
  2. Reinstall dependencies and clear cache: rm -rf node_modules && yarn cache clean
  3. Run yarn install and start the app: yarn start:local
  4. Ensure backend is running and exposes BM issue endpoints (e.g., REACT_APP_APIENDPOINT in .env pointing to API base URL)
  5. Start the app: npm run start:local (or npm start for frontend)
  6. Navigate: Log in with BM Dashboard access → go to Weekly Project Summary → open the "Issue Tracking" tab. The "A List of Issues" table should appear above the issue charts.
  7. Table and filters:
    • Confirm columns: Issue Name, Tag, Open Since (days), Cost (USD), Person, Action.
    • Date range: Use "Filter by Date Range" to pick start/end; table should refetch and show only issues whose projects are ongoing in that range (per backend). Use the ✕ next to the date field to clear.
    • Projects: Use "Filter by Projects" (multi-select); table should refetch and show only issues for selected projects.
    • Reset: Click "Reset" and confirm that tag, date, and project filters are clear and list refetches.
  8. Tag filter: Click a tag (e.g., "Virtual" or "In-person") in the Tag column; the table should show only issues with that tag. Click the same tag again (or Reset) to clear.
  9. Actions:
    • Rename: Options → Rename → edit name in place → Submit. Expect success toast and updated name; empty name should show error toast.
    • Delete: Options → Delete → confirm in modal → Delete. Expect success toast and row removed; cancel should close the modal without deleting.
    • Close Issue: Options → Close. Expect success, toast, and row removed from the list (closed issues no longer returned as open).
  10. Pagination: If more than 5 issues, use « / » and page numbers; verify correct slice of issues and that filters still apply to the full set.
  11. Dark mode: Toggle app dark mode; verify table, filters, dropdown, datepicker, and modal have readable contrast and match provided dark theme screenshots.
  12. Edge cases: Empty list (no open issues) shows "No Open Issues Found" with contextual message; list with filters but no matches suggests adjusting filters. Issues with missing persons show "Unassigned"; missing tag shows "No tag". Loading state shows a spinner during fetch.

API examples (for manual/backend checks):

  • Get open issues (no filters): GET /api/bm/issues/open
  • With filters: GET /api/bm/issues/open?projectIds=id1,id2&startDate=2024-01-01&endDate=2024-12-31&tag=Virtual
  • Get projects: GET /api/bm/issues/projects
  • Update issue: PATCH /api/bm/issues/:issueId body { issueTitle: ["New Name"] } or { status: "closed" }
  • Delete: DELETE /api/bm/issues/:issueId

Screenshots or videos of changes:

  • Light mode:
LightMode
  • Dark mode:
DarkMode
  • Test Video:
TestVideo.mov

Note:

  • Performance Considerations: One fetch per filter change; list is client-paginated (5 items per page) from the current response. Large result sets remain limited by backend pagination if implemented.
  • Validation: Rename blocks empty submission with toast; API errors surfaced via toast and inline error banner; invalid/missing issue titles filtered out before display.
  • Dependencies: Uses existing stack (React Bootstrap, react-datepicker, react-select, react-toastify, axios); no new package added in this PR (yarn.lock churn is from merge/version resolution).

vamsikrishna1704 and others added 30 commits April 15, 2025 19:21
…ighestGoodNetworkApp into Vamsi_Krishna_Create_an_interactive_list_of_open_issues
…ighestGoodNetworkApp into Vamsi_Krishna_Create_an_interactive_list_of_open_issues
…ighestGoodNetworkApp into Vamsi_Krishna_Create_an_interactive_list_of_open_issues
…ighestGoodNetworkApp into Vamsi_Krishna_Create_an_interactive_list_of_open_issues
- Add comprehensive validation to filter issues without valid issueTitle
- Remove 'Untitled' fallback since validation ensures valid titles
- Fixes empty rows appearing in table when filtering by date/project
- Resolves reviewer-reported bugs with Untitled entries
- Change from createdDate to issueDate for accurate duration display
- Add default value of 0 for cost field to prevent undefined display
- Use Date.now() instead of new Date() for better performance
- Aligns with backend schema and requirements specification
- Change payload from dot notation to array format for backend compatibility
- Add validation to prevent empty issue names
- Add trim() to remove whitespace from input
- Improve error messages with more context
- Change from full ISO string to date-only format
- Matches backend specification and openIssueCharts pattern
- Prevents potential timezone-related filtering issues
- Improve error message format
- Add conditional rendering to prevent "undefined - undefined" display
- Show "Unassigned" when person data is missing
- Handle partial person data (name only without role)
- Improve UX with proper fallback values
- Conditionally render tag button only when tag exists
- Show "No tag" text for issues without tags
- Use null instead of empty string for cleaner logic
- Prevent empty tag buttons from appearing
- Display informative message when no issues match filters
- Provide different messages based on filter state
- Follow pattern from openIssueCharts component
- Improve user experience when table is empty
- Add loading state management for better UX
- Display spinner during data fetching
- Clear errors when starting new fetch
- Follow pattern from openIssueCharts component
- Add success toasts for rename, delete, and close operations
- Add error toasts with descriptive messages
- Improve error handling with backend error messages
- Follow toast pattern from issueActions
- Add confirmation dialog before deleting issues
- Follow modal pattern from IssueDashboard component
- Prevent accidental deletions with two-step process
- Add styling for both light and dark themes
- Extract isValidIssue helper for issue validation
- Extract formatDateForAPI helper for date formatting
- Extract getErrorMessage helper for API error handling
- Remove redundant 'filtered' useMemo (was just returning mappedIssues unchanged)
- Update all references to use mappedIssues directly
- Add component-level documentation explaining purpose and features
- Add JSDoc for isValidIssue helper function
- Add JSDoc for formatDateForAPI helper function
- Add JSDoc for getErrorMessage helper function
- Wrap fetchProjects and fetchIssuesWithFilters in useCallback to prevent unnecessary re-renders
- Add proper dependency arrays to useEffect hooks to satisfy exhaustive-deps rule
- Replace array index with semantic page number as key for pagination buttons to improve React reconciliation
- Simplify DatePicker onChange handler by removing redundant fetchIssuesWithFilters call (handled by useEffect)
- Import useCallback hook from React

Fixes:
- Biome lint exhaustive dependencies warnings
- Array index key anti-pattern in pagination
- Improves performance through proper memoization
Updated filter components (DatePicker and react-select) and pagination buttons to use darker blue background (#1c2541) with white text (#e0e0e0) in dark mode, matching the Options button styling for better contrast and visual consistency.
@netlify
Copy link

netlify bot commented Feb 6, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 88cc016
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69855aaf7b2d0d000845d010
😎 Deploy Preview https://deploy-preview-4800--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Aditya-gam and others added 4 commits February 5, 2026 18:40
Co-authored-by: Cursor <cursoragent@cursor.com>
Convert IssuesList.css to IssuesList.module.css to comply with CSS module policy that only allows .module.css or index.css files. Updated component to use CSS module imports and converted all class names to camelCase format.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

@Aditya-gam Aditya-gam changed the title Phase 2: Interactive list of open issues for BM Dashboard (integrates #3683) Aditya-feat: Phase 2 Interactive list of open issues for BM Dashboard (integrates #3683) Feb 6, 2026
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.

2 participants

Comments