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

[7.x] [SR] SLM create and edit policies (#43390) #44172

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"tsvb": "src/legacy/core_plugins/metrics",
"kbnESQuery": "packages/kbn-es-query",
"inspector": "src/plugins/inspector",
"kibana-react": "src/plugins/kibana_react"
"kibana-react": "src/plugins/kibana_react",
"esUi": "src/plugins/es_ui_shared"
},
"exclude": ["src/legacy/ui/ui_render/ui_render_mixin.js"],
"translations": []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* 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.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { Fragment } from 'react';
Expand All @@ -27,12 +40,12 @@ export const CronDaily = ({
<EuiFormRow
label={(
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronDaily.fieldTimeLabel"
id="esUi.cronEditor.cronDaily.fieldTimeLabel"
defaultMessage="Time"
/>
)}
fullWidth
data-test-subj="rollupCronFrequencyConfiguration"
data-test-subj="cronFrequencyConfiguration"
>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
Expand All @@ -45,13 +58,13 @@ export const CronDaily = ({
<EuiText size="xs">
<strong>
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronDaily.fieldHour.textAtLabel"
id="esUi.cronEditor.cronDaily.fieldHour.textAtLabel"
defaultMessage="At"
/>
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyDailyHourSelect"
data-test-subj="cronFrequencyDailyHourSelect"
/>
</EuiFlexItem>

Expand All @@ -68,7 +81,7 @@ export const CronDaily = ({
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyDailyMinuteSelect"
data-test-subj="cronFrequencyDailyMinuteSelect"
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* 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.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { Component, Fragment } from 'react';
Expand All @@ -27,7 +40,7 @@ import {
WEEK,
MONTH,
YEAR,
} from '../../../../../services';
} from './services';

import { CronHourly } from './cron_hourly';
import { CronDaily } from './cron_daily';
Expand Down Expand Up @@ -331,7 +344,7 @@ export class CronEditor extends Component {
<EuiFormRow
label={(
<FormattedMessage
id="xpack.rollupJobs.cronEditor.fieldFrequencyLabel"
id="esUi.cronEditor.fieldFrequencyLabel"
defaultMessage="Frequency"
/>
)}
Expand All @@ -346,13 +359,13 @@ export class CronEditor extends Component {
<EuiText size="xs">
<strong>
<FormattedMessage
id="xpack.rollupJobs.cronEditor.textEveryLabel"
id="esUi.cronEditor.textEveryLabel"
defaultMessage="Every"
/>
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencySelect"
data-test-subj="cronFrequencySelect"
/>
</EuiFormRow>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from '@kbn/i18n/react';

import {
EuiFormRow,
EuiSelect,
EuiText,
} from '@elastic/eui';

export const CronHourly = ({
minute,
minuteOptions,
onChange,
}) => (
<Fragment>
<EuiFormRow
label={(
<FormattedMessage
id="esUi.cronEditor.cronHourly.fieldTimeLabel"
defaultMessage="Minute"
/>
)}
fullWidth
data-test-subj="cronFrequencyConfiguration"
>
<EuiSelect
options={minuteOptions}
value={minute}
onChange={e => onChange({ minute: e.target.value })}
fullWidth
prepend={(
<EuiText size="xs">
<strong>
<FormattedMessage
id="esUi.cronEditor.cronHourly.fieldMinute.textAtLabel"
defaultMessage="At"
/>
</strong>
</EuiText>
)}
data-test-subj="cronFrequencyHourlyMinuteSelect"
/>
</EuiFormRow>
</Fragment>
);

CronHourly.propTypes = {
minute: PropTypes.string.isRequired,
minuteOptions: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* 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.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { Fragment } from 'react';
Expand Down Expand Up @@ -29,12 +42,12 @@ export const CronMonthly = ({
<EuiFormRow
label={(
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronMonthly.fieldDateLabel"
id="esUi.cronEditor.cronMonthly.fieldDateLabel"
defaultMessage="Date"
/>
)}
fullWidth
data-test-subj="rollupCronFrequencyConfiguration"
data-test-subj="cronFrequencyConfiguration"
>
<EuiSelect
options={dateOptions}
Expand All @@ -45,25 +58,25 @@ export const CronMonthly = ({
<EuiText size="xs">
<strong>
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronMonthly.textOnTheLabel"
id="esUi.cronEditor.cronMonthly.textOnTheLabel"
defaultMessage="On the"
/>
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyMonthlyDateSelect"
data-test-subj="cronFrequencyMonthlyDateSelect"
/>
</EuiFormRow>

<EuiFormRow
label={(
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronMonthly.fieldTimeLabel"
id="esUi.cronEditor.cronMonthly.fieldTimeLabel"
defaultMessage="Time"
/>
)}
fullWidth
data-test-subj="rollupCronFrequencyConfiguration"
data-test-subj="cronFrequencyConfiguration"
>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
Expand All @@ -76,13 +89,13 @@ export const CronMonthly = ({
<EuiText size="xs">
<strong>
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronMonthly.fieldHour.textAtLabel"
id="esUi.cronEditor.cronMonthly.fieldHour.textAtLabel"
defaultMessage="At"
/>
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyMonthlyHourSelect"
data-test-subj="cronFrequencyMonthlyHourSelect"
/>
</EuiFlexItem>

Expand All @@ -99,7 +112,7 @@ export const CronMonthly = ({
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyMonthlyMinuteSelect"
data-test-subj="cronFrequencyMonthlyMinuteSelect"
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*
* 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.
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { Fragment } from 'react';
Expand Down Expand Up @@ -29,12 +42,12 @@ export const CronWeekly = ({
<EuiFormRow
label={(
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronWeekly.fieldDateLabel"
id="esUi.cronEditor.cronWeekly.fieldDateLabel"
defaultMessage="Day"
/>
)}
fullWidth
data-test-subj="rollupCronFrequencyConfiguration"
data-test-subj="cronFrequencyConfiguration"
>
<EuiSelect
options={dayOptions}
Expand All @@ -45,25 +58,25 @@ export const CronWeekly = ({
<EuiText size="xs">
<strong>
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronWeekly.textOnLabel"
id="esUi.cronEditor.cronWeekly.textOnLabel"
defaultMessage="On"
/>
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyWeeklyDaySelect"
data-test-subj="cronFrequencyWeeklyDaySelect"
/>
</EuiFormRow>

<EuiFormRow
label={(
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronWeekly.fieldTimeLabel"
id="esUi.cronEditor.cronWeekly.fieldTimeLabel"
defaultMessage="Time"
/>
)}
fullWidth
data-test-subj="rollupCronFrequencyConfiguration"
data-test-subj="cronFrequencyConfiguration"
>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
Expand All @@ -76,13 +89,13 @@ export const CronWeekly = ({
<EuiText size="xs">
<strong>
<FormattedMessage
id="xpack.rollupJobs.cronEditor.cronWeekly.fieldHour.textAtLabel"
id="esUi.cronEditor.cronWeekly.fieldHour.textAtLabel"
defaultMessage="At"
/>
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyWeeklyHourSelect"
data-test-subj="cronFrequencyWeeklyHourSelect"
/>
</EuiFlexItem>

Expand All @@ -99,7 +112,7 @@ export const CronWeekly = ({
</strong>
</EuiText>
)}
data-test-subj="rollupJobCreateFrequencyWeeklyMinuteSelect"
data-test-subj="cronFrequencyWeeklyMinuteSelect"
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Loading