From cc15888b363c3e2676b00a85b2ba2f3f19acd9bd Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Mon, 2 Mar 2020 17:32:11 +0100 Subject: [PATCH] Started implementing sharing management. --- .../src/js/component/wb-project-listing.js | 3 +- frontend/src/js/dialog/wb-browse-dialog.js | 9 ++- frontend/src/js/page/wb-app.js | 3 + frontend/src/js/page/wb-browse.js | 12 +++- frontend/src/js/page/wb-sharing-page.js | 71 +++++++++++++++++++ frontend/src/js/widget/wb-select.js | 19 +++++ 6 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 frontend/src/js/page/wb-sharing-page.js create mode 100644 frontend/src/js/widget/wb-select.js diff --git a/frontend/src/js/component/wb-project-listing.js b/frontend/src/js/component/wb-project-listing.js index ed07d0c..896522b 100644 --- a/frontend/src/js/component/wb-project-listing.js +++ b/frontend/src/js/component/wb-project-listing.js @@ -18,7 +18,7 @@ class WBProjectListing extends Component { prepareRows(items) { const { app, renderRenameLink, renderDeleteButton, - renderSelectionCell } = this.props; + renderSelectionCell, renderSharingButton } = this.props; return items.map(item => [ renderSelectionCell(item), @@ -39,6 +39,7 @@ class WBProjectListing extends Component { { renderDeleteButton(item, () => this.fetchItems()) } + { renderSharingButton(item) } ) ]); } diff --git a/frontend/src/js/dialog/wb-browse-dialog.js b/frontend/src/js/dialog/wb-browse-dialog.js index 5c91caa..fa9954d 100644 --- a/frontend/src/js/dialog/wb-browse-dialog.js +++ b/frontend/src/js/dialog/wb-browse-dialog.js @@ -42,6 +42,7 @@ class WBBrowseDialog extends Component { this.state.bottomPage = 0; this.state.collectionPath = ''; this.state.textSearch = ''; + this.state.id = ('id' in this.props) ? this.props.id : uuid.v4(); } navigateBack() { @@ -134,10 +135,14 @@ class WBBrowseDialog extends Component { ); } - render({ app, id, selectMany, selectWhat }, + show(callback) { + $('#' + this.state.id).modal(); + } + + render({ app, selectMany, selectWhat }, { history, currentUrl, mode, uuid, topPage, bottomPage, textSearch, - collectionPath }) { + collectionPath, id }) { return (