-
Notifications
You must be signed in to change notification settings - Fork 4
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
general upgrade (dependencies, partially ant design) #595
Changes from all commits
f339832
f6433e4
a13feb3
564062b
85e91db
1caf9e9
ab5037b
0532c17
d8bf5b6
ae17310
7118409
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import React from 'react'; | ||
|
||
import Button from "antd/es/button/button"; | ||
import Form from "antd/es/form/Form"; | ||
|
||
// temporary workaround, waiting for https://github.com/libamtrack/web/issues/596 to be fixed | ||
// Form needs to be migrated to ant design v4 | ||
import { Form as LegacyForm } from '@ant-design/compatible'; | ||
import '@ant-design/compatible/assets/index.css'; | ||
|
||
import Input from "antd/es/input/Input"; | ||
import Tooltip from "antd/es/tooltip/index"; | ||
import Select from "antd/es/select/index"; | ||
|
||
|
||
const FormItem = Form.Item; | ||
const FormItem = LegacyForm.Item; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe also call it LegacyFormItem ? |
||
const InputGroup = Input.Group; | ||
const Option = Select.Option; | ||
|
||
|
@@ -51,14 +56,14 @@ class FormGenerator extends React.Component { | |
} | ||
|
||
return ( | ||
<Form onSubmit={this.handleSubmit} layout='horizontal' > | ||
<LegacyForm onSubmit={this.handleSubmit} layout='horizontal' > | ||
<div> | ||
{generatedForm} | ||
</div> | ||
<FormItem style={{ margin: 6 }} label={" "} labelCol={{ span: textLabelForInputSpan }} wrapperCol={{ span: inputFieldSpan }} colon={false}> | ||
<Button style={{ width: inputFieldWidth }} type='primary' htmlType='submit'>Submit</Button> | ||
</FormItem> | ||
</Form> | ||
</LegacyForm> | ||
); | ||
}; | ||
|
||
|
@@ -107,7 +112,7 @@ class FormGenerator extends React.Component { | |
|
||
return ( | ||
<div> | ||
<FormItem style={{ margin: 6 }} label={"Start " + label} labelCol={{ span: textLabelForInputSpan }} wrapperCol={{ span: inputFieldSpan }}> | ||
<FormItem style={{ margin: 6 }} label={"Start " + label} labelCol={{ span: textLabelForInputSpan }} wrapperCol={{ span: inputFieldSpan}}> | ||
<Tooltip title={"Insert start value"}> | ||
{getFieldDecorator(startName, { | ||
rules: [{ | ||
|
@@ -358,5 +363,5 @@ class FormGenerator extends React.Component { | |
} | ||
} | ||
|
||
const GenericForm = Form.create()(FormGenerator); | ||
const GenericForm = LegacyForm.create()(FormGenerator); | ||
export default GenericForm; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,8 @@ import FunctionsView from '../layouts/FunctionsView.js'; | |
import SearchBox from "../functions/utils/SearchBox"; | ||
import Layout from "antd/es/layout/layout"; | ||
import Row from "antd/es/row/index"; | ||
import Col from "react-bootstrap/es/Col"; | ||
import ListGroup from "react-bootstrap/es/ListGroup"; | ||
import ListGroupItem from "react-bootstrap/es/ListGroupItem"; | ||
import Route from "react-router-dom/es/Route"; | ||
import Link from "react-router-dom/es/Link"; | ||
import {Col, ListGroup, ListGroupItem} from "react-bootstrap"; | ||
import {Route, Link} from "react-router-dom"; | ||
import packageJson from '../../../package.json'; | ||
|
||
const { Header, Content, Footer } = Layout; | ||
|
@@ -75,14 +72,14 @@ class MainPage extends React.Component { | |
this.state.introText = confData.introText; | ||
this.state.dictionariesPaths = confData.dictionaries; | ||
|
||
let bundleAnalyzeReportOnlyAtWebDev = packageJson.homepage.indexOf("web_dev") === -1 ? "" : <Row><a href="report.html" target="_blank">{"See the bundle.js analyze"}</a></Row>; | ||
let bundleAnalyzeReportOnlyAtWebDev = packageJson.homepage.indexOf("web_dev") === -1 ? "" : <Row justify="center"><a href="report.html" target="_blank">{"See the bundle.js analyze"}</a></Row>; | ||
|
||
this.state.footer = | ||
<Footer key={"footer"} style={{ textAlign: 'center', background: '#fff' }}> | ||
<Row>{confData.footerText1} Find code at | ||
<Row justify="center">{confData.footerText1} Find code at | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe modify confData to setup year to 2021 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<a href={packageJson.repository}><img key={"githubImg"} src={githubLogo} align="center" style={{ 'height': '25px', 'width': '62px', 'marginLeft': '3px', 'marginBottom': '3px'}}/></a></Row> | ||
<Row style={{ 'font-size': '10px', 'font-style': 'italic' }}>{confData.footerText2}</Row> | ||
<Row style={{ 'font-size': '10px', 'font-style': 'italic' }}>{"Deploy date: " + confData.deployDate + " from branch: " | ||
<Row justify="center" style={{ 'fontSize': '10px', 'fontStyle': 'italic' }}>{confData.footerText2}</Row> | ||
<Row justify="center" style={{ 'fontSize': '10px', 'fontStyle': 'italic' }}>{"Deploy date: " + confData.deployDate + " from branch: " | ||
+ confData.deployBranch + " and commit number: " + confData.deployCommit}</Row> | ||
{bundleAnalyzeReportOnlyAtWebDev} | ||
</Footer>; | ||
|
@@ -108,16 +105,16 @@ class MainPage extends React.Component { | |
this.setState({ | ||
rows: | ||
(<div> | ||
<Row key={1} type='flex' gutter={10} align="center" style={{ paddingBottom: 25, paddingLeft: 25, paddingRight: 25 }}> | ||
<Row key={1} type='flex' gutter={10} justify="center" style={{ paddingBottom: 25, paddingLeft: 25, paddingRight: 25 }}> | ||
{this.state.introText} | ||
</Row> | ||
<Row key={2} type='flex' gutter={10} align="center" style={{ paddingBottom: 25 }}> | ||
<Row key={2} type='flex' gutter={10} justify="center" style={{ paddingBottom: 25 }}> | ||
<SearchBox | ||
searchFuns={this.state.funs} | ||
searchStyle={searchStyle} | ||
/> | ||
</Row> | ||
<Row key={3} type='flex' gutter={10} align="center" style={{ paddingBottom: 25 }}> | ||
<Row key={3} type='flex' gutter={10} justify="center" style={{ paddingBottom: 25 }}> | ||
{categoriesForColumns.map((colums, index) => ( | ||
<Col span={6} key={index} style={{ paddingLeft: 10, width: 320}}> | ||
{colums.map(category => ( | ||
|
@@ -158,7 +155,7 @@ class MainPage extends React.Component { | |
<Layout key={"mainLayout"} className="layout"> | ||
{/*LOGO*/} | ||
<Header key={"logoHeader"} style={{ background: "#fff", height: "200px" }}> | ||
<Row key={"logoRow"} type='flex' gutter={8} align="center"> | ||
<Row key={"logoRow"} type='flex' gutter={8} align="middle" justify="center"> | ||
<img key={"logoImg"} src={logo} align="center" className="App-logo" alt="logo" /> | ||
</Row> | ||
</Header> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if antd is not always keeping backwards comatybility is it safe to use "^" ?