-
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
[Workplace Search] Add read views for Source Sync Scheduling #113199
[Workplace Search] Add read views for Source Sync Scheduling #113199
Conversation
Placeholders in place whle content is being written
The weird typing around `DaysOfWeek` was taken from this SO answer to get an array from a union type: https://stackoverflow.com/a/45486495/1949235
These components are the repeatable components in each of the frequency tabs. - FrequencyItem - BlockedWindowItem Form changes methods are stubbed for now.
This is just the basics. More will be added in a future PR
This is merely a placeholder page so the routes could be built out. Section will be moved from settings in a future PR
@elasticmachine merge upstream |
This was added to the API after the rest of the work was done, so adding it here. https://github.com/elastic/workplace-search-team/issues/2043
itemClassName="scottyItem" | ||
popoverClassName="scottyPopover" |
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.
Fixed in a future commit 🌮
There was a very long discussion about the edge case that is covered here. https://github.com/elastic/ent-search/pull/4715 Basically here is what we landed on: In most cases, the user will use the form to set the sync frequency, in which case the duration will be in the format of "PT3D" (ISO 8601). However, if an operator has set the sync frequency via the API, the duration could be a complex format, such as "P1DT2H3M4S". It was decided that in this case, we should omit seconds and go with the least common denominator from minutes. Example: "P1DT2H3M4S" -> "1563 Minutes"
c30cbe5
to
ef95030
Compare
ef95030
to
07a68fa
Compare
@elasticmachine merge upstream |
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.
This looks great! 🥇
I only have minor comments:
export const SOURCE_SYNCRONIZATION_DESCRIPTION = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.sources.sourceSyncronizationDescription', | ||
{ | ||
defaultMessage: | ||
'Sync chupa chups dragée gummi bears jelly beans brownie. Fruitcake pie chocolate cake caramels carrot cake cotton candy dragée sweet roll soufflé.', | ||
} | ||
); | ||
|
||
export const SOURCE_FREQUENCY_DESCRIPTION = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.sources.sourceFrequencyDescription', | ||
{ | ||
defaultMessage: | ||
'Frequency chupa chups dragée gummi bears jelly beans brownie. Fruitcake pie chocolate cake caramels carrot cake cotton candy dragée sweet roll soufflé.', | ||
} | ||
); | ||
|
||
export const SOURCE_OBJECTS_AND_ASSETS_DESCRIPTION = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.sources.sourceObjectsAndAssetsDescription', | ||
{ | ||
defaultMessage: | ||
'Objects chupa chups dragée gummi bears jelly beans brownie. Fruitcake pie chocolate cake caramels carrot cake cotton candy dragée sweet roll soufflé.', | ||
} | ||
); |
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.
To avoid translators being confused about these messages, maybe we could add something like this at the beginning of the text?
"DO NOT TRANSLATE, temporary placeholder:"
export const DAYS_OF_WEEK_VALUES = [ | ||
'sunday', | ||
'monday', | ||
'tuesday', | ||
'wednesday', | ||
'thursday', | ||
'friday', | ||
'saturday', | ||
] as const; |
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.
@bhuvanaurora in the Day of week multiselect, what day should be the first one in the list? Sunday or Monday?
I'm talking about this multiselect:
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.
This is possibly going away, as the API does not support it.
const dayPickerOptions = DAYS_OF_WEEK_VALUES.reduce((options, day) => { | ||
options.push({ | ||
label: DAYS_OF_WEEK_LABELS[day.toUpperCase() as keyof typeof DAYS_OF_WEEK_LABELS], | ||
value: day, | ||
}); | ||
return options; | ||
}, [] as Array<EuiComboBoxOptionOption<string>>); |
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 it possible to use map
here? I find it easier to understand than reduce
.
If not possible feel free to resolve this comment.
<EuiFlexItem grow={false}> | ||
<EuiText>{BLOCK_LABEL}</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false} style={{ width: 175 }} className="blockedItemSyncSelect"> |
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.
My local setup is broken, so I can't check why custom styles are needed. I'm assuming to keep everything in one line? If so, maybe we could remove those? I don't think it's realistic for design to be perfect on all resolutions. Also, we recently went over the plugin codebase to remove custom styles, so bringing new ones feels like a step back.
Same question for hardcoded values in frequency_item.tsx
component.
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.
Got my local setup working and now see that it's not used to keep things on one line, ignore this comment. 🙈
...orkplace_search/views/content_sources/components/synchronization/sync_frequency_tab.test.tsx
Outdated
Show resolved
Hide resolved
@scottybollinger I'm going to approve this to unblock the following PR. Feel free to provide fixes separately or in this PR. |
Co-authored-by: Vadim Yakhin <[email protected]>
…#113199) * Add constants Placeholders in place whle content is being written * Update mock to match API and add types The weird typing around `DaysOfWeek` was taken from this SO answer to get an array from a union type: https://stackoverflow.com/a/45486495/1949235 * Add routes and stubbed docs urls * Add components for list items These components are the repeatable components in each of the frequency tabs. - FrequencyItem - BlockedWindowItem Form changes methods are stubbed for now. * Add tab components for Frequency page * Add Frequency page component * Add synchronization logic This is just the basics. More will be added in a future PR * Add Synchronization op-level page * Add Synchronization router and subnav * Add `Objects and assets` page stub This is merely a placeholder page so the routes could be built out. Section will be moved from settings in a future PR * Add name and new nav item to source sub nav * Add SynchronizationRouter nav to Source router * Fix a couple of typos * Add callout and disable subnav for disabled sync This was added to the API after the rest of the work was done, so adding it here. elastic/workplace-search-team#2043 * Update frequency item to account for edge case There was a very long discussion about the edge case that is covered here. elastic/ent-search#4715 Basically here is what we landed on: In most cases, the user will use the form to set the sync frequency, in which case the duration will be in the format of "PT3D" (ISO 8601). However, if an operator has set the sync frequency via the API, the duration could be a complex format, such as "P1DT2H3M4S". It was decided that in this case, we should omit seconds and go with the least common denominator from minutes. Example: "P1DT2H3M4S" -> "1563 Minutes" * Fix failing tests and add key * Update constants with note for translators * Fix typo Co-authored-by: Vadim Yakhin <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Vadim Yakhin <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
#113889) * Add constants Placeholders in place whle content is being written * Update mock to match API and add types The weird typing around `DaysOfWeek` was taken from this SO answer to get an array from a union type: https://stackoverflow.com/a/45486495/1949235 * Add routes and stubbed docs urls * Add components for list items These components are the repeatable components in each of the frequency tabs. - FrequencyItem - BlockedWindowItem Form changes methods are stubbed for now. * Add tab components for Frequency page * Add Frequency page component * Add synchronization logic This is just the basics. More will be added in a future PR * Add Synchronization op-level page * Add Synchronization router and subnav * Add `Objects and assets` page stub This is merely a placeholder page so the routes could be built out. Section will be moved from settings in a future PR * Add name and new nav item to source sub nav * Add SynchronizationRouter nav to Source router * Fix a couple of typos * Add callout and disable subnav for disabled sync This was added to the API after the rest of the work was done, so adding it here. elastic/workplace-search-team#2043 * Update frequency item to account for edge case There was a very long discussion about the edge case that is covered here. elastic/ent-search#4715 Basically here is what we landed on: In most cases, the user will use the form to set the sync frequency, in which case the duration will be in the format of "PT3D" (ISO 8601). However, if an operator has set the sync frequency via the API, the duration could be a complex format, such as "P1DT2H3M4S". It was decided that in this case, we should omit seconds and go with the least common denominator from minutes. Example: "P1DT2H3M4S" -> "1563 Minutes" * Fix failing tests and add key * Update constants with note for translators * Fix typo Co-authored-by: Vadim Yakhin <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Vadim Yakhin <[email protected]> Co-authored-by: Scotty Bollinger <[email protected]> Co-authored-by: Vadim Yakhin <[email protected]>
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
closes https://github.com/elastic/workplace-search-team/issues/2040
Summary
This is the first PR for adding Sync Scheduling to the Workplace Search admin dashboard. This PR adds read views for the feature, to help split it into manageable chunks.
Done
Objects and assets
page for routing purposes onlyNot done
ss1.mp4
Also in this PR, we account for when source sync has been disabled in the config (a7a86d6):
Checklist