-
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] Reorganize ML navigation with top and sub level tabs #45220
[ML] Reorganize ML navigation with top and sub level tabs #45220
Conversation
Pinging @elastic/ml-ui |
💔 Build Failed |
💔 Build Failed |
Please merge master |
59844e5
to
796a910
Compare
retest |
💔 Build Failed |
💔 Build Failed |
About the breadcrumbs, in the screenshot there's:
I'm not sure about the start page but I think the Anomaly Explorer page should be |
i agree with @walterra, we should be consistent. even if that now means the "root" of the main tabs will always have a page after it |
x-pack/legacy/plugins/ml/public/datavisualizer/file_based/breadcrumbs.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/components/navigation_menu/main_tabs.tsx
Show resolved
Hide resolved
@peteharverson It's definitely worth doing but I think we should do the analytics breadcrumbs in a follow up, they haven't been considered/implemented at all besides the main page for now. |
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 couple of extra tweaks to the Data Visualizer steps if possible, plus agree with @jgowdyelastic suggestions about the left margin for the sub menus, and the slight style difference on pages where there is no date picker. Otherwise looking good.
DATA_VISUALIZER_BREADCRUMB, | ||
{ | ||
text: i18n.translate('xpack.ml.dataVisualizer.fileBasedLabel', { | ||
defaultMessage: 'File based' |
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.
Now I see it, I think maybe just File
is better than File based
!
ML_BREADCRUMB, | ||
DATA_VISUALIZER_BREADCRUMB, | ||
// @ts-ignore | ||
} from '../../breadcrumbs'; | ||
|
||
export function getDataVisualizerBreadcrumbs() { |
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.
pathId?: string; | ||
} | ||
|
||
const TAB_DATA: { [key: string]: TabData } = { |
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 could be a Record
const TAB_DATA: Record<TabId, TabData> = {
<EuiTabs display="condensed"> | ||
{tabs.map((tab: Tab) => { | ||
const id = tab.id; | ||
const testSubject = TAB_DATA[id as TAB_DATA_PROPERTY].testSubject; |
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.
these type assertions aren't needed, id
is a string.
]; | ||
export type TabId = string; | ||
|
||
const tabSupport = { |
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.
giving this a type of:
type TabSupport = Record<string, string | null>;
means you don't need type assertion on lines 41 and 43.
explorer: 'anomaly_detection', | ||
}; | ||
|
||
type tabSupportId = keyof typeof tabSupport; |
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 isn't needed with the above suggested change
} | ||
|
||
export const NavigationMenu: FC<Props> = ({ tabId }) => { | ||
const disableLinks = isFullLicense() === false; | ||
const showTabs = tabSupport.includes(tabId); | ||
const showTabs = Object.keys(tabSupport).includes(tabId); |
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.
nit, could be const showTabs = typeof tabSupport[tabId] !== 'undefined';
}, | ||
]; | ||
function getTabs(tabId: TabId, disableLinks: boolean): Tab[] { | ||
const TAB_MAP = { |
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.
could be const TAB_MAP: Record<TabId, Tab[]> = {
|
||
type TAB_MAP_ID = keyof typeof TAB_MAP; | ||
|
||
return TAB_MAP[tabId as TAB_MAP_ID]; |
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.
with the suggested change above this type assertion isn't needed
💔 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.
Tested with latest edits, including on IE11, and LGTM
💔 Build Failed |
retest |
💔 Build Failed |
retest |
e6635b2
to
08f3cdf
Compare
💔 Build Failed |
💚 Build Succeeded |
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.
LGTM
) * Add main nav tabs with sub tabs for new nav * move transforms to top level main nav * Make top nav normal font weight * Update breadcrumbs to take top nav into account * proper spacing when settings selected * fix localization error * Fix functional tests. Update breadcrumbs * revert analytics breadcrumb update. save for follow up * ensure main/sub tabs align left * update dataVisualizer breadcrumbs * update typescript for tabs
…45517) * Add main nav tabs with sub tabs for new nav * move transforms to top level main nav * Make top nav normal font weight * Update breadcrumbs to take top nav into account * proper spacing when settings selected * fix localization error * Fix functional tests. Update breadcrumbs * revert analytics breadcrumb update. save for follow up * ensure main/sub tabs align left * update dataVisualizer breadcrumbs * update typescript for tabs
Summary
Reorganize navigation into 4 main areas:
Anomaly Detection
,Transforms
,Data Frame Analytics
, andData Visualizer
.Each main area has sub-navigation pertaining to that area.
When clicking on a main area for the first time the default subsection selected will be the one to the far left.
Updated breadcrumbs to include main tab.
Overview
main tab which will contain an overview of all jobs.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Documentation was added for features that require explanation or tutorialsFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately