Skip to content

Commit

Permalink
Отформатирован весь код
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Apr 24, 2019
1 parent 55db8a8 commit 12c0f40
Show file tree
Hide file tree
Showing 23 changed files with 1,524 additions and 1,605 deletions.
25 changes: 13 additions & 12 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { configure, addDecorator, addParameters } from '@storybook/react';
import { withNotes } from '@storybook/addon-notes';
import { withInfo } from "@storybook/addon-info";
import { withInfo } from '@storybook/addon-info';
import { withOptions } from '@storybook/addon-options';
import requireContext from 'require-context.macro';
import { withI18next } from 'storybook-addon-i18next';
Expand All @@ -17,10 +17,10 @@ addDecorator(
inline: true,
source: true,
propTables: false,
})
}),
);

addParameters ({
addParameters({
options: {
/**
* name to display in the top left corner
Expand Down Expand Up @@ -98,19 +98,20 @@ addParameters ({
},
});

addDecorator(withI18next({
i18n,
languages: {
en: 'English',
ru: 'Русский',
}
}));

addDecorator(
withI18next({
i18n,
languages: {
en: 'English',
ru: 'Русский',
},
}),
);

const req = requireContext('../src', true, /\.stories\.js$/);

function loadStories() {
req.keys().forEach(filename => req(filename));
req.keys().forEach((filename) => req(filename));
}

configure(loadStories, module);
93 changes: 44 additions & 49 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,55 @@
import React from 'react'
import React from 'react';
//import {Col, Row} from "antd";
import {
Layout, Menu, Breadcrumb, Icon,
} from 'antd';
import { Layout, Menu, Breadcrumb, Icon } from 'antd';

import ClassTreeView from './ClassTreeView'
import PropertyEditor from './PropertyEditor'
import ClassTreeView from './ClassTreeView';
import PropertyEditor from './PropertyEditor';

const { Header, Content, Sider } = Layout;
const { SubMenu } = Menu;

const App = () => {
return (
<Layout>
<Header className="header">
{/*
return (
<Layout>
<Header className='header'>
{/*
// TODO : left side navigation menu
*/}
<div className="logo" />
<Menu
mode="horizontal"
defaultSelectedKeys={['2']}
style={{ lineHeight: '64px' }}
>
<Menu.Item key="1">nav 1</Menu.Item>
<Menu.Item key="2">nav 2</Menu.Item>
<Menu.Item key="3">nav 3</Menu.Item>
</Menu>
</Header>
<Layout>
<Sider width={200}
style={{
background: '#fff',
overflow: 'auto',
height: '100vh',
position: 'fixed'
}}>
<ClassTreeView />
</Sider>
<Layout style={{ marginLeft: 300, padding: '0 24px 24px' }}>
<Breadcrumb style={{ margin: '16px 0' }}>
<Breadcrumb.Item>Home</Breadcrumb.Item>
<Breadcrumb.Item>List</Breadcrumb.Item>
<Breadcrumb.Item>App</Breadcrumb.Item>
</Breadcrumb>
<Content style={{
margin: '24px 16px 0',
overflow: 'initial'
}}
>
<PropertyEditor />
</Content>
</Layout>
</Layout>
</Layout>
);
<div className='logo' />
<Menu mode='horizontal' defaultSelectedKeys={['2']} style={{ lineHeight: '64px' }}>
<Menu.Item key='1'>nav 1</Menu.Item>
<Menu.Item key='2'>nav 2</Menu.Item>
<Menu.Item key='3'>nav 3</Menu.Item>
</Menu>
</Header>
<Layout>
<Sider
width={200}
style={{
background: '#fff',
overflow: 'auto',
height: '100vh',
position: 'fixed',
}}>
<ClassTreeView />
</Sider>
<Layout style={{ marginLeft: 300, padding: '0 24px 24px' }}>
<Breadcrumb style={{ margin: '16px 0' }}>
<Breadcrumb.Item>Home</Breadcrumb.Item>
<Breadcrumb.Item>List</Breadcrumb.Item>
<Breadcrumb.Item>App</Breadcrumb.Item>
</Breadcrumb>
<Content
style={{
margin: '24px 16px 0',
overflow: 'initial',
}}>
<PropertyEditor />
</Content>
</Layout>
</Layout>
</Layout>
);
};

export default App
export default App;
165 changes: 70 additions & 95 deletions src/components/AddRDF.stories.js
Original file line number Diff line number Diff line change
@@ -1,107 +1,82 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Form, Input, Button, Upload, Checkbox,Select, Radio, Layout, Icon } from 'antd';

import { Form, Input, Button, Upload, Checkbox, Select, Radio, Layout, Icon } from 'antd';

