CHANGELOG.md 9.25 KB
Newer Older
1 2 3 4 5 6
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

7
## [Unreleased]
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
8
### Added
9 10
 - documentation for `__skipSelectBeforeUpdate` `CustomRepository.misc` flag (added in UB@5.18.9)
 
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
11 12 13 14 15 16 17
### Changed

### Deprecated

### Removed

### Fixed
18 19
 - force `numeric: true` for `Intl.Collator(lang, { numeric: true })`. For `en` this is not necessary, but for `uk`
  without forcing numeric numbers compared as strings. 
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
20 21

## [5.5.0] - 2020-07-19
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
22
### Added
23 24 25 26 27
 - `@unitybase/cs-shared/formatByPattern.setDefaultLang` function - set a default language. Called by AsyncConnection 
 automatically.
 - `@unitybase/cs-shared/formatByPattern.collationCompare` function - compare two value using default language.
 This function allows correct string sorting for non-english languages. 
   
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
28
### Changed
29 30
 - `formatByPattern.formatNumber` & `formatByPattern.formatDate` without language parameter uses default language 
 defined by call to `formatByPattern.setDefaultLang` 
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
31

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
32 33 34 35
## [5.4.1] - 2020-07-01
### Added
 - `UBEntity.isManyManyRef` property added. `true` in case this is many-to-many relation table for storing values of attributes of "Many" type.

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
36 37 38 39 40 41
## [5.4.0] - 2020-06-14
### Added
 - for server-side UBEntity a mixins list include `rls` and `audit` mixin definition if they defined for entity.
   Both `rls` and `audit` are hidden from client side for security reason. Before this patch `rls` and `audit`
   were unavailable even to the server side UBDomain.
   
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
42 43 44 45 46 47 48 49
## [5.3.1] - 2020-05-25
### Added
 - `formatByPattern.setLang2LocaleHook` function added - allows override default UB language to ICU locale transformation rules 

### Changed
 - `formatByPattern.formatDate` now accept any type as a value. For `!value` returns '', for non-date value creates a Date using new Date(value)  
 - `formatByPattern.formatNumber` now accept any type as a value. For `!value`(except 0) and `NaN` returns '', for non-number value uses `parseFloat()` 

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
50 51 52 53 54
## [5.3.0] - 2020-05-22
### Added
 - `formatByPattern` module with `formatNumber` and `formatDate` functions using cached **Intl** instances.
   This module is moved from `@unitybase/ubs` to be used in apps what not require a UBS model.

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
55 56 57 58
## [5.2.7] - 2020-05-13
### Added
 - link to tutorial for an array bindings from `CustomRepository.where()`
 
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
59
## [5.2.6] - 2020-04-24
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
60
## [5.2.5] - 2020-04-10
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
61
### Fixed
62 63 64
 - random invalid session signature calculation what cause a 401 server response and re-logon for
 UB authentication schema of self-circling for Kerberos.
 The root of problem is variable declaration (`let/const`) inside `switch` block - such construction **MUST NOT BE USED**  
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
65

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
66
## [5.2.4] - 2020-03-20
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
67
## [5.2.3] - 2020-03-17
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
68
### Fixed
69 70
 - `Repository.fromUbql(original)` will deep clone original UBQL instead of referencing to it elements.
 This prevent unexpected mutations of new Repository when original UBQL is mutated.
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
71

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
72 73 74 75 76 77
## [5.2.2] - 2020-03-09
### Added
 - 4th parameter of `CustomRepository.where()` can be either string for clause name or Object with optional properties
 `{clauseName: string, clearable: boolean}`. If `clearable === false` then `CustomRepository.clearWhereList()`
 will skip removing this where condition
 
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
78 79 80 81
## [5.2.1] - 2020-03-04
### Added
 - LocalDataStore will exports `whereListToFunctions` method

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
82 83 84 85
## [5.2.0] - 2020-02-29
### Changed
 - ESLint warnings fixed (mostly let -> const)
 
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
86 87 88 89
## [5.1.17] - 2020-02-03
### Changed
 - `Repository.joinCondition` will throw in case clause name already in jointAs

Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
90
## [5.1.16] - 2020-01-31
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
91
## [5.1.15] - 2020-01-17
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
92
### Added
93
 - new private method `CustomRepository.fromUbql` - used in UB.Repository() constructor to create Repository from UBQL
94 95
 - `Repository.withTotal` can accept optional boolean parameter. If `false` total requirements will be removed from repository
 - `Repository.limit(rowsLimit)` will remove limit in case rowsLimit === 0   
96
  
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
97
### Changed
98 99 100
 - in case expression passed to `Repository.orderBy` already exists in order list it direction will be changed;
 Before this patch the same order expression was added that led to errors with duplicates in `order by`
    
Pavel Mashliakovskiy's avatar
Publish  
Pavel Mashliakovskiy committed
101
## [5.1.14] - 2019-12-17
102 103 104 105
### Added
 - new method `CustomRepository.clearWhereList` - remove all where conditions from Repository.
 Should be used instead of direct access to the private CustomRepository.whereList property   

106
## [5.1.11] - 2019-10-09
107 108 109
### Added
  - remove code duplication for `Date` parsing functions (truncTimeToUtcNull & iso8601ParseAsDate are moved to LocalDataStorage) 

110
## [5.1.9] - 2019-09-24
Pavel Mashliakovskiy's avatar
Pavel Mashliakovskiy committed
111 112 113
### Added
 - `UBSession.signature` can return a fake signature if `authMock` parameter is true

