Skip to content

Commit aaa90c6

Browse files
authored
Prepare release and update documentation (#100)
1 parent 59f1a8d commit aaa90c6

File tree

2 files changed

+59
-24
lines changed

2 files changed

+59
-24
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7-
## Version 1.0.7 - 01.07.24
7+
## Version 1.0.7 - 09.07.24
88

99
### Added
1010

@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
1818

1919
- Peer dependency to @sap/cds changed to ">=7"
2020
- Data marked as personal data using data privacy annotations won't get change-tracked anymore to satisfy product standards
21+
- Restructured Documentation
2122

2223

2324
## Version 1.0.6 - 29.04.24

README.md

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
a [CDS plugin](https://cap.cloud.sap/docs/node.js/cds-plugins#cds-plugin-packages) for automatic capturing, storing, and viewing of the change records of modeled entities
44

5-
6-
> [!WARNING]
7-
> Please be aware that [**sensitive** or **personal** data](https://cap.cloud.sap/docs/guides/data-privacy/annotations#annotating-personal-data) should not be change tracked, since viewing the log allows users to circumvent [audit-logging](https://cap.cloud.sap/docs/guides/data-privacy/audit-logging#setup).
8-
95
[![REUSE status](https://api.reuse.software/badge/github.com/cap-js/change-tracking)](https://api.reuse.software/info/github.com/cap-js/change-tracking)
106

117
### Table of Contents
@@ -18,10 +14,12 @@ a [CDS plugin](https://cap.cloud.sap/docs/node.js/cds-plugins#cds-plugin-package
1814
- [Advanced Options](#advanced-options)
1915
- [Altered Table View](#altered-table-view)
2016
- [Disable Lazy Loading](#disable-lazy-loading)
17+
- [Disable UI Facet generation](#disable-ui-facet-generation)
18+
- [Disable Association to Changes Generation](#disable-association-to-changes-generation)
2119
- [Examples](#examples)
2220
- [Specify Object ID](#specify-object-id)
2321
- [Tracing Changes](#tracing-changes)
24-
- [Don'ts](#donts)
22+
- [Don'ts](#donts)
2523
- [Contributing](#contributing)
2624
- [Code of Conduct](#code-of-conduct)
2725
- [Licensing](#licensing)
@@ -38,6 +36,7 @@ In this guide, we use the [Incidents Management reference sample app](https://gi
3836
### 1. Prerequisites
3937

4038
Clone the repository and apply the step-by-step instructions:
39+
4140
```sh
4241
git clone https://github.com/cap-js/incidents-app
4342
cd incidents-app
@@ -94,15 +93,17 @@ Additional identifiers or labels can be added to obtain more *human-readable* ch
9493
With the steps above, we have successfully set up change tracking for our reference application. Let's see that in action.
9594

9695
1. **Start the server**:
97-
```sh
98-
cds watch
99-
```
96+
97+
```sh
98+
cds watch
99+
```
100+
100101
2. **Make a change** on your change-tracked elements. This change will automatically be persisted in the database table (`sap.changelog.ChangeLog`) and made available in a pre-defined view, namely the [Change History view](#change-history-view) for your convenience.
101102

102103
#### Change History View
103104

104105
> [!IMPORTANT]
105-
> To ensure proper lazy loading of the Change History table, please use **SAPUI5 version 1.120.0** or higher.<br>
106+
> To ensure proper lazy loading of the Change History table, please use **SAPUI5 version 1.120.0** or higher.`<br>`
106107
> If you wish to *disable* this feature, please see the customization section on how to [disable lazy loading](#disable-lazy-loading).
107108
108109
<img width="1300" alt="change-history" src="_assets/changes.png">
@@ -215,24 +216,57 @@ annotate sap.changelog.aspect @(UI.Facets: [{
215216

216217
The system now uses the SAPUI5 default setting `![@UI.PartOfPreview]: true`, such that the table will always shown when navigating to that respective Object page.
217218

219+
### Disable UI Facet generation
220+
221+
If you do not want the UI facet added to a specific UI, you can annotate the service entity with `@changelog.disable_facet`. This will disable the automatic addition of the UI faced to this specific entity, but also all views or further projections up the chain.
222+
223+
### Disable Association to Changes Generation
224+
225+
For some scenarios, e.g. when doing `UNION` and the `@changelog` annotion is still propageted, the automatic addition of the association to `changes` does not make sense. You can use `@changelog.disable_assoc`for this to be disabled on entity level.
226+
227+
> [!IMPORTANT]
228+
> This will also supress the addition of the UI facet, since the change-view is not available as target entity anymore.
229+
230+
### Preserve change logs of deleted data
231+
232+
By default, deleting a record will also automatically delete all associated change logs. This helps reduce the impact on the size of the database.
233+
You can turn this behavior off globally by adding the following switch to the `package.json` of your project
234+
235+
```
236+
...
237+
"cds": {
238+
"requires": {
239+
...
240+
"change-tracking": {
241+
"preserveDeletes": true
242+
}
243+
...
244+
}
245+
}
246+
...
247+
```
248+
> [!IMPORTANT]
249+
> Preserving the change logs of deleted data can have a significant impact on the size of the change logging table, since now such data also survives automated data retention runs.
250+
> You must implement an own **data retention strategy** for the change logging table in order to manage the size and performance of your database.
251+
218252
## Examples
219253

220254
This section describes modelling cases for further reference, from simple to complex, including the following:
221255

222-
- [Specify Object ID](#specify-object-id)
223-
- [Use Case 1: Annotate single field/multiple fields of associated table(s) as the Object ID](#use-case-1-annotate-single-fieldmultiple-fields-of-associated-tables-as-the-object-id)
224-
- [Use Case 2: Annotate single field/multiple fields of project customized types as the Object ID](#use-case-2-annotate-single-fieldmultiple-fields-of-project-customized-types-as-the-object-id)
225-
- [Use Case 3: Annotate chained associated entities from the current entity as the Object ID](#use-case-3-annotate-chained-associated-entities-from-the-current-entity-as-the-object-id)
226-
- [Tracing Changes](#tracing-changes)
227-
- [Use Case 1: Trace the changes of child nodes from the current entity and display the meaningful data from child nodes (composition relation)](#use-case-1-trace-the-changes-of-child-nodes-from-the-current-entity-and-display-the-meaningful-data-from-child-nodes-composition-relation)
228-
- [Use Case 2: Trace the changes of associated entities from the current entity and display the meaningful data from associated entities (association relation)](#use-case-2-trace-the-changes-of-associated-entities-from-the-current-entity-and-display-the-meaningful-data-from-associated-entities-association-relation)
229-
- [Use Case 3: Trace the changes of fields defined by project customized types and display the meaningful data](#use-case-3-trace-the-changes-of-fields-defined-by-project-customized-types-and-display-the-meaningful-data)
230-
- [Use Case 4: Trace the changes of chained associated entities from the current entity and display the meaningful data from associated entities (association relation)](#use-case-4-trace-the-changes-of-chained-associated-entities-from-the-current-entity-and-display-the-meaningful-data-from-associated-entities-association-relation)
231-
- [Use Case 5: Trace the changes of union entity and display the meaningful data](#use-case-5-trace-the-changes-of-union-entity-and-display-the-meaningful-data)
232-
- [Don'ts](#donts)
233-
- [Use Case 1: Don't trace changes for field(s) with `Association to many`](#use-case-1-dont-trace-changes-for-fields-with-association-to-many)
234-
- [Use Case 2: Don't trace changes for field(s) with *Unmanaged Association*](#use-case-2-dont-trace-changes-for-fields-with-unmanaged-association)
235-
- [Use Case 3: Don't trace changes for CUD on DB entity](#use-case-3-dont-trace-changes-for-cud-on-db-entity)
256+
- [Specify Object ID](#specify-object-id)
257+
- [Use Case 1: Annotate single field/multiple fields of associated table(s) as the Object ID](#use-case-1-annotate-single-fieldmultiple-fields-of-associated-tables-as-the-object-id)
258+
- [Use Case 2: Annotate single field/multiple fields of project customized types as the Object ID](#use-case-2-annotate-single-fieldmultiple-fields-of-project-customized-types-as-the-object-id)
259+
- [Use Case 3: Annotate chained associated entities from the current entity as the Object ID](#use-case-3-annotate-chained-associated-entities-from-the-current-entity-as-the-object-id)
260+
- [Tracing Changes](#tracing-changes)
261+
- [Use Case 1: Trace the changes of child nodes from the current entity and display the meaningful data from child nodes (composition relation)](#use-case-1-trace-the-changes-of-child-nodes-from-the-current-entity-and-display-the-meaningful-data-from-child-nodes-composition-relation)
262+
- [Use Case 2: Trace the changes of associated entities from the current entity and display the meaningful data from associated entities (association relation)](#use-case-2-trace-the-changes-of-associated-entities-from-the-current-entity-and-display-the-meaningful-data-from-associated-entities-association-relation)
263+
- [Use Case 3: Trace the changes of fields defined by project customized types and display the meaningful data](#use-case-3-trace-the-changes-of-fields-defined-by-project-customized-types-and-display-the-meaningful-data)
264+
- [Use Case 4: Trace the changes of chained associated entities from the current entity and display the meaningful data from associated entities (association relation)](#use-case-4-trace-the-changes-of-chained-associated-entities-from-the-current-entity-and-display-the-meaningful-data-from-associated-entities-association-relation)
265+
- [Use Case 5: Trace the changes of union entity and display the meaningful data](#use-case-5-trace-the-changes-of-union-entity-and-display-the-meaningful-data)
266+
- [Don&#39;ts](#donts)
267+
- [Use Case 1: Don&#39;t trace changes for field(s) with `Association to many`](#use-case-1-dont-trace-changes-for-fields-with-association-to-many)
268+
- [Use Case 2: Don&#39;t trace changes for field(s) with *Unmanaged Association*](#use-case-2-dont-trace-changes-for-fields-with-unmanaged-association)
269+
- [Use Case 3: Don&#39;t trace changes for CUD on DB entity](#use-case-3-dont-trace-changes-for-cud-on-db-entity)
236270

237271
### Specify Object ID
238272

0 commit comments

Comments
 (0)