-
Notifications
You must be signed in to change notification settings - Fork 807
Ransomware landing page #1326
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
Ransomware landing page #1326
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1326 +/- ##
===========================================
- Coverage 40.31% 40.28% -0.04%
===========================================
Files 471 475 +4
Lines 13826 14041 +215
===========================================
+ Hits 5574 5656 +82
- Misses 8252 8385 +133
Continue to review full report at Codecov.
|
…add the ability to disable side navigation
…a Response object to be a promise instead of an object
…(if mode not chosen redirect to landing page, etc.)
dc1dd11
to
dae6692
Compare
…avigation button to go out of "active" mode on ransomware report tab
LandingPage: '/landing-page', | ||
GettingStartedPage: '/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the landing page be /
and the getting started page be /getting-started
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /landing-page
is only default as long as the mode is not chosen
<h4 className={'monkey-description-title'}>What is Infection Monkey?</h4> | ||
<strong>Infection Monkey</strong> is an open-source security tool for testing a data center's resiliency to | ||
perimeter | ||
breaches and internal server infections. The Monkey uses various methods to propagate across a data center | ||
and reports to this Monkey Island Command and Control server. | ||
</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this duplicate to the Getting Started page ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this was a requirement we set in the issue
export const DisabledSidebarLayoutComponent = ({component: Component, ...rest}) => ( | ||
<Route {...rest} render={() => ( | ||
<Row> | ||
<Col sm={3} md={3} lg={3} xl={2} className='sidebar'> | ||
<SideNavComponent disabled={true} completedSteps={rest['completedSteps']}/> | ||
</Col> | ||
<Component {...rest} /> | ||
</Row> | ||
)}/> | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be mostly duplicated from StandardLayoutComponent
. Why not just pass a sidebarDisabled
prop to StandardLayoutComponent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions (not all related to the PR)
} | ||
}); | ||
}; | ||
|
||
checkMode = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be named better. setModeFromBackend()
?
needsRedirectionToLandingPage = (route_path) => { | ||
return (this.state.islandMode === null && route_path !== Routes.LandingPage) | ||
} | ||
|
||
needsRedirectionToGettingStarted = (route_path) => { | ||
return route_path === Routes.LandingPage && | ||
this.state.islandMode !== null && | ||
this.state.islandMode !== undefined | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're checking that this.state.islandMode
is not null or undefined in needsRedirectionToGettingStarted
but only checking that it is null in needsRedirectionToLandingPage
. Why aren't you checking if this.state.islandMode
is null OR undefined needsRedirectionToLandingPage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, the check for undefined is unnecessary since we set the default to null
…Component.tsx into one component to remove duplication
…coded routes into an enum
9c0a423
to
4293673
Compare
What does this PR do?
Fixes parts of #1241
Add any further explanations here.
PR Checklist
Testing Checklist
Screenshots: