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] Add a new relationship views in entities having an Attack Pattern Knowledge view (#8835) #9623

Merged
merged 21 commits into from
Jan 30, 2025

Conversation

CelineSebe
Copy link
Member

@CelineSebe CelineSebe commented Jan 16, 2025

Proposed changes

  • add relationship view button
  • add dataTable view for the relationships
  • add generic component to display the relationship

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 (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

@CelineSebe CelineSebe self-assigned this Jan 16, 2025
@CelineSebe CelineSebe changed the base branch from master to release/6.5.0 January 16, 2025 16:07
@CelineSebe CelineSebe changed the title [frontend] Add a new relationship views in entitys having an Attack Pattern Knwoledge view (#8835) [frontend] Add a new relationship views in entities having an Attack Pattern Knwoledge view (#8835) Jan 16, 2025
@labo-flg labo-flg force-pushed the release/6.5.0 branch 5 times, most recently from 9535c45 to 8574b42 Compare January 17, 2025 16:11
@labo-flg labo-flg added the filigran team use to identify PR from the Filigran team label Jan 20, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.33%. Comparing base (6485014) to head (b26e093).
Report is 9 commits behind head on release/6.5.0.

Additional details and impacted files
@@                Coverage Diff                @@
##           release/6.5.0    #9623      +/-   ##
=================================================
+ Coverage          64.29%   64.33%   +0.04%     
=================================================
  Files                653      653              
  Lines              62473    62475       +2     
  Branches            6920     6923       +3     
=================================================
+ Hits               40166    40195      +29     
+ Misses             22307    22280      -27     

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

@CelineSebe CelineSebe force-pushed the issue/8835 branch 3 times, most recently from 1b33fee to a58bb96 Compare January 23, 2025 14:16
@CelineSebe CelineSebe marked this pull request as ready for review January 23, 2025 15:35
@delemaf delemaf self-requested a review January 23, 2025 15:42
preloadedPaginationProps={preloadedPaginationProps}
exportContext={{ entity_type: 'Attack-Pattern' }}
additionalHeaderButtons={[
(<ToggleButton key="matrix" value="matrix" aria-label="matrix">
Copy link
Member

Choose a reason for hiding this comment

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

would be nice if we could extract this list of buttons to avoid duplication with StixDomainObjectAttackPatternsKillChainMatrixInLine

Copy link
Member

@marieflorescontact marieflorescontact left a comment

Choose a reason for hiding this comment

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

Locally tested:

  • There is a scroll bar when list is empty:
    image

  • Need to full refresh to see in the list newly created relationship

  • Sorting by type/creators/authors makes the platform crash
    image

@CelineSebe
Copy link
Member Author

  • There is a scroll bar when list is empty:

I don't reproduce this issue on my side, but it is linked to the datatable.
image
Are you in full screen? You may need to reset the columns.

I'll look into the other issues. thanks !

predefinedFilters.push({ key: 'elementWithTargetTypes', values: targetTypes });
} else if (direction === 'toEntity') {
predefinedFilters.push({ key: 'toId', values: [entityId] });
// if (role) predefinedFilters.push({ key: 'toRole', values: [role] });
Copy link
Member

Choose a reason for hiding this comment

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

Did you forget comments (line 302, 306)

Copy link
Member

@SouadHadjiat SouadHadjiat left a comment

Choose a reason for hiding this comment

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

Select all relationships targets all entities in the platform, there should be filters
image

@SouadHadjiat SouadHadjiat changed the title [frontend] Add a new relationship views in entities having an Attack Pattern Knwoledge view (#8835) [frontend] Add a new relationship views in entities having an Attack Pattern Knowledge view (#8835) Jan 28, 2025
@marieflorescontact marieflorescontact self-requested a review January 29, 2025 15:55
Copy link
Member

@marieflorescontact marieflorescontact left a comment

Choose a reason for hiding this comment

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

functionally tested ok 👌

@@ -21,4 +22,22 @@ const useQueryLoading = <T extends OperationType>(
return queryRef;
};

export const useQueryLoadingWithLoadQuery = <T extends OperationType>(
query: GraphQLTaggedNode | PreloadableConcreteRequest<T>,
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to create a new method here, as the code is exactly the same as in useQueryLoading except for the return ?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not exactly the same. We have returned loadQuery in addition to queryRef.

Copy link
Member

Choose a reason for hiding this comment

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

yes, the return is different, loadQuery is returned in useQueryLoadingWithLoadQuery but except that the method is exectly the same. I was wondering if we really need to have 2 methods

@SouadHadjiat SouadHadjiat self-requested a review January 29, 2025 16:52
@delemaf delemaf removed their request for review January 30, 2025 08:22
@CelineSebe CelineSebe merged commit cbb6dd7 into release/6.5.0 Jan 30, 2025
5 checks passed
@CelineSebe CelineSebe deleted the issue/8835 branch January 30, 2025 08:41
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.

Add a view in entity/knowledge/attack pattern representing the relation
5 participants