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!
Procházet zdrojové kódy

Make WBBrowse more concise by using common properties.

pull/1/head
Stanislaw Adaszewski před 4 roky
rodič
revize
e3d98fd2f8
2 změnil soubory, kde provedl 21 přidání a 32 odebrání
  1. +1
    -1
      frontend/rollup.config.js
  2. +20
    -31
      frontend/src/js/page/wb-browse.js

+ 1
- 1
frontend/rollup.config.js Zobrazit soubor

@@ -55,7 +55,7 @@ export default {
'node_modules/papaya-viewer/release/current/standard/papaya.css': 'dist/css/papaya.css',
verbose: true
}),
buble({jsx: 'h'}),
buble({jsx: 'h', objectAssign: 'Object.assign'}),
resolve({}),
license({
banner: 'Copyright (C) F. Hoffmann-La Roche AG, 2020.\nAuthor: stanislaw.adaszewski@roche.com\nAll Rights Reserved.',


+ 20
- 31
frontend/src/js/page/wb-browse.js Zobrazit soubor

@@ -146,6 +146,19 @@ class WBBrowse extends Component {
objTypeTab, collectionPage, processPage, workflowPage,
textSearch }, { selected }) {
const commonProps = {
renderRenameLink: (it, cb) => this.renderRenameLink(it, cb),
renderDeleteButton: (it, cb) => this.renderDeleteButton(it, cb),
renderSelectionCell: it => this.renderSelectionCell(it),
renderSharingButton: it => this.renderSharingButton(it),
textSearch,
app,
appState: app.state,
arvHost: app.state.arvHost,
arvToken: app.state.arvToken,
ownerUuid
};
return (
<div>
<WBRenameDialog app={ app } ref={ this.renameDialogRef } />
@@ -170,19 +183,11 @@ class WBBrowse extends Component {
copyHere={ () => this.copyHere() } />
<WBProjectListing ref={ this.projectListingRef }
app={ app }
arvHost={ app.state.arvHost }
arvToken={ app.state.arvToken }
mode={ mode }
ownerUuid={ ownerUuid }
itemsPerPage="5"
activePage={ Number(activePage || 0) }
getPageUrl={ i => this.getUrl({ 'activePage': i }) }
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) }
renderSelectionCell={ it => this.renderSelectionCell(it) }
renderSharingButton={ it => this.renderSharingButton(it) }
textSearch={ textSearch } />
{ ...commonProps } />
{ (mode !== 'browse') ? null : (
<WBTabs tabs={ [
@@ -195,41 +200,25 @@ class WBBrowse extends Component {
{
(mode !== 'browse') ? null :
(!objTypeTab || objTypeTab === 'collection') ? (
<WBCollectionListing app={ app }
ownerUuid={ ownerUuid }
<WBCollectionListing
itemsPerPage="20"
activePage={ Number(collectionPage || 0) }
getPageUrl={ i => this.getUrl({ 'collectionPage': i }) }
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) }
renderSelectionCell={ it => this.renderSelectionCell(it) }
renderSharingButton={ it => this.renderSharingButton(it) }
textSearch={ textSearch } />
{ ...commonProps } />
) : (objTypeTab === 'process') ? (
<WBProcessListing app={ app }
appState={ app.state }
ownerUuid={ ownerUuid }
<WBProcessListing
itemsPerPage="20"
activePage={ Number(processPage || 0) }
onPageChanged={ i => this.route({ 'processPage': i }) }
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) }
renderSelectionCell={ it => this.renderSelectionCell(it) }
renderSharingButton={ it => this.renderSharingButton(it) }
textSearch={ textSearch } />
{ ...commonProps } />
) : (objTypeTab === 'workflow') ? (
<WBWorkflowListing app={ app }
ownerUuid={ ownerUuid }
<WBWorkflowListing
itemsPerPage="20"
page={ Number(workflowPage || 0) }
getPageUrl={ i => this.getUrl({ 'workflowPage': i }) }
renderRenameLink={ (it, cb) => this.renderRenameLink(it, cb) }
renderDeleteButton={ (it, cb) => this.renderDeleteButton(it, cb) }
renderSelectionCell={ it => this.renderSelectionCell(it) }
renderSharingButton={ it => this.renderSharingButton(it) }
textSearch={ textSearch } />
{ ...commonProps } />
) : null
}


Načítá se…
Zrušit
Uložit