|
@@ -10,7 +10,6 @@ module.exports = function(crowi, app) {
|
|
|
, Bookmark = crowi.model('Bookmark')
|
|
, Bookmark = crowi.model('Bookmark')
|
|
|
, UserGroupRelation = crowi.model('UserGroupRelation')
|
|
, UserGroupRelation = crowi.model('UserGroupRelation')
|
|
|
, PageGroupRelation = crowi.model('PageGroupRelation')
|
|
, PageGroupRelation = crowi.model('PageGroupRelation')
|
|
|
- , UpdatePost = crowi.model('UpdatePost')
|
|
|
|
|
, ApiResponse = require('../util/apiResponse')
|
|
, ApiResponse = require('../util/apiResponse')
|
|
|
, interceptorManager = crowi.getInterceptorManager()
|
|
, interceptorManager = crowi.getInterceptorManager()
|
|
|
, pagePathUtil = require('../util/pagePathUtil')
|
|
, pagePathUtil = require('../util/pagePathUtil')
|
|
@@ -290,20 +289,6 @@ module.exports = function(crowi, app) {
|
|
|
renderVars.pageRelatedGroup = pageGroupRelation.relatedGroup;
|
|
renderVars.pageRelatedGroup = pageGroupRelation.relatedGroup;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- if (page.extended.slack) {
|
|
|
|
|
- renderVars.slack = page.extended.slack;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- return UpdatePost.findSettingsByPath(page.path)
|
|
|
|
|
- .then(function(data) {
|
|
|
|
|
- renderVars.slack = data.map(e => e.channel).join(', ');
|
|
|
|
|
- }).catch(function(err) {
|
|
|
|
|
- debug('Error occured in getting slack channels', err);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
.then(function() {
|
|
.then(function() {
|
|
|
var userPage = isUserPage(page.path);
|
|
var userPage = isUserPage(page.path);
|
|
|
var userData = null;
|
|
var userData = null;
|
|
@@ -490,7 +475,6 @@ module.exports = function(crowi, app) {
|
|
|
page: pageData,
|
|
page: pageData,
|
|
|
revision: pageData.revision || {},
|
|
revision: pageData.revision || {},
|
|
|
author: pageData.revision.author || false,
|
|
author: pageData.revision.author || false,
|
|
|
- slack: '',
|
|
|
|
|
};
|
|
};
|
|
|
var userPage = isUserPage(pageData.path);
|
|
var userPage = isUserPage(pageData.path);
|
|
|
var userData = null;
|
|
var userData = null;
|
|
@@ -507,20 +491,6 @@ module.exports = function(crowi, app) {
|
|
|
renderVars.pageRelatedGroup = pageGroupRelation.relatedGroup;
|
|
renderVars.pageRelatedGroup = pageGroupRelation.relatedGroup;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- if (pageData.extended.slack) {
|
|
|
|
|
- renderVars.slack = pageData.extended.slack;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- return UpdatePost.findSettingsByPath(pageData.path)
|
|
|
|
|
- .then(function(data) {
|
|
|
|
|
- renderVars.slack = data.map(e => e.channel).join(', ');
|
|
|
|
|
- }).catch(function(err) {
|
|
|
|
|
- debug('Error occured in getting slack channels', err);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
.then(function() {
|
|
.then(function() {
|
|
|
if (userPage) {
|
|
if (userPage) {
|
|
|
return User.findUserByUsername(User.getUsernameByPath(pageData.path))
|
|
return User.findUserByUsername(User.getUsernameByPath(pageData.path))
|