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

Fix lint issues when bumping eslint-plugin-import #1652

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ describe('<SearchResults>', () => {

it('when click on DownloadResults then call download function', () => {
const originalBlob = global.Blob;
global.Blob = function (text, options) {
return { text, options };
};
global.Blob = (text, options) => ({ text, options });
URL.createObjectURL = jest.fn();
URL.revokeObjectURL = jest.fn();
const content = [`{"data":${JSON.stringify(props.rawTraces)}}`];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const SelectSort = reduxForm({

export const sortFormSelector = formValueSelector('traceResultsSort');

// export for tests
export function createBlob(rawTraces: TraceData[]) {
return new Blob([`{"data":${JSON.stringify(rawTraces)}}`], { type: 'application/json' });
}

export class UnconnectedSearchResults extends React.PureComponent<SearchResultsProps & RouteComponentProps> {
static defaultProps = { skipMessage: false, spanLinks: undefined, queryOfResults: undefined };

Expand Down Expand Up @@ -239,9 +244,5 @@ export class UnconnectedSearchResults extends React.PureComponent<SearchResultsP
);
}
}
// export for tests
export function createBlob(rawTraces: TraceData[]) {
return new Blob([`{"data":${JSON.stringify(rawTraces)}}`], { type: 'application/json' });
}

export default withRouter(UnconnectedSearchResults);
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export default class TraceStatistics extends Component<Props, State> {
if (val.attribute === 'name')
return (
<span
role="button"
onClick={() => onClickOption(row.hasSubgroupValue, row.name)}
style={{
borderLeft: `4px solid ${row.color || `transparent`}`,
Expand Down
8 changes: 3 additions & 5 deletions packages/jaeger-ui/src/demo/trace-generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

import Chance from 'chance';

import { getSpanId } from '../selectors/span';

const chance = new Chance();

export const SERVICE_LIST = ['serviceA', 'serviceB', 'serviceC', 'serviceD', 'serviceE', 'serviceF'];
Expand All @@ -40,7 +38,7 @@ function getParentSpanId(span, levels) {

// pick the correct nesting level if allocated by the levels calculation
levels.forEach((level, idx) => {
if (level.indexOf(getSpanId(span)) >= 0) {
if (level.indexOf(span.spanID) >= 0) {
nestingLevel = idx;
}
});
Expand All @@ -50,7 +48,7 @@ function getParentSpanId(span, levels) {

/* this simulates the hierarchy created by CHILD_OF tags */
function attachReferences(spans, depth, spansPerLevel) {
let levels = [[getSpanId(spans[0])]];
let levels = [[spans[0].spanID]];

const duplicateLevelFilter = currentLevels => span =>
!currentLevels.find(level => level.indexOf(span.spanID) >= 0);
Expand All @@ -60,7 +58,7 @@ function attachReferences(spans, depth, spansPerLevel) {
if (remainingSpans.length <= 0) break;
const newLevel = chance
.pickset(remainingSpans, spansPerLevel || chance.integer({ min: 4, max: 8 }))
.map(getSpanId);
.map(span => span.spanID);
levels.push(newLevel);
}

Expand Down
15 changes: 0 additions & 15 deletions packages/jaeger-ui/src/selectors/span.js

This file was deleted.

24 changes: 0 additions & 24 deletions packages/jaeger-ui/src/selectors/span.test.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/jaeger-ui/src/selectors/trace.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
// limitations under the License.

import { followsFromRef } from './trace.fixture';
import { getSpanId } from './span';
import * as traceSelectors from './trace';
import traceGenerator from '../demo/trace-generators';

const generatedTrace = traceGenerator.trace({ numberOfSpans: 45 });

describe('getTraceSpanIdsAsTree()', () => {
const getTraceSpansAsMap = trace =>
trace.spans.reduce((map, span) => map.set(getSpanId(span), span), new Map());
trace.spans.reduce((map, span) => map.set(span.spanID, span), new Map());
it('builds the tree properly', () => {
const tree = traceSelectors.getTraceSpanIdsAsTree(generatedTrace);
const spanMap = getTraceSpansAsMap(generatedTrace);
Expand Down
1 change: 0 additions & 1 deletion packages/jaeger-ui/tsconfig.lint.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"src/reducers/services.js",
"src/reducers/trace.js",
"src/selectors/dependencies.js",
"src/selectors/span.js",
"src/selectors/trace.js",
"src/utils/configure-store.js",
"src/utils/sort.js",
Expand Down