Skip to content

Commit

Permalink
code review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Jun 16, 2021
1 parent 5c9905f commit 87ea5cb
Showing 1 changed file with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,45 +60,45 @@ export const useEndpointActionItems = (
selected_endpoint: endpointId,
});

const isolationActions = isIsolated // Un-isolate is always available to users regardless of license level
? [
{
'data-test-subj': 'unIsolateLink',
icon: 'logoSecurity',
key: 'unIsolateHost',
navigateAppId: MANAGEMENT_APP_ID,
navigateOptions: {
path: endpointUnIsolatePath,
},
href: formatUrl(endpointUnIsolatePath),
children: (
<FormattedMessage
id="xpack.securitySolution.endpoint.actions.unIsolateHost"
defaultMessage="Unisolate host"
/>
),
},
]
: isPlatinumPlus // For Platinum++ licenses, users also have ability to isolate
? [
{
'data-test-subj': 'isolateLink',
icon: 'logoSecurity',
key: 'isolateHost',
navigateAppId: MANAGEMENT_APP_ID,
navigateOptions: {
path: endpointIsolatePath,
},
href: formatUrl(endpointIsolatePath),
children: (
<FormattedMessage
id="xpack.securitySolution.endpoint.actions.isolateHost"
defaultMessage="Isolate host"
/>
),
},
]
: [];
const isolationActions = [];

if (isIsolated) {
// Un-isolate is always available to users regardless of license level
isolationActions.push({
'data-test-subj': 'unIsolateLink',
icon: 'logoSecurity',
key: 'unIsolateHost',
navigateAppId: MANAGEMENT_APP_ID,
navigateOptions: {
path: endpointUnIsolatePath,
},
href: formatUrl(endpointUnIsolatePath),
children: (
<FormattedMessage
id="xpack.securitySolution.endpoint.actions.unIsolateHost"
defaultMessage="Unisolate host"
/>
),
});
} else if (isPlatinumPlus) {
// For Platinum++ licenses, users also have ability to isolate
isolationActions.push({
'data-test-subj': 'isolateLink',
icon: 'logoSecurity',
key: 'isolateHost',
navigateAppId: MANAGEMENT_APP_ID,
navigateOptions: {
path: endpointIsolatePath,
},
href: formatUrl(endpointIsolatePath),
children: (
<FormattedMessage
id="xpack.securitySolution.endpoint.actions.isolateHost"
defaultMessage="Isolate host"
/>
),
});
}

return [
...isolationActions,
Expand Down

0 comments on commit 87ea5cb

Please sign in to comment.