mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Remove export button if WITH_API is not enabled
#2938 https://github.com/wekan/wekan/issues/2938#issuecomment-589782402
This commit is contained in:
parent
7c25542976
commit
f09219cbfd
4 changed files with 34 additions and 29 deletions
|
|
@ -33,22 +33,6 @@ Template.boardMenuPopup.events({
|
|||
'click .js-card-settings': Popup.open('boardCardSettings'),
|
||||
});
|
||||
|
||||
Template.boardMenuPopup.helpers({
|
||||
exportUrl() {
|
||||
const params = {
|
||||
boardId: Session.get('currentBoard'),
|
||||
};
|
||||
const queryParams = {
|
||||
authToken: Accounts._storedLoginToken(),
|
||||
};
|
||||
return FlowRouter.path('/api/boards/:boardId/export', params, queryParams);
|
||||
},
|
||||
exportFilename() {
|
||||
const boardId = Session.get('currentBoard');
|
||||
return `wekan-export-board-${boardId}.json`;
|
||||
},
|
||||
});
|
||||
|
||||
Template.boardChangeTitlePopup.events({
|
||||
submit(event, templateInstance) {
|
||||
const newTitle = templateInstance
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ template(name="boardMenuPopup")
|
|||
if currentUser.isBoardAdmin
|
||||
hr
|
||||
ul.pop-over-list
|
||||
if withApi
|
||||
li
|
||||
a(href="{{exportUrl}}", download="{{exportFilename}}")
|
||||
i.fa.fa-share-alt
|
||||
|
|
@ -326,6 +327,7 @@ template(name="boardMenuPopup")
|
|||
if isSandstorm
|
||||
hr
|
||||
ul.pop-over-list
|
||||
if withApi
|
||||
li
|
||||
a(href="{{exportUrl}}", download="{{exportFilename}}")
|
||||
i.fa.fa-share-alt
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
|
|
@ -198,6 +198,10 @@ if (Meteor.isServer) {
|
|||
return process.env.CAS_ENABLED === 'true';
|
||||
}
|
||||
|
||||
function isApiEnabled() {
|
||||
return process.env.WITH_API === 'true';
|
||||
}
|
||||
|
||||
Meteor.methods({
|
||||
sendInvitation(emails, boards) {
|
||||
check(emails, [String]);
|
||||
|
|
@ -314,6 +318,10 @@ if (Meteor.isServer) {
|
|||
return isCasEnabled();
|
||||
},
|
||||
|
||||
_isApiEnabled() {
|
||||
return isApiEnabled();
|
||||
},
|
||||
|
||||
// Gets all connection methods to use it in the Template
|
||||
getAuthenticationsEnabled() {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue