Gathering detailed insights and metrics for @memberjunction/ng-data-context
Gathering detailed insights and metrics for @memberjunction/ng-data-context
Gathering detailed insights and metrics for @memberjunction/ng-data-context
Gathering detailed insights and metrics for @memberjunction/ng-data-context
npm install @memberjunction/ng-data-context
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Angular component package for displaying and editing MemberJunction Data Contexts - collections of data items from different sources that can be used together for analysis, reporting, or other data operations.
This package provides Angular components to display Data Contexts and their associated items in a clean, user-friendly interface. Data Contexts in MemberJunction are powerful constructs that allow users to group related data from various sources (SQL queries, views, entities, etc.) into a single logical unit.
1npm install @memberjunction/ng-data-context
1import { DataContextModule } from '@memberjunction/ng-data-context'; 2 3@NgModule({ 4 imports: [ 5 DataContextModule, 6 // other imports 7 ], 8 // ... 9}) 10export class YourModule { }
1<!-- Display a data context using its ID --> 2<mj-data-context 3 [dataContextId]="'your-data-context-id'" 4 [Provider]="customMetadataProvider"> 5</mj-data-context>
1<!-- Show data context in a dialog --> 2<mj-data-context-dialog 3 *ngIf="showDataContextDialog" 4 [dataContextId]="selectedDataContextId" 5 [Provider]="metadataProvider" 6 (dialogClosed)="showDataContextDialog = false"> 7</mj-data-context-dialog>
1import { Component } from '@angular/core'; 2import { IMetadataProvider, Metadata } from '@memberjunction/core'; 3 4@Component({ 5 selector: 'app-data-context-viewer', 6 template: ` 7 <div class="data-context-container"> 8 <h2>Data Context Viewer</h2> 9 10 <!-- Inline component usage --> 11 <mj-data-context 12 [dataContextId]="selectedDataContextId" 13 [Provider]="metadataProvider"> 14 </mj-data-context> 15 16 <!-- Dialog trigger button --> 17 <button (click)="showDialog()">View in Dialog</button> 18 19 <!-- Dialog component --> 20 <mj-data-context-dialog 21 *ngIf="isDialogVisible" 22 [dataContextId]="selectedDataContextId" 23 [Provider]="metadataProvider" 24 (dialogClosed)="onDialogClose()"> 25 </mj-data-context-dialog> 26 </div> 27 `, 28 styles: [` 29 .data-context-container { 30 padding: 20px; 31 } 32 `] 33}) 34export class DataContextViewerComponent { 35 isDialogVisible = false; 36 selectedDataContextId = '12345-67890-abcdef'; 37 metadataProvider: IMetadataProvider; 38 39 constructor() { 40 // Use the global metadata provider or inject your own 41 this.metadataProvider = Metadata.Provider; 42 } 43 44 showDialog(): void { 45 this.isDialogVisible = true; 46 } 47 48 onDialogClose(): void { 49 this.isDialogVisible = false; 50 // Additional cleanup or refresh logic here 51 } 52}
The main component for displaying a data context and its items.
Selector: mj-data-context
Input | Type | Required | Default | Description |
---|---|---|---|---|
dataContextId | string | Yes | - | The ID of the data context to display |
Provider | IMetadataProvider | null | No | Metadata.Provider | Custom metadata provider. If not provided, uses the global MemberJunction metadata provider |
Property | Type | Description |
---|---|---|
dataContextRecord | DataContextEntity | undefined | The loaded data context entity |
dataContextItems | any[] | Array of data context items |
showLoader | boolean | Loading state indicator |
Dialog wrapper component that displays the DataContextComponent in a Kendo dialog.
Selector: mj-data-context-dialog
Input | Type | Required | Default | Description |
---|---|---|---|---|
dataContextId | string | Yes | - | The ID of the data context to display |
Provider | IMetadataProvider | null | No | null | Custom metadata provider |
Output | Type | Description |
---|---|---|
dialogClosed | EventEmitter<void> | Emitted when the dialog is closed |
The NgModule that exports both components.
Exports:
DataContextComponent
DataContextDialogComponent
A data context in MemberJunction consists of:
Context Record (DataContextEntity
)
ID
: Unique identifierName
: Display nameDescription
: Detailed descriptionContext Items (Data Context Items
entity)
Type
: The type of data item (SQL, View, Query, Entity, Record)SQL
: Direct SQL query (if applicable)ViewID
: Reference to a viewQueryID
: Reference to a saved queryEntityID
: Reference to an entityRecordID
: Specific record referenceThe component uses Kendo Grid with the following features enabled:
The components use Kendo UI for Angular styling. You can override styles by targeting the component selectors:
1/* Custom styling example */ 2mj-data-context { 3 /* Your custom styles */ 4} 5 6.kendo-grid-container { 7 height: 500px; /* Adjust grid height */ 8}
@memberjunction/core
(v2.43.0): Core MemberJunction functionality@memberjunction/core-entities
(v2.43.0): Entity type definitions@memberjunction/global
(v2.43.0): Global utilitiestslib
(^2.3.0): TypeScript runtime helpers@angular/common
(18.0.2)@angular/core
(18.0.2)@progress/kendo-angular-grid
(16.2.0)@progress/kendo-angular-indicators
(16.2.0)@progress/kendo-angular-dialog
(imported via module)@progress/kendo-angular-buttons
(imported via module)This package integrates seamlessly with other MemberJunction packages:
RunView
for efficient data retrievalTo build this package individually:
1cd packages/Angular/Generic/data-context 2npm run build
The package uses Angular CLI's ngc
compiler for building the library.
The component includes built-in error handling:
LogError
functionProvider
if you need to override the global metadata providerdialogClosed
event to properly manage dialog stateISC
No vulnerabilities found.
No security vulnerabilities found.