Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-76003-kbn-con…
Browse files Browse the repository at this point in the history
…fig-package
  • Loading branch information
pgayvallet committed Sep 16, 2020
2 parents c0abb98 + e667f2f commit b77c901
Show file tree
Hide file tree
Showing 149 changed files with 4,927 additions and 1,427 deletions.
3 changes: 2 additions & 1 deletion packages/kbn-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/config-schema": "1.0.0"
"@kbn/config-schema": "1.0.0",
"load-json-file": "^6.2.0"
},
"devDependencies": {
"typescript": "4.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ RUN groupadd --gid 1000 kibana && \
useradd --uid 1000 --gid 1000 \
--home-dir /usr/share/kibana --no-create-home \
kibana
USER kibana

LABEL org.label-schema.build-date="{{dockerBuildDate}}" \
org.label-schema.license="{{license}}" \
Expand Down Expand Up @@ -115,8 +114,13 @@ LABEL name="Kibana" \
release="1" \
summary="Kibana" \
description="Your window into the Elastic Stack."

RUN mkdir /licenses && \
cp LICENSE.txt /licenses/LICENSE
{{/ubi}}

USER kibana

ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]

CMD ["/usr/local/bin/kibana-docker"]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react';
import { shallow } from 'enzyme';
import { EuiPageSideBar, EuiButton } from '@elastic/eui';
import { EuiPageSideBar, EuiButton, EuiPageBody } from '@elastic/eui';

import { Layout, INavContext } from './layout';

Expand All @@ -15,6 +15,13 @@ describe('Layout', () => {
const wrapper = shallow(<Layout navigation={null} />);

expect(wrapper.find('.enterpriseSearchLayout')).toHaveLength(1);
expect(wrapper.find(EuiPageBody).prop('restrictWidth')).toBeFalsy();
});

it('passes the restrictWidth prop', () => {
const wrapper = shallow(<Layout navigation={null} restrictWidth />);

expect(wrapper.find(EuiPageBody).prop('restrictWidth')).toEqual(true);
});

it('renders navigation', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import './layout.scss';

interface ILayoutProps {
navigation: React.ReactNode;
restrictWidth?: boolean;
}

export interface INavContext {
closeNavigation(): void;
}
export const NavContext = React.createContext({});

export const Layout: React.FC<ILayoutProps> = ({ children, navigation }) => {
export const Layout: React.FC<ILayoutProps> = ({ children, navigation, restrictWidth }) => {
const [isNavOpen, setIsNavOpen] = useState(false);
const toggleNavigation = () => setIsNavOpen(!isNavOpen);
const closeNavigation = () => setIsNavOpen(false);
Expand Down Expand Up @@ -54,7 +55,9 @@ export const Layout: React.FC<ILayoutProps> = ({ children, navigation }) => {
</div>
<NavContext.Provider value={{ closeNavigation }}>{navigation}</NavContext.Provider>
</EuiPageSideBar>
<EuiPageBody className="enterpriseSearchLayout__body">{children}</EuiPageBody>
<EuiPageBody className="enterpriseSearchLayout__body" restrictWidth={restrictWidth}>
{children}
</EuiPageBody>
</EuiPage>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const createActions = (testBed: TestBed<TestSubject>) => {
});
});
await act(async () => {
find('processorSettingsForm.submitButton').simulate('click');
find('addProcessorForm.submitButton').simulate('click');
});
},

Expand Down Expand Up @@ -166,7 +166,7 @@ const createActions = (testBed: TestBed<TestSubject>) => {
});
});
await act(async () => {
find('processorSettingsForm.submitButton').simulate('click');
find('addProcessorForm.submitButton').simulate('click');
});
},

