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

[FEAT] Refactor the layout of modules #3494

Merged
merged 9 commits into from
Aug 9, 2021

Conversation

Desvelao
Copy link
Member

Changes

  • Refactor modules-defaults.js to define what buttons and components are rendered in each module tab.
  • Removed old logic to render the component depending on the selected module and tab.
  • Removed the Explore agent button from Modules/MITRE ATT&CK/Intelligence.
  • Created PromptModuleNotForAgent component.
  • Created withModuleNotForAgent HOC.

Tests

  • Review each tab for each module is rendering its view.
  • Review the Explore agent is working as usual.
  • Review the Generate report is working as usual.
  • Review the Modules/MITRE ATT&CK/Intelligence is not displaying the Explore agent button.

Closes #3485

Desvelao added 3 commits July 19, 2021 13:25
… and view are redered.

  - Moved view to each tab in tab for each module
  - Now each module tab defines its buttons to display in the header
  - Adapted custom tab components adding the `withAgentSupportModule`
  - Created and refactor the logic of `Loader` component to a HOC `withModuleTabLoader`
  - Removed `Settings` and `Loader` components duw to are not used
  - Removed not used imports
  - Refactor `Explore agent` button
  - Added `availabeFor` propery to `modules-defaults.json` used by
`Explore agent` button.
  - Created `PromptModuleNotForAgent` component
  - Created `withModuleNotForAgent` HOC
  - Removed no used code and use component props intead use `store` in `public/components/common/modules/main.tsx`
@Desvelao Desvelao added the type/enhancement Enhancement issue label Jul 20, 2021
@Desvelao Desvelao requested a review from a team July 20, 2021 11:20
@Desvelao Desvelao self-assigned this Jul 20, 2021
@pablomarga
Copy link
Contributor

When generation a report in Security Events this error is displayed in the dev tools console
Screenshot_20210721_131731

@sortiz1191 sortiz1191 self-requested a review August 3, 2021 13:14
Copy link
Contributor

@sortiz1191 sortiz1191 left a comment

Choose a reason for hiding this comment

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

CR & Test: LGTM

Copy link
Member

@mpRegalado mpRegalado left a comment

Choose a reason for hiding this comment

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

CR: LGTM ✔️
Testing: LGTM ✔️


export const PromptModuleNotForAgent = ({ body, title, ...agentSelectionProps }: PromptSelectAgentProps) => {
const dispatch = useDispatch();
const filterManager = useFilterManager();
Copy link
Member

Choose a reason for hiding this comment

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

This has changed in the office365 branch. Noting it so we are mindful when merging there.

@CPAlejandro
Copy link
Contributor

Changes applied:

  • In visualizationIDList we save the visualizations that we are going to show, thus avoiding the undefined that were previously passed to it in item.

Copy link
Member

@mpRegalado mpRegalado left a comment

Choose a reason for hiding this comment

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

CR: LGTM ✔️

@Desvelao
Copy link
Member Author

Desvelao commented Aug 9, 2021

Changes

  • Updated the branch with the last changes of 4.3-7.10
  • Resolved the conflicts

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2021

Jest Test Coverage % values
Statements 3.81% ( 1360 / 35655 )
Branches 1.47% ( 413 / 28047 )
Functions 2.62% ( 225 / 8598 )
Lines 3.86% ( 1315 / 34079 )

@Desvelao Desvelao merged commit cb2c131 into 4.3-7.10 Aug 9, 2021
@Desvelao Desvelao deleted the feat/3485-enhance-module-tab-buttons branch August 9, 2021 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants