Skip to content

Commit

Permalink
Merge branch 'master' into upgrade_turf
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jul 30, 2020
2 parents 2b3a7ea + e8cc2ff commit da4096a
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ export class MapsAppView extends React.Component {
this._globalSyncChangeMonitorSubscription.unsubscribe();
}

// Clean up app state filters
const { filterManager } = getData().query;
filterManager.filters.forEach((filter) => {
if (filter.$state.store === esFilters.FilterStateStore.APP_STATE) {
filterManager.removeFilter(filter);
}
});

getCoreChrome().setBreadcrumbs([]);
}

Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/maps/public/routing/state_syncing/app_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export function startAppStateSyncing(appStateManager) {
// sync app filters with app state container from data.query to state container
const { query } = getData();

// Filter manager state persists across applications
// clear app state filters to prevent application filters from other applications being transfered to maps
query.filterManager.setAppFilters([]);

const stateContainer = {
get: () => ({
query: appStateManager.getQuery(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
*/

import React, { memo } from 'react';
import { EuiErrorBoundary } from '@elastic/eui';
import { PageView, PageViewProps } from '../../common/components/endpoint/page_view';

export const ManagementPageView = memo<Omit<PageViewProps, 'tabs'>>((options) => {
return <PageView {...options} />;
return (
<EuiErrorBoundary>
<PageView {...options} />
</EuiErrorBoundary>
);
});

ManagementPageView.displayName = 'ManagementPageView';
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,16 @@ export const PolicyResponse = memo(
responseActions: Immutable<HostPolicyResponseAppliedAction[]>;
responseAttentionCount: Map<string, number>;
}) => {
const generateId = useMemo(() => htmlIdGenerator(), []);

return (
<>
{Object.entries(responseConfig).map(([key, val]) => {
const attentionCount = responseAttentionCount.get(key);
return (
<PolicyResponseConfigAccordion
id={
/* eslint-disable-next-line react-hooks/rules-of-hooks */
useMemo(() => htmlIdGenerator()(), [])
}
key={
/* eslint-disable-next-line react-hooks/rules-of-hooks */
useMemo(() => htmlIdGenerator()(), [])
}
id={generateId(`id_${key}`)}
key={generateId(`key_${key}`)}
data-test-subj="hostDetailsPolicyResponseConfigAccordion"
buttonContent={
<EuiText size="s">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const EventsCheckbox = React.memo(function ({
const policyDetailsConfig = usePolicyDetailsSelector(policyConfig);
const selected = getter(policyDetailsConfig);
const dispatch = useDispatch<(action: PolicyDetailsAction) => void>();
const checkboxId = useMemo(() => htmlIdGenerator()(), []);

const handleCheckboxChange = useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -42,7 +43,7 @@ export const EventsCheckbox = React.memo(function ({

return (
<EuiCheckbox
id={useMemo(() => htmlIdGenerator()(), [])}
id={checkboxId}
label={name}
checked={selected}
onChange={handleCheckboxChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const protection = 'malware';
const ProtectionRadio = React.memo(({ id, label }: { id: ProtectionModes; label: string }) => {
const policyDetailsConfig = usePolicyDetailsSelector(policyConfig);
const dispatch = useDispatch();
const radioButtonId = useMemo(() => htmlIdGenerator()(), []);
// currently just taking windows.malware, but both windows.malware and mac.malware should be the same value
const selected = policyDetailsConfig && policyDetailsConfig.windows.malware.mode;

Expand All @@ -66,7 +67,7 @@ const ProtectionRadio = React.memo(({ id, label }: { id: ProtectionModes; label:
<EuiRadio
className="policyDetailsProtectionRadio"
label={label}
id={useMemo(() => htmlIdGenerator()(), [])}
id={radioButtonId}
checked={selected === id}
onChange={handleRadioChange}
disabled={selected === ProtectionModes.off}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,22 @@ export const PolicyList = React.memo(() => {
[services.application, handleDeleteOnClick, formatUrl, search]
);

const bodyContent = useMemo(() => {
return policyItems && policyItems.length > 0 ? (
<EuiBasicTable
items={[...policyItems]}
columns={columns}
loading={loading}
pagination={paginationSetup}
onChange={handleTableChange}
data-test-subj="policyTable"
hasActions={false}
/>
) : (
<PolicyEmptyState loading={loading} onActionClick={handleCreatePolicyClick} />
);
}, [policyItems, loading, columns, handleCreatePolicyClick, handleTableChange, paginationSetup]);

return (
<>
{showDelete && (
Expand Down Expand Up @@ -449,32 +465,7 @@ export const PolicyList = React.memo(() => {
<EuiHorizontalRule margin="xs" />
</>
)}
{useMemo(() => {
return (
<>
{policyItems && policyItems.length > 0 ? (
<EuiBasicTable
items={[...policyItems]}
columns={columns}
loading={loading}
pagination={paginationSetup}
onChange={handleTableChange}
data-test-subj="policyTable"
hasActions={false}
/>
) : (
<PolicyEmptyState loading={loading} onActionClick={handleCreatePolicyClick} />
)}
</>
);
}, [
policyItems,
loading,
columns,
handleCreatePolicyClick,
handleTableChange,
paginationSetup,
])}
{bodyContent}
<SpyRoute pageName={SecurityPageName.administration} />
</ManagementPageView>
</>
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -5008,7 +5008,6 @@
"xpack.apm.settings.anomaly_detection.legacy_jobs.body": "以前の統合のレガシー機械学習ジョブが見つかりました。これは、APMアプリでは使用されていません。",
"xpack.apm.settings.anomaly_detection.legacy_jobs.button": "ジョブの確認",
"xpack.apm.settings.anomaly_detection.legacy_jobs.title": "レガシーMLジョブはAPMアプリで使用されていません。",
"xpack.apm.settings.anomaly_detection.license.text": "異常検知を使用するには、Elastic Platinumライセンスのサブスクリプションが必要です。このライセンスがあれば、機械学習を活用して、サービスを監視できます。",
"xpack.apm.settings.anomalyDetection": "異常検知",
"xpack.apm.settings.anomalyDetection.addEnvironments.cancelButtonText": "キャンセル",
"xpack.apm.settings.anomalyDetection.addEnvironments.createJobsButtonText": "ジョブの作成",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5009,7 +5009,6 @@
"xpack.apm.settings.anomaly_detection.legacy_jobs.body": "我们在以前的集成中发现 APM 应用中不再使用的旧版 Machine Learning 作业",
"xpack.apm.settings.anomaly_detection.legacy_jobs.button": "复查作业",
"xpack.apm.settings.anomaly_detection.legacy_jobs.title": "旧版 ML 作业不再用于 APM 应用",
"xpack.apm.settings.anomaly_detection.license.text": "要使用异常检测,必须订阅 Elastic 白金级许可。使用该许可,您将能够借助 Machine Learning 监测服务。",
"xpack.apm.settings.anomalyDetection": "异常检测",
"xpack.apm.settings.anomalyDetection.addEnvironments.cancelButtonText": "取消",
"xpack.apm.settings.anomalyDetection.addEnvironments.createJobsButtonText": "创建作业",
Expand Down

0 comments on commit da4096a

Please sign in to comment.