Skip to content

[frontend/backend] Display custom views tab(s) (#13389)#15343

Open
fellowseb wants to merge 12 commits intoissue/13389-custom-viewsfrom
issue/13389-2-custom-views-tab
Open

[frontend/backend] Display custom views tab(s) (#13389)#15343
fellowseb wants to merge 12 commits intoissue/13389-custom-viewsfrom
issue/13389-2-custom-views-tab

Conversation

@fellowseb
Copy link
Copy Markdown
Member

@fellowseb fellowseb commented Apr 2, 2026

Proposed changes

Implements chunk Users can view a and navigate to a "Custom views" tab on entities pages of the "Custom views" feature

A custom view is a dashboard an administrator creates for a given entity type. This dashboard is then viewable (not editable) by "normal" users.

User journeys

  • Case 1: given there is one Custom views in DB for a specific Entity Type (ex.: Intrusion-Set); a participating user with the correct feature flag will see a new tab appear on the SDO page with the name of the custom view. Clicking on the tab reroutes the user to the custom view path (/[slug]-[id-without-dashes]) and displays its content.
  • Case 2: given there are multiple Custom views in DB for a specific Entity Type (ex.: Intrusion-Set); a participating user with the correct feature flag will see a Custom views tab appear on the SDO page. Clicking on the tab displays a drop-down menu with an item per custom view. Clicking on the menu items reroutes the user to the custom view path (/[slug]-[id-without-dashes]) and displays its content.
Enregistrement.de.l.ecran.2026-04-02.a.11.40.14.mov

Specs

Figma: https://www.figma.com/design/K2TFfOTI4MBgWzIyGT2AHV/Custom-views?node-id=119-150&t=y1ubGmkFiRj9H8fl-0
Notion: https://www.notion.so/filigran/New-TAB-with-a-custom-knowledge-view-2b18fce17f2a80f09a34db26a15ff8d1

Details

Frontend
  • Created a useTabWithDropDown hook that returns two components separately, for case 2: the returned Tab and the DropDown. Seems a little awkward but I had to do that given returning either a Fragment or an array of both elements under the <Tabs> component lead to styles not applied to the Tab.
  • Created types like DashboardManifest and DashboardConfig to be reused in all places using dashboards (Dashboards, Public Dashboards & Custom views)
  • Adds translation keys for the Custom view string
Backend

Data model changes:

  • Adds a path property to the custom view entity type and expose it in the API. This will be a concatenation of a slug (from the name) with its ID, and is used in the URL bar of the user, it's a path à la Notion that allows changing the name/slug while still being able to open an old link.
  • Adds a target_entity_type to CustomView entities to tell which entities are concerned by this custom view

Related issues

Manual testing

Feature branch deployment available here : https://feat-issue-13389-2-c.octi.staging.filigran.io/ .
Use "feat-issue-13389-2-c" credentials in 1Password.

Connect as customers@filigran.io.

To test case 1: go to a Campaign page. You should see a single custom view tab.
To test case 2 go to a Intrusion Set page. You should see two custom views under a dropdown tab.

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Apr 2, 2026
@fellowseb fellowseb changed the title Issue/13389 2 custom views tab [frontend/backend] Display custom views tab(s) (#13389) Apr 2, 2026
@fellowseb fellowseb changed the base branch from master to issue/13389-custom-views April 2, 2026 11:00
@fellowseb fellowseb force-pushed the issue/13389-custom-views branch from f8f1509 to c70d27e Compare April 2, 2026 23:29
@fellowseb fellowseb force-pushed the issue/13389-2-custom-views-tab branch from 916fae8 to 7be583e Compare April 3, 2026 07:38
@fellowseb fellowseb requested a review from Copilot April 3, 2026 07:43
@fellowseb fellowseb self-assigned this Apr 3, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 79.20354% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.27%. Comparing base (2b10314) to head (15c1eda).

Files with missing lines Patch % Lines
.../components/workspaces/dashboards/DashboardViz.tsx 9.09% 10 Missing ⚠️
...ont/src/private/components/widgets/useDashboard.ts 0.00% 8 Missing ⚠️
...front/src/private/components/custom_views/Root.tsx 30.00% 7 Missing ⚠️
...m/opencti-front/src/utils/filters/filtersUtils.tsx 0.00% 5 Missing ⚠️
...src/private/components/custom_views/CustomView.tsx 42.85% 4 Missing ⚠️
...on/stix_domain_objects/StixDomainObjectTabsBox.tsx 70.00% 3 Missing ⚠️
...ncti-front/src/components/NotionLikeRedirector.tsx 88.23% 2 Missing ⚠️
...encti-front/src/components/TabWithDropDownMenu.tsx 88.88% 2 Missing ⚠️
...ate/components/workspaces/dashboards/Dashboard.jsx 0.00% 2 Missing ⚠️
...pencti-platform/opencti-front/src/private/Root.tsx 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@                     Coverage Diff                      @@
##           issue/13389-custom-views   #15343      +/-   ##
============================================================
+ Coverage                     33.17%   33.27%   +0.10%     
============================================================
  Files                          3156     3166      +10     
  Lines                        214202   214406     +204     
  Branches                      39135    39161      +26     
============================================================
+ Hits                          71055    71350     +295     
+ Misses                       143147   143056      -91     
Flag Coverage Δ
opencti-client-python 45.59% <ø> (ø)
opencti-front 3.06% <66.66%> (+0.19%) ⬆️
opencti-graphql 69.16% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fellowseb fellowseb force-pushed the issue/13389-custom-views branch from c70d27e to 7e8927c Compare April 3, 2026 07:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 98 out of 100 changed files in this pull request and generated 3 comments.

Comment on lines +141 to +148
{shouldDisplayCustomViewTab ? (
<Tab
component={Link}
to={customViews[0].path}
value={CUSTOM_VIEW_TAB_VALUE}
label={customViews[0].name}
/>
) : null}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

When a single custom view is available, the Tab component's to property should prepend the basePath to the custom view path, matching the pattern used in the dropdown menu items (line 121). Currently, the link will not work correctly when navigating to the custom view because the basePath is omitted.

Copilot uses AI. Check for mistakes.
Comment on lines +41 to 42
const parsedManifest: DashboardManifest = JSON.parse(manifest ? fromB64(manifest) : '{}');
const { widgets, config } = parsedManifest;
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

When parsing an empty manifest (when manifest is null/undefined), the code uses JSON.parse('{}') which creates an object without the config and widgets properties required by DashboardManifest. While the code has defensive checks for undefined values (line 65), the type assertion on line 41 is incorrect. Consider using the deserializeDashboardManifestForFrontend utility function which properly handles empty manifests, or explicitly construct the proper structure.

Copilot uses AI. Check for mistakes.
} as const;

const ARROW_STYLE = {
fontStyle: '20px',
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The CSS property should be fontSize instead of fontStyle. The fontStyle property is used for specifying italic, normal, or oblique styles, not for setting font size. The correct property is fontSize: '20px'.

Suggested change
fontStyle: '20px',
fontSize: '20px',

Copilot uses AI. Check for mistakes.
@fellowseb fellowseb force-pushed the issue/13389-custom-views branch from 7e8927c to ba8cbc1 Compare April 3, 2026 07:57
@fellowseb fellowseb force-pushed the issue/13389-2-custom-views-tab branch from 7be583e to 129f9f2 Compare April 3, 2026 08:00
@fellowseb fellowseb marked this pull request as ready for review April 3, 2026 08:35
@fellowseb fellowseb force-pushed the issue/13389-2-custom-views-tab branch 3 times, most recently from 1a1e42b to e79e7a1 Compare April 3, 2026 16:58
@fellowseb fellowseb force-pushed the issue/13389-custom-views branch from ba8cbc1 to 2b10314 Compare April 3, 2026 18:44
@fellowseb fellowseb force-pushed the issue/13389-2-custom-views-tab branch 2 times, most recently from 086f64b to 1610e64 Compare April 4, 2026 20:21
@fellowseb fellowseb force-pushed the issue/13389-2-custom-views-tab branch from 1610e64 to 1a45852 Compare April 4, 2026 22:40
@fellowseb fellowseb force-pushed the issue/13389-2-custom-views-tab branch from 1a45852 to 15c1eda Compare April 4, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Custom view] Introduce custom views

2 participants