114
## [5.1.7] - 2019-08-27
115 116 117
### Added
 - extended property UBDomain.UBModel.packageJSON added to the extended domain; Property value is parsed model `package.json`  
 
118
## [5.1.5] - 2019-07-28
119 120 121
### Added
 - documentation for 'lockType' flag of `CustomRepository.misc` method

122
## [5.1.3] - 2019-06-21
123 124 125
### Fixed
 - `UBEntity.asPlainJSON` will exclude `hasCatalogueIndex` computed property

126
## [5.1.1] - 2019-05-30
127 128 129
### Fixed
 - error in LocalDataStore filter fabric for `isNull`/`isNotNull` conditions (used inside filtering of cached entities on the client side)   
 
130
## [5.1.0] - 2019-05-20
131 132 133
### Added
  - support for UBQL v2 (value instead of values in whereList)

134
## [5.0.22] - 2019-05-14
135 136
### Fixed
 - CustomRepository.clone() - prevent deep cloning of connection property
137
 - error message for filtering by non-existed attribute in LocalDataStore will include entity name 
138

139
## [5.0.19] - 2019-03-11
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
### Fixed
 - addingCondition now checked in `CustomRepository.miscIf` 
 
### Added
 - `CustomRepository.clone()` method
 ```javascript
  let repo1 = UB.Repository('uba_user').attrs('ID', 'code').where('ID', '>', 15, 'byID')
  let repo2 = repo1.clone()
  repo1.orderBy('code')
  repo1.selectAsObject() // return ordered users with ID > 15

  repo2.attrs('name').where('ID', '>', 100, 'byID')
  repo2.selectAsObject() // return unordered users with their names and ID > 100
 ```
 
### Changed
 - `CustomRepository.misc` `will remove option in case it value is `false` instead of setting it to `false`
 This reduce resulting UBQL size
 
 - `CustomRepository.orderBy(attrd, direction)` accept null as `direction`.
  In this case ordering by `attr` will be removed
  ```javascript
   let repo = UB.Repository('my_entity').attrs('ID').orderBy('code')
   let orderedData = await repo.selectAsObject() // ordered. await is for client-side only
   repo.orderBy('code', null) // remove order by code
   let unorderedData = await repo.selectAsObject() // NOT ordered
  ```
 
168
## [5.0.18] - 2019-03-04
169
### Added
170
 - new method asPlainJSON() for UBEntity & UBEntityAttribute - return a 
171 172
 JSON representation WITHOUT properties which have default values.
 Very close to data stored in meta file
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
 - helper `Repository.attrsIf()`
    ```javascript
    let isPessimisticLock = !!UB.connection.domain.get('uba_user').attributes.mi_modifyDate
    // with whereIf
    let repo = UB.Repository('uba_user').attrs('ID').attrsIf(isPessimisticLock, 'mi_modifyDate')
    //without whereIf
    let repo = UB.Repository('uba_user').attrs('ID')
    if (isPessimisticLock) repo = repo.attrs('mi_modifyDate')  
    ```
 - helper `Repository.whereIf()`
    ```javascript
    let filterString = 'foundAllLikeThis' // or may be empty string
    // with whereIf
    let repo = UB.Repository('my_entity').attrs('ID')
      .whereIf(filterString, 'myAttr', 'like', filterString)
    
    //without whereIf
    let repo = UB.Repository('my_entity').attrs('ID')
    if (filterString) repo = repo.where('myAttr', 'like', filterString)
    ```
 - helper `Repository.miscIf()`  
194
 
195 196 197
### Changed
 - remove obsolete UBEntity & UBEntityAttribute `asJSON` method
 
198
## [5.0.15] - 2018-12-12
199 200 201
### Added
 - support for new authentication schema 'ROOT'. Server side in-proc server only

202
## [5.0.14] - 2018-12-04
203 204 205 206 207
### Added
 - client side `UBDomain` will throw error in case attribute exists in i18n but not defined in entity. Output sample:
```
Error: Invalid i18n for entity "tst_document" - attribute "superOld" not exist in meta or it's dataType is empty
```
208 209
 - new constant UBDomain.FLOATING_SCALE_PRECISION === 6 to be used for DDL generation and UI scale precision 
 for attributes of type **Float**
210

211
## [5.0.12] - 2018-10-23
212 213 214 215 216 217
### Added
 - `UBModel.version` attribute added. Accessible inside client and server.
 Version is taken from model package.json `version` key.
 Empty in case package.json not found or version is not specified.
 **UB server must be >= 5.4.3**  
 
218
## [5.0.10] - 2018-09-30
219 220 221
### Added
 - new convert rule is added for attributes of type `Json` in `getConvertRules` function  

222
## [5.0.9] - 2018-09-29
223 224 225 226 227 228 229 230 231 232 233 234 235
### Added 
 - `UBEntity.getEntityAttributeInfo` in case of request to inner keys of Json type attribute
 will return actual Json attribute in `parentAttribute` and `attribute: ubndefined`
 
### Changed
 - `UBEntity.getEntityAttributeInfo` speed up from x10 to x100 (avoid calling String.split if not necessary)
 - `UBEntity.getEntityAttributeInfo` will return additional parameter `parentAttribute`

### Fixed 
 - `UBEntity.getEntityAttributeInfo` will return correct entity (listed after @) for
 cases `domain.get('org_unit').getEntityAttributeInfo('parentID.code@org_department')`.
 Previous implementation return `org_unit` for such query.