imng-kendo-schematics 19.218.1 → 19.232.3

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 (30) hide show
  1. package/package.json +1 -1
  2. package/schematics/imng-crud/files/add.component.spec.ts.template +2 -1
  3. package/schematics/imng-crud/files/api.service.ts.template +2 -0
  4. package/schematics/imng-crud/files/base-entry.component.ts.template +4 -3
  5. package/schematics/imng-crud/files/crud.facade.spec.ts.template +2 -1
  6. package/schematics/imng-crud/files/crud.facade.ts.template +7 -10
  7. package/schematics/imng-crud/files/edit.component.spec.ts.template +2 -1
  8. package/schematics/imng-crud/schema.json +38 -35
  9. package/schematics/imng-list/files/list.component.html.template +8 -8
  10. package/schematics/imng-list/files/list.component.spec.ts.template +2 -1
  11. package/schematics/imng-list/files/list.component.ts.template +2 -1
  12. package/schematics/imng-list/files/list.facade.spec.ts.template +3 -1
  13. package/schematics/imng-list/files/list.facade.ts.template +2 -1
  14. package/schematics/imng-list/files/list.grid-state.ts.template +2 -1
  15. package/schematics/imng-list/schema.json +38 -35
  16. package/schematics/imng-module/files/+state/__singularizedName@dasherize__-crud.effects.ts.template +3 -3
  17. package/schematics/imng-module/files/+state/__singularizedName@dasherize__-list.effects.ts.template +2 -1
  18. package/schematics/imng-module/files/+state/__singularizedName@dasherize__.actions.ts.template +2 -1
  19. package/schematics/imng-module/files/+state/__singularizedName@dasherize__.feature.ts.template +8 -6
  20. package/schematics/imng-module/files/+state/index.ts.template +1 -2
  21. package/schematics/imng-module/files/__pluralizedName@dasherize__.module.ts.template +3 -1
  22. package/schematics/imng-module/schema.json +38 -34
  23. package/schematics/imng-sub-list/files/+state/__singularizedName@dasherize__.actions.ts.template +3 -1
  24. package/schematics/imng-sub-list/files/+state/__singularizedName@dasherize__.effects.ts.template +7 -7
  25. package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/api.service.ts.template +3 -3
  26. package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.component.html.template +12 -7
  27. package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.component.ts.template +4 -3
  28. package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.facade.ts.template +1 -2
  29. package/schematics/imng-sub-list/schema.json +42 -39
  30. package/schematics/shared/options.d.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imng-kendo-schematics",
