Skip to content
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

Fix safari layout issue in Visualize, Graph and Lens #54694

Merged
merged 2 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,17 @@ export const renderApp = (element: HTMLElement, appBasePath: string, deps: Rende
};
};

const mainTemplate = (basePath: string) => `<div style="height: 100%">
const mainTemplate = (basePath: string) => `<div ng-view class="kbnLocalApplicationWrapper">
<base href="${basePath}" />
<div ng-view style="height: 100%;"></div>
</div>
`;
</div>`;

const moduleName = 'app/dashboard';

const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react'];

function mountDashboardApp(appBasePath: string, element: HTMLElement) {
const mountpoint = document.createElement('div');
mountpoint.setAttribute('style', 'height: 100%');
mountpoint.setAttribute('class', 'kbnLocalApplicationWrapper');
// eslint-disable-next-line
mountpoint.innerHTML = mainTemplate(appBasePath);
// bootstrap angular into detached element and attach it later to
Expand Down
3 changes: 3 additions & 0 deletions src/legacy/core_plugins/kibana/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// Management styles
@import './management/index';

// Local application mount wrapper styles
@import 'local_application_service/index';

// Dashboard styles
// MUST STAY AT THE BOTTOM BECAUSE OF DARK THEME IMPORTS
@import './dashboard/index';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'local_application_service';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.kbnLocalApplicationWrapper {
display: flex;
flex-direction: column;
flex-grow: 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class LocalApplicationService {
outerAngularWrapperRoute: true,
reloadOnSearch: false,
reloadOnUrl: false,
template: `<div style="height:100%" id="${wrapperElementId}"></div>`,
template: `<div class="kbnLocalApplicationWrapper" id="${wrapperElementId}"></div>`,
controller($scope: IScope) {
const element = document.getElementById(wrapperElementId)!;
let unmountHandler: AppUnmount | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ export const renderApp = async (
return () => $injector.get('$rootScope').$destroy();
};

const mainTemplate = (basePath: string) => `<div style="height: 100%">
const mainTemplate = (basePath: string) => `<div ng-view class="kbnLocalApplicationWrapper">
<base href="${basePath}" />
<div ng-view style="height: 100%;"></div>
</div>
`;

Expand All @@ -75,7 +74,7 @@ const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react'];

function mountVisualizeApp(appBasePath: string, element: HTMLElement) {
const mountpoint = document.createElement('div');
mountpoint.setAttribute('style', 'height: 100%');
mountpoint.setAttribute('class', 'kbnLocalApplicationWrapper');
mountpoint.innerHTML = mainTemplate(appBasePath);
// bootstrap angular into detached element and attach it later to
// make angular-within-angular possible
Expand Down
5 changes: 2 additions & 3 deletions x-pack/legacy/plugins/graph/public/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ export const renderApp = ({ appBasePath, element, ...deps }: GraphDependencies)
};
};

const mainTemplate = (basePath: string) => `<div style="height: 100%">
const mainTemplate = (basePath: string) => `<div ng-view class="kbnLocalApplicationWrapper">
<base href="${basePath}" />
<div ng-view style="height: 100%; display:flex; justify-content: center;"></div>
</div>
`;

Expand All @@ -108,7 +107,7 @@ const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react', 'ui.boo

function mountGraphApp(appBasePath: string, element: HTMLElement) {
const mountpoint = document.createElement('div');
mountpoint.setAttribute('style', 'height: 100%');
mountpoint.setAttribute('class', 'kbnLocalApplicationWrapper');
// eslint-disable-next-line
mountpoint.innerHTML = mainTemplate(appBasePath);
// bootstrap angular into detached element and attach it later to
Expand Down