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

Watcher history page: port to react #33047

Merged
merged 26 commits into from
Apr 12, 2019

Conversation

pcsanwald
Copy link
Contributor

@pcsanwald pcsanwald commented Mar 12, 2019

This is a work in progress PR that I'm opening to get feedback on the implementation.

Here's an april 1st walkthrough:

stuff

So far, I set up two EuiInMemoryTables alongside the existing tables, and have changed over the detail page from a separate route, over to an EuiFlyout.

Incomplete list of things left to do:

  • Populate flyout page with correct data (Execution Status and Execution Output)
  • Add actions to main table to deactivate watch
  • Support old watch history detail page links by supporting optional URL
  • Add unit tests
  • Design review
  • Check if a watch is disabled, if so, toggle default disable button state

@elasticmachine
Copy link
Contributor

💔 Build Failed

@bmcconaghy
Copy link
Contributor

@pcsanwald this is looking good.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@pcsanwald pcsanwald requested a review from gchaps April 1, 2019 22:52
@elasticmachine
Copy link
Contributor

💔 Build Failed

@yaronp68
Copy link

yaronp68 commented Apr 2, 2019

@pcsanwald The date time format is not friendly IMO. I guess having the same format as the EUI date picker makes sense
image

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

@pcsanwald Here are some suggested edits.

Watch History Detail flyout

Use sentence case for titles:

  • Watch history detail

Delete watch modal

Suggest including watch name in title (if they are not tool long) and removing "Are you sure."

Delete watch watch_name

You can’t recover a deleted watch.

Cancel | Delete watch

Current Status page

Sentence case for titles:

  • Current status
  • Watch history

Sentence case for button labels:

  • Activate watch
  • Deactivate watch

Shorten empty state text:

  • No current status to show -> No current status

Toast on deletion

Screen Shot 2019-04-03 at 9 38 07 AM

If possible, include watch name:

  • Watch watch_name deleted.

Otherwise:

  • Watch deleted.

Screen Shot 2019-04-03 at 9 37 42 AM

It would be nice to be more specific here. The reason I got this message was that the watch was already deleted.

@pcsanwald
Copy link
Contributor Author

thanks for the feedback @gchaps, will work on all these things

@@ -0,0 +1,25 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

@pcsanwald I think this is something that I'd like to reuse for the advanced watcher pages too. Maybe we should move it under /watcher/public/components?

Generally speaking, I'm not sure how we want to approach the file structure. However, right now, it seems we have some common components in there already (e.g., form_errors.tsx, delete_watches_modal.tsx) FYI @bmcconaghy

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah seems like a good candidate for moving up to the common components dir.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we do this after merge, or should I go ahead and do in this PR? I'm fine either way

Copy link
Contributor

Choose a reason for hiding this comment

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

another PR is fine I think

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

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

Looking good, just left a few minor comments. This will need some tests, but those can be added in a follow up PR

@@ -0,0 +1,25 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah seems like a good candidate for moving up to the common components dir.

}>({});
const [executionDetail, setExecutionDetail] = useState<string>('');

const kbnUrlService = urlService;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why this is done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 2b23125

};

const watchHistoryTimeSpanOptions = [
{ value: 'now-1h', text: 'Last one hour' },
Copy link
Contributor

Choose a reason for hiding this comment

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

these probably need i18n

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 2b23125

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of minor comments.

} else {
await activateWatch(watchId);
}
// TODO[pcs]: error handling, response checking, etc...
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still a valid TODO?

},
];

const onTimespanChange = (e: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should work (and it will be more specific): (e: React.ChangeEvent<HTMLInputElement>)

},
];

const onTimespanChange = (e: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should work (and it will be more specific): (e: React.ChangeEvent<HTMLInputElement>)

},
];

const onTimespanChange = (e: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should work (and it will be more specific): (e: React.ChangeEvent<HTMLInputElement>)

},
];

const onTimespanChange = (e: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should work (and it will be more specific): (e: React.ChangeEvent<HTMLInputElement>)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 7e6c10a

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@pcsanwald pcsanwald merged commit 0078417 into elastic:watcher-port Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants