Commit Graph

1346 Commits

Author SHA1 Message Date
Bryan Frimin
82f241628c Refactor MeasuresPage to use Relay fragments
Replace the client-side grouped-by-category view (fetching 500 items)
with a flat table using server-side filtering and cursor-based
pagination. Colocate GraphQL queries, fragments, and mutations in the
component file per console CLAUDE.md conventions.

Backend changes add a category filter to the measure list endpoints
(GraphQL, MCP) and a new measureCategories field on Organization.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:54:33 +01:00
Bryan Frimin
32cc4a4f9c WIP
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:39 +01:00
Bryan Frimin
239f201a93 Restore missing useState import in AuditsPage
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:38 +01:00
Bryan Frimin
5c42d2e9ba Simplify dropzone overlay to use fixed positioning without portal
Remove createPortal and main element ref/state in favor of a simple
fixed overlay with top-12 offset. This avoids React 19 strict mode
violations around ref access during render and setState in effects.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:38 +01:00
Bryan Frimin
6eebfa11ef Use state instead of ref for main element portal target
Replace mainRef with useState to avoid accessing ref.current during
render, which is forbidden by React 19's strict ref rules.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:38 +01:00
Bryan Frimin
f89fdc02b1 Clean up main element style on unmount in AuditsPage
Add cleanup function to the useEffect that sets position: relative on
the main element, so the style is restored when the component unmounts.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:37 +01:00
Bryan Frimin
44cc650af2 Fix dragCounterRef going negative in audit list dropzone
Clamp the counter with Math.max(0, ...) and use <= 0 check to prevent
the drag overlay from getting stuck when dragLeave fires more than
dragEnter.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:37 +01:00
Bryan Frimin
e055b21bc3 Exclude header from audit dropzone overlay
Offset the fixed overlay with top-12 so the navigation bar remains
visible and unobstructed during file drag.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:37 +01:00
Bryan Frimin
d746f32903 Use window-level drag detection for audit list dropzone
The previous approach attached drag handlers to a content div that
didn't fill the viewport, making the dropzone hard to target. Now
drag detection uses window-level events with a counter for correct
nested element handling, and the full-screen overlay itself becomes
the react-dropzone drop target.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:37 +01:00
Bryan Frimin
d360725d24 Fix import order and handle GraphQL errors in upload onCompleted
- Move DialogFooter before type DialogRef to satisfy import-x/order
- Check errors argument in onCompleted callback to avoid treating
  GraphQL errors as successful uploads

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:36 +01:00
Bryan Frimin
65e3bd014b Fix ESLint violations in CreateAuditDialog
- Fix import order for DialogRef type
- Add explicit type parameter to useMutation
- Remove unnecessary parens around single arrow function arg
- Fix jsx-one-expression-per-line for MB text

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:36 +01:00
Bryan Frimin
a6d5e9b1f0 Colocate upload mutation and remove promisifyMutation usage
Move uploadAuditReportMutation into CreateAuditDialog and replace
promisifyMutation with a Promise wrapper using native Relay callbacks.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:36 +01:00
Bryan Frimin
b4a6618736 Add PDF dropzone to audit list for streamlined report upload
Enable users to drag-and-drop PDF reports onto the audit list page, which automatically opens the create-audit dialog with the file attached. The dialog chains createAudit → uploadAuditReport mutations, with graceful handling for partial failures (audit created but upload failed).

Changes:
- AuditsPage: Add dropzone with visual overlay (dashed border + icon) when dragging PDFs
- CreateAuditDialog: Accept optional file prop, show file info, chain mutations on submit
- Extract audit ID from createAudit response to pass to uploadAuditReport
- Handle upload failure with warning toast, allowing manual upload from audit detail page
- Add react-dropzone dependency to console app

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:39:34 +01:00
Bryan Frimin
1e5f4012f0 Add dynamic favicon for trust center using file API
Use the trust center's logo as favicon via the public file API URL,
falling back to the default favicon when no logo is configured.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:32:37 +01:00
Bryan Frimin
751d9eb1f3 Add SSR for compliance page with dynamic title and meta tags
Implement server-side rendering of trust center page `<head>` with dynamic organization name and OG meta tags. Adds generic `FileRenderer` mechanism to statichandler for dynamic file rendering, allowing the trust server to inject templated content at request time.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 09:32:34 +01:00
Bryan Frimin
52b4951507 Hide audit report buttons when no file attached
When an audit has no report attached, neither the View nor Request access button should be displayed. Updated the conditional rendering to wrap the entire button section with the audit.report check instead of only checking it in the nested ternary.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:20:04 +01:00
Bryan Frimin
0e0539f1f3 Replace console frontend with unified findings pages
Add FindingsPage, FindingDetailsPage, and CreateFindingDialog
supporting all finding kinds (nonconformity, observation, exception)
with filtering, sorting, and audit linking.

Remove the separate nonconformity and continual improvement pages,
routes, and graph hooks. Update sidebar navigation, routes, and
components for nullable audit framework field.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-17 15:05:33 +01:00
Sacha Al Himdani
cf1dadc0b5 Add implemented state and justification to controls
Introduce `implemented` enum (IMPLEMENTED/NOT_IMPLEMENTED) and
`not_implemented_justification` (nullable text) fields on the Control
entity across all API surfaces (GraphQL, MCP, CLI), database, frontend,
and SOA export.

The database stores implementation state as a PostgreSQL enum
`control_implementation_state`. Controls default to IMPLEMENTED during
migration. The SOA list and PDF export show implementation status
alongside applicability, with "-" for non-applicable controls.
Justification columns are renamed for clarity: "Justification for
non-applicability" and "Justification for non-implementation".

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-17 11:01:04 +01:00
Bryan Frimin
7ffb2d5e94 Add document viewer with proper 404 handling for trust center
Move document download/view to a dedicated viewer page with PDF preview,
access request flow, and a proper 404 error boundary when documents are
not found. The backend now returns NOT_FOUND instead of INTERNAL for
missing documents and reports.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 19:13:21 +01:00
Bryan Frimin
807213d384 Stop tracking generated files
Run make generate in CI lint and test jobs since generated files are
now gitignored. Also include Relay codegen for frontend apps in the
generate target.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 16:19:47 +01:00
Sacha Al Himdani
0b7c0e0806 Add validation to mailman service
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-16 14:37:34 +01:00
Émile Ré
f62a2cb494 Fix build
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-16 16:50:57 +04:00
Bryan Frimin
f4a027e719 Fix generated files
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-16 12:07:37 +01:00
Bryan Frimin
7a4101185b Add per-folder CLAUDE.md for key packages
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 15:04:27 +01:00
Bryan Frimin
ecba352307 Revert relay generics that cause cascade type errors
Adding TypeScript generics to useMutation, usePaginationFragment,
and useRefetchableFragment in graph hooks and page files causes
cascade type mismatches: string values are not assignable to
generated enum types, and typed refetch functions are incompatible
with SortableTable's generic refetch prop.

Use eslint-disable-next-line relay/generated-typescript-types
instead until the calling code is updated to use enum types.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:45:23 +01:00
Bryan Frimin
43d6ab38fb Fix formatting and React hook dependency lint errors
Fix max-len violations by breaking long lines across multiple
lines. Fix react-hooks/exhaustive-deps by adding missing deps
and removing unnecessary ones. Remove stale eslint-disable
comments in DataTable stories.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:32:54 +01:00
Bryan Frimin
13ca50df68 Fix relay lint in components and pages
Remove unused GraphQL fields (createdAt, updatedAt, totalCount,
__id, sourceId, etc.) from queries and fragments across 50+ files.

Add TypeScript generics to useMutation, usePaginationFragment,
useRefetchableFragment, and useLazyLoadQuery calls to satisfy
relay/generated-typescript-types.

Add justified eslint-disable comments for fields needed by Relay
cache normalization (id) or consumed by sibling components through
fragment spreads.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:32:43 +01:00
Bryan Frimin
d263cda3f6 Add eslint-disable and TypeScript generics to graph hooks
Centralized graph files (hooks/graph/*.ts) define GraphQL
queries consumed by multiple page components. This architecture
intentionally separates field definitions from usage, triggering
relay/unused-fields and relay/must-colocate-fragment-spreads.
File-level eslint-disable comments suppress these false positives.

Also adds explicit TypeScript generics to useMutation and
usePaginationFragment calls to satisfy relay/generated-typescript-types
without eslint-disable.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-15 13:32:18 +01:00
Émile Ré
0fe494bb73 Fix condition
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-13 16:58:11 +04:00
Émile Ré
5188f9638b Fix usage of getPathPrefix
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-13 16:58:11 +04:00
Sacha Al Himdani
c493e31745 Fix documents UI
- Fix redirection after document deletion in detail page
- Fix refetch after publication
- Return proper error when trying to update a published document

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-13 12:01:57 +01:00
Sacha Al Himdani
4fbb5acb70 Change compliance update modals
- Merge new and edit modals design
- Create a send modal

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-12 20:33:15 +01:00
Sacha Al Himdani
c98ffaeda3 Add mermaid suport
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-12 14:41:30 +01:00
Émile Ré
85ed5296e7 Fix safe ssoLoginURL params after activation + resolver error
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-12 17:24:27 +04:00
Émile Ré
792871bab6 Stop redirecting on sign up errors
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-12 17:24:27 +04:00
Émile Ré
1d54f22cd9 Add ssoLoginURL in activate account outputs
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-12 17:24:27 +04:00
Émile Ré
03bdb27e20 redirect to password login after setting password
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-12 17:24:27 +04:00
Sacha Al Himdani
b8ba213fcb Compliance updates should be public
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-12 13:46:19 +01:00
Sacha Al Himdani
5372404a12 Fix compliance update display
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-11 18:34:44 +01:00
Sacha Al Himdani
85ec106cd6 Send mailing list emails
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-11 15:34:37 +01:00
Sacha Al Himdani
4d2cb793b6 Add compliance page mailing list base
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-11 15:34:36 +01:00
Émile Ré
38a0f28094 Misc fixes
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:43 +04:00
Émile Ré
af17afeffb Catch account already activated error and redirect
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:43 +04:00
Émile Ré
355e6b81b8 Add an account activation step in the signing request flow when needed
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:42 +04:00
Émile Ré
fec4696aeb Remove document signing requests page
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-03-11 17:08:42 +04:00
Bryan Frimin
73ba7aab63 Fix duplicated identifier
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:17:06 +01:00
Sacha Al Himdani
6b75d55330 Update vendor compliance report UI
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-03-11 13:09:03 +01:00
Bryan Frimin
e1643d1e3a Add missing validation
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:02 +01:00
Bryan Frimin
edce4fe666 Fix lint
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:02 +01:00
Bryan Frimin
e393411333 Move kind to string
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-11 13:09:02 +01:00