App settings are located in vaa-shared
module. Settings are separated into static and dynamic settings.
Static settings can be changed only by modifying staticSettings.ts.
Dynamic settings can be changed by modifying dynamicSettings.ts. In addition, dynamic settings can also be changed in the backend. This has been currently implemented only in Strapi. Settings from dynamicSettings.ts
are loaded into Strapi if the app settings collection is empty.
Settings from dynamicSettings.ts
, staticSettings.ts
and from the DataProvider are merged together into settings
store. Settings from dynamicSettings.ts
are overwritten by dynamic settings from the DataProvider. Settings from staticSettings.ts
are merged last to prevent overwriting them.
In case of static settings:
- Add the type and documentation for the new setting to the
StaticSettings
type in staticSettings.ts. - Add the default value for the setting to staticSettings.ts.
In case of dynamic settings:
- Add the type and documentation for the new setting to the
DynamicSettings
type in staticSettings.ts. - Add the default value for the setting to dynamicSettings.ts.
- Edit the settings components in Strapi:
- If the new setting is a top-level one, create a new component for the setting and add it to the
App Settings
content-type. - If the new setting is a subsetting of a top-level item, edit that setting.
- If the new setting is a top-level one, create a new component for the setting and add it to the
- Edit the populate restrictions for the app-settings route so that the new component is allowed to be populated both for
find
andfindOne
. - Update the Strapi data types for
StrapiAppSettingsData
in strapiDataProvider.type.ts - Add the necessary
populate
query params to thegetAppSettings
method in strapiDataProvider.ts, because components need to be explicitly populated. - If the data type for the setting does not match the one in the
DynamicSettings
type:- Edit the
getAppSettings
method in strapiDataProvider.ts so that it returns the setting in the correct format. - Edit the loadDefaultAppSettings utility so that it converts the default settings to a format suitable for Strapi.
- Edit the
- Repeat steps 3–5 for all other
DataProvider
implementations that supportgetAppSettings
.
App customization includes publisher logo, front page image, translations and frequently asked questions of the candidate app. App customization has been currently implemented only in Strapi.
Translations from dynamic.json
are loaded into Strapi if the app customization collection is empty. In addition to changing the dynamic translations, any other translation can be overridden.
- Add the new option to
AppCustomization
type in global.d.ts. - Add the new option to the
App Customization
content type in Strapi. - If the new setting is a relation, media field or a component:
- Edit the populate restrictions for the app-customization route.
- Add the necessary
populate
query params to thegetAppCustomization
method in strapiDataProvider.ts.
- Update the Strapi data types for
StrapiAppCustomizationData
in strapiDataProvider.type.ts