Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RJS-1413: Add support for a logical counter as a presentation data ty…
…pe (#6694) * Group schema normalization tests into suites. * Allow 'counter' in schema parser. * Test schema parser with 'counter'. * Add Counter class. * Implement creating a counter on Realm object. * Add implementation to Counter. * Expose Core's 'add_int()'. * Add object property getter. * Export types. * Test create and access via 'realm.create()' (input: nums and Counter). * Test create and access via 'realm.create()' (input: collections). * Test create and access via collection accessors. * Test updating the counter value. * Test updating the Realm object counter property. * Move common logic to shared functions. * Test updating the Realm object collection property. * Test returning different reference for each access. * Test throwing when updating by non-integer. * Change how a counter should be defined in the schema. We originally decided on using 'counter' as its own primitive type (defined e.g. "type: 'counter'"). We have updated this to now use a 'presentation' type (e.g. "type: 'int', presentation: 'counter'"). * Rename test property. * Add 'skips' to tests that await implementation. * Add 'presentations' to the stored sdk-specifc schema info. * Add 'isCreating' argument to object property setters to disallow certain operations for counter. * Test throwing when resetting via property setter. * Test throwing outside transaction. * Test throwing if setting regular int to counter. * Test throwing if invalidated object. * Extend 'Unmanaged' with Counter and allowing number. * Throw custom message if getting value on invalid object. * Implement 'Counter.set()'. * Disallow counter as mixed. * Test throwing if used as mixed. * Test filtering. * Fixing returning null if counter is null. * Remove support for collections of counters. * Test updating Realm object counter prop via UpdateMode. * Fix Unmanaged type for Counter. * Add Unmanaged RealmSet. * Update API docs. * Remove implicit coercion to number due to TS not supporting it. For reference on lack of TS support, see: microsoft/TypeScript#2361 * Test 'Realm.schema'. * Replace 'Object.defineProperty' with Symbols. * Add CHANGELOG entry. * Change default value in test to non-zero. * Test throwing when setting 'Counter.value' directly. * Make 'describe' test names lowercase. * List what is not supported onto the 'Counter' API docs. * Move 'expectCounter' to common file. * Remove link to API ref docs in CHANGELOG if doing RC release. * Refactor a test to use `map` instead of for-loop Co-authored-by: Kræn Hansen <[email protected]> * Update error message from 'floating point' to 'decimal'. * [12.10.0-rc.0] Bump version (#6696) Co-authored-by: elle-j <[email protected]> * Prepare for vNext (#6697) Co-authored-by: elle-j <[email protected]> * Update formatting. * Update test variable name. * Add links in CHANGELOG. Co-authored-by: Kenneth Geisshirt <[email protected]> * Update API docs formatting. * Update initial value in test from 0 to 10. * Refactor similar tests into for-loop. * Point to Core v14.10.0. * Update Counter API docs. * Remove redundant comment. * Refactor logic allowing/disallowing setting a counter. * Update type name w/o abbreviation Co-authored-by: Kræn Hansen <[email protected]> * Fix CHANGELOG after merge. --------- Co-authored-by: Kræn Hansen <[email protected]> Co-authored-by: Yavor Georgiev <[email protected]> Co-authored-by: elle-j <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kenneth Geisshirt <[email protected]>
- Loading branch information