|
@@ -22,6 +22,12 @@ class WBBrowse extends Component { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
getUrl(params) {
|
|
|
getUrl(params) {
|
|
|
|
|
|
const mode = ('mode' in params ? params.mode : this.props.mode);
|
|
|
|
|
|
|
|
|
|
|
|
if (mode === 'shared-with-me')
|
|
|
|
|
|
return '/shared-with-me/' + ('activePage' in params ? params.activePage :
|
|
|
|
|
|
(this.props.activePage || ''));
|
|
|
|
|
|
|
|
|
let res = '/browse/' +
|
|
|
let res = '/browse/' +
|
|
|
('ownerUuid' in params ? params.ownerUuid : (this.props.ownerUuid || '')) + '/' +
|
|
|
('ownerUuid' in params ? params.ownerUuid : (this.props.ownerUuid || '')) + '/' +
|
|
|
('activePage' in params ? params.activePage : (this.props.activePage || '')) + '/' +
|
|
|
('activePage' in params ? params.activePage : (this.props.activePage || '')) + '/' +
|
|
@@ -59,7 +65,7 @@ class WBBrowse extends Component { |
|
|
);
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
render({ ownerUuid, activePage, appState, app,
|
|
|
|
|
|
|
|
|
render({ mode, ownerUuid, activePage, app,
|
|
|
objTypeTab, collectionPage, processPage, workflowPage }) {
|
|
|
objTypeTab, collectionPage, processPage, workflowPage }) {
|
|
|
|
|
|
|
|
|
return (
|
|
|
return (
|
|
@@ -70,36 +76,41 @@ class WBBrowse extends Component { |
|
|
|
|
|
|
|
|
<WBNewProjectDialog app={ app } ref={ this.newProjectDialogRef } />
|
|
|
<WBNewProjectDialog app={ app } ref={ this.newProjectDialogRef } />
|
|
|
|
|
|
|
|
|
<WBNavbarCommon app={ app } activeItem={ !ownerUuid ? 'all-projects' :
|
|
|
|
|
|
(ownerUuid === app.state.currentUser.uuid ? 'home' : null) } />
|
|
|
|
|
|
|
|
|
<WBNavbarCommon app={ app } activeItem={ mode === 'shared-with-me' ? 'shared-with-me' :
|
|
|
|
|
|
(!ownerUuid) ? 'all-projects' :
|
|
|
|
|
|
(ownerUuid === app.state.currentUser.uuid) ? 'home' : null } />
|
|
|
|
|
|
|
|
|
<WBArvadosCrumbs uuid={ ownerUuid } app={ app } />
|
|
|
|
|
|
|
|
|
<WBArvadosCrumbs mode={ mode } uuid={ ownerUuid } app={ app } />
|
|
|
|
|
|
|
|
|
<WBTabs tabs={ [
|
|
|
<WBTabs tabs={ [
|
|
|
{ 'name': 'Projects', 'isActive': true },
|
|
|
{ 'name': 'Projects', 'isActive': true },
|
|
|
{ 'name': ( <span><i class="fas fa-plus-square text-success"></i> New Project</span> ),
|
|
|
|
|
|
|
|
|
ownerUuid ? { 'name': ( <span><i class="fas fa-plus-square text-success"></i> New Project</span> ),
|
|
|
'onClick': () => this.newProjectDialogRef.current.show(ownerUuid,
|
|
|
'onClick': () => this.newProjectDialogRef.current.show(ownerUuid,
|
|
|
() => this.projectListingRef.current.fetchItems() ) }
|
|
|
|
|
|
|
|
|
() => this.projectListingRef.current.fetchItems() ) } : null
|
|
|
] } />
|
|
|
] } />
|
|
|
|
|
|
|
|
|
<WBProjectListing ref={ this.projectListingRef }
|
|
|
<WBProjectListing ref={ this.projectListingRef }
|
|
|
app={ app }
|
|
|
app={ app }
|
|
|
arvHost={ appState.arvHost }
|
|
|
|
|
|
arvToken={ appState.arvToken }
|
|
|
|
|
|
|
|
|
arvHost={ app.state.arvHost }
|
|
|
|
|
|
arvToken={ app.state.arvToken }
|
|
|
|
|
|
mode={ mode }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
itemsPerPage="5"
|
|
|
itemsPerPage="5"
|
|
|
activePage={ Number(activePage || 0) }
|
|
|
activePage={ Number(activePage || 0) }
|
|
|
onPageChanged={ i => route('/browse/' + (ownerUuid || '') + '/' + i) }
|
|
|
|
|
|
|
|
|
getPageUrl={ i => this.getUrl({ 'activePage': i }) }
|
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
|
|
|
|
|
|
<WBTabs tabs={ [
|
|
|
|
|
|
{ 'id': 'collection', 'name': 'Collections', 'isActive': (!objTypeTab || objTypeTab === 'collection') },
|
|
|
|
|
|
{ 'id': 'process', 'name': 'Processes', 'isActive': (objTypeTab === 'process') },
|
|
|
|
|
|
{ 'id': 'workflow', 'name': 'Workflows', 'isActive': (objTypeTab === 'workflow') } ] }
|
|
|
|
|
|
onTabChanged={ tab => this.route({ 'objTypeTab': tab['id'] }) } />
|
|
|
|
|
|
|
|
|
{ (mode !== 'browse') ? null : (
|
|
|
|
|
|
<WBTabs tabs={ [
|
|
|
|
|
|
{ 'id': 'collection', 'name': 'Collections', 'isActive': (!objTypeTab || objTypeTab === 'collection') },
|
|
|
|
|
|
{ 'id': 'process', 'name': 'Processes', 'isActive': (objTypeTab === 'process') },
|
|
|
|
|
|
{ 'id': 'workflow', 'name': 'Workflows', 'isActive': (objTypeTab === 'workflow') } ] }
|
|
|
|
|
|
onTabChanged={ tab => this.route({ 'objTypeTab': tab['id'] }) } />
|
|
|
|
|
|
) }
|
|
|
|
|
|
|
|
|
{
|
|
|
{
|
|
|
|
|
|
(mode !== 'browse') ? null :
|
|
|
(!objTypeTab || objTypeTab === 'collection') ? (
|
|
|
(!objTypeTab || objTypeTab === 'collection') ? (
|
|
|
<WBCollectionListing app={ app }
|
|
|
<WBCollectionListing app={ app }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
ownerUuid={ ownerUuid }
|
|
@@ -109,8 +120,8 @@ class WBBrowse extends Component { |
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
|
|
|
|
|
|
) : (objTypeTab === 'process' ? (
|
|
|
|
|
|
<WBProcessListing appState={ appState }
|
|
|
|
|
|
|
|
|
) : (objTypeTab === 'process') ? (
|
|
|
|
|
|
<WBProcessListing appState={ app.state }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
itemsPerPage="20"
|
|
|
itemsPerPage="20"
|
|
|
activePage={ Number(processPage || 0) }
|
|
|
activePage={ Number(processPage || 0) }
|
|
@@ -118,7 +129,7 @@ class WBBrowse extends Component { |
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
|
|
|
|
|
|
) : (objTypeTab === 'workflow' ? (
|
|
|
|
|
|
|
|
|
) : (objTypeTab === 'workflow') ? (
|
|
|
<WBWorkflowListing app={ app }
|
|
|
<WBWorkflowListing app={ app }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
ownerUuid={ ownerUuid }
|
|
|
itemsPerPage="20"
|
|
|
itemsPerPage="20"
|
|
@@ -127,7 +138,7 @@ class WBBrowse extends Component { |
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) } />
|
|
|
|
|
|
|
|
|
) : null))
|
|
|
|
|
|
|
|
|
) : null
|
|
|
}
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|
|
|
);
|
|
|