Skip to content

partial progress on threshold watch form including validation#34819

Merged
bmcconaghy merged 3 commits intoelastic:watcher-portfrom
bmcconaghy:watcher-port
Apr 10, 2019
Merged

partial progress on threshold watch form including validation#34819
bmcconaghy merged 3 commits intoelastic:watcher-portfrom
bmcconaghy:watcher-port

Conversation

@bmcconaghy
Copy link
Copy Markdown
Contributor

This PR introduces a new strategy for saving watch changes and adds save + form validation to the threshold watcher edit screen.

@bmcconaghy bmcconaghy added Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// labels Apr 9, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/es-ui

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Copy link
Copy Markdown
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

@bmcconaghy this looks good!

Two other things I noticed:

  • I see this react warning in the console when I do a full page refresh on the threshold page: Warning: React does not recognize the `isInvalid` prop on a DOM element. I didn't immediately find what was causing it.
  • Also, the json_watch_edit_component is still referencing kbnUrl rather than urlService, but I can address that when I adopt the new validation approach.

this.isNew = get(props, 'isNew', true);

this.name = get(props, 'name', '');
this.name = get(props, 'name');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't we need to set an initial value for name to avoid this react warning?

 A component is changing an uncontrolled input of type text to be controlled.

} else if (!regex.test(id)) {
return i18n.translate('xpack.watcher.sections.watchEdit.json.error.invalidIdText', {
defaultMessage: 'ID must only letters, underscores, dashes, and numbers.',
defaultMessage: 'ID can only contain letters, underscores, dashes, and numbers.',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for fixing this!

@@ -66,7 +66,7 @@ export async function saveWatch(watch: BaseWatch, kbnUrl: any, licenseService: a
})
);
// TODO: Not correctly redirecting back to /watches route
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think we can remove this todo now

*/
export class ThresholdWatch extends BaseWatch {
constructor(props = {}) {
console.log('CONSTRUCT', props);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: remove at some point

@alisonelizabeth
Copy link
Copy Markdown
Contributor

@bmcconaghy ignore my second comment, I see you fixed the urlService issue.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@bmcconaghy bmcconaghy merged commit 7de0bff into elastic:watcher-port Apr 10, 2019
@bmcconaghy bmcconaghy deleted the watcher-port branch April 10, 2019 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Watcher Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants