-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] calendar eui conversion #26741
Conversation
Pinging @elastic/ml-ui |
💔 Build Failed |
There was a problem hiding this 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.
x-pack/plugins/ml/public/settings/calendar/edit/import_modal.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/import_modal.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/import_modal.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/new_calendar.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/list/delete_calendars.js
Outdated
Show resolved
Hide resolved
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
x-pack/plugins/ml/public/settings/calendar/edit/calendar_form.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/list/calendars_list.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/list/calendars_list.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/new_calendar.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/new_calendar.js
Outdated
Show resolved
Hide resolved
|
||
uiRoutes | ||
.when('/settings/calendars_list/new_calendar', { | ||
template, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above comment. 👍
x-pack/plugins/ml/public/settings/calendar/edit/new_calendar.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/new_calendar.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/edit/new_calendar.js
Outdated
Show resolved
Hide resolved
{timeInputs} | ||
<EuiSpacer size="s" /> | ||
<EuiFormRow fullWidth> | ||
<EuiDatePickerRange |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. 🤔
x-pack/plugins/ml/public/settings/calendar/list/calendars_list.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/settings/calendar/list/calendars_list.js
Outdated
Show resolved
Hide resolved
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
I've updated with all suggested changes if you wanted to take another look when you get a chance. 😄 |
💔 Build Failed |
|
||
onEventDelete = (eventId) => { | ||
this.setState(prevState => ({ | ||
events: prevState.events.filter(event => event.event_id !== eventId) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 👍
There was a problem hiding this 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!
I saw you have used css classes like |
5acfca7
to
3bbc4f7
Compare
💔 Build Failed |
💚 Build Succeeded |
* 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
* 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
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
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorialsFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately