kibana/x-pack/plugins/searchprofiler/public/application/index.tsx

45 lines
1.2 KiB
TypeScript
Raw Normal View History

[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
*/
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { HttpStart as Http, ToastsSetup } from 'kibana/public';
import { LicenseStatus } from '../../common';
import { App } from './app';
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
import { AppContextProvider } from './contexts/app_context';
import { ProfileContextProvider } from './contexts/profiler_context';
interface AppDependencies {
el: HTMLElement;
http: Http;
I18nContext: any;
notifications: ToastsSetup;
initialLicenseStatus: LicenseStatus;
}
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
export const renderApp = ({
el,
http,
I18nContext,
notifications,
initialLicenseStatus,
}: AppDependencies) => {
render(
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
<I18nContext>
<AppContextProvider args={{ initialLicenseStatus, notifications, http }}>
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
<ProfileContextProvider>
<App />
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
</ProfileContextProvider>
</AppContextProvider>
</I18nContext>,
el
[SearchProfiler] SearchProfiler to NP (#48795) * Added the following components: - highlight details (with render test) - searchprofiler tabs - (wip) profile tree - (wip) shard details * First iteration of ProfileTree component (needs render test) * Remove space * ProfileTree render test * Add profile tree test to git index * First iteration of editor component with render test * First iteration of nearly functional public * Fix highlight_details_flyout render test * Move NP directory to public and fix import issue created by directly importing FormattedMessage * Rendering and looking more normal * Fix type issues and fix a11y for ace editor * Added ability to do profile requests again and render into UI (styling WiP) * Fix props in editor test * Added empty tree placeholder component (with test), moved styling around into individual files (wip) * Fix path * Lots of style updates and added util for determining visible children (+test) * Re-add missing badge and make it slightly wider (otherwise 100.00% cuts off to 100.0...) * Delete legacy public! * SCSS refactor + fix for re-rendering editor * UI and server updates after license checks * [skip ci] Add server np_ready code * fix i18n * Re-enable error annotations * Minor UX improvements (focus editor after failed request and no tabindex for textarea without active license) Added some spaces to make code more readable * Removed xpackMain from ServerShim Updated use of notifications -> notifications.toasts from np core setup Removed TODO for using core.application.register (not available for legacy apps) * Added placeholder component for loading state and implemented useReducer * Refactor actions * Changes after PR feedback: - TS for unsafe utils test fixtures - Safer use of .selfTime (no more NaN) - Sentence case where applicable - Cleaned up TODOs - Fix styling issue with percentage on badges of profile tree - Refactor name of profile hook (now useRequestProfile) - Fixed copy paste issue in highlight flyout `Total time` -> `Self time` - Restyled the profile button to be fill and not take up the full horizontal space - Removed the `Type` input from the profiler query section * Removed .type from backend and cleanup translations * Disable responsive UI layout for now * Remove buggy error annotation code * - Refactored percentage badge to own component - Updated styles after testing on IE11 - Updated styles after testing on Safari - Chrome and FF worked on this commit * Update missing i18n and fix use ace ui keyboard hook * Update useEffect dependencies array for editor component * Use absolute path to dev tools app (to fix CI) * Remove file extensions * Re-add missing data-test-subj
2019-10-31 22:23:17 +01:00
);
return () => unmountComponentAtNode(el);
};