-
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
[NP] Dashboard #61895
[NP] Dashboard #61895
Conversation
…a_parsed_url # Conflicts: # x-pack/legacy/plugins/lens/public/plugin.tsx
…a_parsed_url # Conflicts: # x-pack/legacy/plugins/lens/public/plugin.tsx
…a_parsed_url # Conflicts: # x-pack/legacy/plugins/lens/public/legacy_imports.ts
# Conflicts: # src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts
# Conflicts: # src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts
# Conflicts: # src/plugins/dashboard/public/dashboard_app.tsx # src/plugins/dashboard/public/dashboard_app_controller.tsx # src/plugins/dashboard/public/lib/embeddable_saved_object_converters.test.ts
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.
Added some comments, but this is looking great already! Big step forward 🎉
* under the License. | ||
*/ | ||
|
||
export const DashboardConstants = { |
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.
Wow, I wasn't aware we had duplicate code for this stuff, it's good we can finally get rid of it :)
# Conflicts: # src/plugins/dashboard/public/application/actions/expand_panel_action.test.tsx # src/plugins/dashboard/public/application/actions/replace_panel_action.test.tsx # src/plugins/dashboard/public/application/dashboard_app_controller.tsx # src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx # src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx # src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx
# Conflicts: # src/plugins/dashboard/public/application/dashboard_state_manager.ts
|
||
// get state defaults from saved dashboard, make sure it is migrated | ||
this.stateDefaults = migrateAppState( | ||
getAppStateDefaults(this.savedDashboard, this.hideWriteControls), | ||
kibanaVersion | ||
{ ...getAppStateDefaults(this.savedDashboard, this.hideWriteControls) }, |
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.
Wonder what has changed that before this spread wasn't needed?
Or is this fixes some existing bug?
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.
Not sure what caused this, but TypeScript started hate the previous one
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 tried to revert and seems like all is good. maybe you had some type issues in a process of moving staff around. Could you double check please?
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.
Okay, that was my fault.
VSCode accidentally thought that I want to use the TypeScript version which it likes more 🙂
And throws me such an issue:
I reverted back those changes, but seems this will become actual again once ts 3.8.2 is merged
https://github.com/elastic/kibana/pull/57774/files#diff-2f67bccb7b0ca326ff2a7aec1b0ee965
@@ -94,7 +94,7 @@ export function initDashboardApp(app, deps) { | |||
.when(DashboardConstants.LANDING_PAGE_PATH, { | |||
...defaults, | |||
template: dashboardListingTemplate, | |||
controller($scope, kbnUrlStateStorage, history) { | |||
controller: function($scope, kbnUrlStateStorage, history) { |
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 function
changes something? or no need?
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.
Ohhh, that's a very interesting point!
So, it was working fine in legacy platform, but stop working in the new platform.
The failure was something like: Angular can't bootstrap...
, the reason was the controller is invoked as new controller()
inside the angular and this particular function was not converted to a function declaration and acts like an arrow function.
So seems we have different babel configs for legacy and new platform (in legacy object methods are converted to function declarations, but in new platform they are not).
Maybe @joshdover could clarify this? 🙂
} from '../types'; | ||
import { migratePanelsTo730 } from '../../migrations/migrate_to_730_panels'; | ||
} from '../../types'; | ||
// should be moved in src/plugins/dashboard/common right after https://github.com/elastic/kibana/pull/61895 is merged |
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 you please clarify? this is a link to the same pr 🤔
circular dependency :D
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.
Ah, yeah, awkward.
An infinite loop 😆
That actually means a separate PR will be created with moving those right after this one is merged 😃
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 in chrome. Was focused on navigation between apps. And _g
preserving between navigations.
Didn't notice anything
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 in Chrome and everything works as expected, LGTM 👍
(Assuming the i18n thing is fixed, should be a really small change)
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
Sass file moves typical of NP migration. Did not check the JS level.
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.
Code lgtm, didn't retest after previous comment
* Remove absoluteToParsedUrl reference in dashboard * Remove KibanaParsedUrl from visualize * Fix tests * Add tests * Fix saved dashboard * Fix empty line after resolving conflicts * Move dashboard to np * Move migrations back to legacy * Make it works * Other fixes * Move into application folder * FIx translations * Make share & home plugins otional * FIx kbn url tracking, jest tests * Import from dashboard_constants in FT * Fix translations order * Use getStartServices for start plugin deps * Path fixes * i18n fix Co-authored-by: Elastic Machine <[email protected]>
* Remove absoluteToParsedUrl reference in dashboard * Remove KibanaParsedUrl from visualize * Fix tests * Add tests * Fix saved dashboard * Fix empty line after resolving conflicts * Move dashboard to np * Move migrations back to legacy * Make it works * Other fixes * Move into application folder * FIx translations * Make share & home plugins otional * FIx kbn url tracking, jest tests * Import from dashboard_constants in FT * Fix translations order * Use getStartServices for start plugin deps * Path fixes * i18n fix Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
Move the
Dashboard
plugin to NP.Note:
src/legacy/core_plugins/kibana/public/dashboard/migrations
was only left in legacy and will be moved right after this PR is merged.Changes are mostly related to update imports, files structure and i18n ids.
Other changes:
remove all
jest.mock('ui/...')
, so completely removed all references to legacy;in file
kbn_url_tracker.ts
thecreateHashHistory()
were moved down intoonMountApp
func to avoid creating a hash history before an app is mounted (the hash history starts adding#
ending to the actual url);since the
share
plugin is optional, theShare
button was disabled ifshare
contract is not exposedChecklist
Delete any items that are not applicable to this PR.
For maintainers