Skip to content

Commit

Permalink
Fixes formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Mar 7, 2019
1 parent eaa1f56 commit b1c4d05
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 150 deletions.
2 changes: 1 addition & 1 deletion src/Add.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Add extends Component {
<>
{ step === "preview" ? (
<>
<Redirect to="/add/preview"/>
<Redirect to="/add/preview"/>
</>
) :
(
Expand Down
18 changes: 9 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ class App extends Component {
<DatasetProvider>
<GroupProvider>

<Header />
<Route exact={true} path='/' render={()=>(home)} />
<Route exact={true} path='/datasets' render={()=>(datasets)} />
<Header />
<Route exact={true} path='/' render={()=>(home)} />
<Route exact={true} path='/datasets' render={()=>(datasets)} />
<Route exact={true} path='/dataset/:id' render={({match})=>(<EditDataset id={match.params.id}/>)}/>

<Route exact={true} path='/groups' render={()=>(groups)} />
<Route exact={true} path='/groups' render={()=>(groups)} />

<Route exact={true} path='/add' render={()=>(add)} />
<Route exact={true} path='/add' render={()=>(add)} />

<Route exact={true} path='/add/preview' render={()=>(preview)} />
<Route exact={true} path='/add/schema' render={()=>(schema)} />
<Route exact={true} path='/add/detail' render={()=>(detail)} />
<Route exact={true} path='/add/publish' render={()=>(publish)} />
<Route exact={true} path='/add/preview' render={()=>(preview)} />
<Route exact={true} path='/add/schema' render={()=>(schema)} />
<Route exact={true} path='/add/detail' render={()=>(detail)} />
<Route exact={true} path='/add/publish' render={()=>(publish)} />
</GroupProvider>

</DatasetProvider>
Expand Down
12 changes: 6 additions & 6 deletions src/Datasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Datasets extends Component {
Header: 'Edit',
accessor: 'interra.id',
Cell: props => (
<Link className="scenarioDetailLink"
<Link className='scenarioDetailLink'
to={`/dataset/${props.value}`}
id="hey">edit</Link>
id='edit'>edit</Link>
)
}
]
Expand All @@ -42,11 +42,11 @@ class Datasets extends Component {
<>
{datasets ? (
<div>
<ReactTable
data={datasets}
<ReactTable
data={datasets}
showPageSizeOptions={false}
defaultPageSize={10}
columns={columns} />
defaultPageSize={10}
columns={columns} />
</div>
) : (
<Loader />
Expand Down
20 changes: 10 additions & 10 deletions src/Detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class Publish extends Component {
<div>
{file ? (
<div>
<Form schema={dataset}
formData={metadata}
uiSchema={uiSchema.dataset}
onChange={updateMetadata}
onSubmit={log("submitted")}
onError={log("errors")}>
<br/>
</Form>
</div>
<Form schema={dataset}
formData={metadata}
uiSchema={uiSchema.dataset}
onChange={updateMetadata}
onSubmit={log("submitted")}
onError={log("errors")}>
<br/>
</Form>
</div>
) : (
<Redirect to="/"/>
)}
</div>
)}
</FileConsumer> <Pager />
</FileConsumer> <Pager />

</main>
</div>
Expand Down
30 changes: 13 additions & 17 deletions src/EditDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@ class EditDataset extends Component {
<div class="row h-100">
<Sidebar className="col-12 col-md-2 p-0" />
<main className="col bg-faded py-3">

<h1>Detail</h1>
<p className="lead">Time to add metadata.</p>

<h1>Detail</h1>
<p className="lead">Time to add metadata.</p>
<div>
<div>
<Form schema={dataset}
formData={metadata}
uiSchema={uiSchema.dataset}
onSubmit={log("submitted")}
onError={log("errors")}>
<br/>
</Form>
</div>

</div>

</main>
<div>
<Form schema={dataset}
formData={metadata}
uiSchema={uiSchema.dataset}
onSubmit={log("submitted")}
onError={log("errors")}>
<br/>
</Form>
</div>
</div>
</main>
</div>
</div>
);
}
}
Expand Down
67 changes: 33 additions & 34 deletions src/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,39 @@ class Preview extends Component {
<div class="row h-100">
<Sidebar className="col-12 col-md-2 p-0" />
<main className="col bg-faded py-3">

<h1>Preview</h1>
<p className="lead">This is the preview page.</p>
<FileConsumer>
{({ file, data, step, metadata, updateMetadata }) => (
<div>
{step !== "preview" && (
<Redirect to="/" />
)}
{file && data ? (
<div>
<input id="title" onChange={updateMetadata} value={metadata.title} type="text" />
<p>
<strong>Name:</strong> {file.name}<br/>
<strong>Size:</strong> {filesize(file.size)}
</p>
<p>
</p>
<ReactTable
data={data.data}
defaultPageSize={5}
columns={data.cols} />
</div>
) : (
<Loader />
)}
</div>
)}
</FileConsumer>
<Pager />

</main>
</div>
</div> );
<h1>Preview</h1>
<p className="lead">This is the preview page.</p>
<FileConsumer>
{({ file, data, step, metadata, updateMetadata }) => (
<div>
{step !== "preview" && (
<Redirect to="/" />
)}
{file && data ? (
<div>
<input id="title" onChange={updateMetadata} value={metadata.title} type="text" />
<p>
<strong>Name:</strong> {file.name}<br/>
<strong>Size:</strong> {filesize(file.size)}
</p>
<p>
</p>
<ReactTable
data={data.data}
defaultPageSize={5}
columns={data.cols} />
</div>
) : (
<Loader />
)}
</div>
)}
</FileConsumer>
<Pager />
</main>
</div>
</div>
);
}
}

