The settings concept allows us to store most settings in a general way in a single table.
Settings are stored in table core.setting where column setting_key is primary key and column setting_value has the value for the setting.
Settings are grouped using column group_key which links to table core.setting_group.
Function core.get_seting_value is used in code to read setting from table.
SELECT * FROM core.setting ORDER BY setting_key
SELECT * FROM core.setting_ex ORDER BY group_key, setting_key
SELECT * FROM core.setting_group
SELECT core.get_setting_value('zys_debug_logging')
Note that you have identical core.setting tables in both STG and PROD but the data in the tables is different. You can also have have the same setting keys in both databases with different setting values (columns setting_key and setting_value), one example being the zys settings where you could f.e. have different database stats or index maintenance settings in STG and PROD.
To edit the navigation open System Settings, head to App navigation, and then click the button which will open a config modal. After implementing your changes, click save and refresh the app.
Note: To edit the the JSON config the user must have Development Mode feature enabled.
properties
The app navigation is an array of modules, with each module containing the following properties…
name
(string)The name
property sets the name of the module in the navigation bar. The property is translated and the translation key should be used.
index
(number)The dropdown menu of modules is sorted by their index
.
color
(string)The following colors are available for you to choose from:
homepage
(string)When a module is selected, or the AGR logo is clicked, the user will be redirected to the homepage
. The default homepage
is the dashboard
. However, since not all modules will have access to the dashboard
and others might want a custom homepage
this property gives you the freedom to select your own.
navigation
(object)Sets the navigation bar of the module. The example below will result in the navigation bar shown here:
{
"navigation": [
{
"caption": "ITEMS",
"path": "items",
"feature": "items"
},
{
"caption": "NAV_REPORTS",
"path": "reports",
"feature": "reports"
},
{
"caption": "NAV_PLANS",
"path": "workspaces/list/plans",
"feature": "plans",
"icon": "thumbs-up"
},
{
"caption": "ORDERS",
"path": "orders",
"feature": "orders",
"submenu": [
{
"caption": "NAV_REPORTS",
"path": "reports",
"feature": "reports"
},
{
"divider": "true"
},
{
"caption": "NAV_PLANS",
"path": "workspaces/list/plans",
"feature": "plans"
}
]
}
]
}
caption
(string): The name of the feature, i.e. the translation key.path
(string): The path of the feature.feature
(string | string[]): The feature(s) required to access the feature.divider
(boolean): Turns the object into a dropdown divider.icon
(string): Name of a font-awesome icon, e.g. “thumbs-up”, without the fa- prefix. Adds an icon in front of the caption, but the caption is not required, i.e. you may use only an icon if you want to. Any icon from this list may be used: https://fontawesome.com/v4.7.0/cheatsheet/.submenu
(array): To turn a button in the navigation bar to a dropdown menu. The array holds the dropdown items.full example
(array)The example below is an example from a bm initial load, to show the navigation with multiple modules. It does not include dropdowns or icons, so be sure to check those out in the navigation section above.
[
{
"name": "INVENTORY",
"index": 0,
"color": "blue",
"homepage": "dashboard",
"navigation": [
{
"caption": "ITEMS",
"path": "items",
"feature": "items"
},
{
"caption": "NAV_REPORTS",
"path": "reports",
"feature": "reports"
},
{
"caption": "NAV_PLANS",
"path": "workspaces/list/plans",
"feature": [
"plans",
"purchasePlans"
]
},
{
"caption": "NAV_ORDERS",
"path": "orders",
"feature": "orders"
},
{
"caption": "NAV_COUNTING",
"path": "counting",
"feature": "counting"
}
]
},
{
"name": "PLANNING",
"index": 1,
"color": "green",
"navigation": [
{
"caption": "NAV_MERCHANDISE_FINANCIAL",
"path": "workspaces/dm/dm",
"feature": "dm"
},
{
"caption": "NAV_LOCATION_FINANCIAL_PLANNING",
"path": "workspaces/dm/dm",
"feature": "dm"
},
{
"caption": "NAV_LOCATION_CLUSTERING",
"path": "workspaces/lm/lm",
"feature": "lm"
}
]
},
{
"name": "ASSORTMENT",
"index": 2,
"color": "orange",
"navigation": [
{
"caption": "NAV_RANGE_MANAGER",
"path": "workspaces/rm/rm",
"feature": "rm"
},
{
"caption": "NAV_OPTION_MANAGER",
"path": "workspaces/om/om",
"feature": "om"
},
{
"caption": "NAV_PURCHASE_PLANS",
"path": "workspaces/ppm/ppm",
"feature": "ppm"
}
]
}
]
Since version 6.2 translations have been moved to the cloud. This means that new translations and languages can be added to the system without releasing a new update.
To Enable this feature (retrieval of translations from the cloud) you have to set the cloud_translations
setting in [core].[setting]
to true
. This can also be done in system settings from within the client application.
Global translations for all running AGR systems are stored in the “AGR Pool” cloud service at pool.agrdynamics.com/api. When translations are added or updated there they become available in all clients running AGR 6.2 or later.
The technical flow of how communications to the AGR Pool translations are handled are as follows:
[dbo].[translations]
and [dbo].[translation_override]
.translations checksum
from the cloud with the translations_checksum
value stored in [core].[setting]
[dbo].[translations]
are deleted and replaced with those retrieved from the cloud.translations_checksum
in [core].[setting]
Translations added to [dbo].[translation_override]
take precedence over those in the cloud
/[dbo].[translations]
.
INSERT INTO dbo.translation_override VALUES
('MY_NEW_REPORT_COLUMN', 'My new report column', 'en'),
('MY_NEW_REPORT_COLUMN', 'Nýji skýrsludálkurinn minn', 'is')
Don’t add translations to [dbo].[translations]
, it is harmless but your changes will be temporary as these translations are regularly overwritten with new data.
Adding global translations might eventually be made available in a separate web application. Currently there are two inferior ways to add and update cloud translations.
It is suggested to edit translations through the cloud database (method 1) since it is more user-friendly.
/translations
to the URL (e.g. r62.daily.local/translations).
Note: the caption in e.g. mbe_columns
needs to correspond to the translation key (dbo.translations
).
Go to pool.agrdynamics.com/api and ask the DEV team for login credentials.
POST
/api/login
route supplying the correct username and password, your response should look something like:{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }
access_token
value without the surrounding quote marks, e.g eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
access_token
value.GET
/api/users
endpoint.POST
/api/translations
endpoint.If the translation needs to have a dynamic value you can use the translation placeholders. You add %s
anywehere in the translation and that value will be replaced with whatever you put after the ,
in the translation key. F.ex:
INSERT INTO dbo.translations VALUES
('GOT_X_MINUTES', 'Got %s minues', 'en')
GOT_X_MINUTES,10
-> Got %s minutes
-> Got 10 minutes