@memberjunction/ng-versions 0.0.1 → 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 +125 -43
- package/dist/lib/label-create/label-create.component.d.ts +71 -0
- package/dist/lib/label-create/label-create.component.d.ts.map +1 -0
- package/dist/lib/label-create/label-create.component.js +776 -0
- package/dist/lib/label-create/label-create.component.js.map +1 -0
- package/dist/lib/label-detail/label-detail.component.d.ts +186 -0
- package/dist/lib/label-detail/label-detail.component.d.ts.map +1 -0
- package/dist/lib/label-detail/label-detail.component.js +2076 -0
- package/dist/lib/label-detail/label-detail.component.js.map +1 -0
- package/dist/lib/panel/slide-panel.component.d.ts +35 -0
- package/dist/lib/panel/slide-panel.component.d.ts.map +1 -0
- package/dist/lib/panel/slide-panel.component.js +199 -0
- package/dist/lib/panel/slide-panel.component.js.map +1 -0
- package/dist/lib/record-micro-view/record-micro-view.component.d.ts +114 -0
- package/dist/lib/record-micro-view/record-micro-view.component.d.ts.map +1 -0
- package/dist/lib/record-micro-view/record-micro-view.component.js +824 -0
- package/dist/lib/record-micro-view/record-micro-view.component.js.map +1 -0
- package/dist/lib/types.d.ts +22 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +5 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/versions.module.d.ts +14 -0
- package/dist/lib/versions.module.d.ts.map +1 -0
- package/dist/lib/versions.module.js +48 -0
- package/dist/lib/versions.module.js.map +1 -0
- package/dist/public-api.d.ts +7 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +7 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +37 -7
package/README.md
CHANGED
|
@@ -1,45 +1,127 @@
|
|
|
1
1
|
# @memberjunction/ng-versions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { EntityInfo } from '@memberjunction/core';
|
|
3
|
+
import { CreateVersionLabelProgress } from '@memberjunction/graphql-dataprovider';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface RecordOption {
|
|
6
|
+
ID: string;
|
|
7
|
+
DisplayName: string;
|
|
8
|
+
Selected: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class MjLabelCreateComponent implements OnInit {
|
|
11
|
+
private cdr;
|
|
12
|
+
/**
|
|
13
|
+
* When set, skips the entity picker step and pre-selects this entity.
|
|
14
|
+
*/
|
|
15
|
+
PreselectedEntity: EntityInfo | null;
|
|
16
|
+
/**
|
|
17
|
+
* When set along with PreselectedEntity, auto-selects these record IDs
|
|
18
|
+
* and skips directly to the details step.
|
|
19
|
+
*/
|
|
20
|
+
PreselectedRecordIds: string[];
|
|
21
|
+
/** Emitted when labels are successfully created. */
|
|
22
|
+
Created: EventEmitter<{
|
|
23
|
+
LabelCount: number;
|
|
24
|
+
ItemCount: number;
|
|
25
|
+
}>;
|
|
26
|
+
/** Emitted when the user cancels. */
|
|
27
|
+
Cancel: EventEmitter<void>;
|
|
28
|
+
CreateStep: 'entity' | 'records' | 'details' | 'creating' | 'done';
|
|
29
|
+
EntitySearchText: string;
|
|
30
|
+
FilteredEntities: EntityInfo[];
|
|
31
|
+
SelectedEntity: EntityInfo | null;
|
|
32
|
+
RecordSearchText: string;
|
|
33
|
+
AvailableRecords: RecordOption[];
|
|
34
|
+
FilteredRecords: RecordOption[];
|
|
35
|
+
IsLoadingRecords: boolean;
|
|
36
|
+
LabelName: string;
|
|
37
|
+
LabelDescription: string;
|
|
38
|
+
IsCreatingLabel: boolean;
|
|
39
|
+
CreateError: string;
|
|
40
|
+
CreatedLabelCount: number;
|
|
41
|
+
CreatedItemCount: number;
|
|
42
|
+
CreateProgress: CreateVersionLabelProgress | null;
|
|
43
|
+
private metadata;
|
|
44
|
+
constructor(cdr: ChangeDetectorRef);
|
|
45
|
+
ngOnInit(): void;
|
|
46
|
+
private skipToDetailsWithPreselection;
|
|
47
|
+
private preselectRecordsByIds;
|
|
48
|
+
OnEntitySearchChange(text: string): void;
|
|
49
|
+
SelectEntity(entity: EntityInfo): void;
|
|
50
|
+
OnRecordSearchChange(text: string): void;
|
|
51
|
+
ToggleRecordSelection(record: RecordOption): void;
|
|
52
|
+
SelectAllRecords(): void;
|
|
53
|
+
DeselectAllRecords(): void;
|
|
54
|
+
get SelectedRecordCount(): number;
|
|
55
|
+
GoToDetailsStep(): void;
|
|
56
|
+
GoBackToRecords(): void;
|
|
57
|
+
GoBackToEntity(): void;
|
|
58
|
+
CreateLabels(): Promise<void>;
|
|
59
|
+
FinishCreate(): void;
|
|
60
|
+
OnCancel(): void;
|
|
61
|
+
private createSingleLabel;
|
|
62
|
+
private createGroupedLabels;
|
|
63
|
+
private loadEntityRecords;
|
|
64
|
+
private findNameField;
|
|
65
|
+
private getTrackableEntities;
|
|
66
|
+
private suggestLabelName;
|
|
67
|
+
private resetCreateDialog;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MjLabelCreateComponent, never>;
|
|
69
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MjLabelCreateComponent, "mj-label-create", never, { "PreselectedEntity": { "alias": "PreselectedEntity"; "required": false; }; "PreselectedRecordIds": { "alias": "PreselectedRecordIds"; "required": false; }; }, { "Created": "Created"; "Cancel": "Cancel"; }, never, never, false, never>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=label-create.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-create.component.d.ts","sourceRoot":"","sources":["../../../src/lib/label-create/label-create.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,MAAM,EACN,iBAAiB,EAEpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAGH,0BAA0B,EAC7B,MAAM,sCAAsC,CAAC;;AAE9C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,qBAOa,sBAAuB,YAAW,MAAM;IA6Cr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