|
|
@@ -303,7 +303,6 @@ module.exports = (crowi) => {
|
|
|
if (assetPath == null) {
|
|
|
return res.apiv3Err(new ErrorV3(`The asset for '${webpackAssetKey}' is undefined.`, 'invalid-asset'));
|
|
|
}
|
|
|
-
|
|
|
return res.apiv3({ assetPath });
|
|
|
});
|
|
|
|
|
|
@@ -330,7 +329,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeTheme'
|
|
|
*/
|
|
|
- router.put('/theme', loginRequiredStrictly, adminRequired, csrf, validator.theme, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/theme', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.theme, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:theme': req.body.themeType,
|
|
|
};
|
|
|
@@ -340,6 +339,8 @@ module.exports = (crowi) => {
|
|
|
const customizedParams = {
|
|
|
themeType: await crowi.configManager.getConfig('crowi', 'customize:theme'),
|
|
|
};
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_THEME_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -408,7 +409,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeFunction'
|
|
|
*/
|
|
|
- router.put('/function', loginRequiredStrictly, adminRequired, csrf, validator.function, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/function', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.function, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:isEnabledTimeline': req.body.isEnabledTimeline,
|
|
|
'customize:isSavedStatesOfTabChanges': req.body.isSavedStatesOfTabChanges,
|
|
|
@@ -436,6 +437,8 @@ module.exports = (crowi) => {
|
|
|
isAllReplyShown: await crowi.configManager.getConfig('crowi', 'customize:isAllReplyShown'),
|
|
|
isSearchScopeChildrenAsDefault: await crowi.configManager.getConfig('crowi', 'customize:isSearchScopeChildrenAsDefault'),
|
|
|
};
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_FUNCTION_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -468,7 +471,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeHighlight'
|
|
|
*/
|
|
|
- router.put('/highlight', loginRequiredStrictly, adminRequired, csrf, validator.highlight, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/highlight', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.highlight, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:highlightJsStyle': req.body.highlightJsStyle,
|
|
|
'customize:highlightJsStyleBorder': req.body.highlightJsStyleBorder,
|
|
|
@@ -480,6 +483,8 @@ module.exports = (crowi) => {
|
|
|
styleName: await crowi.configManager.getConfig('crowi', 'customize:highlightJsStyle'),
|
|
|
styleBorder: await crowi.configManager.getConfig('crowi', 'customize:highlightJsStyleBorder'),
|
|
|
};
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_CODE_HIGHLIGHT_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -512,7 +517,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeTitle'
|
|
|
*/
|
|
|
- router.put('/customize-title', loginRequiredStrictly, adminRequired, csrf, validator.customizeTitle, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/customize-title', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.customizeTitle, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:title': req.body.customizeTitle,
|
|
|
};
|
|
|
@@ -525,6 +530,8 @@ module.exports = (crowi) => {
|
|
|
customizeTitle: await crowi.configManager.getConfig('crowi', 'customize:title'),
|
|
|
};
|
|
|
customizeService.initCustomTitle();
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_CUSTOM_TITLE_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -557,7 +564,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeHeader'
|
|
|
*/
|
|
|
- router.put('/customize-header', loginRequiredStrictly, adminRequired, csrf, validator.customizeHeader, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/customize-header', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.customizeHeader, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:header': req.body.customizeHeader,
|
|
|
};
|
|
|
@@ -566,6 +573,8 @@ module.exports = (crowi) => {
|
|
|
const customizedParams = {
|
|
|
customizeHeader: await crowi.configManager.getConfig('crowi', 'customize:header'),
|
|
|
};
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_CUSTOM_HTML_HEADER_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -598,7 +607,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeCss'
|
|
|
*/
|
|
|
- router.put('/customize-css', loginRequiredStrictly, adminRequired, csrf, validator.customizeCss, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/customize-css', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.customizeCss, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:css': req.body.customizeCss,
|
|
|
};
|
|
|
@@ -610,6 +619,8 @@ module.exports = (crowi) => {
|
|
|
customizeCss: await crowi.configManager.getConfig('crowi', 'customize:css'),
|
|
|
};
|
|
|
customizeService.initCustomCss();
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_CUSTOM_CSS_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|
|
|
@@ -642,7 +653,7 @@ module.exports = (crowi) => {
|
|
|
* schema:
|
|
|
* $ref: '#/components/schemas/CustomizeScript'
|
|
|
*/
|
|
|
- router.put('/customize-script', loginRequiredStrictly, adminRequired, csrf, validator.customizeScript, apiV3FormValidator, async(req, res) => {
|
|
|
+ router.put('/customize-script', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.customizeScript, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
|
'customize:script': req.body.customizeScript,
|
|
|
};
|
|
|
@@ -651,6 +662,8 @@ module.exports = (crowi) => {
|
|
|
const customizedParams = {
|
|
|
customizeScript: await crowi.configManager.getConfig('crowi', 'customize:script'),
|
|
|
};
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_CUSTOM_SCRIPT_UPDATE };
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
|
catch (err) {
|