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

[Discover] Migrate discover.html Angular template to React #75784

Merged
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0ac5b98
Convert ES body of discover doc request to use fields API
kertal Aug 19, 2020
fb91a0e
Migrate angular discover.html template to react
kertal Aug 24, 2020
13a1756
Undo es doc fetch change
kertal Aug 25, 2020
d513821
Enable collapsing of sidebar
kertal Aug 25, 2020
f4060f8
Enable filtering of doc table
kertal Aug 25, 2020
007f84b
Fix tests
kertal Aug 25, 2020
e3710a8
Merge remote-tracking branch 'upstream/master' into kertal-2020-08-24…
kertal Aug 27, 2020
244d2cb
Fix missing data-title and data-description
kertal Aug 27, 2020
2855008
Fix missing timeRange leading to an functional test fail
kertal Aug 27, 2020
e1512e0
Fix another test
kertal Aug 27, 2020
7c5b929
Fix sorting of table
kertal Aug 27, 2020
4b24407
Handle refresh
kertal Aug 27, 2020
3be7374
Fix scroll to bottom
kertal Sep 1, 2020
ccdfc75
Fix invalid painless scripted field functional test
kertal Sep 1, 2020
373aedc
Merge remote-tracking branch 'upstream/master' into kertal-2020-08-24…
kertal Sep 3, 2020
129d7c9
Simplify code
kertal Sep 3, 2020
26b70c1
Fix types
kertal Sep 3, 2020
5caba4a
Fix savedSearches test
kertal Sep 4, 2020
0442073
Fix showSaveQuery
kertal Sep 4, 2020
f10997f
Fix type and cleanup
kertal Sep 4, 2020
55ba25e
Merge master/fix conflicts
kertal Sep 4, 2020
ab2a7c1
Undo accidentally commited code
kertal Sep 4, 2020
c0e0f3e
Merge branch 'master' into kertal-2020-08-24-discover-migrate-discove…
elasticmachine Sep 8, 2020
a328c2c
Address review comments part 1
kertal Sep 9, 2020
f244011
Merge branch 'kertal-2020-08-24-discover-migrate-discover-html' of gi…
kertal Sep 9, 2020
a594b3e
Fix types
kertal Sep 10, 2020
128736f
Migrate fixed_scroll directive
kertal Sep 14, 2020
e514a33
Fix closing sidebar
kertal Sep 14, 2020
9b7e381
Fix debounce tests
kertal Sep 14, 2020
9b6dc07
Merge remote-tracking branch 'upstream/master' into kertal-2020-08-24…
kertal Sep 14, 2020
8011988
Merge branch 'master' into kertal-2020-08-24-discover-migrate-discove…
elasticmachine Sep 14, 2020
f2aacc4
Address review comments
kertal Sep 14, 2020
39e1a15
Merge branch 'kertal-2020-08-24-discover-migrate-discover-html' of gi…
kertal Sep 14, 2020
a59fafc
Merge master/fix conflicts
kertal Sep 14, 2020
ee43b9e
Fix i18n
kertal Sep 14, 2020
f7d6b4b
Set aria-expanded of sidebar
kertal Sep 15, 2020
101ff24
Merge master/fix conflicts
kertal Sep 15, 2020
b6a46bd
Address review comments
kertal Sep 16, 2020
e79be95
Further cleanup of SCSS
kertal Sep 16, 2020
31cf12f
improve sidebar toggle
andreadelrio Sep 16, 2020
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
2 changes: 1 addition & 1 deletion src/plugins/discover/public/application/_discover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ discover-app {
top: $euiSizeXS;
}

