ubjs issueshttps://git-pub.intecracy.com/unitybase/ubjs/-/issues2019-01-28T12:35:47+02:00https://git-pub.intecracy.com/unitybase/ubjs/-/issues/28Localization: allow UB request to specify (override) locale2019-01-28T12:35:47+02:00Andrii BezuglyiLocalization: allow UB request to specify (override) localeThere must be a way for request to pass the current language, so that developer won't need to do painful, form to form, request to request work by specifying "_lang^" suffixes manually. I believe it would be beneficiary for platform to ...There must be a way for request to pass the current language, so that developer won't need to do painful, form to form, request to request work by specifying "_lang^" suffixes manually. I believe it would be beneficiary for platform to be able to pass something like __lang: 'uk' in mParams.
Cases: anonymous user, which does not even have uData and rest of goodies available for regular users.https://git-pub.intecracy.com/unitybase/ubjs/-/issues/25DDL Generator - support "strict" mode for DDL SQL generation - to be safe on ...2018-12-07T14:37:23+02:00Andrii BezuglyiDDL Generator - support "strict" mode for DDL SQL generation - to be safe on productionCurrently DDL generator makes it best to generate SQL which would run smoothly.
Even if you add NOT NULL reference to a dictionary - it will figure out and put a value in the added column.
That is awesome! ...for DEV environment.
And d...Currently DDL generator makes it best to generate SQL which would run smoothly.
Even if you add NOT NULL reference to a dictionary - it will figure out and put a value in the added column.
That is awesome! ...for DEV environment.
And dangerously scaring for production enviornment.
I suggest to provide the "strict" mode for DDL generator, which would not try to put default / technically valid values in added columns.
That would make me feel a lot safer :)Pavel MashliakovskiyPavel Mashliakovskiyhttps://git-pub.intecracy.com/unitybase/ubjs/-/issues/21Allow to append custom CSP rules2019-12-20T11:35:00+02:00Pavel MashliakovskiyAllow to append custom CSP rulesAs proposed by @rumata - add a additionalCSPSources custom setting to config
```
"customSettings":{
"additionalCSPSources": {
"default": [""],
"image": ["https://my-cdn"],
"connect": ["wss://my-external-chart.com", "..",
...As proposed by @rumata - add a additionalCSPSources custom setting to config
```
"customSettings":{
"additionalCSPSources": {
"default": [""],
"image": ["https://my-cdn"],
"connect": ["wss://my-external-chart.com", "..",
"....": ["..."]
}
}
```Pavel MashliakovskiyPavel Mashliakovskiyhttps://git-pub.intecracy.com/unitybase/ubjs/-/issues/18TimeZome conversion issue with "Date" attributes2019-01-24T19:42:58+02:00Andrii BezuglyiTimeZome conversion issue with "Date" attributesSTR:
* Have an entity with `Date` attribute.
* For example (a real example):
```json
{
"name": "deliveryDate",
"caption": "Delivery Date",
"dataType": "Date",
"allowNull": false
}
```
* Client-si...STR:
* Have an entity with `Date` attribute.
* For example (a real example):
```json
{
"name": "deliveryDate",
"caption": "Delivery Date",
"dataType": "Date",
"allowNull": false
}
```
* Client-side: generate a value for the attribute. Many UI controls (most) generate begin of the date in local TZ of the browser.
* That would be a value like `Tue Nov 13 2018 00:00:00 GMT+0200 (Eastern European Standard Time)`:
* Save (insert or update) an instance of the entity with the value.
* Request would looke like:
```json
{
"entity": "pln_ProjectSkuCategory",
"method": "update",
"execParams": {
"ID": 3000000062661,
"mi_modifyDate": "2018-11-05T14:53:44.000Z",
"deliveryDate": "2018-11-12T22:00:00.000Z"
}
}
```
* Note - no handling in `UB.connection` happened, no TZ shifting, nothing. Date value goes to JSON "as is" and in UTC it is not a start of a day anymore.
* In DB you would have:
```
| ID | deliveryDate |
| 3000000062661 | 2018-11-12 22:00:00.000 |
```
* And when you query that value from the server, you'd get (`resultData.data[0]`):
```json
[
3000000062661,
"2018-11-12T22:00:00Z"
]
```
* This value returned by `selectAsArray`:
![image](/uploads/d96a3fccf3eacdcc3f0c8698914e9c89/image.png)
* NOTE: now the value is all wrong.
EXPECTED:
* The best would be to `UB.connection.query` to patch date values, so that DB would store them as start of the day in UTC.
* Though "fixing" `selectAsArray` (to not change value) may look like a fix, it would be not: users with local TZ differ from the user saved the value would see different result, which is highly undesiraeble.
WORKAROUND APPLIED:
* We manually patch value before sending to server as the following:
```javascript
const deliverDateConverted = new Date((deliveryDate.getTime() / 60000 - deliveryDate.getTimezoneOffset())*60000)
```
Nectain 01Pavel MashliakovskiyPavel Mashliakovskiyhttps://git-pub.intecracy.com/unitybase/ubjs/-/issues/13AdminUI BUG - Drag-and-Drop file attempt leave the drop target element on the...2018-10-05T13:20:50+03:00Andrii BezuglyiAdminUI BUG - Drag-and-Drop file attempt leave the drop target element on the screenSTR:
* Open a form for any entity with "Document" attribute, for example User (it has "Avatar" document attribute)
* Start dragging file
* Do NOT put cursor on the drop target area ("Add Avatar" / "Replace Avatar")
* Stop dragging
AR:
*...STR:
* Open a form for any entity with "Document" attribute, for example User (it has "Avatar" document attribute)
* Start dragging file
* Do NOT put cursor on the drop target area ("Add Avatar" / "Replace Avatar")
* Stop dragging
AR:
* The area not disappeared
ER:
* The area must disappearPavel MashliakovskiyPavel Mashliakovskiyhttps://git-pub.intecracy.com/unitybase/ubjs/-/issues/10Specifying "browser" in package.json (as UB advices in warning messages by s...2018-09-06T18:28:59+03:00Andrii BezuglyiSpecifying "browser" in package.json (as UB advices in warning messages by server) lead to crashThe package.json of model:
```json
{
"config": {
"ubmodel": {
"name": "mdm"
}
},
"browser": "./public/initModel.js",
"private": true
}
```
The crash:
```
20180802 22352935 " ERROR assertPath@path.js:13:11 join@p...The package.json of model:
```json
{
"config": {
"ubmodel": {
"name": "mdm"
}
},
"browser": "./public/initModel.js",
"private": true
}
```
The crash:
```
20180802 22352935 " ERROR assertPath@path.js:13:11 join@path.js:474:7 getServerConfiguration/<@C:\projects-nectain\ub-app\node_modules\@unitybase\base\argv.js:323:44 getServerConfiguration@C:\projects-nectain\ub-app\node_modules\@unitybase\base\argv.js:301:3 @C:\projects-nectain\ub-app\node_modules\@unitybase\ub\modules\App.js:221:22 Module.prototype._compile@module.js:641:14 Module._extensions[".js"]@module.js:652:3 Module.prototype.load@module.js:560:3 tryModuleLoad@module.js:503:5 Module._load@module.js:495:3 Module.prototype.require@module.js:585:10 require@internal/module.js:11:14 @C:\projects-nectain\ub-app\node_modules\@unitybase\ub\modelUB.js:5:13 Module.prototype._compile@module.js:641:14 Module._extensions[".js"]@module.js:652:3 Module.prototype.load@module.js:560:3 tryModuleLoad@module.js:503:5 Module._load@module.js:495:3 Module.prototype.require@module.js:585:10 require@internal/module.js:11:14 @C:\projects-nectain\ub-app\index.js:1:74 Module.prototype._compile@module.js:641:14 Module._extensions[".js"]@module.js:652:3 Module.prototype.load@module.js:560:3 tryModuleLoad@module.js:503:5 Module._load@module.js:495:3 Module.prototype.require@module.js:585:10 @UB.js:42:3
20180802 22352935 " EXC C:\\projects-nectain\\ub-app\\node_modules\\@unitybase\\ub\\modules\\App.js:240\n\nError: App.serverConfig is undefined\n@C:\\projects-nectain\\ub-app\\node_modules\\@unitybase\\ub\\modules\\App.js:240:1\n@C:\\projects-nectain\\ub-app\\node_modules\\@unitybase\\ub\\modelUB.js:5:13\n@C:\\projects-nectain\\ub-app\\index.js:1:74\n@UB.js:42:3\n
20180802 22352935 " ERROR GET init ERROR=500 (App.serverConfig is undefined)
```
Adding/removing "browser" attribute to/from package.json makes UB work or not.Pavel MashliakovskiyPavel Mashliakovskiy