Skip to content

Commit ec69225

Browse files
vogievetskyjon-wei
authored andcommitted
Downgrade blueprintjs version in the web console to one with a vanilla Apache 2.0 license (apache#7139)
* revert bp * fix tests * move @types/hjson to dev dep * removed all the package upgrades
1 parent 86040e2 commit ec69225

39 files changed

+1263
-980
lines changed

services/src/main/java/org/apache/druid/cli/RouterJettyServerInitializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public class RouterJettyServerInitializer implements JettyServerInitializer
6666
"/",
6767
"/coordinator-console/*",
6868
"/public/*",
69+
"/assets/*",
6970
"/old-console/*",
7071
"/pages/*",
7172
"/unified-console.html",

web-console/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node/
22
node_modules/
33
resources/
44
public/
5+
assets/
56
lib/*.css
67

78
coordinator-console/

web-console/package-lock.json

Lines changed: 711 additions & 711 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web-console/package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"start": "webpack-dev-server --hot --open"
1818
},
1919
"dependencies": {
20-
"@blueprintjs/core": "^3.12.0",
21-
"@types/hjson": "^2.4.0",
20+
"@blueprintjs/core": "1.0.1",
2221
"axios": "^0.18.0",
22+
"brace": "^0.11.1",
2323
"classnames": "^2.2.6",
2424
"d3-array": "^2.0.3",
2525
"druid-console": "^0.0.2",
@@ -28,16 +28,20 @@
2828
"hjson": "^3.1.2",
2929
"lodash.debounce": "^4.0.8",
3030
"numeral": "^2.0.6",
31-
"react": "^16.7.0",
32-
"react-dom": "^16.7.0",
31+
"prop-types": "^15.7.2",
32+
"react": "^16.8.3",
33+
"react-ace": "^6.4.0",
34+
"react-addons-css-transition-group": "^15.6.2",
35+
"react-dom": "^16.8.3",
3336
"react-router": "^4.3.1",
3437
"react-router-dom": "^4.3.1",
35-
"react-table": "^6.8.6",
38+
"react-table": "^6.9.2",
3639
"tslib": "^1.9.3"
3740
},
3841
"devDependencies": {
3942
"@types/classnames": "^2.2.7",
4043
"@types/d3-array": "^1.2.4",
44+
"@types/hjson": "^2.4.0",
4145
"@types/jest": "^23.3.13",
4246
"@types/lodash.debounce": "^4.0.4",
4347
"@types/mocha": "^5.2.5",

web-console/script/build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ cp -r ./node_modules/druid-console/coordinator-console .
2323
cp -r ./node_modules/druid-console/pages .
2424
cp ./node_modules/druid-console/index.html .
2525

26+
echo "Copying blueprint assets in..."
27+
sed 's|url("assets|url("/assets|g' "./node_modules/@blueprintjs/core/dist/blueprint.css" > lib/blueprint.css
28+
cp -r "./node_modules/@blueprintjs/core/dist/assets" .
29+
2630
echo "Transpiling ReactTable CSS..."
2731
PATH="./target/node:$PATH" ./node_modules/.bin/stylus lib/react-table.styl -o lib/react-table.css
2832

web-console/script/clean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
# limitations under the License.
1818

1919
rm -rf \
20-
lib/react-table.css \
20+
lib/*.css \
2121
node_modules \
2222
coordinator-console \
2323
pages \
2424
public \
25+
assets \
2526
index.html

web-console/script/cp-to

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ cp -r coordinator-console "$1"
2424
cp -r old-console "$1"
2525
cp -r pages "$1"
2626
cp -r public "$1"
27+
cp -r assets "$1"

web-console/src/components/auto-form.tsx

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,8 @@
1919
import { resolveSrv } from 'dns';
2020
import * as React from 'react';
2121
import axios from 'axios';
22-
import {
23-
FormGroup,
24-
Button,
25-
InputGroup,
26-
Dialog,
27-
NumericInput,
28-
Classes,
29-
Tooltip,
30-
AnchorButton,
31-
TagInput,
32-
Intent,
33-
ButtonGroup,
34-
HTMLSelect
35-
} from "@blueprintjs/core";
22+
import { InputGroup } from "@blueprintjs/core";
23+
import { HTMLSelect, FormGroup, NumericInput, TagInput } from "../components/filler";
3624

3725
interface Field {
3826
name: string;
@@ -67,7 +55,7 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
6755
const { model, onChange } = this.props;
6856
return <NumericInput
6957
value={(model as any)[field.name]}
70-
onValueChange={v => {
58+
onValueChange={(v: any) => {
7159
if (isNaN(v)) return;
7260
onChange(Object.assign({}, model, { [field.name]: v }));
7361
}}
@@ -79,7 +67,7 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
7967
const { model, onChange } = this.props;
8068
return <NumericInput
8169
value={(model as any)[field.name]}
82-
onValueChange={v => {
70+
onValueChange={(v: number) => {
8371
if (isNaN(v)) return;
8472
onChange(Object.assign({}, model, { [field.name]: v }));
8573
}}
@@ -102,12 +90,14 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
10290
private renderBooleanInput(field: Field): JSX.Element {
10391
const { model, onChange } = this.props;
10492
return <HTMLSelect
105-
options={["True", "False"]}
10693
value={(model as any)[field.name] === true ? "True" : "False"}
107-
onChange={e => {
94+
onChange={(e: any) => {
10895
onChange(Object.assign({}, model, { [field.name]: e.currentTarget.value === "True" }));
10996
}}
110-
/>
97+
>
98+
<option value="True">True</option>
99+
<option value="False">False</option>
100+
</HTMLSelect>
111101
}
112102

113103
private renderStringArrayInput(field: Field): JSX.Element {
@@ -118,7 +108,7 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
118108
onChange={(v: any) => {
119109
onChange(Object.assign({}, model, { [field.name]: v }));
120110
}}
121-
addOnBlur={true}
111+
fill
122112
/>;
123113
}
124114

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
.pt-select {
20+
&.pt-fill {
21+
flex: 1;
22+
}
23+
}
24+
25+
.form-group {
26+
margin: 0 0 15px;
27+
}

0 commit comments

Comments
 (0)