Skip to content

Commit

Permalink
[CCR] Create follower index UI form (#27864)
Browse files Browse the repository at this point in the history
* Initial setup Follower Index form

* Working form without client validation

* Add client side validation for follower index

* Add client validation to check if index already exist

* Improve error message when leader index does not exist

* Remove update method for follower index

* Clear api error on field change

* Fix i18n error
  • Loading branch information
sebelga authored and jen-huang committed Jan 2, 2019
1 parent 7ff2519 commit be371b8
Show file tree
Hide file tree
Showing 25 changed files with 1,046 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export const BASE_PATH = '/management/elasticsearch/cross_cluster_replication';
export const BASE_PATH_REMOTE_CLUSTERS = '/management/elasticsearch/remote_clusters';
export const API_BASE_PATH = '/api/cross_cluster_replication';
export const API_REMOTE_CLUSTERS_BASE_PATH = '/api/remote_clusters';
export const API_INDEX_MANAGEMENT_BASE_PATH = '/api/index_management';
4 changes: 3 additions & 1 deletion x-pack/plugins/cross_cluster_replication/public/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { BASE_PATH } from '../../common/constants';
import {
CrossClusterReplicationHome,
AutoFollowPatternAdd,
AutoFollowPatternEdit
AutoFollowPatternEdit,
FollowerIndexAdd,
} from './sections';

export class App extends Component {
Expand Down Expand Up @@ -52,6 +53,7 @@ export class App extends Component {
<Redirect exact from={`${BASE_PATH}`} to={`${BASE_PATH}/follower_indices`} />
<Route exact path={`${BASE_PATH}/auto_follow_patterns/add`} component={AutoFollowPatternAdd} />
<Route exact path={`${BASE_PATH}/auto_follow_patterns/edit/:id`} component={AutoFollowPatternEdit} />
<Route exact path={`${BASE_PATH}/follower_indices/add`} component={FollowerIndexAdd} />
<Route exact path={`${BASE_PATH}/:section`} component={CrossClusterReplicationHome} />
</Switch>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<FollowerIndexForm /> state transitions updateFields() should merge new fields value with existing followerIndex 1`] = `
Object {
"followerIndex": Object {
"leaderIndex": "bar",
"name": "new-name",
},
}
`;

exports[`<FollowerIndexForm /> state transitions updateFormErrors() should merge errors with existing fieldsErrors 1`] = `
Object {
"fieldsErrors": Object {
"leaderIndex": null,
"name": "Some error",
},
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const AutoFollowPatternPageTitle = ({ title }) => (
iconType="help"
>
<FormattedMessage
id="xpack.crossClusterReplication.readDocsButtonLabel"
id="xpack.crossClusterReplication.readDocsAutoFollowPatternButtonLabel"
defaultMessage="Auto-follow pattern docs"
/>
</EuiButtonEmpty>
Expand Down
Loading

0 comments on commit be371b8

Please sign in to comment.