summaryrefslogtreecommitdiff
path: root/app/client/common/views/new.view.js
blob: a417bfcea0bb42d5057702b0c99a4bc6692c189e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { h, Component } from 'preact'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import util from '../../util'

import Group from '../group.component'
import Param from '../param.component'
import Loading from '../loading.component'
import FolderList from '../folderList.component'

import NewDatasetForm from '../../dataset/dataset.new'

export default class NewView extends Component {
  constructor(props){
    super(props)
    console.log(props)
    if (! props.db.data) {
      props.actions.load_directories()
    }
  }
  render(){
    const { module, history, db, path } = this.props
    return (
      <div className={'app new-view ' + module.name}>
        <div className='heading'>
          <h1>{module.displayName || module.name}</h1>
        </div>
        <div className='col narrow'>
          <NewDatasetForm
            module={module}
            history={history}
          />
          <FolderList
            db={db}
            path={path}
            activity="dataset"
            emptyText={<i>No projects yet. Please create one~</i>}
          />
        </div>
      </div>
    )
  }
}