diff --git a/package.json b/package.json index c1b3dc7..22cd71d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pri-plugin-dob", - "version": "2.0.4", + "version": "2.0.5", "types": "src/index.ts", "main": "dist/index.js", "scripts": { @@ -19,8 +19,7 @@ "pri": "^2.0.3" }, "pri": { - "type": "plugin", - "version": "2.0.6" + "type": "plugin" }, "dependencies": { "styled-components": "^4.1.3", diff --git a/src/index.ts b/src/index.ts index 829c191..8a4a980 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,5 @@ export const getPlugin = () => import('./plugin'); -export const getUIPlugins = () => [import('./web-menu'), import('./web-store')]; - export const getConfig = () => ({ name: 'pri-plugin-dob' }); diff --git a/src/web-menu/index.tsx b/src/web-menu/index.tsx deleted file mode 100644 index 6589ad6..0000000 --- a/src/web-menu/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Icon } from 'antd'; -import { Connect } from 'dob-react'; -import * as React from 'react'; -import { NewStoreComponent } from './new-store/new-store.component'; -import * as S from './style'; -import { Props, State } from './type'; - -const TreeIcon = (props: any) => ; - -@Connect -class View extends React.Component { - public static defaultProps = new Props(); - public state = new State(); - - public render() { - return ; - } -} - -export default { - position: 'menu', - view: View -}; diff --git a/src/web-menu/new-store/form.tsx b/src/web-menu/new-store/form.tsx deleted file mode 100644 index c9d637c..0000000 --- a/src/web-menu/new-store/form.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { Button, Form, Input, Switch } from 'antd'; -import { Connect } from 'dob-react'; -import * as React from 'react'; -import { Props, State } from './new-store.type'; -import * as S from './style'; - -const FormItem = Form.Item; - -const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 8 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - } -}; - -const tailFormItemLayout = { - wrapperCol: { - xs: { - span: 24, - offset: 0 - }, - sm: { - span: 16, - offset: 8 - } - } -}; - -function hasErrors(fieldsError: any) { - return Object.keys(fieldsError).some((field: string) => fieldsError[field]); -} - -@Connect -class FormComponent extends React.PureComponent { - public static defaultProps = new Props(); - public state = new State(); - - public render() { - return ( -
- - {this.props.form.getFieldDecorator('name', { - initialValue: 'application', - rules: [ - { - type: 'string', - message: 'Name must be string!' - }, - { - required: true, - message: 'Name is required!' - } - ] - })()} - - - - {this.props.form.getFieldDecorator('withDemo', { - initialValue: true, - valuePropName: 'checked' - })()} - - - - - -
- ); - } - - private handleSubmit = async (e: any) => { - e.preventDefault(); - await this.props.ApplicationAction.addStore(this.props.form.getFieldsValue()); - this.props.onSuccess(); - }; -} - -export default Form.create()(FormComponent as any) as any; diff --git a/src/web-menu/new-store/new-store.component.tsx b/src/web-menu/new-store/new-store.component.tsx deleted file mode 100644 index 80dd58e..0000000 --- a/src/web-menu/new-store/new-store.component.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Modal } from 'antd'; -import { Connect } from 'dob-react'; -import * as React from 'react'; -import { Props, State } from './new-store.type'; -import * as S from './style'; - -import FormComponent from './form'; - -@Connect -export class NewStoreComponent extends React.PureComponent { - public static defaultProps = new Props(); - public state = new State(); - - public render() { - return ( - - - - New Store - - - - - - - ); - } - - private showModal = () => { - this.setState({ - visible: true - }); - }; - private handleOk = () => { - this.setState({ - visible: false - }); - }; - private handleCancel = () => { - this.setState({ - visible: false - }); - }; -} diff --git a/src/web-menu/new-store/new-store.type.ts b/src/web-menu/new-store/new-store.type.ts deleted file mode 100644 index ac67108..0000000 --- a/src/web-menu/new-store/new-store.type.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class Props { - public form?: any; - public onSuccess?: () => void = () => { - // - }; - [x: string]: any; -} - -export class State { - public visible = false; -} diff --git a/src/web-menu/new-store/style.tsx b/src/web-menu/new-store/style.tsx deleted file mode 100644 index cd9f5b7..0000000 --- a/src/web-menu/new-store/style.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Icon } from 'antd'; -import * as React from 'react'; -import styled from 'styled-components'; - -export const MenuIcon = (props: any) => ; - -export const Container = styled.div` - display: flex; -`; - -export const Button = styled.div` - display: flex; - align-items: center; - justify-content: center; - font-size: 14px; - color: #666; - border-right: 1px solid #eee; - padding: 0 10px; - cursor: pointer; - transition: background-color 0.2s; - &:hover { - background-color: whitesmoke; - } -`; diff --git a/src/web-menu/style.ts b/src/web-menu/style.ts deleted file mode 100644 index c338983..0000000 --- a/src/web-menu/style.ts +++ /dev/null @@ -1,3 +0,0 @@ -import styled from 'styled-components'; - -export const Container = styled.div``; diff --git a/src/web-menu/type.ts b/src/web-menu/type.ts deleted file mode 100644 index 8290052..0000000 --- a/src/web-menu/type.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class Props { - [x: string]: any; -} - -export class State {} diff --git a/src/web-store/index.tsx b/src/web-store/index.tsx deleted file mode 100644 index 34b800a..0000000 --- a/src/web-store/index.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Icon } from 'antd'; -import { Connect } from 'dob-react'; -import * as React from 'react'; -import * as S from './style'; -import { Props, State } from './type'; - -const TreeIcon = (props: any) => ; - -@Connect -class View extends React.Component { - public static defaultProps = new Props(); - public state = new State(); - - public render() { - return Stores Info: TODO; - } -} - -export default { - position: 'tree-stores', - view: View, - init: (applicationAction: any) => { - applicationAction.event.on('freshProjectStatus', () => { - const dobInfo = applicationAction.applicationStore.status.analyseInfo.projectAnalyseDob; - if (dobInfo) { - applicationAction.pipeTreeNode((treeData: any) => { - treeData[0].children.push({ - key: 'stores', - title: `Stores (${dobInfo.storeFiles.length})`, - icon: , - disabled: dobInfo.storeFiles.length === 0, - children: dobInfo.storeFiles.map((storeFile: any, index: number) => { - return { - key: index, - title: storeFile.name, - icon: - }; - }) - }); - return treeData; - }); - } - }); - } -}; diff --git a/src/web-store/style.ts b/src/web-store/style.ts deleted file mode 100644 index c338983..0000000 --- a/src/web-store/style.ts +++ /dev/null @@ -1,3 +0,0 @@ -import styled from 'styled-components'; - -export const Container = styled.div``; diff --git a/src/web-store/type.ts b/src/web-store/type.ts deleted file mode 100644 index 8290052..0000000 --- a/src/web-store/type.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class Props { - [x: string]: any; -} - -export class State {}