@memberjunction/ng-user-view-properties 2.32.2 → 2.34.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.
Files changed (2) hide show
  1. package/README.md +169 -0
  2. package/package.json +8 -8
package/README.md ADDED
@@ -0,0 +1,169 @@
1
+ # @memberjunction/ng-user-view-properties
2
+
3
+ A comprehensive Angular dialog component for viewing and editing User View properties within the MemberJunction framework. This component enables users to configure how entity data is displayed in grids, including field visibility, sorting, filtering, and sharing options.
4
+
5
+ ## Features
6
+
7
+ - **Complete View Configuration**: Modify all aspects of a user view through a tabbed interface
8
+ - **Field Management**: Drag-and-drop reordering of fields with visibility toggles
9
+ - **Advanced Filtering**: Supports both standard filters and AI-powered "Smart Filters"
10
+ - **Custom Sorting**: Multi-field sorting with direction controls
11
+ - **Sharing Controls**: Permission management for user views
12
+ - **Smart Filter Integration**: Reference other views and lists in Smart Filter prompts
13
+ - **Advanced Options**: Direct SQL WHERE clause editing for complex queries
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @memberjunction/ng-user-view-properties
19
+ ```
20
+
21
+ ## Requirements
22
+
23
+ This library has the following peer dependencies:
24
+ - Angular 18.x
25
+ - @memberjunction/core
26
+ - @memberjunction/global
27
+ - @memberjunction/core-entities
28
+ - Multiple Kendo UI Angular components (Dialog, Layout, Inputs, etc.)
29
+
30
+ ## Usage
31
+
32
+ ### Module Import
33
+
34
+ ```typescript
35
+ import { UserViewPropertiesDialogModule } from '@memberjunction/ng-user-view-properties';
36
+
37
+ @NgModule({
38
+ imports: [
39
+ // ... other imports
40
+ UserViewPropertiesDialogModule
41
+ ]
42
+ })
43
+ export class YourModule { }
44
+ ```
45
+
46
+ ### Basic Usage
47
+
48
+ ```html
49
+ <mj-user-view-properties-dialog
50
+ [ViewID]="currentViewId"
51
+ (dialogClosed)="onViewPropertiesClosed($event)">
52
+ </mj-user-view-properties-dialog>
53
+ ```
54
+
55
+ ### Creating a New View
56
+
57
+ ```typescript
58
+ @ViewChild('viewProperties') viewPropertiesDialog: UserViewPropertiesDialogComponent;
59
+
60
+ createNewView() {
61
+ this.viewPropertiesDialog.CreateView('YourEntityName');
62
+ }
63
+ ```
64
+
65
+ ### Creating a View in a Specific Category
66
+
67
+ ```typescript
68
+ createCategorizedView() {
69
+ this.viewPropertiesDialog.CreateViewInCategory('YourEntityName', 'categoryId');
70
+ }
71
+ ```
72
+
73
+ ## API Reference
74
+
75
+ ### Inputs
76
+
77
+ | Input | Type | Description |
78
+ |-----------------------|--------------------|--------------------------------------------------------|
79
+ | ViewID | string \| undefined | ID of the view to edit or undefined for a new view |
80
+ | EntityName | string \| undefined | Entity name when creating a new view |
81
+ | CategoryID | string \| null | Optional category ID for the view |
82
+ | ShowPropertiesButton | boolean | Whether to show the properties button (default: true) |
83
+
84
+ ### Outputs
85
+
86
+ | Output | Type | Description |
87
+ |---------------|----------------|-----------------------------------------------------------|
88
+ | dialogClosed | EventEmitter | Emits when dialog is closed with save status and view data |
89
+
90
+ ### Methods
91
+
92
+ | Method | Parameters | Returns | Description |
93
+ |------------------------|----------------------------------|-----------|------------------------------------------------|
94
+ | CreateView | entityName: string | void | Opens dialog to create a new view |
95
+ | CreateViewInCategory | entityName: string, viewCategoryID: string | void | Creates a view in a specific category |
96
+ | Open | ViewID?: string | void | Opens the dialog for editing an existing view |
97
+ | saveProperties | - | Promise<void> | Saves the current view properties |
98
+
99
+ ## Component Structure
100
+
101
+ The dialog consists of six tabbed sections:
102
+
103
+ 1. **General**: Basic view properties (name and description)
104
+ 2. **Fields**: Configure visible fields and their order
105
+ 3. **Filters**: Set up filtering using either Smart Filters or standard filters
106
+ 4. **Sorting**: Define multi-field sorting with direction control
107
+ 5. **Sharing**: Manage view permissions using ResourcePermissions
108
+ 6. **Advanced**: Access to SQL WHERE clauses and Smart Filter explanations
109
+
110
+ ## Examples
111
+
112
+ ### Complete Integration Example
113
+
114
+ ```typescript
115
+ import { Component, ViewChild } from '@angular/core';
116
+ import { UserViewPropertiesDialogComponent } from '@memberjunction/ng-user-view-properties';
117
+ import { Metadata } from '@memberjunction/core';
118
+
119
+ @Component({
120
+ selector: 'app-my-component',
121
+ template: `
122
+ <button kendoButton (click)="editViewProperties()">Edit View</button>
123
+ <button kendoButton (click)="createNewView()">New View</button>
124
+
125
+ <mj-user-view-properties-dialog
126
+ #viewProperties
127
+ [ViewID]="selectedViewId"
128
+ (dialogClosed)="onViewPropertiesClosed($event)">
129
+ </mj-user-view-properties-dialog>
130
+ `
131
+ })
132
+ export class MyComponent {
133
+ @ViewChild('viewProperties') viewPropertiesDialog: UserViewPropertiesDialogComponent;
134
+ selectedViewId: string = 'some-view-id';
135
+
136
+ editViewProperties() {
137
+ this.viewPropertiesDialog.Open(this.selectedViewId);
138
+ }
139
+
140
+ createNewView() {
141
+ this.viewPropertiesDialog.CreateView('Contacts');
142
+ }
143
+
144
+ onViewPropertiesClosed(event: any) {
145
+ if (event.Saved) {
146
+ console.log('View saved:', event.ViewEntity);
147
+ // Refresh your view or data
148
+ }
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### Handling Smart Filters
154
+
155
+ Smart Filters allow users to describe filtering requirements in natural language:
156
+
157
+ ```html
158
+ <textarea
159
+ placeholder="Show me all contacts who have been inactive for more than 30 days and have a status of 'Lead'"
160
+ [(ngModel)]="smartFilterPrompt">
161
+ </textarea>
162
+ ```
163
+
164
+ ## Notes
165
+
166
+ - The component integrates with the MemberJunction metadata system for field information
167
+ - Permissions are automatically enforced via the `UserCanEdit` property
168
+ - The dialog automatically adjusts for window resizing
169
+ - Changes are not applied until the user clicks Save
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-user-view-properties",
3
- "version": "2.32.2",
3
+ "version": "2.34.0",
4
4
  "description": "MemberJunction: Angular UI Dialog Component to View/Edit User View Properties",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -24,13 +24,13 @@
24
24
  "@angular/forms": "18.0.2"
25
25
  },
26
26
  "dependencies": {
27
- "@memberjunction/global": "2.32.2",
28
- "@memberjunction/core": "2.32.2",
29
- "@memberjunction/core-entities": "2.32.2",
30
- "@memberjunction/ng-base-forms": "2.32.2",
31
- "@memberjunction/ng-find-record": "2.32.2",
32
- "@memberjunction/ng-resource-permissions": "2.32.2",
33
- "@memberjunction/ng-shared": "2.32.2",
27
+ "@memberjunction/global": "2.34.0",
28
+ "@memberjunction/core": "2.34.0",
29
+ "@memberjunction/core-entities": "2.34.0",
30
+ "@memberjunction/ng-base-forms": "2.34.0",
31
+ "@memberjunction/ng-find-record": "2.34.0",
32
+ "@memberjunction/ng-resource-permissions": "2.34.0",
33
+ "@memberjunction/ng-shared": "2.34.0",
34
34
  "@progress/kendo-angular-sortable": "16.2.0",
35
35
  "@progress/kendo-angular-dialog": "16.2.0",
36
36
  "@progress/kendo-angular-layout": "16.2.0",