Expand Down
76 changes: 38 additions & 38 deletions src/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,44 @@ class Schema extends Component {

render() {
return (
<div class="container-fluid h-100">
<div class="row h-100">
<Sidebar className="col-12 col-md-2 p-0" />
<main className="col bg-faded py-3">
<h1>Edit Schema</h1>
<p className="lead">Edit the schema for your package..</p>
<FileConsumer>
{({ file, data, errors, step, metadata, updateMetadata, tableSchema, updateTableSchemaType, updateTableSchemaFormat, updateTableSchemaDesc, updateDataFromCell }) => (
<div>
{step !== "schema" && (
<Redirect to="/" />
)}
{file && data && metadata ? (
<div>
<input id="title" onChange={updateMetadata} value={metadata.title} type="text" />
<p>
</p>
<SchemaTable
tableSchema={tableSchema}
updateTableSchemaFormat={updateTableSchemaFormat}
updateTableSchemaType={updateTableSchemaType}
updateTableSchemaDesc={updateTableSchemaDesc}
updateDataFromCell={updateDataFromCell}
data={data.data}
errors={errors}
defaultPageSize={5}
columns={data.cols} />
</div>
) : (
<Loader />
)}
</div>
)}
</FileConsumer> <Pager />

</main>
</div>
</div>
<div class="container-fluid h-100">
<div class="row h-100">
<Sidebar className="col-12 col-md-2 p-0" />
<main className="col bg-faded py-3">
<h1>Edit Schema</h1>
<p className="lead">Edit the schema for your package..</p>
<FileConsumer>
{({ file, data, errors, step, metadata, updateMetadata, tableSchema, updateTableSchemaType, updateTableSchemaFormat, updateTableSchemaDesc, updateDataFromCell }) => (
<div>
{step !== "schema" && (
<Redirect to="/" />
)}
{file && data && metadata ? (
<div>
<input id="title" onChange={updateMetadata} value={metadata.title} type="text" />
<p>
</p>
<SchemaTable
tableSchema={tableSchema}
updateTableSchemaFormat={updateTableSchemaFormat}
updateTableSchemaType={updateTableSchemaType}
updateTableSchemaDesc={updateTableSchemaDesc}
updateDataFromCell={updateDataFromCell}
data={data.data}
errors={errors}
defaultPageSize={5}
columns={data.cols} />
</div>
) : (
<Loader />
)}
</div>
)}
</FileConsumer>
<Pager />
</main>
</div>
</div>
);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import logo from '../../assets/images/logo.svg';
import Wrapper from './Wrapper';
import { Link } from 'react-router-dom';

class Header extends React.Component {

render() {
return (
<Wrapper role="banner">
<nav className="navbar navbar-dark bg-dark">
<a className="navbar-brand" href="/">
<nav className="navbar navbar-dark bg-dark">
<Link className="navbar-brand" to="/">
<img className="logo" alt="logo" src={logo}/>
</a>
</Link>
<span className="navbar-text">
<a href="#">Sign out</a>
</span>
Expand Down
14 changes: 7 additions & 7 deletions src/components/SchemaTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const formats = (type) => {
return fieldTypes[type];
}


const Errors = (props) => {
const errors = props.errors;
let report = (<div className="alert alert-success"><h4 className="alert-heading">Tidy Data!</h4><p>Your data has no validation errors.</p></div>);
Expand All @@ -44,6 +43,7 @@ const Errors = (props) => {
report
)
}

export default class SchemaTable extends React.Component {

colorCheck(n) {
Expand Down Expand Up @@ -73,7 +73,7 @@ export default class SchemaTable extends React.Component {
const column = props.column.Header;
if (props.index === 0) {
return (
<div onBlur={updateTableSchemaDesc} tabIndex="1" className="edit-schema-cont">
<div onBlur={updateTableSchemaDesc} tabIndex="1" className="edit-schema-cont">
<input className="edit-schema-input" type="text" key={`${column}-desc-input`} data-tag={column} defaultValue={props.value} /><FontAwesomeIcon icon={faEdit} />
</div>
)
Expand Down Expand Up @@ -116,15 +116,15 @@ export default class SchemaTable extends React.Component {
style={{ backgroundColor: color, padding: "7px" }}
contentEditable
suppressContentEditableWarning
onBlur={e => {
updateDataFromCell(e, cellInfo);
onBlur={e => {
updateDataFromCell(e, cellInfo);
}}
dangerouslySetInnerHTML={{
__html: data[cellInfo.index][cellInfo.column.id]
}}
/>
);
}
}
render() {
const { data, defaultPageSize, columns, tableSchema, updateTableSchemaType, updateTableSchemaFormat, updateTableSchemaDesc, updateDataFromCell, errors } = this.props;
const desc = Object.values(tableSchema).reduce((r, v) => { const desc = 'desc' in v ? v.desc : ""; r[v.name] = desc; return r; }, {});
Expand All @@ -144,12 +144,12 @@ export default class SchemaTable extends React.Component {
return (
<div className="row">
<div className="col-sm-1">
<div id="schema-help">
<div id="schema-help">
<div className="schema-help-row">Name <FontAwesomeIcon icon={faQuestionCircle} /></div>
<div className="schema-help-row">Description <FontAwesomeIcon icon={faQuestionCircle} /></div>
<div className="schema-help-row">Type <FontAwesomeIcon icon={faQuestionCircle} /></div>
<div className="schema-help-row">Format <FontAwesomeIcon icon={faQuestionCircle} /></div>
</div>
</div>
</div>
<div className="col-sm-11">
{tableSchema ? (
Expand Down
Loading

0 comments on commit b1c4d05

Please sign in to comment.