Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend/backend] Public dashboard chunk 2 (#4903) #5951

Merged
merged 12 commits into from Mar 20, 2024

Conversation

lndrtrbn
Copy link
Member

@lndrtrbn lndrtrbn commented Feb 13, 2024

Proposed changes

Context recap: possibility to publish a version of a dashboard that is visible by every having the url. No need to be connected to OpenCTI. In the previous chunk (merged) we defined the process to create public dashboard and implemented one widget to feature the scenario. The objective of this PR is to generalize to all the widgets we can have in a dashboard.

  • [front] refactor all existing widgets (used in private dashboard) to avoid duplicating code and be able to generate easier their public versions used in public dashboard.
  • [back] create the different APIs to be able to retrieve the data for widgets.
  • [front] use those new APIs in public widgets called inside public dashboards.
  • [back] some refactoring on private APIs where typescript errors were found.
  • [back] deleting a private dashboard also delete its public dashboards.
  • [back] tests CRUD public dashboard + basic usage of widgets.

Related issues

Checklist

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

Further comments

80% of the lines are refactoring and new widgets on frontend side. And there is a lot, it's not possible to read all the changes so we invite to focus more on the backend code and manual testing for the widgets.

How to test?

  • Create a dashboard and add it all sort of widgets for both entities and knowledge graph,
  • Click on publish button (top right) to create some public dashboards,
  • Play with markings and keep an eye on the difference of data displayed in the widgets,
  • Delete some public dashboards, the URL should redirect to home or login page,
  • Delete the private dashboard, all associated public URL should redirect to home or login page.

@marieflorescontact marieflorescontact force-pushed the issue/4903-public-widgets-2 branch 3 times, most recently from 691d549 to 1d486ca Compare February 19, 2024 08:50
@SarahBocognano SarahBocognano added the filigran team use to identify PR from the Filigran team label Feb 20, 2024
@marieflorescontact marieflorescontact force-pushed the issue/4903-public-widgets-2 branch 3 times, most recently from 3888dcf to af4afaf Compare February 22, 2024 08:40
@lndrtrbn lndrtrbn force-pushed the issue/4903-public-widgets-2 branch 7 times, most recently from 17f1ce2 to 12be3bd Compare March 4, 2024 14:35
@lndrtrbn lndrtrbn marked this pull request as ready for review March 4, 2024 15:06
@lndrtrbn lndrtrbn changed the title Issue/4903 public widgets 2 [frontend/backend] Public dashboard chunk 2 (#4903) Mar 4, 2024
@labo-flg
Copy link
Member

labo-flg commented Mar 8, 2024

Could you move the widget definition in another file in the tests, please ?
It would make it easier to read, and focus on the test itself.

Copy link
Member

@labo-flg labo-flg left a comment

Choose a reason for hiding this comment

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

Pair reviewed, comments addressed.

Tested on several dashboards.
Last remarks is about the date on the line graph: the date are technical in private dashboard, but seems to be the real creation date once public.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 73.59223% with 136 lines in your changes are missing coverage. Please review.

Project coverage is 67.31%. Comparing base (70fb123) to head (7fecdd1).

Files Patch % Lines
.../modules/publicDashboard/publicDashboard-domain.ts 66.94% 118 Missing ⚠️
...ncti-platform/opencti-graphql/src/types/store.d.ts 0.00% 12 Missing ⚠️
...-graphql/src/modules/workspace/workspace-domain.ts 89.74% 4 Missing ⚠️
.../opencti-graphql/src/database/middleware-loader.ts 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5951      +/-   ##
==========================================
+ Coverage   66.97%   67.31%   +0.34%     
==========================================
  Files         541      541              
  Lines       64557    64992     +435     
  Branches     5313     5393      +80     
==========================================
+ Hits        43234    43748     +514     
+ Misses      21323    21244      -79     

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

@lndrtrbn lndrtrbn force-pushed the issue/4903-public-widgets-2 branch from db863fa to 7e5cafd Compare March 19, 2024 15:05
@lndrtrbn lndrtrbn force-pushed the issue/4903-public-widgets-2 branch from 7e5cafd to dfe5929 Compare March 19, 2024 15:21
@lndrtrbn lndrtrbn force-pushed the issue/4903-public-widgets-2 branch from dfe5929 to 0c8055a Compare March 19, 2024 16:39
@lndrtrbn lndrtrbn force-pushed the issue/4903-public-widgets-2 branch from 0c8055a to 7fecdd1 Compare March 19, 2024 17:12
@lndrtrbn lndrtrbn merged commit ba2d2a5 into master Mar 20, 2024
8 checks passed
@lndrtrbn lndrtrbn deleted the issue/4903-public-widgets-2 branch March 20, 2024 08:19
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.

None yet

4 participants