|
@@ -77,11 +77,11 @@ const multer = require('multer');
|
|
|
* properties:
|
|
* properties:
|
|
|
* customizeTitle:
|
|
* customizeTitle:
|
|
|
* type: string
|
|
* type: string
|
|
|
- * CustomizeHtml:
|
|
|
|
|
- * description: CustomizeHtml
|
|
|
|
|
|
|
+ * CustomizeNoscript:
|
|
|
|
|
+ * description: CustomizeNoscript
|
|
|
* type: object
|
|
* type: object
|
|
|
* properties:
|
|
* properties:
|
|
|
- * customizeHtml:
|
|
|
|
|
|
|
+ * customizeNoscript:
|
|
|
* type: string
|
|
* type: string
|
|
|
* CustomizeCss:
|
|
* CustomizeCss:
|
|
|
* description: CustomizeCss
|
|
* description: CustomizeCss
|
|
@@ -143,8 +143,8 @@ module.exports = (crowi) => {
|
|
|
customizeCss: [
|
|
customizeCss: [
|
|
|
body('customizeCss').isString(),
|
|
body('customizeCss').isString(),
|
|
|
],
|
|
],
|
|
|
- customizeHtml: [
|
|
|
|
|
- body('customizeHtml').isString(),
|
|
|
|
|
|
|
+ customizeNoscript: [
|
|
|
|
|
+ body('customizeNoscript').isString(),
|
|
|
],
|
|
],
|
|
|
logo: [
|
|
logo: [
|
|
|
body('isDefaultLogo').isBoolean().optional({ nullable: true }),
|
|
body('isDefaultLogo').isBoolean().optional({ nullable: true }),
|
|
@@ -188,7 +188,7 @@ module.exports = (crowi) => {
|
|
|
customizeTitle: await crowi.configManager.getConfig('crowi', 'customize:title'),
|
|
customizeTitle: await crowi.configManager.getConfig('crowi', 'customize:title'),
|
|
|
customizeScript: await crowi.configManager.getConfig('crowi', 'customize:script'),
|
|
customizeScript: await crowi.configManager.getConfig('crowi', 'customize:script'),
|
|
|
customizeCss: await crowi.configManager.getConfig('crowi', 'customize:css'),
|
|
customizeCss: await crowi.configManager.getConfig('crowi', 'customize:css'),
|
|
|
- customizeHtml: await crowi.configManager.getConfig('crowi', 'customize:noscript'),
|
|
|
|
|
|
|
+ customizeNoscript: await crowi.configManager.getConfig('crowi', 'customize:noscript'),
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
return res.apiv3({ customizeParams });
|
|
return res.apiv3({ customizeParams });
|
|
@@ -531,43 +531,43 @@ module.exports = (crowi) => {
|
|
|
/**
|
|
/**
|
|
|
* @swagger
|
|
* @swagger
|
|
|
*
|
|
*
|
|
|
- * /customize-setting/customize-html:
|
|
|
|
|
|
|
+ * /customize-setting/customize-noscript:
|
|
|
* put:
|
|
* put:
|
|
|
* tags: [CustomizeSetting]
|
|
* tags: [CustomizeSetting]
|
|
|
- * operationId: updateCustomizeHtmlCustomizeSetting
|
|
|
|
|
- * summary: /customize-setting/customize-html
|
|
|
|
|
- * description: Update customizeHtml
|
|
|
|
|
|
|
+ * operationId: updateCustomizeNoscriptCustomizeSetting
|
|
|
|
|
+ * summary: /customize-setting/customize-noscript
|
|
|
|
|
+ * description: Update customizeNoscript
|
|
|
* requestBody:
|
|
* requestBody:
|
|
|
* required: true
|
|
* required: true
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * $ref: '#/components/schemas/CustomizeHtml'
|
|
|
|
|
|
|
+ * $ref: '#/components/schemas/CustomizeNoscript'
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: Succeeded to update customize header
|
|
* description: Succeeded to update customize header
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * $ref: '#/components/schemas/CustomizeHtml'
|
|
|
|
|
|
|
+ * $ref: '#/components/schemas/CustomizeNoscript'
|
|
|
*/
|
|
*/
|
|
|
- router.put('/customize-html', loginRequiredStrictly, adminRequired, addActivity, validator.customizeHtml, apiV3FormValidator, async(req, res) => {
|
|
|
|
|
|
|
+ router.put('/customize-noscript', loginRequiredStrictly, adminRequired, addActivity, validator.customizeNoscript, apiV3FormValidator, async(req, res) => {
|
|
|
const requestParams = {
|
|
const requestParams = {
|
|
|
- 'customize:noscript': req.body.customizeHtml,
|
|
|
|
|
|
|
+ 'customize:noscript': req.body.customizeNoscript,
|
|
|
};
|
|
};
|
|
|
try {
|
|
try {
|
|
|
await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestParams);
|
|
await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestParams);
|
|
|
const customizedParams = {
|
|
const customizedParams = {
|
|
|
- customizeHtml: await crowi.configManager.getConfig('crowi', 'customize:noscript'),
|
|
|
|
|
|
|
+ customizeNoscript: await crowi.configManager.getConfig('crowi', 'customize:noscript'),
|
|
|
};
|
|
};
|
|
|
- const parameters = { action: SupportedAction.ACTION_ADMIN_CUSTOM_HTML_HEADER_UPDATE };
|
|
|
|
|
|
|
+ const parameters = { action: SupportedAction.ACTION_ADMIN_CUSTOM_NOSCRIPT_UPDATE };
|
|
|
activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
return res.apiv3({ customizedParams });
|
|
return res.apiv3({ customizedParams });
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
- const msg = 'Error occurred in updating customizeHtml';
|
|
|
|
|
|
|
+ const msg = 'Error occurred in updating customizeNoscript';
|
|
|
logger.error('Error', err);
|
|
logger.error('Error', err);
|
|
|
- return res.apiv3Err(new ErrorV3(msg, 'update-customizeHtml-failed'));
|
|
|
|
|
|
|
+ return res.apiv3Err(new ErrorV3(msg, 'update-customizeNoscript-failed'));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|