Skip to content
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 @@ -66,6 +66,7 @@ public class RouterJettyServerInitializer implements JettyServerInitializer
"/",
"/coordinator-console/*",
"/public/*",
"/assets/*",
"/old-console/*",
"/pages/*",
"/unified-console.html",
Expand Down
1 change: 1 addition & 0 deletions web-console/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node/
node_modules/
resources/
public/
assets/
lib/*.css

coordinator-console/
Expand Down
1,252 changes: 669 additions & 583 deletions web-console/package-lock.json

Large diffs are not rendered by default.

46 changes: 25 additions & 21 deletions web-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
"start": "webpack-dev-server --hot --open"
},
"dependencies": {
"@blueprintjs/core": "^3.12.0",
"@types/hjson": "^2.4.0",
"@blueprintjs/core": "1.0.1",
"@types/hjson": "^2.4.1",
"axios": "^0.18.0",
"brace": "^0.11.1",
"classnames": "^2.2.6",
"d3-array": "^2.0.3",
"druid-console": "^0.0.2",
Expand All @@ -28,44 +29,47 @@
"hjson": "^3.1.2",
"lodash.debounce": "^4.0.8",
"numeral": "^2.0.6",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"prop-types": "^15.7.2",
"react": "^16.8.3",
"react-ace": "^6.4.0",
"react-addons-css-transition-group": "^15.6.2",
"react-dom": "^16.8.3",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-table": "^6.8.6",
"react-table": "^6.9.2",
"tslib": "^1.9.3"
},
"devDependencies": {
"@types/classnames": "^2.2.7",
"@types/d3-array": "^1.2.4",
"@types/jest": "^23.3.13",
"@types/lodash.debounce": "^4.0.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.18",
"@types/d3-array": "^1.2.6",
"@types/jest": "^24.0.6",
"@types/lodash.debounce": "^4.0.5",
"@types/mocha": "^5.2.6",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all of these version updates necessary, and can we use fixed package versions instead of "^"?

I think it would be simpler for review and also tracking our dependencies/licenses if we minimize version upgrades

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just upgraded to the latest versions as part of my testing. I figured since I was messing with the package versions anyway I would update things to the latest versions as I was going to be doing comprehensive end-to-end testing anyway. As for using the non-fixed versions that is not an issue as there is a package-lock file included which locks those versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also almost all of the 'spurious' things I upgraded are devDependancies in the normal dependency list every change is needed for this PR except @types/hjson which should actually probably be in the dev list also.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved @types/hjson to dev list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed all the package changes other than what is necessary for this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks

"@types/node": "^11.9.5",
"@types/numeral": "^0.0.25",
"@types/react-dom": "^16.0.11",
"@types/react-dom": "^16.8.2",
"@types/react-router-dom": "^4.3.1",
"@types/react-table": "^6.7.21",
"autoprefixer": "^9.4.6",
"@types/react-table": "^6.7.22",
"autoprefixer": "^9.4.8",
"css-loader": "^2.1.0",
"identity-obj-proxy": "^3.0.0",
"ignore-styles": "^5.0.1",
"jest": "^24.0.0",
"mocha": "^5.2.0",
"jest": "^24.1.0",
"mocha": "^6.0.1",
"node-sass": "^4.11.0",
"node-sass-chokidar": "^1.3.4",
"postcss-cli": "^6.1.1",
"postcss-cli": "^6.1.2",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.5.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"stylus": "^0.54.5",
"ts-jest": "^23.10.5",
"ts-jest": "^24.0.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.2",
"typescript": "^3.2.4",
"webpack": "^4.29.0",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
"typescript": "^3.3.3333",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.0"
}
}
4 changes: 4 additions & 0 deletions web-console/script/build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ cp -r ./node_modules/druid-console/coordinator-console .
cp -r ./node_modules/druid-console/pages .
cp ./node_modules/druid-console/index.html .

echo "Copying blueprint assets in..."
sed 's|url("assets|url("/assets|g' "./node_modules/@blueprintjs/core/dist/blueprint.css" > lib/blueprint.css
cp -r "./node_modules/@blueprintjs/core/dist/assets" .

echo "Transpiling ReactTable CSS..."
PATH="./target/node:$PATH" ./node_modules/.bin/stylus lib/react-table.styl -o lib/react-table.css

Expand Down
3 changes: 2 additions & 1 deletion web-console/script/clean
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
# limitations under the License.

rm -rf \
lib/react-table.css \
lib/*.css \
node_modules \
coordinator-console \
pages \
public \
assets \
index.html
1 change: 1 addition & 0 deletions web-console/script/cp-to
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ cp -r coordinator-console "$1"
cp -r old-console "$1"
cp -r pages "$1"
cp -r public "$1"
cp -r assets "$1"
30 changes: 10 additions & 20 deletions web-console/src/components/auto-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,8 @@
import { resolveSrv } from 'dns';
import * as React from 'react';
import axios from 'axios';
import {
FormGroup,
Button,
InputGroup,
Dialog,
NumericInput,
Classes,
Tooltip,
AnchorButton,
TagInput,
Intent,
ButtonGroup,
HTMLSelect
} from "@blueprintjs/core";
import { InputGroup } from "@blueprintjs/core";
import { HTMLSelect, FormGroup, NumericInput, TagInput } from "../components/filler";

interface Field {
name: string;
Expand Down Expand Up @@ -67,7 +55,7 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
const { model, onChange } = this.props;
return <NumericInput
value={(model as any)[field.name]}
onValueChange={v => {
onValueChange={(v: any) => {
if (isNaN(v)) return;
onChange(Object.assign({}, model, { [field.name]: v }));
}}
Expand All @@ -79,7 +67,7 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
const { model, onChange } = this.props;
return <NumericInput
value={(model as any)[field.name]}
onValueChange={v => {
onValueChange={(v: number) => {
if (isNaN(v)) return;
onChange(Object.assign({}, model, { [field.name]: v }));
}}
Expand All @@ -102,12 +90,14 @@ export class AutoForm<T> extends React.Component<AutoFormProps<T>, AutoFormState
private renderBooleanInput(field: Field): JSX.Element {
const { model, onChange } = this.props;
return <HTMLSelect
options={["True", "False"]}
value={(model as any)[field.name] === true ? "True" : "False"}
onChange={e => {
onChange={(e: any) => {
onChange(Object.assign({}, model, { [field.name]: e.currentTarget.value === "True" }));
}}
/>
>
<option value="True">True</option>
<option value="False">False</option>
</HTMLSelect>
}

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

Expand Down
27 changes: 27 additions & 0 deletions web-console/src/components/filler.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.pt-select {
&.pt-fill {
flex: 1;
}
}

.form-group {
margin: 0 0 15px;
}
Loading