const { TextArea } = Input;

class AddRDFForm extends React.Component {
constructor() {
super();
this.state = {
formLayout: 'horizontal',
}; }
const { TextArea } = Input;

handleFormLayoutChange = (e) => {
this.setState({ formLayout: e.target.value });
}
class AddRDFForm extends React.Component {
constructor() {
super();
this.state = {
formLayout: 'horizontal',
};
}

render() {
const { formLayout } = this.state;
const formItemLayout = {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
} ;
handleFormLayoutChange = (e) => {
this.setState({ formLayout: e.target.value });
};

return (
<div>
<Form layout={formLayout}>
<Form.Item id="base" {...formItemLayout} label="Base URI: ">
<Layout>
<Input readOnly style={{ width: "50%" }} />
<Checkbox> use base URI as context identifier </Checkbox>
</Layout>
</Form.Item>
render() {
const { formLayout } = this.state;
const formItemLayout = {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
};

<Form.Item id="context" {...formItemLayout} label="Context:">
<Input readOnly style={{ width: "50%" }} />
</Form.Item>
return (
<div>
<Form layout={formLayout}>
<Form.Item id='base' {...formItemLayout} label='Base URI: '>
<Layout>
<Input readOnly style={{ width: '50%' }} />
<Checkbox> use base URI as context identifier </Checkbox>
</Layout>
</Form.Item>

<Form.Item
id="dataFormat"
{...formItemLayout}
label="Data format:"
>
<Layout>
<Select
defaultValue="(autodetect)"
style={{ width: 120 }}
>
<Option value="(autodetect)">(autodetect)</Option>
<Option value="N-Triples">N-Triples</Option>
<Option value="RDF/XML">RDF/XML</Option>
<Option value="Turtle">Turtle</Option>
</Select>
<Radio>Location of the RDF data you wish to upload</Radio>
</Layout>
</Form.Item>
<Form.Item id='context' {...formItemLayout} label='Context:'>
<Input readOnly style={{ width: '50%' }} />
</Form.Item>

<Form.Item
id="RDFdataUrl"
{...formItemLayout}
label="RDF Data URL:"
>
<Layout>
<Input readOnly style={{ width: "50%" }} />
<Radio>
Select the file containing the RDF data you wish to
upload
</Radio>
</Layout>
</Form.Item>
<Form.Item id='dataFormat' {...formItemLayout} label='Data format:'>
<Layout>
<Select defaultValue='(autodetect)' style={{ width: 120 }}>
<Option value='(autodetect)'>(autodetect)</Option>
<Option value='N-Triples'>N-Triples</Option>
<Option value='RDF/XML'>RDF/XML</Option>
<Option value='Turtle'>Turtle</Option>
</Select>
<Radio>Location of the RDF data you wish to upload</Radio>
</Layout>
</Form.Item>

<Form.Item label="RDF Data File: " {...formItemLayout}>
{
<Upload
name="logo"
action="/upload.do"
listType="picture"
>
<Button>
<Icon type="upload" /> Click to upload
</Button>
</Upload>
}
<Checkbox>Enter the RDF data you wish to upload</Checkbox>
</Form.Item>
<Form.Item id='RDFdataUrl' {...formItemLayout} label='RDF Data URL:'>
<Layout>
<Input readOnly style={{ width: '50%' }} />
<Radio>Select the file containing the RDF data you wish to upload</Radio>
</Layout>
</Form.Item>

<Form.Item
id="RDFcontent"
{...formItemLayout}
label="RDF Content:"
>
<Layout>
<TextArea readOnly rows={4} style={{ width: "50%" }} />
<Button style={{ width: "30%" }}>Upload</Button>
</Layout>
</Form.Item>
</Form>
</div>
);
}
<Form.Item label='RDF Data File: ' {...formItemLayout}>
{
<Upload name='logo' action='/upload.do' listType='picture'>
<Button>
<Icon type='upload' /> Click to upload
</Button>
</Upload>
}
<Checkbox>Enter the RDF data you wish to upload</Checkbox>
</Form.Item>

<Form.Item id='RDFcontent' {...formItemLayout} label='RDF Content:'>
<Layout>
<TextArea readOnly rows={4} style={{ width: '50%' }} />
<Button style={{ width: '30%' }}>Upload</Button>
</Layout>
</Form.Item>
</Form>
</div>
);
}

storiesOf('Add RDF', module)
.add('form', () => (
<AddRDFForm></AddRDFForm>
));
}

storiesOf('Add RDF', module).add('form', () => <AddRDFForm />);
Loading

0 comments on commit 12c0f40

Please sign in to comment.