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

[ENDPOINT][INGEST]Task/endpoint ingest update #67234

Merged
merged 25 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e300f90
endpoint advanced config. changed message
parkiino May 18, 2020
11c3837
add edit mode
parkiino May 20, 2020
0cf3ae9
no more endpoint
parkiino May 21, 2020
82b20af
wow it werks but after going down the wrong path
parkiino May 21, 2020
2b0fa3e
fix type script error
parkiino May 21, 2020
4ccc118
rename linky
parkiino May 26, 2020
3398ed6
Merge remote-tracking branch 'upstream/master' into task/endpoint-inj…
parkiino May 26, 2020
f232a7c
use navigatetoapp, no refresh
parkiino May 26, 2020
b1777d9
Merge branch 'master' into task/endpoint-injest-update
elasticmachine May 26, 2020
8444aec
fixed wording
parkiino May 27, 2020
057f440
Merge branch 'task/endpoint-injest-update' of github.com:parkiino/kib…
parkiino May 27, 2020
f9852af
POC for custom configure data source panel from outside plugin
jen-huang May 28, 2020
ad71c88
added security text
parkiino May 29, 2020
3efce1c
Merge remote-tracking branch 'upstream/master' into task/endpoint-inj…
parkiino May 29, 2020
8586e3b
it werks
parkiino May 29, 2020
412f5e0
Merge remote-tracking branch 'upstream/master' into task/endpoint-inj…
parkiino Jun 1, 2020
7583c48
removed redundant import, type error
parkiino Jun 1, 2020
04dee90
i18n fix
parkiino Jun 1, 2020
2208beb
remove unused file
parkiino Jun 1, 2020
b43801e
grab policyId from datasource
parkiino Jun 2, 2020
9ee8750
Merge remote-tracking branch 'upstream/master' into task/endpoint-inj…
parkiino Jun 2, 2020
4f4e14c
update doc comments
parkiino Jun 2, 2020
635d035
pauls comments
parkiino Jun 2, 2020
ac2441d
registerDatasource from plugin lifecycle
parkiino Jun 3, 2020
165c0fb
Merge remote-tracking branch 'upstream/master' into task/endpoint-inj…
parkiino Jun 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { memo } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { useLocation } from 'react-router-dom';
import { EuiLink } from '@elastic/eui';

export const EndpointConfiguration = memo<{ editMode: boolean }>(({ editMode }) => {
const pathname = useLocation().pathname.split('/');
const policyId = pathname[pathname.length - 1];
const linkToSiemApp = `/app/siem#/policy/${policyId}`;
return (
<>
{editMode === true ? (
<>
<FormattedMessage
id="xpack.ingestManager.editDatasource.stepConfigure.endpointConfiguration"
defaultMessage="See security app policy tab for additional configuration options: "
/>
<EuiLink href={linkToSiemApp}>Click me to configure</EuiLink>
Copy link
Contributor

@oatkiller oatkiller May 26, 2020

Choose a reason for hiding this comment

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

Missing i18n here.

Also, UX recommendation re: links. Phrase it like:

See <a href="">security app policy tab</a> for additional configuration options.

You can google ux "here" link to see a lot of articles which all agree (but with various reasonings.)

The a11y reason is that an assistive device that lists links would show 'Click me to configure' as a place you can link to. In this case 'security app policy tab' is a better description.

The usability reason is basically this: If a user scans for buttons/links in order to take their next action, they'll see a 'Click me...' link, and then have to scan the previous paragraph to figure out what it does. The idea is that by placing a description of where the link goes in the link itself, the user can scan the page for links and see what they do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we'll be switching apps here, I think we have do a little bit more to avoid the full app refresh.

@paul-tavares does something similar here https://github.com/elastic/kibana/blob/master/x-pack/plugins/siem/public/endpoint_policy/view/policy_list.tsx#L137

</>
) : (
<FormattedMessage
id="xpack.ingestManager.createDatasource.stepConfigure.endpointConfiguration"
defaultMessage="See security app policy tab for additional configuration"
/>
)}
</>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@ import { PackageInfo, NewDatasource, DatasourceInput } from '../../../types';
import { Loading } from '../../../components';
import { DatasourceValidationResults, validationHasErrors } from './services';
import { DatasourceInputPanel } from './components';
import { EndpointConfiguration } from './components/endpoint_configuration';

export const StepConfigureDatasource: React.FunctionComponent<{
packageInfo: PackageInfo;
datasource: NewDatasource;
updateDatasource: (fields: Partial<NewDatasource>) => void;
validationResults: DatasourceValidationResults;
submitAttempted: boolean;
}> = ({ packageInfo, datasource, updateDatasource, validationResults, submitAttempted }) => {
editMode?: boolean;
}> = ({
packageInfo,
datasource,
updateDatasource,
validationResults,
submitAttempted,
editMode = false,
}) => {
const hasErrors = validationResults ? validationHasErrors(validationResults) : false;

// Configure inputs (and their streams)
Expand Down Expand Up @@ -72,10 +81,14 @@ export const StepConfigureDatasource: React.FunctionComponent<{
body={
<EuiText>
<p>
<FormattedMessage
id="xpack.ingestManager.createDatasource.stepConfigure.noConfigOptionsMessage"
defaultMessage="Nothing to configure"
/>
{datasource.package?.name === 'endpoint' ? (
<EndpointConfiguration editMode={editMode} />
) : (
<FormattedMessage
id="xpack.ingestManager.createDatasource.stepConfigure.noConfigOptionsMessage"
defaultMessage="Nothing to configure"
/>
)}
</p>
</EuiText>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ export const EditDatasourcePage: React.FunctionComponent = () => {
updateDatasource={updateDatasource}
validationResults={validationResults!}
submitAttempted={formState === 'INVALID'}
editMode={true}
/>
),
},
Expand Down