Web console: update dev dependencies (#12240)

* Update dependencies

* Set "allowFunctions: true" for react/jsx-no-bind

* Prettify

* npm audit fix

* Bump playwright, set testEnvironment=node

* Bump node and npm

* Revert "Bump node and npm"

This reverts commit e93c8e00e7.

* Minor/patch bump node@14, npm@6
This commit is contained in:
John Gozde 2022-02-08 17:37:36 -07:00 committed by GitHub
parent ab3d994a17
commit 0d23713862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 3426 additions and 3117 deletions

View File

@ -385,7 +385,7 @@ jobs:
install: web-console/script/druid build
before_script:
- ./check_test_suite.py && travis_terminate 0 || echo 'Starting nvm install...'
- nvm install 10.24.0
- nvm install 14.19.0
- web-console/script/druid start
script: (cd web-console && npm run test-e2e)
after_script: web-console/script/druid stop

View File

@ -35,5 +35,6 @@ module.exports = {
'block',
{ pattern: 'Licensed to the Apache Software Foundation \\(ASF\\).+' },
],
'react/jsx-no-bind': [2, { allowArrowFunctions: true, allowFunctions: true }],
},
};

View File

@ -20,4 +20,5 @@ const common = require('./jest.common.config');
module.exports = Object.assign(common, {
testMatch: ['**/?(*.)+(spec).ts?(x)'],
testEnvironment: 'node',
});

File diff suppressed because it is too large Load Diff

View File

