Skip to content

Commit

Permalink
Merge branch 'master' into fix/revert-use-kibana-ui-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 17, 2019
2 parents 1b68662 + d577d40 commit ca04db0
Show file tree
Hide file tree
Showing 35 changed files with 5,320 additions and 414 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@
"@types/pngjs": "^3.3.2",
"@types/podium": "^1.0.0",
"@types/prop-types": "^15.5.3",
"@types/reach__router": "^1.2.6",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"@types/react-redux": "^6.0.6",
Expand Down
8 changes: 8 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,14 @@
'@types/podium',
],
},
{
groupSlug: '@reach/router',
groupName: '@reach/router related packages',
packageNames: [
'@reach/router',
'@types/reach__router',
],
},
{
groupSlug: 'request',
groupName: 'request related packages',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ describe('Legacy (Ace) Console Editor Component Smoke Test', () => {
updateCurrentState: () => {},
},
},
// eslint-disable-next-line
ResizeChecker: function() {
return { on: () => {} };
},
docLinkVersion: 'NA',
};
editor = mount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const DEFAULT_INPUT_VALUE = `GET _search
function _Editor({ previousStateLocation = 'stored' }: EditorProps) {
const {
services: { history, notifications },
ResizeChecker,
docLinkVersion,
} = useAppContext();

Expand Down Expand Up @@ -130,7 +129,6 @@ function _Editor({ previousStateLocation = 'stored' }: EditorProps) {
mappings.retrieveAutoCompleteInfo();

const unsubscribeResizer = subscribeResizeChecker(
ResizeChecker,
editorRef.current!,
editorInstanceRef.current
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function _EditorOuput() {
const editorInstanceRef = useRef<null | any>(null);
const {
services: { settings },
ResizeChecker,
} = useAppContext();

const dispatch = useEditorActionContext();
Expand All @@ -42,11 +41,7 @@ function _EditorOuput() {
const editor$ = $(editorRef.current!);
editorInstanceRef.current = initializeOutput(editor$, settings);
editorInstanceRef.current.update('');
const unsubscribe = subscribeResizeChecker(
ResizeChecker,
editorRef.current!,
editorInstanceRef.current
);
const unsubscribe = subscribeResizeChecker(editorRef.current!, editorInstanceRef.current);

dispatch({ type: 'setOutputEditor', value: editorInstanceRef.current });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const CHILD_ELEMENT_PREFIX = 'historyReq';
export function ConsoleHistory({ close }: Props) {
const {
services: { history },
ResizeChecker,
} = useAppContext();

const dispatch = useEditorActionContext();
Expand Down Expand Up @@ -200,7 +199,6 @@ export function ConsoleHistory({ close }: Props) {
<HistoryViewer
settings={readOnlySettings}
req={viewingReq}
ResizeChecker={ResizeChecker}
/>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ import { applyCurrentSettings } from '../console_editor/apply_editor_settings';
interface Props {
settings: DevToolsSettings;
req: any | null;
ResizeChecker: any;
}

export function HistoryViewer({ settings, ResizeChecker, req }: Props) {
export function HistoryViewer({ settings, req }: Props) {
const divRef = useRef<HTMLDivElement | null>(null);
const viewerRef = useRef<any | null>(null);

Expand All @@ -43,7 +42,7 @@ export function HistoryViewer({ settings, ResizeChecker, req }: Props) {
viewerRef.current = viewer;
viewer.renderer.setShowPrintMargin(false);
viewer.$blockScrolling = Infinity;
const unsubscribe = subscribeResizeChecker(ResizeChecker, divRef.current!, viewer);
const unsubscribe = subscribeResizeChecker(divRef.current!, viewer);
return () => unsubscribe();
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
import { ResizeChecker } from '../../../../../../../../../plugins/kibana_utils/public';

export function subscribeResizeChecker(ResizeChecker: any, $el: any, ...editors: any[]) {
const checker = new ResizeChecker($el);
export function subscribeResizeChecker(el: HTMLElement, ...editors: any[]) {
const checker = new ResizeChecker(el);
checker.on('resize', () =>
editors.forEach(e => {
e.resize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ interface ContextValue {
notifications: NotificationsSetup;
};
docLinkVersion: string;
ResizeChecker: any;
}

interface ContextProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ export function legacyBackDoorToSettings() {
export function boot(deps: {
docLinkVersion: string;
I18nContext: any;
ResizeChecker: any;
notifications: NotificationsSetup;
}) {
const { I18nContext, ResizeChecker, notifications, docLinkVersion } = deps;
const { I18nContext, notifications, docLinkVersion } = deps;

const storage = createStorage({
engine: window.localStorage,
Expand All @@ -51,7 +50,6 @@ export function boot(deps: {
value={{
docLinkVersion,
services: { storage, history, settings, notifications },
ResizeChecker,
}}
>
<EditorContextProvider settings={settings.toJSON()}>
Expand Down
3 changes: 0 additions & 3 deletions src/legacy/core_plugins/console/np_ready/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ import 'brace/mode/text';
/* eslint-disable @kbn/eslint/no-restricted-paths */
import { npSetup, npStart } from 'ui/new_platform';
import { I18nContext } from 'ui/i18n';
import { ResizeChecker } from 'ui/resize_checker';
/* eslint-enable @kbn/eslint/no-restricted-paths */

export interface XPluginSet {
devTools: DevToolsSetup;
feature_catalogue: FeatureCatalogueSetup;
__LEGACY: {
I18nContext: any;
ResizeChecker: any;
};
}

Expand All @@ -48,7 +46,6 @@ pluginInstance.setup(npSetup.core, {
...npSetup.plugins,
__LEGACY: {
I18nContext,
ResizeChecker,
},
});
pluginInstance.start(npStart.core);
3 changes: 1 addition & 2 deletions src/legacy/core_plugins/console/np_ready/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ConsoleUIPlugin implements Plugin<any, any> {

async setup({ notifications }: CoreSetup, pluginSet: XPluginSet) {
const {
__LEGACY: { I18nContext, ResizeChecker },
__LEGACY: { I18nContext },
devTools,
feature_catalogue,
} = pluginSet;
Expand Down Expand Up @@ -62,7 +62,6 @@ export class ConsoleUIPlugin implements Plugin<any, any> {
boot({
docLinkVersion: ctx.core.docLinks.DOC_LINK_VERSION,
I18nContext,
ResizeChecker,
notifications,
}),
element
Expand Down
208 changes: 0 additions & 208 deletions src/legacy/ui/public/resize_checker/__tests__/resize_checker.js

This file was deleted.

Loading

0 comments on commit ca04db0

Please sign in to comment.