|
@@ -255,7 +255,6 @@ module.exports = function(crowi, app) {
|
|
|
tree: [],
|
|
tree: [],
|
|
|
pageRelatedGroup: null,
|
|
pageRelatedGroup: null,
|
|
|
template: null,
|
|
template: null,
|
|
|
- slack: '',
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
var pageTeamplate = 'customlayout-selector/page';
|
|
var pageTeamplate = 'customlayout-selector/page';
|
|
@@ -291,6 +290,20 @@ 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;
|
|
@@ -355,15 +368,6 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- return UpdatePost.findSettingsByPath(renderVars.path)
|
|
|
|
|
- .then(function(data) {
|
|
|
|
|
- data = data.map(e => e.channel);
|
|
|
|
|
- renderVars.slack = data.join(',');
|
|
|
|
|
- }).catch(function(err) {
|
|
|
|
|
- debug('Error occured in getting slack channels', err);
|
|
|
|
|
- });
|
|
|
|
|
- })
|
|
|
|
|
.then(function() {
|
|
.then(function() {
|
|
|
return interceptorManager.process('beforeRenderPage', req, res, renderVars);
|
|
return interceptorManager.process('beforeRenderPage', req, res, renderVars);
|
|
|
})
|
|
})
|