3
- "version": "19.218.1",
3
+ "version": "19.232.3",
4
4
  "description": "Angular Schematics facilitating Angular, Kendo, NGRX and imng package integration",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -9,7 +9,8 @@ import { mockConsoleError<% if (hasDates || hasObjects) { %>, mockConsoleGroup,
9
9
  import { of } from 'rxjs';<% } %>
10
10
 
11
11
  import { <%= classify(name) %>AddComponent } from './add.component';
12
- import { <%= classify(name) %>CrudFacade } from './crud.facade';
12
+ import { <%= classify(name) %>CrudFacade } from './crud.facade';<% if (modelFolderLocation) { %>
13
+ import { I<%= classify(singularizedName) %>, createTest<%= classify(singularizedName) %> } from '<%= modelFolderLocation %>';<% } %>
13
14
 
14
15
  <% if (hasObjects) { %>export function createMock<%= classify(name) %>Facade() {
15
16
  return {
@@ -1,6 +1,8 @@
1
1
  import { Injectable } from '@angular/core';
2
2
  import { NrsrxBaseApiClientService } from 'imng-nrsrx-client-utils';
3
3
  import { environment } from '@env';
4
+ <% if (modelFolderLocation) { %>
5
+ import { I<%= classify(name) %>, <%= classify(name) %>Properties } from '<%= modelFolderLocation %>';<% } %>
4
6
 
5
7
  @Injectable({
6
8
  providedIn: 'root',
@@ -4,11 +4,12 @@ import { FormGroup } from '@angular/forms';
4
4
  import { BaseDataEntryComponent } from 'imng-kendo-data-entry';<% if (hasObjects) { %>
5
5
  import { BehaviorSubject, map, Observable, switchMap } from 'rxjs';<% } %>
6
6
 
7
- import { <%= classify(name) %>CrudFacade } from './crud.facade';
7
+ import { <%= classify(name) %>CrudFacade } from './crud.facade';<% if (modelFolderLocation) { %>
8
+ import { <%= classify(singularizedName) %>Properties, I<%= classify(singularizedName) %>Form, <%= classify(singularizedName) %>FormGroupFac, <% swaggerObjectProperties.forEach(function(swaggerProperty, i, arr){ %>I<%= classify(swaggerProperty.propertyTypeName) %><% if(arr.length != i + 1) {%>, <%} }); %> } from '<%= modelFolderLocation %>';<% } %>
8
9
 
9
- @Component({
10
+ @Component({
10
11
  template: '',
11
- standalone: false,
12
+ standalone: false,
12
13
  })
13
14
  export abstract class <%= classify(name) %>BaseEntryComponent extends BaseDataEntryComponent<<%= classify(name) %>CrudFacade>
14
15
  implements OnInit {
@@ -15,7 +15,8 @@ import { of } from 'rxjs';
15
15
 
16
16
  import { <%= camelize(pluralizedStoreName) %>Feature, <%= classify(singularizedStoreName) %>ListEffects, <%= classify(singularizedStoreName) %>CrudEffects } from '../+state';
17
17
  import { <%= classify(name) %>CrudFacade } from './crud.facade';
18
- import { <%= classify(name) %>ApiService } from './api.service';
18
+ import { <%= classify(name) %>ApiService } from './api.service';<% if (modelFolderLocation) { %>
19
+ import { createTest<%= classify(singularizedName) %> } from '<%= modelFolderLocation %>';<% } %>
19
20
  import { environment } from '@env';
20
21
 
21
22
  describe('<%= classify(name) %>CrudFacade', () => {
@@ -1,9 +1,10 @@
1
1
  import { Injectable, inject } from '@angular/core';
2
2
  import { Store } from '@ngrx/store';
3
- import { IDataEntryFacade, ModalStates } from 'imng-kendo-data-entry';<% if (hasObjects) { %>
3
+ import { IDataEntryFacade, ModalStates, isModalState } from 'imng-kendo-data-entry';<% if (hasObjects) { %>
4
4
  import { ODataState } from 'imng-kendo-odata';<% } %>
5
- import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(singularizedStoreName) %>ActionTypes } from '../+state';
6
- import { map } from 'rxjs';
5
+
6
+ import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(singularizedStoreName) %>ActionTypes } from '../+state';<% if (modelFolderLocation) { %>
7
+ import { I<%= classify(singularizedName) %>, <% swaggerObjectProperties.forEach(function(swaggerProperty, i, arr){ %>I<%= classify(swaggerProperty.name) %><% if(arr.length != i + 1) {%>, <%} }); %> } from '<%= modelFolderLocation %>';<% } %>
7
8
 
8
9
  @Injectable()
9
10
  export class <%= classify(name) %>CrudFacade implements IDataEntryFacade<I<%= classify(name) %>> {
@@ -11,13 +12,9 @@ export class <%= classify(name) %>CrudFacade implements IDataEntryFacade<I<%= cl
11
12
 
12
13
  loading$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectLoading);
13
14
  currentEntity$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectCurrent<%= classify(name) %>);
14
- currentModalState$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectCurrentModalState);
15
- isEditActive$ = this.currentModalState$.pipe(
16
- map((modalState) => modalState === ModalStates.EDIT),
17
- );
18
- isNewActive$ = this.currentModalState$.pipe(
19
- map((modalState) => modalState === ModalStates.ADD),
20
- );<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
15
+ currentModalState$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectCurrent<%= classify(singularizedName) %>ModalState);
16
+ isEditActive$ = isModalState(this, ModalStates.EDIT);
17
+ isNewActive$ = isModalState(this, ModalStates.ADD);<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
21
18
  <%= camelize(swaggerProperty.pluralizedName) %>$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.select<%= classify(swaggerProperty.pluralizedName) %>);<% }); %>
22
19
 
23
20
  public setCurrentEntity(item: I<%= classify(name) %>, modalState: string): void {
@@ -9,7 +9,8 @@ import { of } from 'rxjs';<% } %>
9
9
  import { mockConsoleError<% if (hasDates || hasObjects) { %>, mockConsoleGroup, mockConsoleWarn<% } %>, readFirst } from 'imng-ngrx-utils/testing';
10
10
  <% if (hasObjects) { %>import { createMock<%= classify(name) %>Facade } from './add.component.spec';<% } %>
11
11
  import { <%= classify(name) %>EditComponent } from './edit.component';
12
- import { <%= classify(name) %>CrudFacade } from './crud.facade';
12
+ import { <%= classify(name) %>CrudFacade } from './crud.facade';<% if (modelFolderLocation) { %>
13
+ import { I<%= classify(singularizedName) %>, createTest<%= classify(singularizedName) %> } from '<%= modelFolderLocation %>';<% } %>
13
14
 
14
15
  describe('<%= classify(name) %>EditComponent', () => {
15
16
  let component: <%= classify(name) %>EditComponent;
@@ -1,38 +1,41 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "imng-crud",
4
- "type": "object",
5
- "properties": {
6
- "name": {
7
- "type": "string",
8
- "description": "Entity name",
9
- "$default": {
10
- "$source": "argv",
11
- "index": 0
12
- }
13
- },
14
- "storeName": {
15
- "type": "string",
16
- "description": "NGRX Feature Store name"
17
- },
18
- "path": {
19
- "type": "string",
20
- "description": "Directory where you would like the output to go"
21
- },
22
- "openApiJsonUrl": {
23
- "type": "string",
24
- "description": "URL of swagger page"
25
- },
26
- "openApiJsonFileName": {
27
- "type": "string",
28
- "description": "Relative file name and path"
29
- },
30
- "appPrefix": {
31
- "type": "string",
32
- "default": "imng",
33
- "description": "Application selector prefix for components and directives."
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "imng-crud",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "description": "Entity name",
9
+ "$default": {
10
+ "$source": "argv",
11
+ "index": 0
34
12
  }
35
13
  },
36
- "required": ["name", "path"]
37
- }
38
-
14
+ "storeName": {
15
+ "type": "string",
16
+ "description": "NGRX Feature Store name"
17
+ },
18
+ "path": {
19
+ "type": "string",
20
+ "description": "Directory where you would like the output to go"
21
+ },
22
+ "openApiJsonUrl": {
23
+ "type": "string",
24
+ "description": "URL of OpenApi Json document"
25
+ },
26
+ "openApiJsonFileName": {
27
+ "type": "string",
28
+ "description": "Relative file name and path of OpenApi json document"
29
+ },
30
+ "appPrefix": {
31
+ "type": "string",
32
+ "default": "imng",
33
+ "description": "Application selector prefix for components and directives."
34
+ },
35
+ "modelFolderLocation": {
36
+ "type": "string",
37
+ "description": "Location of the model folder (relative to the generated component root)"
38
+ }
39
+ },
40
+ "required": ["name", "path"]
41
+ }
@@ -13,7 +13,7 @@
13
13
  <kendo-grid-column [width]="75">
14
14
  <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
15
15
  <kendo-menu title="Actions">
16
- <kendo-menu-item [svgIcon]="icons.menuIcon">
16
+ <kendo-menu-item [svgIcon]="icons.menu">
17
17
  <kendo-menu-item>
18
18
  <ng-template kendoMenuItemLinkTemplate>
19
19
  <button
@@ -22,7 +22,7 @@
22
22
  (click)="editItem(dataItem)"
23
23
  placement="left"
24
24
  tooltip="Edit">
25
- <span class="k-icon k-i-edit"></span>
25
+ <kendo-svgicon [icon]="icons.menu" size="xlarge"></kendo-svgicon>
26
26
  Edit
27
27
  </button>
28
28
  </ng-template>
@@ -35,7 +35,7 @@
35
35
  (click)="deleteItem(dataItem)"
36
36
  placement="left"
37
37
  tooltip="Delete">
38
- <span class="k-icon k-i-delete"></span>
38
+ <kendo-svgicon [icon]="icons.trash" size="xlarge"></kendo-svgicon>
39
39
  Delete
40
40
  </button>
41
41
  </ng-template>
@@ -51,11 +51,11 @@
51
51
  <%} else if (swaggerProperty.type === 'boolean') { %>
52
52
  <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
53
53
  <ng-template kendoGridCellTemplate let-dataItem>
54
- <div *ngIf="dataItem[props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>]">
55
- <span class="text-success font-weight-bolder h2" tooltip="<%= swaggerProperty.startCaseName %>">
56
- <span class="k-icon k-i-check-circle start-50" />
57
- </span>
58
- </div>
54
+ @if (dataItem[props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>]) {
55
+ <kendo-svgicon class="text-success font-weight-bolder h2" [icon]="icons.check" size="xlarge"></kendo-svgicon>
56
+ } @else {
57
+ <kendo-svgicon class="text-danger font-weight-bolder h2" [icon]="icons.cancel" size="xlarge"></kendo-svgicon>
58
+ }
59
59
  </ng-template>
60
60
  <%} else if (swaggerProperty.format === 'uuid') { %>
61
61
  <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
@@ -9,7 +9,8 @@ import { ModalStates } from 'imng-kendo-data-entry';
9
9
  import { <%= classify(singularizedName) %>ListComponent } from './list.component';
10
10
  import { <%= classify(singularizedName) %>ListFacade } from './list.facade';
11
11
  import { <%= classify(singularizedName) %>CrudFacade } from '../<%= dasherize(pluralizedName) %>-crud';
12
- import { <%= camelize(singularizedName) %>Routes } from '../<%= dasherize(pluralizedName) %>.routing';
12
+ import { <%= camelize(singularizedName) %>Routes } from '../<%= dasherize(pluralizedName) %>.routing';<% if (modelFolderLocation) { %>
13
+ import { createTest<%= classify(name) %> } from '<%= modelFolderLocation %>';<% } %>
13
14
 
14
15
  describe('<%= classify(singularizedName) %>ListComponent', () => {
15
16
  let component: <%= classify(singularizedName) %>ListComponent;
@@ -6,7 +6,8 @@ import { ModalStates } from 'imng-kendo-data-entry';
6
6
 
7
7
  import { <%= classify(singularizedName) %>ListFacade } from './list.facade';
8
8
  import { <%= classify(singularizedName) %>CrudFacade } from '../<%= dasherize(pluralizedName) %>-crud';
9
- import { <%= camelize(singularizedName) %>GridState } from './list.grid-state';
9
+ import { <%= camelize(singularizedName) %>GridState } from './list.grid-state';<% if (modelFolderLocation) { %>
10
+ import { I<%= classify(singularizedName) %>, <%= classify(singularizedName) %>Properties } from '<%= modelFolderLocation %>';<% } %>
10
11
 
11
12
  @Component({
12
13
  selector: '<%= appPrefix %>-<%= dasherize(singularizedName) %>-list',
@@ -9,7 +9,9 @@ import { testDeleteCurrentEntity } from 'imng-kendo-data-entry/testing';
9
9
  import { Observable, of } from 'rxjs';
10
10
 
11
11
  import { <%= camelize(pluralizedStoreName) %>Feature, <%= classify(singularizedStoreName) %>ListEffects, <%= classify(singularizedStoreName) %>CrudEffects } from '../+state';
12
- import { <%= classify(singularizedName) %>ListFacade } from './list.facade';
12
+ import * as <%= camelize(singularizedName) %>ActionTypes from '../+state/<%= dasherize(singularizedName) %>.actions';
13
+ import { <%= classify(singularizedName) %>ListFacade } from './list.facade';<% if (modelFolderLocation) { %>
14
+ import { createTest<%= classify(singularizedName) %> } from '<%= modelFolderLocation %>';<% } %>
13
15
  import { environment } from '@env';
14
16
 
15
17
  describe('<%= classify(singularizedName) %>ListFacade', () => {
@@ -4,7 +4,8 @@ import { IDataDeleteFacade } from 'imng-kendo-data-entry';
4
4
  import { IKendoODataGridFacade } from 'imng-kendo-grid-odata';
5
5
  import { ODataState } from 'imng-kendo-odata';
6
6
 
7
- import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(storeName) %>ActionTypes } from '../+state';
7
+ import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(storeName) %>ActionTypes } from '../+state';<% if (modelFolderLocation) { %>
8
+ import { I<%= classify(name) %> } from '<%= modelFolderLocation %>';<% } %>
8
9
 
9
10
  @Injectable()
10
11
  export class <%= classify(singularizedName) %>ListFacade implements IKendoODataGridFacade<I<%= classify(name) %>>, IDataDeleteFacade<I<%= classify(name) %>> {
@@ -1,4 +1,5 @@
1
- import { ODataState } from 'imng-kendo-odata';
1
+ import { ODataState } from 'imng-kendo-odata';<% if (modelFolderLocation) { %>
2
+ import { <%= classify(singularizedName) %>Properties, <% swaggerObjectProperties.forEach(function(swaggerProperty, i, arr){ %><%= classify(swaggerProperty.propertyTypeName) %>Properties<% if(arr.length != i + 1) {%>, <%} }); %> } from '<%= modelFolderLocation %>';<% } %>
2
3
 
3
4
  export const <%= camelize(singularizedName) %>GridState: ODataState = {
4
5
  take: 20,
@@ -1,38 +1,41 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "imng-list",
4
- "type": "object",
5
- "properties": {
6
- "name": {
7
- "type": "string",
8
- "description": "Entity name",
9
- "$default": {
10
- "$source": "argv",
11
- "index": 0
12
- }
13
- },
14
- "storeName": {
15
- "type": "string",
16
- "description": "NGRX Feature Store name"
17
- },
18
- "path": {
19
- "type": "string",
20
- "description": "Directory where you would like the output to go"
21
- },
22
- "openApiJsonUrl": {
23
- "type": "string",
24
- "description": "URL of swagger page"
25
- },
26
- "openApiJsonFileName": {
27
- "type": "string",
28
- "description": "Relative file name and path"
29
- },
30
- "appPrefix": {
31
- "type": "string",
32
- "default": "imng",
33
- "description": "Application selector prefix for components and directives."
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "imng-list",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "description": "Entity name",
9
+ "$default": {
10
+ "$source": "argv",
11
+ "index": 0
34
12
  }
35
13
  },
36
- "required": ["name", "path"]
37
- }
38
-
14
+ "storeName": {
15
+ "type": "string",
16
+ "description": "NGRX Feature Store name"
17
+ },
18
+ "path": {
19
+ "type": "string",
20
+ "description": "Directory where you would like the output to go"
21
+ },
22
+ "openApiJsonUrl": {
23
+ "type": "string",
24
+ "description": "URL of OpenApi json document"
25
+ },
26
+ "openApiJsonFileName": {
27
+ "type": "string",
28
+ "description": "Relative file name and path of OpenApi json document"
29
+ },
30
+ "appPrefix": {
31
+ "type": "string",
32
+ "default": "imng",
33
+ "description": "Application selector prefix for components and directives."
34
+ },
35
+ "modelFolderLocation": {
36
+ "type": "string",
37
+ "description": "Location of the model folder (relative to the generated component root)"
38
+ }
39
+ },
40
+ "required": ["name", "path"]
41
+ }
@@ -5,9 +5,9 @@ import { handleEffectError } from 'imng-ngrx-utils';
5
5
  import { map, switchMap } from 'rxjs/operators';
6
6
 
7
7
  import * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';
8
- <% if (openApiJsonUrl || openApiJsonFileName) { %>
9
- import { <%= classify(singularizedName) %>ApiService } from '../<%= dasherize(pluralizedName) %>-crud/api.service';
10
- <% } %>
8
+ <% if (openApiJsonUrl || openApiJsonFileName) { %>import { <%= classify(singularizedName) %>ApiService } from '../<%= dasherize(pluralizedName) %>-crud/api.service';
9
+ <% } %><% if (modelFolderLocation) { %>import { <% swaggerObjectProperties.forEach(function(swaggerProperty, i, arr){ %>I<%= classify(swaggerProperty.propertyTypeName) %><% if(arr.length != i + 1) {%>, <%} }); %> } from '<%= modelFolderLocation %>';<% } %>
10
+
11
11
  @Injectable()
12
12
  export class <%= classify(singularizedName) %>CrudEffects {
13
13
  private readonly actions$ = inject(Actions);
@@ -7,7 +7,8 @@ import { handleEffectError } from 'imng-ngrx-utils';
7
7
  import { map, switchMap } from 'rxjs/operators';
8
8
 
9
9
  import { <%= camelize(pluralizedStoreName) %>Feature } from './<%= dasherize(singularizedName) %>.feature';
10
- import * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';
10
+ import * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';<% if (modelFolderLocation) { %>
11
+ import { I<%= classify(name) %>, <%= classify(name) %>Properties } from '<%= modelFolderLocation %>';<% } %>
11
12
  import { environment } from '@env';
12
13
 
13
14
  @Injectable()
@@ -1,6 +1,7 @@
1
1
  import { createAction } from '@ngrx/store';
2
2
  import { ODataResult, ODataState } from 'imng-kendo-odata';
3
- import { createModalAction, createPayloadAction } from 'imng-ngrx-utils';
3
+ import { createModalAction, createPayloadAction } from 'imng-ngrx-utils';<% if (modelFolderLocation) { %>
4
+ import { I<%= classify(name) %>, <% swaggerObjectProperties.forEach(function(swaggerProperty, i, arr){ %>I<%= classify(swaggerProperty.propertyTypeName) %><% if(arr.length != i + 1) {%>, <%} }); %> } from '<%= modelFolderLocation %>';<% } %>
4
5
  <% if (openApiJsonUrl || openApiJsonFileName) { %>
5
6
  export const load<%= classify(pluralizedName) %>Request = createPayloadAction<ODataState>(
6
7
  '[<%= classify(pluralizedName) %>] Load <%= classify(pluralizedName) %> Request');
@@ -2,19 +2,21 @@ import { createReducer, on, createFeature } from '@ngrx/store';
2
2
  import { createKendoODataGridInitialState, getODataPagerSettings, KendoODataGridState } from 'imng-kendo-grid-odata';
3
3
  import { imngEffectError, imngEffectErrorReducer } from 'imng-ngrx-utils';
4
4
 
5
- import * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';
5
+ import * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';<% if (modelFolderLocation) { %>
6
+ import { I<%= classify(name) %>, <% swaggerObjectProperties.forEach(function(swaggerProperty, i, arr){ %>I<%= classify(swaggerProperty.propertyTypeName) %><% if(arr.length != i + 1) {%>, <%} }); %> } from '<%= modelFolderLocation %>';<% } %>
7
+
6
8
  export const <%= underscore(pluralizedName).toUpperCase() %>_FEATURE_KEY = '<%= camelize(pluralizedName) %>';
7
9
 
8
10
  export interface State extends KendoODataGridState<I<%= classify(singularizedName) %>> {
9
- current<%= classify(singularizedName) %>: I<%= classify(singularizedName) %> | undefined;<% if(openApiJsonUrl || openApiJsonFileName){ swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
10
- currentModalState: string | undefined;
11
+ current<%= classify(singularizedName) %>: I<%= classify(singularizedName) %> | undefined;
12
+ current<%= classify(singularizedName) %>ModalState: string | undefined;<% if(openApiJsonUrl || openApiJsonFileName){ swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
11
13
  <%= camelize(swaggerProperty.pluralizedName) %>: I<%= classify(swaggerProperty.propertyTypeName) %>[];<% })} %>
12
14
  }
13
15
 
14
16
  export const initialState: State = {
15
17
  ...createKendoODataGridInitialState(),
16
18
  current<%= classify(singularizedName) %>: undefined,
17
- currentModalState: undefined,<% if(openApiJsonUrl || openApiJsonFileName){ swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
19
+ current<%= classify(singularizedName) %>ModalState: undefined,<% if(openApiJsonUrl || openApiJsonFileName){ swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
18
20
  <%= camelize(swaggerProperty.pluralizedName) %>: [],<% })} %>
19
21
  loading: true,
20
22
  };
@@ -43,13 +45,13 @@ export const <%= camelize(pluralizedStoreName) %>Feature = createFeature({
43
45
  on(<%= camelize(singularizedName) %>ActionTypes.setCurrent<%= classify(singularizedName) %>,
44
46
  (state, { payload }) : State =>
45
47
  ({ ...state,
46
- currentModalState: payload.modalState,
48
+ current<%= classify(singularizedName) %>ModalState: payload.modalState,
47
49
  current<%= classify(singularizedName) %>: payload.entity })),
48
50
  on(<%= camelize(singularizedName) %>ActionTypes.clearCurrent<%= classify(singularizedName) %>,
49
51
  (state) : State => ({
50
52
  ...state,
51
53
  current<%= classify(singularizedName) %>: undefined,
52
- currentModalState: undefined,
54
+ current<%= classify(singularizedName) %>ModalState: undefined,
53
55
  })),
54
56
  on(<%= camelize(singularizedName) %>ActionTypes.save<%= classify(singularizedName) %>Request,
55
57
  <%= camelize(singularizedName) %>ActionTypes.update<%= classify(singularizedName) %>Request,
@@ -1,5 +1,4 @@
1
1
  export * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';
2
2
  export { <%= camelize(pluralizedStoreName) %>Feature } from './<%= dasherize(singularizedName) %>.feature';
3
3
  export { <%= classify(singularizedName) %>ListEffects } from './<%= dasherize(singularizedName) %>-list.effects';
4
- export { <%= classify(singularizedName) %>CrudEffects } from './<%= dasherize(singularizedName) %>-crud.effects';
5
- export { <%= camelize(singularizedName) %>Selectors } from './<%= dasherize(singularizedName) %>.selectors'
4
+ export { <%= classify(singularizedName) %>CrudEffects } from './<%= dasherize(singularizedName) %>-crud.effects';
@@ -4,10 +4,11 @@ import { ReactiveFormsModule } from '@angular/forms';
4
4
  import { StoreModule } from '@ngrx/store';
5
5
  import { EffectsModule } from '@ngrx/effects';
6
6
  import { GridModule, ExcelModule, PDFModule } from '@progress/kendo-angular-grid';
7
+ import { IconsModule } from '@progress/kendo-angular-icons';
7
8
  import { DialogModule } from '@progress/kendo-angular-dialog';<% if (hasDates) { %>
8
9
  import { DateInputsModule } from '@progress/kendo-angular-dateinputs';<% } %><% if (hasObjects) { %>
9
10
  import { DropDownsModule } from '@progress/kendo-angular-dropdowns';<% } %>
10
- import { MenusModule } from "@progress/kendo-angular-menu";
11
+ import { MenusModule } from '@progress/kendo-angular-menu';
11
12
  import { ImngKendoGridModule } from 'imng-kendo-grid';
12
13
  import { ImngKendoGridODataModule } from 'imng-kendo-grid-odata';
13
14
  import { ImngDataEntryDialogModule } from 'imng-kendo-data-entry';
@@ -27,6 +28,7 @@ import { <%= classify(singularizedName) %>AddComponent, <%= classify(singularize
27
28
  GridModule,
28
29
  ExcelModule,
29
30
  PDFModule,
31
+ IconsModule,
30
32
  DialogModule,<% if (hasDates) { %>
31
33
  DateInputsModule,<% } %><% if (hasObjects) { %>
32
34
  DropDownsModule,<% } %>
@@ -1,37 +1,41 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "imng-module",
4
- "type": "object",
5
- "properties": {
6
- "name": {
7
- "type": "string",
8
- "description": "Module name (should be singular)",
9
- "$default": {
10
- "$source": "argv",
11
- "index": 0
12
- }
13
- },
14
- "path": {
15
- "type": "string",
16
- "description": "Directory where you would like the output to go"
17
- },
18
- "openApiJsonUrl": {
19
- "type": "string",
20
- "description": "URL of swagger page"
21
- },
22
- "openApiJsonFileName": {
23
- "type": "string",
24
- "description": "Relative file name and path"
25
- },
26
- "storeName": {
27
- "type": "string",
28
- "description": "NGRX Feature Store name"
29
- },
30
- "appPrefix": {
31
- "type": "string",
32
- "default": "imng",
33
- "description": "Application selector prefix for components and directives."
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "imng-module",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "description": "Module name (should be singular)",
9
+ "$default": {
10
+ "$source": "argv",
11
+ "index": 0
34
12
  }
35
13
  },
36
- "required": ["name", "path"]
37
- }
14
+ "path": {
15
+ "type": "string",
16
+ "description": "Directory where you would like the output to go"
17
+ },
18
+ "openApiJsonUrl": {
19
+ "type": "string",
20
+ "description": "URL of OpenApi json document"
21
+ },
22
+ "openApiJsonFileName": {
23
+ "type": "string",
24
+ "description": "Relative file name and path of OpenApi json document"
25
+ },
26
+ "storeName": {
27
+ "type": "string",
28
+ "description": "NGRX Feature Store name"
29
+ },
30
+ "appPrefix": {
31
+ "type": "string",
32
+ "default": "imng",
33
+ "description": "Application selector prefix for components and directives."
34
+ },
35
+ "modelFolderLocation": {
36
+ "type": "string",
37
+ "description": "Location of the model folder (relative to the generated module root)"
38
+ }
39
+ },
40
+ "required": ["name", "path"]
41
+ }
@@ -1,5 +1,7 @@
1
1
  import { ODataResult, ODataState } from 'imng-kendo-odata';
2
- import { createPayloadAction } from 'imng-ngrx-utils';
2
+ import { createPayloadAction } from 'imng-ngrx-utils';<% if (modelFolderLocation) { %>
3
+ import { I<%= classify(name) %> } from '<%= modelFolderLocation %>';<% } %>
4
+
3
5
  <% if (openApiJsonUrl || openApiJsonFileName) { %>
4
6
  export const load<%= classify(pluralizedName) %>Request = createPayloadAction<{ <%= camelize(parentName) %>Id: string, odataState: ODataState; }>(
5
7
  '[<%= classify(pluralizedName) %>] Load <%= classify(pluralizedName) %> Request');
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { Store } from '@ngrx/store';
3
3
  import { createEffect, Actions, ofType, concatLatestFrom } from '@ngrx/effects';
4
4
  import { ODataService } from 'imng-kendo-odata';
@@ -13,12 +13,12 @@ import { environment } from '@env';
13
13
 
14
14
  @Injectable()
15
15
  export class <%= classify(singularizedName) %>Effects {
16
- constructor(
17
- private readonly actions$: Actions,
18
- private readonly odataService: ODataService,
19
- private readonly store: Store,
20
- private readonly apiService : <%= classify(singularizedName) %>ApiService,
21
- ) {}
16
+
17
+ private readonly actions$ = inject(Actions);
18
+ private readonly odataService = inject(ODataService);
19
+ private readonly store = inject(Store);
20
+ private readonly apiService = inject(<%= classify(singularizedName) %>ApiService);
21
+
22
22
  <% if (openApiJsonUrl || openApiJsonFileName) { %>
23
23
  load<%= classify(pluralizedName) %>Effect$ = createEffect(() => {
24
24
  return this.actions$.pipe(
@@ -1,4 +1,4 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { NrsrxBaseApiClientService } from 'imng-nrsrx-client-utils';
3
3
  import { HttpClient } from '@angular/common/http';
4
4
  import { environment } from '@env';
@@ -8,7 +8,7 @@ import { environment } from '@env';
8
8
  })
9
9
  export class <%= classify(singularizedName) %>ApiService extends NrsrxBaseApiClientService<I<%= classify(singularizedName) %>> {
10
10
  public override url = environment.webApiEndpoints.<%= camelize(pluralizedName) %>;
11
- constructor(http: HttpClient) {
12
- super(http);
11
+ constructor() {
12
+ super(inject(HttpClient));
13
13
  }
14
14
  }
@@ -10,20 +10,25 @@
10
10
  </div>
11
11
  </ng-template>
12
12
  <% swaggerProperties.forEach(function(swaggerProperty) {%><% if ((swaggerProperty.format === 'date-time' || swaggerProperty.format === 'date') && swaggerProperty.name.toLowerCase().endsWith('utc') ) { %>
13
- <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" format="{0:MM/dd/yy HH:mm}" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
13
+ <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" format="{0:MM/dd/yy HH:mm}" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
14
14
  <%} else if (swaggerProperty.format === 'date-time' || swaggerProperty.format === 'date') { %>
15
- <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" format="{0:MM/dd/yy}" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
15
+ <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" format="{0:MM/dd/yy}" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
16
16
  <%} else if (swaggerProperty.type === 'boolean') { %>
17
- <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
17
+ <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
18
18
  <ng-template kendoGridCellTemplate let-dataItem>
19
19
  <div *ngIf="dataItem.<%= underscore(swaggerProperty.name) %>">
20
20
  <span class="text-success font-weight-bolder h2" placement="left" tooltip="Active">
21
21
  <span class="k-icon k-i-check-circle"></span>
22
22
  </span>
23
23
  </div>
24
+ @if (dataItem[props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>]) {
25
+ <kendo-svgicon class="text-success font-weight-bolder h2" [icon]="icons.check" size="xlarge"></kendo-svgicon>
26
+ } @else {
27
+ <kendo-svgicon class="text-danger font-weight-bolder h2" [icon]="icons.cancel" size="xlarge"></kendo-svgicon>
28
+ }
24
29
  </ng-template>
25
30
  <%} else if (swaggerProperty.format === 'uuid') { %>
26
- <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
31
+ <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
27
32
  <ng-template kendoGridCellTemplate let-dataItem>
28
33
  <imng-kendo-copy
29
34
  [displayValue]="dataItem[props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>] | slice:0:5"
@@ -38,7 +43,7 @@
38
43
  [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>"
39
44
  [width]="100"
40
45
  title="<%= swaggerProperty.startCaseName %>"
41
- filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
46
+ filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
42
47
  <ng-template kendoGridFilterMenuTemplate let-column="column">
43
48
  <imng-multi-select-filter
44
49
  [isPrimitive]="false"
@@ -54,12 +59,12 @@
54
59
  <%} else if (swaggerProperty.htmlInputType === 'object') { %>
55
60
  <kendo-grid-column
56
61
  [field]="getRelatedField(props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>, <%= camelize(swaggerProperty.name) %>Props.<%= swaggerProperty.firstProperty?.snakeCaseName.toUpperCase() %>)"
57
- [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
62
+ [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
58
63
  <ng-template kendoGridCellTemplate let-dataItem>
59
64
  {{ getRelatedValue(dataItem, props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>, <%= camelize(swaggerProperty.name) %>Props.<%= swaggerProperty.firstProperty?.snakeCaseName.toUpperCase() %>) }}
60
65
  </ng-template>
61
66
  <%} else { %>
62
- <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>>
67
+ <kendo-grid-column [field]="props.<%= swaggerProperty.snakeCaseName.toUpperCase() %>" [width]="100" title="<%= swaggerProperty.startCaseName %>" filter="<%= swaggerProperty.filterExpression %>" [hidden]="<%= swaggerProperty.hidden %>">
63
68
  <%} %> <ng-template class="header" kendoGridHeaderTemplate let-column>
64
69
  <span class="h6"><%= swaggerProperty.startCaseName %></span>
65
70
  </ng-template>
@@ -1,4 +1,4 @@
1
- import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
1
+ import { Component, ChangeDetectionStrategy, Input, inject } from '@angular/core';
2
2
  import { KendoODataBasedComponent } from 'imng-kendo-grid-odata';
3
3
  import { ODataState } from 'imng-kendo-odata';
4
4
  import { <%= classify(singularizedName) %>ListFacade } from './list.facade';
@@ -10,6 +10,7 @@ import { <%= camelize(singularizedName) %>GridState } from './list.grid-state';
10
10
  styleUrls: ['./list.component.scss'],
11
11
  providers: [<%= classify(singularizedName) %>ListFacade],
12
12
  changeDetection: ChangeDetectionStrategy.OnPush,
13
+ standalone: false,
13
14
  })
14
15
  export class <%= classify(singularizedName) %>ListComponent extends KendoODataBasedComponent<I<%= classify(singularizedName) %>, <%= classify(singularizedName) %>ListFacade> {
15
16
  public readonly props = <%= classify(singularizedName) %>Properties;<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
@@ -17,8 +18,8 @@ export class <%= classify(singularizedName) %>ListComponent extends KendoODataBa
17
18
  public readonly <%= camelize(swaggerProperty.pluralizedPropertyTypeName) %> = <%= camelize(swaggerProperty.singularizedPropertyTypeName) %>Values;<% }) %>
18
19
  public currentItem: I<%= classify(singularizedName) %> | undefined;
19
20
 
20
- constructor(facade: <%= classify(singularizedName) %>ListFacade) {
21
- super(facade, <%= camelize(singularizedName) %>GridState);
21
+ constructor() {
22
+ super(inject(<%= classify(singularizedName) %>ListFacade), <%= camelize(singularizedName) %>GridState);
22
23
  }
23
24
 
24
25
  @Input()
@@ -13,6 +13,7 @@ import { <%= camelize(singularizedName) %>Selectors } from '../+state/<%= dasher
13
13
  @Injectable()
14
14
  export class <%= classify(singularizedName) %>ListFacade implements IKendoODataGridFacade<I<%= classify(name) %>>, IDataDeleteFacade<I<%= classify(name) %>> {
15
15
  private _parentGridId = '';
16
+ private readonly store = inject(Store);
16
17
  public parentGrid$ = new BehaviorSubject<string>('');
17
18
  public get parentGridId() {
18
19
  return this._parentGridId;
@@ -33,8 +34,6 @@ export class <%= classify(singularizedName) %>ListFacade implements IKendoODataG
33
34
  switchMap(x =>
34
35
  this.store.select(<%= camelize(singularizedName) %>Selectors.selectODataState$(x))));
35
36
 
36
- constructor(private readonly store: Store) {}
37
-
38
37
  public loadEntities(odataState: ODataState): void {
39
38
  odataState = applyFilter({ ...odataState },
40
39
  { field: <%= classify(singularizedName) %>Properties.<%= classify(snakeCasedParentName) %>_ID, operator: 'eq', value: this.parentGridId });
@@ -1,42 +1,45 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "imng-sub-list",
4
- "type": "object",
5
- "properties": {
6
- "name": {
7
- "type": "string",
8
- "description": "Entity name",
9
- "$default": {
10
- "$source": "argv",
11
- "index": 0
12
- }
13
- },
14
- "parentName": {
15
- "type": "string",
16
- "description": "Parent Entity name"
17
- },
18
- "storeName": {
19
- "type": "string",
20
- "description": "NGRX Feature Store name"
21
- },
22
- "path": {
23
- "type": "string",
24
- "description": "Directory where you would like the output to go"
25
- },
26
- "openApiJsonUrl": {
27
- "type": "string",
28
- "description": "URL of swagger page"
29
- },
30
- "openApiJsonFileName": {
31
- "type": "string",
32
- "description": "Relative file name and path"
33
- },
34
- "appPrefix": {
35
- "type": "string",
36
- "default": "imng",
37
- "description": "Application selector prefix for components and directives."
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "imng-sub-list",
4
+ "type": "object",
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "description": "Entity name",
9
+ "$default": {
10
+ "$source": "argv",
11
+ "index": 0
38
12
  }
39
13
  },
40
- "required": ["name", "path"]
41
- }
42
-
14
+ "parentName": {
15
+ "type": "string",
16
+ "description": "Parent Entity name"
17
+ },
18
+ "storeName": {
19
+ "type": "string",
20
+ "description": "NGRX Feature Store name"
21
+ },
22
+ "path": {
23
+ "type": "string",
24
+ "description": "Directory where you would like the output to go"
25
+ },
26
+ "openApiJsonUrl": {
27
+ "type": "string",
28
+ "description": "URL of OpenApi Json document"
29
+ },
30
+ "openApiJsonFileName": {
31
+ "type": "string",
32
+ "description": "Relative file name and path of OpenApi json document"
33
+ },
34
+ "appPrefix": {
35
+ "type": "string",
36
+ "default": "imng",
37
+ "description": "Application selector prefix for components and directives."
38
+ },
39
+ "modelFolderLocation": {
40
+ "type": "string",
41
+ "description": "Location of the model folder (relative to the generated component root)"
42
+ }
43
+ },
44
+ "required": ["name", "path"]
45
+ }
@@ -15,6 +15,8 @@ export interface IOptions {
15
15
  /** Optional: File path of local OpenApi JSON document (If this is not provided, then you must specify openApiJsonUrl) */
16
16
  openApiJsonFileName?: string;
17
17
  /** Optional: This is the property that will used for initial sorting on list and auto focus on crud schematics */
18
+ modelFolderLocation?: string;
19
+ /** Optional: Location of model files relative to the module/component generated root */
18
20
  firstProperty?: PropertyInfo;
19
21
  /** Ignore: This is for internal schematic use only */
20
22
  swaggerProperties: PropertyInfo[];