[Code] Fix additional type errors after merge

This commit is contained in:
Fuyao Zhao 2018-12-20 21:16:02 -08:00
parent c0604c460e
commit dec6b4bc4a
13 changed files with 79 additions and 102 deletions

View file

@ -260,6 +260,7 @@
"@types/bluebird": "^3.1.1",
"@types/boom": "^7.2.0",
"@types/chance": "^1.0.0",
"@types/cheerio": "^0.22.10",
"@types/classnames": "^2.2.3",
"@types/d3": "^3.5.41",
"@types/dedent": "^0.7.0",

View file

@ -24,6 +24,7 @@ import {
IndexWorker,
UpdateWorker,
} from './server/queue';
import { RepositoryServiceFactory } from './server/repository_service_factory';
import { fileRoute } from './server/routes/file';
import { installRoute } from './server/routes/install';
import { lspRoute, symbolByQnameRoute } from './server/routes/lsp';
@ -149,16 +150,27 @@ export const code = (kibana: any) =>
cancellationService,
socketService
).bind();
const cloneWorker = new CloneWorker(queue, log, esClient, indexWorker, socketService).bind();
const repoServiceFactory: RepositoryServiceFactory = new RepositoryServiceFactory();
const cloneWorker = new CloneWorker(
queue,
log,
esClient,
indexWorker,
repoServiceFactory,
socketService
).bind();
const deleteWorker = new DeleteWorker(
queue,
log,
esClient,
cancellationService,
lspService,
repoServiceFactory,
socketService
).bind();
const updateWorker = new UpdateWorker(queue, log, esClient).bind();
const updateWorker = new UpdateWorker(queue, log, esClient, repoServiceFactory).bind();
// Initialize schedulers.
const updateScheduler = new UpdateScheduler(updateWorker, serverOptions, esClient, log);

View file

@ -136,7 +136,7 @@ class CodeContent extends React.PureComponent<Props, State> {
return (
<ButtonsContainer>
<Button onClick={this.hideBlame}>
<a href={`../api/code/repo/${repoUri}/blob/${revision}/${path}`}>Raw</a>
<a href={`../api/code/repo/${repoUri}/blob/${revision}/${path}`}>Raw File</a>
</Button>
<Button onClick={this.showBlame}>Blame</Button>
<Button onClick={this.hideBlame}>History</Button>

View file

@ -32,6 +32,7 @@ exports[`render correctly with empty query string 1`] = `
onOutsideClick={[Function]}
>
<div
aria-controls="typeahead-items"
aria-expanded={false}
aria-haspopup="true"
aria-owns="typeahead-items"
@ -135,11 +136,7 @@ exports[`render correctly with empty query string 1`] = `
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -150,11 +147,7 @@ exports[`render correctly with empty query string 1`] = `
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -288,6 +281,7 @@ exports[`render correctly with input query string changed 1`] = `
onOutsideClick={[Function]}
>
<div
aria-controls="typeahead-items"
aria-expanded={true}
aria-haspopup="true"
aria-owns="typeahead-items"
@ -391,11 +385,7 @@ exports[`render correctly with input query string changed 1`] = `
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -406,11 +396,7 @@ exports[`render correctly with input query string changed 1`] = `
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"

View file

@ -21,12 +21,14 @@ exports[`render file item 1`] = `
>
<styled.div
active={false}
aria-selected={false}
id="suggestion-1-1"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
aria-selected={false}
className="sc-bdVaJa iExjoJ"
id="suggestion-1-1"
onClick={[Function]}
@ -57,10 +59,10 @@ exports[`render file item 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
>
This is a file
</div>
@ -95,12 +97,14 @@ exports[`render repository item 1`] = `
>
<styled.div
active={false}
aria-selected={false}
id="suggestion-1-1"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
aria-selected={false}
className="sc-bdVaJa iExjoJ"
id="suggestion-1-1"
onClick={[Function]}
@ -130,10 +134,10 @@ exports[`render repository item 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
/>
</styled.div>
</Styled(styled.div)>
@ -166,12 +170,14 @@ exports[`render symbol item 1`] = `
>
<styled.div
active={false}
aria-selected={false}
id="suggestion-1-1"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
aria-selected={false}
className="sc-bdVaJa iExjoJ"
id="suggestion-1-1"
onClick={[Function]}
@ -205,11 +211,7 @@ exports[`render symbol item 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -218,11 +220,7 @@ exports[`render symbol item 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -258,10 +256,10 @@ exports[`render symbol item 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
>
elastic/elasticsearch &gt; src/foo/bar.java
</div>

View file

@ -140,7 +140,7 @@ exports[`render full suggestions component 1`] = `
>
<styled.div>
<div
className="sc-bZQynM gyPMl"
className="sc-bZQynM gNhebF"
>
<styled.div>
<div
@ -162,11 +162,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -175,11 +171,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -203,7 +195,7 @@ exports[`render full suggestions component 1`] = `
</styled.div>
<styled.div>
<div
className="sc-dnqmqq creRkv"
className="sc-dnqmqq cXfCkY"
>
1
Result
@ -232,13 +224,15 @@ exports[`render full suggestions component 1`] = `
>
<styled.div
active={true}
aria-selected={true}
id="suggestion-0-0"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
className="sc-bdVaJa bhnUSL"
aria-selected={true}
className="sc-bdVaJa cBoxAT"
id="suggestion-0-0"
onClick={[Function]}
onMouseEnter={[Function]}
@ -271,11 +265,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -284,11 +274,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -324,10 +310,10 @@ exports[`render full suggestions component 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
>
elastic/elasticsearch &gt; src/foo/bar.java
</div>
@ -349,7 +335,7 @@ exports[`render full suggestions component 1`] = `
>
<styled.div>
<div
className="sc-bZQynM gyPMl"
className="sc-bZQynM gNhebF"
>
<styled.div>
<div
@ -371,11 +357,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -384,11 +366,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -412,7 +390,7 @@ exports[`render full suggestions component 1`] = `
</styled.div>
<styled.div>
<div
className="sc-dnqmqq creRkv"
className="sc-dnqmqq cXfCkY"
>
1
Result
@ -441,12 +419,14 @@ exports[`render full suggestions component 1`] = `
>
<styled.div
active={false}
aria-selected={false}
id="suggestion-1-0"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
aria-selected={false}
className="sc-bdVaJa iExjoJ"
id="suggestion-1-0"
onClick={[Function]}
@ -471,10 +451,10 @@ exports[`render full suggestions component 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
>
This is a file
</div>
@ -496,7 +476,7 @@ exports[`render full suggestions component 1`] = `
>
<styled.div>
<div
className="sc-bZQynM gyPMl"
className="sc-bZQynM gNhebF"
>
<styled.div>
<div
@ -518,11 +498,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -531,11 +507,7 @@ exports[`render full suggestions component 1`] = `
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -560,7 +532,7 @@ exports[`render full suggestions component 1`] = `
</styled.div>
<styled.div>
<div
className="sc-dnqmqq creRkv"
className="sc-dnqmqq cXfCkY"
>
2
Result
@ -590,12 +562,14 @@ exports[`render full suggestions component 1`] = `
>
<styled.div
active={false}
aria-selected={false}
id="suggestion-2-0"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
aria-selected={false}
className="sc-bdVaJa iExjoJ"
id="suggestion-2-0"
onClick={[Function]}
@ -620,10 +594,10 @@ exports[`render full suggestions component 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
/>
</styled.div>
</Styled(styled.div)>
@ -654,12 +628,14 @@ exports[`render full suggestions component 1`] = `
>
<styled.div
active={false}
aria-selected={false}
id="suggestion-2-1"
onClick={[Function]}
onMouseEnter={[Function]}
role="option"
>
<div
aria-selected={false}
className="sc-bdVaJa iExjoJ"
id="suggestion-2-1"
onClick={[Function]}
@ -684,10 +660,10 @@ exports[`render full suggestions component 1`] = `
</Styled(styled.div)>
<Styled(styled.div)>
<styled.div
className="sc-EHOje jxxXAR"
className="sc-EHOje iasAWb"
>
<div
className="sc-EHOje jxxXAR sc-htpNat bUoeMH"
className="sc-EHOje iasAWb sc-htpNat bUoeMH"
/>
</styled.div>
</Styled(styled.div)>
@ -717,11 +693,11 @@ exports[`render full suggestions component 1`] = `
</div>
<styled.div>
<div
className="sc-gZMcBi iNXLyj"
className="sc-gZMcBi fTFWAX"
>
<styled.div>
<div
className="sc-gqjmRU cxjLAE"
className="sc-gqjmRU laCIgx"
>
Press ⮐ Return for Full Text Search
</div>

View file

@ -8,7 +8,6 @@ import { mount } from 'enzyme';
import toJson from 'enzyme-to-json';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import sinon from 'sinon';
import props from '../props.json';
import { SuggestionsComponent } from './suggestions_component';

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { CancellationToken } from '@code/esqueue';
import { CancellationToken } from '../lib/esqueue';
import sinon from 'sinon';

View file

@ -3,12 +3,12 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { AnyObject, EsClient, Esqueue } from '@code/esqueue';
import fs from 'fs';
import Git from 'nodegit';
import path from 'path';
import rimraf from 'rimraf';
import sinon from 'sinon';
import { AnyObject, EsClient, Esqueue } from '../lib/esqueue';
import { Repository } from '../../model';
import { Log } from '../log';

View file

@ -3,8 +3,8 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { AnyObject, EsClient, Esqueue } from '@code/esqueue';
import sinon from 'sinon';
import { AnyObject, EsClient, Esqueue } from '../lib/esqueue';
import { Log } from '../log';
import { LspService } from '../lsp/lsp_service';

View file

@ -3,8 +3,8 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { AnyObject, CancellationToken, EsClient, Esqueue } from '@code/esqueue';
import sinon from 'sinon';
import { AnyObject, CancellationToken, EsClient, Esqueue } from '../lib/esqueue';
import { IndexerFactory } from '../indexer';
import { Log } from '../log';

View file

@ -3,8 +3,8 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { AnyObject, EsClient, Esqueue } from '@code/esqueue';
import sinon from 'sinon';
import { AnyObject, EsClient, Esqueue } from '../lib/esqueue';
import { Log } from '../log';
import { RepositoryServiceFactory } from '../repository_service_factory';

View file

@ -1348,6 +1348,11 @@
resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.8.tgz#5702f74f78b73e13f1eb1bd435c2c9de61a250d4"
integrity sha512-LzF540VOFabhS2TR2yYFz2Mu/fTfkA+5AwYddtJbOJGwnYrr2e7fHadT7/Z3jNGJJdCRlO3ySxmW26NgRdwhNA==
"@types/cheerio@^0.22.10":
version "0.22.10"
resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.10.tgz#780d552467824be4a241b29510a7873a7432c4a6"
integrity sha512-fOM/Jhv51iyugY7KOBZz2ThfT1gwvsGCfWxpLpZDgkGjpEO4Le9cld07OdskikLjDUQJ43dzDaVRSFwQlpdqVg==
"@types/classnames@^2.2.3":
version "2.2.3"
resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.3.tgz#3f0ff6873da793870e20a260cada55982f38a9e5"