summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar
diff options
context:
space:
mode:
authorNico <paetni1@gmail.com>2020-04-09 01:55:01 +0200
committerNico <paetni1@gmail.com>2020-04-09 01:55:01 +0200
commitf09219cbfd620e04fd48539bd11eced20c81137b (patch)
treeff859c3cfeeeef8576a4c79840755dad82bfabf2 /client/components/sidebar
parent7c2554297617898187906baa646b5b89f6f37af6 (diff)
downloadwekan-f09219cbfd620e04fd48539bd11eced20c81137b.tar.gz
wekan-f09219cbfd620e04fd48539bd11eced20c81137b.tar.bz2
wekan-f09219cbfd620e04fd48539bd11eced20c81137b.zip
Remove export button if WITH_API is not enabled
#2938 https://github.com/wekan/wekan/issues/2938#issuecomment-589782402
Diffstat (limited to 'client/components/sidebar')
-rw-r--r--client/components/sidebar/sidebar.jade20
-rw-r--r--client/components/sidebar/sidebar.js19
2 files changed, 26 insertions, 13 deletions
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade
index 901fe99f..6bfedc9c 100644
--- a/client/components/sidebar/sidebar.jade
+++ b/client/components/sidebar/sidebar.jade
@@ -298,10 +298,11 @@ template(name="boardMenuPopup")
if currentUser.isBoardAdmin
hr
ul.pop-over-list
- li
- a(href="{{exportUrl}}", download="{{exportFilename}}")
- i.fa.fa-share-alt
- | {{_ 'export-board'}}
+ if withApi
+ li
+ a(href="{{exportUrl}}", download="{{exportFilename}}")
+ i.fa.fa-share-alt
+ | {{_ 'export-board'}}
li
a.js-outgoing-webhooks
i.fa.fa-globe
@@ -326,11 +327,12 @@ template(name="boardMenuPopup")
if isSandstorm
hr
ul.pop-over-list
- li
- a(href="{{exportUrl}}", download="{{exportFilename}}")
- i.fa.fa-share-alt
- i.fa.fa-sign-out
- | {{_ 'export-board'}}
+ if withApi
+ li
+ a(href="{{exportUrl}}", download="{{exportFilename}}")
+ i.fa.fa-share-alt
+ i.fa.fa-sign-out
+ | {{_ 'export-board'}}
li
a.js-import-board
i.fa.fa-share-alt
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index baf57114..78b47a48 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -196,14 +196,14 @@ Template.boardMenuPopup.events({
},
'click .js-change-board-color': Popup.open('boardChangeColor'),
'click .js-change-language': Popup.open('changeLanguage'),
- 'click .js-archive-board ': Popup.afterConfirm('archiveBoard', function() {
+ 'click .js-archive-board ': Popup.afterConfirm('archiveBoard', function () {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
currentBoard.archive();
// XXX We should have some kind of notification on top of the page to
// confirm that the board was successfully archived.
FlowRouter.go('home');
}),
- 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() {
+ 'click .js-delete-board': Popup.afterConfirm('deleteBoard', function () {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
Popup.close();
Boards.remove(currentBoard._id);
@@ -215,7 +215,18 @@ Template.boardMenuPopup.events({
'click .js-card-settings': Popup.open('boardCardSettings'),
});
+
+Template.boardMenuPopup.onCreated(function () {
+ this.apiEnabled = new ReactiveVar(false);
+ Meteor.call('_isApiEnabled', (e, result) => {
+ this.apiEnabled.set(result)
+ })
+})
+
Template.boardMenuPopup.helpers({
+ withApi() {
+ return Template.instance().apiEnabled.get()
+ },
exportUrl() {
const params = {
boardId: Session.get('currentBoard'),
@@ -237,7 +248,7 @@ Template.memberPopup.events({
Popup.close();
},
'click .js-change-role': Popup.open('changePermissions'),
- 'click .js-remove-member': Popup.afterConfirm('removeMember', function() {
+ 'click .js-remove-member': Popup.afterConfirm('removeMember', function () {
const boardId = Session.get('currentBoard');
const memberId = this.userId;
Cards.find({ boardId, members: memberId }).forEach(card => {
@@ -578,7 +589,7 @@ BlazeComponent.extendComponent({
'subtext-with-parent',
'no-parent',
];
- options.forEach(function(element) {
+ options.forEach(function (element) {
if (element !== value) {
$(`#${element} ${MCB}`).toggleClass(CKCLS, false);
$(`#${element}`).toggleClass(CKCLS, false);