Skip to content

feat: add secret import support to overview page#5509

Merged
scott-ray-wilson merged 17 commits intomainfrom
SECRETS-85
Feb 24, 2026
Merged

feat: add secret import support to overview page#5509
scott-ray-wilson merged 17 commits intomainfrom
SECRETS-85

Conversation

@scott-ray-wilson
Copy link
Contributor

Context

This PR adds secret import support to the overview page:

  • ability to add secret imports from resource dropdown
  • ability to sort and view imports in single-env view
  • ability to view and compare imports in multi-env view

Screenshots

CleanShot 2026-02-17 at 17 51 57@2x

Steps to verify the change

  • verify import creation behavior
  • verify import sort behavior
  • verify import display accuracy (replication vs direct)
  • verify pagination behavior (no regressions when no imports and proper total count andpagination when imports exist, varying env presence, and replication vs direct)
  • verify comparison behavior in multi-view
  • verify responsiveness of new elements

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Read the contributing guide

@linear
Copy link

linear bot commented Feb 18, 2026

@maidul98
Copy link
Collaborator

maidul98 commented Feb 18, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 18, 2026

Greptile Summary

This PR adds secret import support to the overview page, enabling users to view, create, sort (drag-and-drop in single-env view), compare (multi-env view), and delete secret imports directly from the overview. The implementation closely follows existing patterns for folders, dynamic secrets, and secret rotations.

  • Backend: Adds getUniqueImportCountByFolderIds DAL method for counting distinct imports across folder IDs, updates the dashboard router to include imports in totalCount and the early-return path, and removes search filtering from import counts (search is now handled client-side for imported secret content).
  • Frontend: New SecretImportTableRow component with expand/collapse for viewing imported secrets, drag-and-drop reorder support via @dnd-kit/react (v0.3.0, pre-1.0), environment selection dialog for creating imports in multi-env view, and a delete confirmation dialog.
  • Style consistency: Several existing components updated from hover:text-red to hover:text-danger, and Table component updated to use forwardRef and :last-of-type CSS selector.
  • The @dnd-kit/react package (v0.3.0) is a pre-1.0 dependency — worth monitoring for breaking changes in future updates.
  • No breaking API changes detected.

Confidence Score: 4/5

  • This PR is safe to merge with minor concerns around a non-null assertion and a pre-1.0 dependency.
  • The changes follow existing codebase patterns closely. The backend query logic is sound and the frontend components are well-structured. The main concerns are: (1) a non-null assertion on an optional environment field that could cause a runtime error in edge cases, and (2) introducing a pre-1.0 dependency (@dnd-kit/react v0.3.0). No security vulnerabilities or breaking API changes identified.
  • frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx deserves attention for the non-null assertion on line 782 and the overall complexity of the changes.

Important Files Changed

Filename Overview
backend/src/services/secret-import/secret-import-dal.ts Adds getUniqueImportCountByFolderIds that counts distinct (importPath, importEnv) pairs, filtering out reserved imports. Uses isReserved: false which is consistent with the frontend filtering logic. Column names in the query are unambiguous since the join is only with the Environment table.
backend/src/server/routes/v1/dashboard-router.ts Adds import count to totalCount, includes imports in the early-return path, and adds pagination offset logic for imports. The uniqueImportCount calculation for adjusting remainingLimit is consistent with the backend count query (both filter isReserved).
frontend/src/hooks/utils/secrets-overview.tsx Adds useSecretImportOverview hook following the same pattern as existing useFolderOverview, useDynamicSecretOverview, etc. Properly filters out reserved imports in all helper functions.
frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx Major changes: adds DragDropProvider for import reordering, secret import creation dialog with environment selection, import deletion, and rendering import rows in both single-env and multi-env views. Has a non-null assertion on secretImportData.environment! and introduces @dnd-kit/react (pre-1.0 library).
frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx New component implementing the import table row with single-env drag-to-reorder support and multi-env expanded view showing linked environments and imported secrets with discrepancy detection.
frontend/src/components/v3/generic/Table/Table.tsx Converts UnstableTableRow to use React.forwardRef for ref forwarding (needed for drag-and-drop), and fixes CSS selector from :last-child to :last-of-type.
frontend/package.json Adds @dnd-kit/react v0.3.0 (pre-1.0 beta package) as a new dependency for drag-and-drop support.

Last reviewed commit: 2003d52

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

20 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

@scott-ray-wilson scott-ray-wilson merged commit a27938c into main Feb 24, 2026
11 of 12 checks passed
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