Expand Down Expand Up @@ -202,8 +202,10 @@ type TestSubject =
| 'pipelineEditorDoneButton'
| 'pipelineEditorOnFailureToggle'
| 'addProcessorsButtonLevel1'
| 'processorSettingsForm'
| 'processorSettingsForm.submitButton'
| 'editProcessorForm'
| 'editProcessorForm.submitButton'
| 'addProcessorForm.submitButton'
| 'addProcessorForm'
| 'processorOptionsEditor'
| 'processorSettingsFormFlyout'
| 'processorTypeSelector'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('Pipeline Editor', () => {
it('prevents moving a processor while in edit mode', () => {
const { find, exists } = testBed;
find('processors>0.manageItemButton').simulate('click');
expect(exists('processorSettingsForm')).toBe(true);
expect(exists('editProcessorForm')).toBe(true);
expect(find('processors>0.moveItemButton').props().disabled).toBe(true);
expect(find('processors>1.moveItemButton').props().disabled).toBe(true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ const createActions = (testBed: TestBed<TestSubject>) => {
component.update();
},

clickProcessorOutputTab() {
act(() => {
async clickProcessorOutputTab() {
await act(async () => {
find('outputTab').simulate('click');
});
component.update();
Expand Down Expand Up @@ -224,7 +224,8 @@ type TestSubject =
| 'processorStatusIcon'
| 'documentsTab'
| 'manageItemButton'
| 'processorSettingsForm'
| 'addProcessorForm'
| 'editProcessorForm'
| 'configurationTab'
| 'outputTab'
| 'processorOutputTabContent'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Test pipeline', () => {

describe('Test pipeline actions', () => {
it('should successfully add sample documents and execute the pipeline', async () => {
const { find, actions, exists } = testBed;
const { actions, exists } = testBed;

httpRequestsMockHelpers.setSimulatePipelineResponse(SIMULATE_RESPONSE);

Expand All @@ -59,7 +59,6 @@ describe('Test pipeline', () => {
expect(exists('testPipelineFlyout')).toBe(true);
expect(exists('documentsTabContent')).toBe(true);
expect(exists('outputTabContent')).toBe(false);
expect(find('outputTab').props().disabled).toEqual(true);

// Add sample documents and click run
actions.addDocumentsJson(JSON.stringify(DOCUMENTS));
Expand Down Expand Up @@ -89,21 +88,25 @@ describe('Test pipeline', () => {
});

// Verify output tab is active
expect(find('outputTab').props().disabled).toEqual(false);
expect(exists('documentsTabContent')).toBe(false);
expect(exists('outputTabContent')).toBe(true);

// Click reload button and verify request
const totalRequests = server.requests.length;
await actions.clickRefreshOutputButton();
expect(server.requests.length).toBe(totalRequests + 1);
// There will be two requests made to the simulate API
// the second request will have verbose enabled to update the processor results
expect(server.requests.length).toBe(totalRequests + 2);
expect(server.requests[server.requests.length - 2].url).toBe(
'/api/ingest_pipelines/simulate'
);
expect(server.requests[server.requests.length - 1].url).toBe(
'/api/ingest_pipelines/simulate'
);

// Click verbose toggle and verify request
await actions.toggleVerboseSwitch();
expect(server.requests.length).toBe(totalRequests + 2);
expect(server.requests.length).toBe(totalRequests + 3);
expect(server.requests[server.requests.length - 1].url).toBe(
'/api/ingest_pipelines/simulate'
);
Expand Down Expand Up @@ -228,10 +231,10 @@ describe('Test pipeline', () => {
// Click processor to open manage flyout
await actions.clickProcessor('processors>0');
// Verify flyout opened
expect(exists('processorSettingsForm')).toBe(true);
expect(exists('editProcessorForm')).toBe(true);

// Navigate to "Output" tab
actions.clickProcessorOutputTab();
await actions.clickProcessorOutputTab();
// Verify content
expect(exists('processorOutputTabContent')).toBe(true);
});
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

export {
ManageProcessorForm,
ManageProcessorFormOnSubmitArg,
OnSubmitHandler,
} from './manage_processor_form';
export { ProcessorForm, ProcessorFormOnSubmitArg, OnSubmitHandler } from './processor_form';

export { ProcessorsTree, ProcessorInfo, OnActionHandler } from './processors_tree';

Expand All @@ -22,6 +18,4 @@ export { OnDoneLoadJsonHandler, LoadFromJsonButton } from './load_from_json';

export { TestPipelineActions } from './test_pipeline';

export { DocumentsDropdown } from './documents_dropdown';

export { PipelineProcessorsItemTooltip, Position } from './pipeline_processors_editor_item_tooltip';

This file was deleted.

Loading

0 comments on commit b77c901

Please sign in to comment.