IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

71 Zeilen
3.0KB

  1. import { h, Component } from 'preact';
  2. import { route } from 'preact-router';
  3. import WBNavbar from 'wb-navbar';
  4. import WBProjectListing from 'wb-project-listing';
  5. import WBInlineSearch from 'wb-inline-search';
  6. import WBProjectCrumbs from 'wb-project-crumbs';
  7. import WBTabs from 'wb-tabs';
  8. import WBProcessListing from 'wb-process-listing';
  9. class WBBrowse extends Component {
  10. route(params) {
  11. route('/browse/' +
  12. ('ownerUuid' in params ? params.ownerUuid : (this.props.ownerUuid || '')) + '/' +
  13. ('activePage' in params ? params.activePage : (this.props.activePage || '')) + '/' +
  14. ('objTypeTab' in params ? params.objTypeTab : (this.props.objTypeTab || '')) + '/' +
  15. ('collectionPage' in params ? params.collectionPage : (this.props.collectionPage || '')) + '/' +
  16. ('processPage' in params ? params.processPage : (this.props.processPage || '')) + '/' +
  17. ('workflowPage' in params ? params.workflowPage : (this.props.workflowPage || '')));
  18. }
  19. render({ ownerUuid, activePage, appCallbacks, appState,
  20. objTypeTab, collectionPage, processPage, workflowPage }) {
  21. return (
  22. <div>
  23. <WBNavbar items={ [
  24. { 'name': 'Home', 'id': 'home', 'active': (ownerUuid === appState.currentUser.uuid) },
  25. { 'name': 'All Projects', 'id': 'all-projects', 'active': (!ownerUuid) },
  26. { 'name': 'User', 'dropdown': [ { 'id': 'sign-out', 'name': 'Sign Out' } ]}
  27. ] } rhs={ (
  28. <WBInlineSearch />
  29. ) } onItemClicked={ appCallbacks.navbarItemClicked } />
  30. <WBProjectCrumbs uuid={ ownerUuid } appState={ appState }
  31. onItemClicked={ item => route('/browse/' + item['uuid']) } />
  32. <WBTabs tabs={ [ { 'name': 'Projects', 'isActive': true } ] } />
  33. <WBProjectListing arvHost={ appState.arvHost }
  34. arvToken={ appState.arvToken }
  35. ownerUuid={ ownerUuid }
  36. itemsPerPage="5"
  37. activePage={ Number(activePage || 0) }
  38. onPageChanged={ i => route('/browse/' + (ownerUuid || '') + '/' + i)} />
  39. <WBTabs tabs={ [
  40. { 'id': 'collection', 'name': 'Collections', 'isActive': (!objTypeTab || objTypeTab === 'collection') },
  41. { 'id': 'process', 'name': 'Processes', 'isActive': (objTypeTab === 'process') },
  42. { 'id': 'workflow', 'name': 'Workflows', 'isActive': (objTypeTab === 'workflow') } ] }
  43. onTabChanged={ tab => this.route({ 'objTypeTab': tab['id'] }) } />
  44. {
  45. (!objTypeTab || objTypeTab === 'collection') ? (
  46. null
  47. ) : (objTypeTab === 'process' ? (
  48. <WBProcessListing appState={ appState }
  49. ownerUuid={ ownerUuid }
  50. itemsPerPage="20"
  51. activePage={ Number(processPage || 0) }
  52. onPageChanged={ i => this.route({ 'processPage': i }) } />
  53. ) : (objTypeTab === 'workflow' ? (
  54. null
  55. ) : null))
  56. }
  57. </div>
  58. );
  59. }
  60. }
  61. export default WBBrowse;