@ -55,8 +55,8 @@
"node": ">=14"
},
"volta": {
"node": "14.16.1",
"npm": "6.14.12"
"node": "14.19.0",
"npm": "6.14.16"
},
"browserslist": [
"> 1% and supports es6",
@ -103,9 +103,9 @@
"tslib": "^2.3.1"
},
"devDependencies": {
"@awesome-code-style/eslint-config": "^3.2.0",
"@awesome-code-style/prettier-config": "^3.0.0",
"@awesome-code-style/stylelint-config": "^3.0.0",
"@awesome-code-style/eslint-config": "^4.0.0",
"@awesome-code-style/prettier-config": "^4.0.0",
"@awesome-code-style/stylelint-config": "^4.0.0",
"@babel/core": "^7.14.3",
"@babel/preset-env": "^7.14.4",
"@testing-library/react": "^8.0.9",
@ -118,7 +118,7 @@
"@types/enzyme-adapter-react-16": "^1.0.5",
"@types/file-saver": "^2.0.1",
"@types/hjson": "^2.4.1",
"@types/jest": "^26.0.22",
"@types/jest": "^27.4.0",
"@types/lodash.debounce": "^4.0.6",
"@types/lodash.escape": "^4.0.6",
"@types/memoize-one": "^4.1.1",
@ -130,44 +130,44 @@
"@types/react-splitter-layout": "^3.0.0",
"@types/react-table": "6.8.5",
"@types/uuid": "^7.0.2",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"autoprefixer": "^10.2.6",
"babel-loader": "^8.2.2",
"browserslist": "^4.16.6",
"codecov": "^3.6.1",
"codecov": "^3.8.2",
"css-loader": "^5.2.1",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.3",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.2.0",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unicorn": "^30.0.0",
"eslint-plugin-unused-imports": "^1.1.2",
"eslint-plugin-unicorn": "^38.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"file-loader": "^6.2.0",
"fs-extra": "^8.1.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest": "^27.5.0",
"license-checker": "^25.0.1",
"node-sass": "^5.0.0",
"playwright-chromium": "^1.10.0",
"playwright-chromium": "^1.18.1",
"postcss": "^8.3.0",
"postcss-loader": "^5.3.0",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
"prettier": "^2.5.1",
"sass-loader": "^11.0.1",
"snarkdown": "^2.0.0",
"style-loader": "^2.0.0",
"stylelint": "^13.12.0",
"stylus": "^0.54.7",
"ts-jest": "^26.5.5",
"ts-jest": "^27.1.3",
"ts-loader": "^8.1.0",
"ts-node": "^8.4.1",
"typescript": "^4.4.3",
"typescript": "^4.5.5",
"uuid": "^7.0.2",
"webpack": "^5.33.2",
"webpack-bundle-analyzer": "^4.4.1",

View File

@ -34,8 +34,8 @@
<properties>
<resources.directory>${project.build.directory}/resources</resources.directory>
<druid.console.skip>false</druid.console.skip> <!-- this property is overidden in Travis CI to skip the javascript-related work -->
<node.version>v14.16.1</node.version>
<npm.version>6.14.12</npm.version>
<node.version>v14.19.0</node.version>
<npm.version>6.14.16</npm.version>
</properties>
<build>

View File

@ -74,10 +74,9 @@ function arrayJoin<T, U>(array: T[], separator: U): (T | U)[] {
function hideThousandsSeparator(text: string) {
const parts = text.split(THOUSANDS_SEPARATOR);
if (parts.length < 2) return text;
return arrayJoin(
parts,
<span className="unselectable">{THOUSANDS_SEPARATOR}</span>,
).map((x, i) => <Fragment key={i}>{x}</Fragment>);
return arrayJoin(parts, <span className="unselectable">{THOUSANDS_SEPARATOR}</span>).map(
(x, i) => <Fragment key={i}>{x}</Fragment>,
);
}
export const BracedText = React.memo(function BracedText(props: BracedTextProps) {

View File

@ -205,9 +205,8 @@ export const HeaderBar = React.memo(function HeaderBar(props: HeaderBarProps) {
const { active, capabilities } = props;
const [aboutDialogOpen, setAboutDialogOpen] = useState(false);
const [doctorDialogOpen, setDoctorDialogOpen] = useState(false);
const [coordinatorDynamicConfigDialogOpen, setCoordinatorDynamicConfigDialogOpen] = useState(
false,
);
const [coordinatorDynamicConfigDialogOpen, setCoordinatorDynamicConfigDialogOpen] =
useState(false);
const [overlordDynamicConfigDialogOpen, setOverlordDynamicConfigDialogOpen] = useState(false);
const loadDataPrimary = false;

View File

@ -40,14 +40,8 @@ export class BarGroup extends React.Component<BarGroupProps> {
}
render(): JSX.Element[] | null {
const {
dataToRender,
changeActiveDatasource,
xScale,
yScale,
onHoverBar,
barWidth,
} = this.props;
const { dataToRender, changeActiveDatasource, xScale, yScale, onHoverBar, barWidth } =
this.props;
if (dataToRender === undefined) return null;
return dataToRender.map((entry: BarUnitData, i: number) => {

View File

@ -32,16 +32,8 @@ export interface SuggestibleInputProps extends Omit<FormattedInputProps, 'format
}
export const SuggestibleInput = React.memo(function SuggestibleInput(props: SuggestibleInputProps) {
const {
className,
value,
onValueChange,
onFinalize,
onBlur,
onFocus,
suggestions,
...rest
} = props;
const { className, value, onValueChange, onFinalize, onBlur, onFocus, suggestions, ...rest } =
props;
const lastFocusValue = useRef<string>();

View File

@ -106,18 +106,16 @@ export const SupervisorStatisticsTable = React.memo(function SupervisorStatistic
columns = columns.concat(
Object.keys(movingAveragesBuildSegments)
.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }))
.map(
(interval: string): Column<SupervisorStatisticsTableRow> => {
return {
Header: interval,
id: interval,
accessor: d => {
return deepGet(d, `summary.movingAverages.buildSegments.${interval}`);
},
Cell: renderCell,
};
},
),
.map((interval: string): Column<SupervisorStatisticsTableRow> => {
return {
Header: interval,
id: interval,
accessor: d => {
return deepGet(d, `summary.movingAverages.buildSegments.${interval}`);
},
Cell: renderCell,
};
}),
);
}

View File

@ -52,8 +52,10 @@ const MIN_MICRO = MIN_MILLIS * 1000;
const MIN_NANO = MIN_MICRO * 1000;
const MAX_NANO = MIN_NANO * 1000;
export const AUTO_MATCHER = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))( ((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)$/;
export const ISO_MATCHER = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)$/;
export const AUTO_MATCHER =
/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))( ((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)$/;
export const ISO_MATCHER =
/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)$/;
// Note: AUTO and ISO are basically the same except ISO has a space as a separator instead of the T

View File

@ -140,9 +140,8 @@ export class DruidError extends Error {
};
}
const matchLexical = /Lexical error at line (\d+), column (\d+).\s+Encountered: "\\u201\w"/.exec(
errorMessage,
);
const matchLexical =
/Lexical error at line (\d+), column (\d+).\s+Encountered: "\\u201\w"/.exec(errorMessage);
if (matchLexical) {
return {
label: 'Replace fancy quotes with ASCII quotes',
@ -158,9 +157,10 @@ export class DruidError extends Error {
// Incorrect quoting on table
// ex: org.apache.calcite.runtime.CalciteContextException: From line 3, column 17 to line 3, column 31: Column '#ar.wikipedia' not found in any table
const matchQuotes = /org.apache.calcite.runtime.CalciteContextException: From line (\d+), column (\d+) to line \d+, column \d+: Column '([^']+)' not found in any table/.exec(
errorMessage,
);
const matchQuotes =
/org.apache.calcite.runtime.CalciteContextException: From line (\d+), column (\d+) to line \d+, column \d+: Column '([^']+)' not found in any table/.exec(
errorMessage,
);
if (matchQuotes) {
const line = Number(matchQuotes[1]);
const column = Number(matchQuotes[2]);

View File

@ -389,36 +389,34 @@ ORDER BY 1`;
);
const loadstatusResp = await Api.instance.get('/druid/coordinator/v1/loadstatus?simple');
const loadstatus = loadstatusResp.data;
datasources = datasourcesResp.data.map(
(d: any): DatasourceQueryResultRow => {
const totalDataSize = deepGet(d, 'properties.segments.size') || -1;
const segmentsToLoad = Number(loadstatus[d.name] || 0);
const availableSegments = Number(deepGet(d, 'properties.segments.count'));
const numSegments = availableSegments + segmentsToLoad;
return {
datasource: d.name,
num_segments: numSegments,
num_segments_to_load: segmentsToLoad,
num_segments_to_drop: 0,
minute_aligned_segments: -1,
hour_aligned_segments: -1,
day_aligned_segments: -1,
month_aligned_segments: -1,
year_aligned_segments: -1,
all_granularity_segments: -1,
replicated_size: -1,
total_data_size: totalDataSize,
min_segment_rows: -1,
avg_segment_rows: -1,
max_segment_rows: -1,
min_segment_size: -1,
avg_segment_size: -1,
max_segment_size: -1,
total_rows: -1,
avg_row_size: -1,
};
},
);
datasources = datasourcesResp.data.map((d: any): DatasourceQueryResultRow => {
const totalDataSize = deepGet(d, 'properties.segments.size') || -1;
const segmentsToLoad = Number(loadstatus[d.name] || 0);
const availableSegments = Number(deepGet(d, 'properties.segments.count'));
const numSegments = availableSegments + segmentsToLoad;
return {
datasource: d.name,
num_segments: numSegments,
num_segments_to_load: segmentsToLoad,
num_segments_to_drop: 0,
minute_aligned_segments: -1,
hour_aligned_segments: -1,
day_aligned_segments: -1,
month_aligned_segments: -1,
year_aligned_segments: -1,
all_granularity_segments: -1,
replicated_size: -1,
total_data_size: totalDataSize,
min_segment_rows: -1,
avg_segment_rows: -1,
max_segment_rows: -1,
min_segment_size: -1,
avg_segment_size: -1,
max_segment_size: -1,
total_rows: -1,
avg_row_size: -1,
};
});
} else {
throw new Error(`must have SQL or coordinator access`);
}
@ -969,12 +967,8 @@ ORDER BY 1`;
renderDatasourceTable() {
const { goToSegments, capabilities } = this.props;
const {
datasourcesAndDefaultRulesState,
datasourceFilter,
showUnused,
visibleColumns,
} = this.state;
const { datasourcesAndDefaultRulesState, datasourceFilter, showUnused, visibleColumns } =
this.state;
let { datasources, defaultRules } = datasourcesAndDefaultRulesState.data
? datasourcesAndDefaultRulesState.data

View File

@ -312,10 +312,9 @@ ORDER BY "rank" DESC, "created_time" DESC`;
error_msg: d.errorMsg,
location: d.location.host ? `${d.location.host}:${d.location.port}` : null,
status: d.statusCode === 'RUNNING' ? d.runnerStatusCode : d.statusCode,
rank:
IngestionView.statusRanking[
d.statusCode === 'RUNNING' ? d.runnerStatusCode : d.statusCode
],
rank: IngestionView.statusRanking[
d.statusCode === 'RUNNING' ? d.runnerStatusCode : d.statusCode
],
};
});
};
@ -713,13 +712,8 @@ ORDER BY "rank" DESC, "created_time" DESC`;
}
renderTaskTable() {
const {
tasksState,
taskFilter,
groupTasksBy,
hiddenTaskColumns,
supervisorFilter,
} = this.state;
const { tasksState, taskFilter, groupTasksBy, hiddenTaskColumns, supervisorFilter } =
this.state;
const tasks = tasksState.data || [];
return (

View File

@ -224,9 +224,10 @@ function formatSampleEntries(sampleEntries: SampleEntry[], isDruidSource: boolea
return sampleEntries.map(showDruidLine).join('\n');
}
return (sampleEntries.every(l => !l.parsed)
? sampleEntries.map(showBlankLine)
: sampleEntries.map(showRawLine)
return (
sampleEntries.every(l => !l.parsed)
? sampleEntries.map(showBlankLine)
: sampleEntries.map(showRawLine)
).join('\n');
} else {
return 'No data returned from sampler';
@ -1687,9 +1688,8 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
this.updateSpecPreview(
deepSetMulti(spec, {
'spec.dataSchema.timestampSpec': CONSTANT_TIMESTAMP_SPEC,
'spec.dataSchema.transformSpec.transforms': removeTimestampTransform(
transforms,
),
'spec.dataSchema.transformSpec.transforms':
removeTimestampTransform(transforms),
}),
);
}}
@ -1705,9 +1705,8 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
this.updateSpecPreview(
deepSetMulti(spec, {
'spec.dataSchema.timestampSpec': timestampSpec,
'spec.dataSchema.transformSpec.transforms': removeTimestampTransform(
transforms,
),
'spec.dataSchema.transformSpec.transforms':
removeTimestampTransform(transforms),
}),
);
}}
@ -1811,13 +1810,8 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
}
renderTransformStep() {
const {
spec,
columnFilter,
specialColumnsOnly,
transformQueryState,
selectedTransform,
} = this.state;
const { spec, columnFilter, specialColumnsOnly, transformQueryState, selectedTransform } =
this.state;
const transforms: Transform[] =
deepGet(spec, 'spec.dataSchema.transformSpec.transforms') || EMPTY_ARRAY;

View File

@ -448,12 +448,8 @@ export class LookupsView extends React.PureComponent<LookupsViewProps, LookupsVi
}
render(): JSX.Element {
const {
lookupEntriesAndTiersState,
visibleColumns,
lookupTableActionDialogId,
actions,
} = this.state;
const { lookupEntriesAndTiersState, visibleColumns, lookupTableActionDialogId, actions } =
this.state;
return (
<div className="lookups-view app-view">

View File

@ -275,15 +275,8 @@ END AS "partitioning"`,
this.segmentsQueryManager = new QueryManager({
debounceIdle: 500,
processQuery: async (query: SegmentsQuery, _cancelToken, setIntermediateQuery) => {
const {
page,
pageSize,
filtered,
sorted,
visibleColumns,
capabilities,
groupByInterval,
} = query;
const { page, pageSize, filtered, sorted, visibleColumns, capabilities, groupByInterval } =
query;
if (capabilities.hasSql()) {
const whereParts = filterMap(filtered, (f: Filter) => {

View File

@ -537,12 +537,8 @@ ORDER BY
const { service_type } = row.original;
switch (service_type) {
case 'historical': {
const {
segmentsToLoad,
segmentsToLoadSize,
segmentsToDrop,
segmentsToDropSize,
} = row.original;
const { segmentsToLoad, segmentsToLoadSize, segmentsToDrop, segmentsToDropSize } =
row.original;
return formatQueues(
segmentsToLoad,
segmentsToLoadSize,