[fixed-scroll] {
.fixed-scroll {
kertal marked this conversation as resolved.
Show resolved Hide resolved
overflow-x: auto;
padding-bottom: 0;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import _ from 'lodash';
// Debounce service, angularized version of lodash debounce
// borrowed heavily from https://github.com/shahata/angular-debounce

export function DebounceProviderTimeout($timeout) {
export function createDebounceProviderTimeout($timeout) {
return function (func, wait, options) {
let timeout;
let args;
Expand Down Expand Up @@ -66,7 +66,3 @@ export function DebounceProviderTimeout($timeout) {
return debounce;
};
}

export function DebounceProvider(debounce) {
return debounce;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'angular-sanitize';
import 'angular-route';

// @ts-ignore
import { DebounceProvider } from './index';
import { createDebounceProviderTimeout } from './debounce';
import { coreMock } from '../../../../../../../core/public/mocks';
import { initializeInnerAngularModule } from '../../../../get_inner_angular';
import { navigationPluginMock } from '../../../../../../navigation/public/mocks';
Expand All @@ -33,7 +33,6 @@ import { initAngularBootstrap } from '../../../../../../kibana_legacy/public';

describe('debounce service', function () {
let debounce: (fn: () => void, timeout: number, options?: any) => any;
let debounceFromProvider: (fn: () => void, timeout: number, options?: any) => any;
let $timeout: ITimeoutService;
let spy: SinonSpy;

Expand All @@ -51,22 +50,17 @@ describe('debounce service', function () {

angular.mock.module('app/discover');

angular.mock.inject(
($injector: auto.IInjectorService, _$timeout_: ITimeoutService, Private: any) => {
$timeout = _$timeout_;
angular.mock.inject(($injector: auto.IInjectorService, _$timeout_: ITimeoutService) => {
$timeout = _$timeout_;

debounce = $injector.get('debounce');
debounceFromProvider = Private(DebounceProvider);
}
);
debounce = createDebounceProviderTimeout($timeout);
});
});

it('should have a cancel method', function () {
const bouncer = debounce(() => {}, 100);
const bouncerFromProvider = debounceFromProvider(() => {}, 100);

expect(bouncer).toHaveProperty('cancel');
expect(bouncerFromProvider).toHaveProperty('cancel');
});

describe('delayed execution', function () {
Expand All @@ -77,62 +71,40 @@ describe('debounce service', function () {

it('should delay execution', function () {
const bouncer = debounce(spy, 100);
const bouncerFromProvider = debounceFromProvider(spy, 100);

bouncer();
sinon.assert.notCalled(spy);
$timeout.flush();
sinon.assert.calledOnce(spy);

spy.resetHistory();

bouncerFromProvider();
sinon.assert.notCalled(spy);
$timeout.flush();
sinon.assert.calledOnce(spy);
});

it('should fire on leading edge', function () {
const bouncer = debounce(spy, 100, { leading: true });
const bouncerFromProvider = debounceFromProvider(spy, 100, { leading: true });

bouncer();
sinon.assert.calledOnce(spy);
$timeout.flush();
sinon.assert.calledTwice(spy);

spy.resetHistory();

bouncerFromProvider();
sinon.assert.calledOnce(spy);
$timeout.flush();
sinon.assert.calledTwice(spy);
});

it('should only fire on leading edge', function () {
const bouncer = debounce(spy, 100, { leading: true, trailing: false });
const bouncerFromProvider = debounceFromProvider(spy, 100, {
leading: true,
trailing: false,
});

bouncer();
sinon.assert.calledOnce(spy);
$timeout.flush();
sinon.assert.calledOnce(spy);

spy.resetHistory();

bouncerFromProvider();
sinon.assert.calledOnce(spy);
$timeout.flush();
sinon.assert.calledOnce(spy);
});

it('should reset delayed execution', function () {
const cancelSpy = sinon.spy($timeout, 'cancel');
const bouncer = debounce(spy, 100);
const bouncerFromProvider = debounceFromProvider(spy, 100);

bouncer();
sandbox.clock.tick(1);
Expand All @@ -145,23 +117,13 @@ describe('debounce service', function () {

spy.resetHistory();
cancelSpy.resetHistory();

bouncerFromProvider();
sandbox.clock.tick(1);

bouncerFromProvider();
sinon.assert.notCalled(spy);
$timeout.flush();
sinon.assert.calledOnce(spy);
sinon.assert.calledOnce(cancelSpy);
});
});

describe('cancel', function () {
it('should cancel the $timeout', function () {
const cancelSpy = sinon.spy($timeout, 'cancel');
const bouncer = debounce(spy, 100);
const bouncerFromProvider = debounceFromProvider(spy, 100);

bouncer();
bouncer.cancel();
Expand All @@ -170,12 +132,6 @@ describe('debounce service', function () {
$timeout.verifyNoPendingTasks();

cancelSpy.resetHistory();

bouncerFromProvider();
bouncerFromProvider.cancel();
sinon.assert.calledOnce(cancelSpy);
// throws if pending timeouts
$timeout.verifyNoPendingTasks();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@
* under the License.
*/

import './debounce';

export { DebounceProvider } from './debounce';
export { createDebounceProviderTimeout } from './debounce';
Loading