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

[ML] calendar eui conversion #26741

Merged

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Dec 5, 2018

Summary

Settings -> Calendar management (settings/scheduled_events/) rewrite to React/eui (settings/calendar/).

Meta issue with details and screenshots: #25970

Note:

Adding tests. File structure will change as I add them.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately

@alvarezmelissa87 alvarezmelissa87 added review enhancement New value added to drive a business result :ml Feature:Anomaly Detection ML anomaly detection v6.6.0 labels Dec 5, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

I'd start using the EUI name schema on new sass files. I know we didn't convert ML completely to this yet, but it'll save you trouble when we do make those changes.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed


uiRoutes
.when('/settings/calendars_list/new_calendar', {
template,
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to pull in the k7breadcrumbs from x-pack/plugins/ml/public/settings/breadcrumbs.js by rebasing to latest master

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Doing this in a follow up PR to avoid backport messiness since the breadcrumbs update is only in master. This way I can backport this PR and just leave the route update follow-up PR in master. 😄

}
})
.when('/settings/calendars_list/edit_calendar/:calendarId', {
template,
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, you'll need to pull in the k7breadcrumbs from x-pack/plugins/ml/public/settings/breadcrumbs.js by rebasing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above comment. 👍

{timeInputs}
<EuiSpacer size="s" />
<EuiFormRow fullWidth>
<EuiDatePickerRange
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 component fully accessible as used here? I wasn't able to navigate to particular dates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the inputs and the arrows to move between months are - this should give keyboard access to all functionality. Moving around through each day in the calendars themselves looks like it isn't - not sure we can override that on our side, though. 🤔

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@alvarezmelissa87
Copy link
Contributor Author

I've updated with all suggested changes if you wanted to take another look when you get a chance. 😄
cc @peteharverson, @jgowdyelastic

@elasticmachine
Copy link
Contributor

💔 Build Failed


onEventDelete = (eventId) => {
this.setState(prevState => ({
events: prevState.events.filter(event => event.event_id !== eventId)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a problem with this for events which have been added, but before the calendar has been saved. Looks like events only pick up an ID after saving, so if you delete a 'new' event (as in one which has yet to be saved), all 'new' events end up being deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heya @peteharverson - this is fixed now. The temp event id wasn't being passed on to the new_calendar form so there was no id to keep track of deletions. 👍

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

A few styling edits are needed!

x-pack/plugins/ml/public/settings/_index.scss Outdated Show resolved Hide resolved
x-pack/plugins/ml/public/settings/calendars/_calendar.scss Outdated Show resolved Hide resolved
x-pack/plugins/ml/public/settings/calendars/_calendar.scss Outdated Show resolved Hide resolved
@walterra
Copy link
Contributor

I saw you have used css classes like .mlCalendar_list or .mlCalendar_management with single underscores. While I think there are BEM variants which use single underscores, I'm not seeing that in our BEM spec. So depending on the context, I think these classes need to be named either .mlCalendarList or .mlCalendar__list, depending on how they're nested.

@alvarezmelissa87 alvarezmelissa87 force-pushed the ml-calendar-settings-react branch from 5acfca7 to 3bbc4f7 Compare December 12, 2018 17:25
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alvarezmelissa87 alvarezmelissa87 merged commit 7f4ac5d into elastic:master Dec 12, 2018
alvarezmelissa87 added a commit to alvarezmelissa87/kibana that referenced this pull request Dec 12, 2018
* Create calendar list in react

* wip: create new_calendar page

* Update new calendar settings directory name

* Edit button action + update utils

* Adds ability to create new calendar

* Display calendar data on edit

* rename directory to settings/calendar

* Add scss files to calendar dir

* Create new group from form

* Adds event table and partial event modal.

* adds datepicker to modal

* Time range event functionality

* add import event functionality

* upate new event modal design

* Add error handling to list/edit

* calendarId validity check

* Create/delete permission. List/form style tweak

* Update calendarList to match filterList

* Add missing newlines in scss files

* Initial tests for calendar list

* Update classnames to meet guidelines

* ImportedEvents component + create utils

* remove unnecessary import

* rename calendars dir

* include past evens in import if checkbox checked

* code review updates

* move components into own directories

* update index.scss with dir name change

* skip irrelevant tests

* fix unsaved event deletion. rename scss file.

* Add modal tests

* Show calendarId and description as header on edit

* update snapshot for refactor

* update classnames to BEM guidelines

* Update snapshot for classname change
alvarezmelissa87 added a commit that referenced this pull request Dec 12, 2018
* Create calendar list in react

* wip: create new_calendar page

* Update new calendar settings directory name

* Edit button action + update utils

* Adds ability to create new calendar

* Display calendar data on edit

* rename directory to settings/calendar

* Add scss files to calendar dir

* Create new group from form

* Adds event table and partial event modal.

* adds datepicker to modal

* Time range event functionality

* add import event functionality

* upate new event modal design

* Add error handling to list/edit

* calendarId validity check

* Create/delete permission. List/form style tweak

* Update calendarList to match filterList

* Add missing newlines in scss files

* Initial tests for calendar list

* Update classnames to meet guidelines

* ImportedEvents component + create utils

* remove unnecessary import

* rename calendars dir

* include past evens in import if checkbox checked

* code review updates

* move components into own directories

* update index.scss with dir name change

* skip irrelevant tests

* fix unsaved event deletion. rename scss file.

* Add modal tests

* Show calendarId and description as header on edit

* update snapshot for refactor

* update classnames to BEM guidelines

* Update snapshot for classname change
@alvarezmelissa87 alvarezmelissa87 deleted the ml-calendar-settings-react branch December 12, 2018 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Anomaly Detection ML anomaly detection :ml review v6.6.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants