|
|
@@ -61,8 +61,6 @@ const router = express.Router();
|
|
|
* type: boolean
|
|
|
* isSearchScopeChildrenAsDefault:
|
|
|
* type: boolean
|
|
|
- * isEnabledMarp:
|
|
|
- * type: boolean
|
|
|
* CustomizeHighlight:
|
|
|
* description: CustomizeHighlight
|
|
|
* type: object
|
|
|
@@ -127,6 +125,8 @@ module.exports = (crowi) => {
|
|
|
body('isEnabledStaleNotification').isBoolean(),
|
|
|
body('isAllReplyShown').isBoolean(),
|
|
|
body('isSearchScopeChildrenAsDefault').isBoolean(),
|
|
|
+ ],
|
|
|
+ CustomizePresentation: [
|
|
|
body('isEnabledMarp').isBoolean(),
|
|
|
],
|
|
|
customizeTitle: [
|
|
|
@@ -411,7 +411,6 @@ module.exports = (crowi) => {
|
|
|
'customize:isEnabledStaleNotification': req.body.isEnabledStaleNotification,
|
|
|
'customize:isAllReplyShown': req.body.isAllReplyShown,
|
|
|
'customize:isSearchScopeChildrenAsDefault': req.body.isSearchScopeChildrenAsDefault,
|
|
|
- 'customize:isEnabledMarp': req.body.isEnabledMarp,
|
|
|
};
|
|
|
|
|
|
try {
|
|
|
@@ -426,7 +425,6 @@ module.exports = (crowi) => {
|
|
|
isEnabledStaleNotification: await crowi.configManager.getConfig('crowi', 'customize:isEnabledStaleNotification'),
|
|
|
isAllReplyShown: await crowi.configManager.getConfig('crowi', 'customize:isAllReplyShown'),
|
|
|
isSearchScopeChildrenAsDefault: await crowi.configManager.getConfig('crowi', 'customize:isSearchScopeChildrenAsDefault'),
|
|
|
- isEnabledMarp: await crowi.configManager.getConfig('crowi', 'customize:isEnabledMarp'),
|
|
|
};
|
|
|
const parameters = { action: SupportedAction.ACTION_ADMIN_FUNCTION_UPDATE };
|
|
|
activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
@@ -439,6 +437,28 @@ module.exports = (crowi) => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ router.put('/presentation', loginRequiredStrictly, adminRequired, addActivity, validator.CustomizePresentation, apiV3FormValidator, async(req, res) => {
|
|
|
+ const requestParams = {
|
|
|
+ 'customize:isEnabledMarp': req.body.isEnabledMarp,
|
|
|
+ };
|
|
|
+
|
|
|
+ try {
|
|
|
+ await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestParams);
|
|
|
+ const customizedParams = {
|
|
|
+ isEnabledMarp: await crowi.configManager.getConfig('crowi', 'customize:isEnabledMarp'),
|
|
|
+ };
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_FUNCTION_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
+ return res.apiv3({ customizedParams });
|
|
|
+ }
|
|
|
+ catch (err) {
|
|
|
+ const msg = 'Error occurred in updating presentaion';
|
|
|
+ logger.error('Error', err);
|
|
|
+ return res.apiv3Err(new ErrorV3(msg, 'update-presentation-failed'));
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
/**
|
|
|
* @swagger
|
|
|
*
|