@memberjunction/ng-versions 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @memberjunction/ng-versions
|
|
2
|
+
|
|
3
|
+
Angular components for viewing entity record version history in MemberJunction applications. Provides a slide panel, label creation, label detail, and record micro-view for working with the built-in Record Changes system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @memberjunction/ng-versions
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
MemberJunction includes built-in version control ("Record Changes") that tracks all changes to entity records. This package provides Angular components for browsing that history: a slide panel for navigating versions, a micro-view for previewing snapshots, and label management for bookmarking specific versions.
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
flowchart TD
|
|
17
|
+
subgraph Panel["SlidePanelComponent"]
|
|
18
|
+
A["Version List"]
|
|
19
|
+
A --> B["RecordMicroViewComponent"]
|
|
20
|
+
A --> C["LabelCreateComponent"]
|
|
21
|
+
A --> D["LabelDetailComponent"]
|
|
22
|
+
end
|
|
23
|
+
subgraph Data["MJ Record Changes"]
|
|
24
|
+
E["RecordChange Entity"]
|
|
25
|
+
F["Field-level Diffs"]
|
|
26
|
+
G["Version Labels"]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
E --> Panel
|
|
30
|
+
F --> B
|
|
31
|
+
G --> C
|
|
32
|
+
G --> D
|
|
33
|
+
|
|
34
|
+
style Panel fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
35
|
+
style Data fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Module Import
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { VersionsModule } from '@memberjunction/ng-versions';
|
|
44
|
+
|
|
45
|
+
@NgModule({
|
|
46
|
+
imports: [VersionsModule]
|
|
47
|
+
})
|
|
48
|
+
export class YourModule {}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Slide Panel
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<mj-slide-panel
|
|
55
|
+
[EntityName]="'Products'"
|
|
56
|
+
[RecordID]="productId"
|
|
57
|
+
[Mode]="'slide'"
|
|
58
|
+
[Visible]="showVersionPanel">
|
|
59
|
+
</mj-slide-panel>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Record Micro View
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<mj-record-micro-view
|
|
66
|
+
[Data]="microViewData">
|
|
67
|
+
</mj-record-micro-view>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Label Creation
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<mj-label-create
|
|
74
|
+
[EntityName]="'Products'"
|
|
75
|
+
[RecordID]="productId"
|
|
76
|
+
[RecordChangeID]="selectedChangeId"
|
|
77
|
+
(LabelCreated)="onLabelCreated($event)">
|
|
78
|
+
</mj-label-create>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Components
|
|
82
|
+
|
|
83
|
+
| Component | Selector | Purpose |
|
|
84
|
+
|-----------|----------|---------|
|
|
85
|
+
| `SlidePanelComponent` | `mj-slide-panel` | Container for version history navigation |
|
|
86
|
+
| `RecordMicroViewComponent` | `mj-record-micro-view` | Compact snapshot preview with field diffs |
|
|
87
|
+
| `LabelCreateComponent` | `mj-label-create` | Create a named label/bookmark for a version |
|
|
88
|
+
| `LabelDetailComponent` | `mj-label-detail` | View and manage label details |
|
|
89
|
+
|
|
90
|
+
## Exported Types
|
|
91
|
+
|
|
92
|
+
### MicroViewData
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
interface MicroViewData {
|
|
96
|
+
EntityName: string;
|
|
97
|
+
EntityID: string;
|
|
98
|
+
RecordID: string;
|
|
99
|
+
RecordChangeID: string;
|
|
100
|
+
FullRecordJSON: Record<string, unknown> | null;
|
|
101
|
+
FieldDiffs: FieldChangeView[] | null;
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### FieldChangeView
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
interface FieldChangeView {
|
|
109
|
+
FieldName: string;
|
|
110
|
+
OldValue: string;
|
|
111
|
+
NewValue: string;
|
|
112
|
+
ChangeType: 'Added' | 'Modified' | 'Removed';
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### SlidePanelMode
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
type SlidePanelMode = 'slide' | 'dialog';
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Dependencies
|
|
123
|
+
|
|
124
|
+
- [@memberjunction/core](../../MJCore/README.md) -- Metadata, RunView
|
|
125
|
+
- [@memberjunction/core-entities](../../MJCoreEntities/README.md) -- RecordChange entities
|
|
126
|
+
- [@memberjunction/graphql-dataprovider](../../GraphQLDataProvider/README.md) -- Data provider
|
|
127
|
+
- [@memberjunction/ng-shared-generic](../shared/README.md) -- Loading component
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-versions",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "MemberJunction: Angular Version History Components - Label creation, detail viewing, and slide panel",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@angular/forms": "21.1.3"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@memberjunction/core": "4.
|
|
28
|
-
"@memberjunction/core-entities": "4.
|
|
29
|
-
"@memberjunction/global": "4.
|
|
30
|
-
"@memberjunction/graphql-dataprovider": "4.
|
|
31
|
-
"@memberjunction/ng-shared-generic": "4.
|
|
27
|
+
"@memberjunction/core": "4.1.0",
|
|
28
|
+
"@memberjunction/core-entities": "4.1.0",
|
|
29
|
+
"@memberjunction/global": "4.1.0",
|
|
30
|
+
"@memberjunction/graphql-dataprovider": "4.1.0",
|
|
31
|
+
"@memberjunction/ng-shared-generic": "4.1.0",
|
|
32
32
|
"rxjs": "^7.8.2",
|
|
33
33
|
"tslib": "^2.8.1"
|
|
34
34
|
},
|