-
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] NavMenu conversion to React follow-up #41054
Merged
alvarezmelissa87
merged 5 commits into
elastic:master
from
alvarezmelissa87:ml-nav-menu-followup
Jul 15, 2019
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
aaec2d6
remove old nav_menu direcory
alvarezmelissa87 8263f63
Bit of cleanup of types and in datavis controller
alvarezmelissa87 3069d0c
replace angular service with importable observable
alvarezmelissa87 b48feda
wrap tabs in links
alvarezmelissa87 79e7632
Merge branch 'master' of github.com:elastic/kibana into ml-nav-menu-f…
alvarezmelissa87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
x-pack/legacy/plugins/ml/public/components/nav_menu/_index.scss
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
x-pack/legacy/plugins/ml/public/components/nav_menu/_nav_menu.scss
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
x-pack/legacy/plugins/ml/public/components/nav_menu/nav_menu.html
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
x-pack/legacy/plugins/ml/public/components/nav_menu/nav_menu.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,12 @@ interface Props { | |
timefilter: Timefilter; | ||
} | ||
|
||
function getRecentlyUsedRanges(timeHistory: TimeHistory): Array<{ start: string; end: string }> { | ||
interface Time { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder whether |
||
start: string; | ||
end: string; | ||
} | ||
|
||
function getRecentlyUsedRanges(timeHistory: TimeHistory): Time[] { | ||
return timeHistory.get().map(({ from, to }: TimeRange) => { | ||
return { | ||
start: from, | ||
|
@@ -60,7 +65,7 @@ export const TopNav: FC<Props> = ({ dateFormat, forceRefresh, timeHistory, timef | |
setIsTimeRangeSelectorEnabled(timefilter.isTimeRangeSelectorEnabled); | ||
} | ||
|
||
function updateFilter({ start, end }: { start: string; end: string }) { | ||
function updateFilter({ start, end }: Time) { | ||
const newTime = { from: start, to: end }; | ||
// Update timefilter for controllers listening for changes | ||
timefilter.setTime(newTime); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: this is more about
as keyof typeof
, I hadn't seen that before but it looks really useful! My suggestion is about just a bit of renaming to make it more obvious what it does.TAB_TEST_SUBJ_MAP
is now anenum
you could remove_MAP
and name itTAB_TEST_SUBJECT
(singular enum convention)const type TAB_TEST_SUBJECTS = keyof typeof TAB_TEST_SUBJECT
so later on in JSX you'd reference this instead of the inline definition.If you agree to the change, I'll refactor to the same pattern some of the data frames code.
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.
Good one, @walterra! 👍 Updated in b48feda