Refactor groups configs in webapp and backend to new structure

This commit is contained in:
Wolfgang Huß 2023-12-20 17:10:58 +01:00
parent 16a7a1ec5f
commit f10006563e
6 changed files with 46 additions and 8 deletions

View File

@ -0,0 +1,5 @@
// this file is duplicated in backend/src/branding/groupsBranding' and 'webapp/branding/groupsBranding'
// configurable values see: 'backend/src/constants/groupsDefault', 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groups', 'webapp/constants/groups'
export const DUMMY = '' // to avoid import error ts(2306): File X is not a module.

View File

@ -1,3 +1,10 @@
// this file is duplicated in `backend/src/constants/group` and `webapp/constants/group.js`
export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 50 // with removed HTML tags
export const DESCRIPTION_EXCERPT_HTML_LENGTH = 250 // with removed HTML tags
// configurable values see: 'backend/src/constants/groupsDefault', 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groups', 'webapp/constants/groups'
import * as groupsDefault from './groupsDefault'
import * as groupsBranding from '../branding/groupsBranding'
export const { DESCRIPTION_WITHOUT_HTML_LENGTH_MIN, DESCRIPTION_EXCERPT_HTML_LENGTH } = {
...groupsDefault,
...groupsBranding,
}

View File

@ -0,0 +1,6 @@
// this file is duplicated in 'backend/src/constants/groupsDefault' and 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groupsDefault', 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groups', 'webapp/constants/groups'
export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 50 // with removed HTML tags
export const DESCRIPTION_EXCERPT_HTML_LENGTH = 250 // with removed HTML tags

View File

@ -0,0 +1,5 @@
// this file is duplicated in backend/src/branding/groupsBranding' and 'webapp/branding/groupsBranding'
// configurable values see: 'backend/src/constants/groupsDefault', 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groups', 'webapp/constants/groups'
export const DUMMY = '' // to avoid import error ts(2306): File X is not a module.

View File

@ -1,5 +1,12 @@
// this file is duplicated in `backend/src/constants/group.js` and `webapp/constants/group.js`
export const NAME_LENGTH_MIN = 3
export const NAME_LENGTH_MAX = 50
export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 50 // with removed HTML tags
export const SHOW_GROUP_BUTTON_IN_HEADER = true
// configurable values see: 'backend/src/constants/groupsDefault', 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groups', 'webapp/constants/groups'
import * as groupsDefault from './groupsDefault'
import * as groupsBranding from '../branding/groupsBranding'
export const {
NAME_LENGTH_MIN,
NAME_LENGTH_MAX,
DESCRIPTION_WITHOUT_HTML_LENGTH_MIN,
SHOW_GROUP_BUTTON_IN_HEADER,
} = {...groupsDefault, ...groupsBranding}

View File

@ -0,0 +1,8 @@
// this file is duplicated in 'backend/src/constants/groupsDefault' and 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groupsDefault', 'webapp/constants/groupsDefault'
// configurable values see: 'backend/src/constants/groups', 'webapp/constants/groups'
export const NAME_LENGTH_MIN = 3
export const NAME_LENGTH_MAX = 50
export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 50 // with removed HTML tags
export const SHOW_GROUP_BUTTON_IN_HEADER = true