[ACS-6924] Rename tags and categories plugins to mitigate naming conflicts (#3687)

* [ACS-6924] Rename tags and categories plugins to mitigate conflicts

* [ACS-6924] Add missing logic for tags and categories plugins
This commit is contained in:
MichalKinas 2024-03-04 19:52:17 +01:00 committed by GitHub
parent c883e16d2b
commit 33264f0731
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 6 deletions

View File

@ -13,8 +13,8 @@
"aosPlugin": true, "aosPlugin": true,
"contentService": true, "contentService": true,
"folderRules": true, "folderRules": true,
"tags": true, "tagsEnabled": true,
"categories": true "categoriesEnabled": true
}, },
"oauth2": { "oauth2": {
"host": "{protocol}//{hostname}{:port}/auth/realms/alfresco", "host": "{protocol}//{hostname}{:port}/auth/realms/alfresco",

View File

@ -117,3 +117,13 @@ if [ -n "${APP_BASE_SHARE_URL}" ]; then
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${encoded}\"/g" \ sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${encoded}\"/g" \
-i "$APP_CONFIG_FILE" -i "$APP_CONFIG_FILE"
fi fi
if [ -n "${APP_CONFIG_PLUGIN_TAGS}" ]; then
echo "SET APP_CONFIG_PLUGIN_TAGS"
sed -e "s/\"tagsEnabled\": [^,]*/\"tagsEnabled\": ${APP_CONFIG_PLUGIN_TAGS}/g" -i "$APP_CONFIG_FILE"
fi
if [ -n "${APP_CONFIG_PLUGIN_CATEGORIES}" ]; then
echo "SET APP_CONFIG_PLUGIN_CATEGORIES"
sed -e "s/\"categoriesEnabled\": [^,]*/\"categoriesEnabled\": ${APP_CONFIG_PLUGIN_CATEGORIES}/g" -i "$APP_CONFIG_FILE"
fi

View File

@ -947,7 +947,7 @@ describe('app.evaluators', () => {
}; };
app.areTagsEnabled(context); app.areTagsEnabled(context);
expect(context.appConfig.get).toHaveBeenCalledWith('plugins.tags', true); expect(context.appConfig.get).toHaveBeenCalledWith('plugins.tagsEnabled', true);
}); });
it('should return true if get from appConfig returns true', () => { it('should return true if get from appConfig returns true', () => {
@ -980,7 +980,7 @@ describe('app.evaluators', () => {
}; };
app.areCategoriesEnabled(context); app.areCategoriesEnabled(context);
expect(context.appConfig.get).toHaveBeenCalledWith('plugins.categories', true); expect(context.appConfig.get).toHaveBeenCalledWith('plugins.categoriesEnabled', true);
}); });
it('should return true if get from appConfig returns true', () => { it('should return true if get from appConfig returns true', () => {

View File

@ -647,6 +647,6 @@ export function isSmartFolder(context: RuleContext): boolean {
return false; return false;
} }
export const areTagsEnabled = (context: AcaRuleContext): boolean => context.appConfig.get('plugins.tags', true); export const areTagsEnabled = (context: AcaRuleContext): boolean => context.appConfig.get('plugins.tagsEnabled', true);
export const areCategoriesEnabled = (context: AcaRuleContext): boolean => context.appConfig.get('plugins.categories', true); export const areCategoriesEnabled = (context: AcaRuleContext): boolean => context.appConfig.get('plugins.categoriesEnabled', true);