Skip to content

feat: version directive, xComponent

Daniel Schmidt requested to merge instantnoodl/versioned-entity-changes into master

VersionedController

With the VersionedController you can automatically insert a history icon to form-fields. If you click on the icon a popup with the version history of only this field is shown.

// Init with array of referenceIds (can be a Observable<string[]>)
@state() _version = new VersionedController(this, [ this.studentID ]);
<cr-country-picker ${this._form.field('staatsangehoerigkeit')} ${this._version.field('staatsangehoerigkeit')}></cr-country-picker>

Icon on the right

image

History popup

image

Helper: Regex to add version directive to all form fields

Pattern:
\$\{this\._form\.field\(([^)]+)\)\}

Replace:
${this._form.field($1)}
${this.version.field($1)}

Other changes

  • added filterPatches attribute to x-entity-version-patch-list to filter which patches should be shown
  • added filterSinglePatches attribute to x-entity-version-patch-list to filter which single patches should be shown
  • added xComponent to templates
  • added x-entity-version-patch-field-detail that can be wrapped around any component to show a icon on the right when hovering
Edited by Daniel Schmidt

Merge request reports

Loading