Commit 10fd37d3 authored by Pavel Mashliakovskiy's avatar Pavel Mashliakovskiy 🤹🏻
Browse files

UBA model fill `ubs_settings` using migration YAML

parent 0492cd4b
Pipeline #32630 skipped with stage
......@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
### Changed
- UBA model fill `ubs_settings` using migration YAML
### Deprecated
......
$context:
type: settings
uba.user.publicRegistrationSubject:
name: Subject of email, sent to new user on public registration
description: Subject of email, sent to new user on public registration
type: string
uba.user.publicRegistrationReportCode:
name: Report code for generating email, sent to new user on public registration
description: Report code for generating email, sent to new user on public registration
type: string
\ No newline at end of file
const csvLoader = require('@unitybase/base').dataLoader
const path = require('path')
/**
* Fill UBS model settings
* Used by `ubcli initialize` command
* @param {ServerSession} session
*/
module.exports = function (session) {
let conn = session.connection
let domain = conn.getDomainInfo()
if (!domain.has('ubs_settings')) {
console.info('\tSkip adding default settings - entity `ubs_settings` not in domain')
return
}
console.info('\tFill default settings for UBS model')
csvLoader.loadSimpleCSVData(conn, path.join(__dirname, 'ubs_settings-UBA.csv'),
'ubs_settings',
'settingKey;type;defaultValue;settingValue;name;description'.split(';'),
[0, 1, 2, 3, 4, 5],
1
)
}
settingKey;type;defaultValue;settingValue;name;description
uba.user.publicRegistrationSubject;string;"";"";Subject of email, sent to new user on public registration;Subject of email, sent to new user on public registration
uba.user.publicRegistrationReportCode;string;"";"";Report code for generating email, sent to new user on public registration;Report code for generating email, sent to new user on public registration
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment