imng-kendo-schematics 19.178.2 → 19.178.4
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/package.json +1 -1
- package/schematics/imng-crud/files/api.service.ts.template +0 -4
- package/schematics/imng-crud/files/crud.facade.ts.template +3 -3
- package/schematics/imng-list/files/list.component.ts.template +5 -5
- package/schematics/imng-list/files/list.facade.ts.template +3 -3
- package/schematics/imng-module/files/+state/__singularizedName@dasherize__-crud.effects.ts.template +5 -6
- package/schematics/imng-module/files/+state/__singularizedName@dasherize__-list.effects.ts.template +5 -6
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { NrsrxBaseApiClientService } from 'imng-nrsrx-client-utils';
|
|
3
|
-
import { HttpClient } from '@angular/common/http';
|
|
4
3
|
import { environment } from '@env';
|
|
5
4
|
|
|
6
5
|
@Injectable({
|
|
@@ -12,7 +11,4 @@ export class <%= classify(name) %>ApiService extends NrsrxBaseApiClientService<I
|
|
|
12
11
|
public override dateOnlyPropertyNames = [<% swaggerProperties.filter(t => t.format === 'date').forEach(function (swaggerProperty, index, dateProperties) { %>
|
|
13
12
|
<%= classify(singularizedName) %>Properties.<%= swaggerProperty.snakeCaseName.toUpperCase() %><% if (index + 1 < dateProperties.length) { %>,<% }}) %>];
|
|
14
13
|
<% } %>
|
|
15
|
-
constructor(http: HttpClient) {
|
|
16
|
-
super(http);
|
|
17
|
-
}
|
|
18
14
|
}
|
|
@@ -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 { IDataEntryFacade } from 'imng-kendo-data-entry';<% if (hasObjects) { %>
|
|
4
4
|
import { ODataState } from 'imng-kendo-odata';<% } %>
|
|
@@ -6,14 +6,14 @@ import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(singularizedS
|
|
|
6
6
|
|
|
7
7
|
@Injectable()
|
|
8
8
|
export class <%= classify(name) %>CrudFacade implements IDataEntryFacade<I<%= classify(name) %>> {
|
|
9
|
+
private readonly store = inject(Store);
|
|
10
|
+
|
|
9
11
|
loading$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectLoading);
|
|
10
12
|
currentEntity$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectCurrent<%= classify(name) %>);
|
|
11
13
|
isEditActive$ = this.store.select(<%= camelize(singularizedStoreName) %>Selectors.selectIsEdit<%= classify(name) %>Active);
|
|
12
14
|
isNewActive$ = this.store.select(<%= camelize(singularizedStoreName) %>Selectors.selectIsNew<%= classify(name) %>Active);<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
|
|
13
15
|
<%= camelize(swaggerProperty.pluralizedName) %>$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.select<%= classify(swaggerProperty.pluralizedName) %>);<% }); %>
|
|
14
16
|
|
|
15
|
-
constructor(private readonly store: Store) {}
|
|
16
|
-
|
|
17
17
|
public setCurrentEntity(item: I<%= classify(name) %>): void {
|
|
18
18
|
this.store.dispatch(<%= camelize(singularizedStoreName) %>ActionTypes.setCurrent<%= classify(name) %>(item));
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
1
|
+
import { Component, ChangeDetectionStrategy, inject } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import { DetailExpandEvent } from '@progress/kendo-angular-grid';
|
|
4
4
|
import { KendoODataBasedComponent } from 'imng-kendo-grid-odata';
|
|
@@ -15,15 +15,15 @@ import { <%= camelize(singularizedName) %>GridState } from './list.grid-state';
|
|
|
15
15
|
standalone: false,
|
|
16
16
|
})
|
|
17
17
|
export class <%= classify(singularizedName) %>ListComponent extends KendoODataBasedComponent<I<%= classify(singularizedName) %>, <%= classify(singularizedName) %>ListFacade> {
|
|
18
|
+
public readonly crudFacade = inject(<%= classify(singularizedName) %>CrudFacade);
|
|
19
|
+
|
|
18
20
|
public readonly props = <%= classify(singularizedName) %>Properties;<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
|
|
19
21
|
public readonly <%= camelize(swaggerProperty.name) %>Props = <%= classify(swaggerProperty.propertyTypeName) %>Properties;<% }) %><% swaggerObjectProperties.filter(t=> t.enum).forEach(function(swaggerProperty){ %>
|
|
20
22
|
public readonly <%= camelize(swaggerProperty.pluralizedPropertyTypeName) %> = <%= camelize(swaggerProperty.singularizedPropertyTypeName) %>Values;<% }) %>
|
|
21
23
|
public currentItem: I<%= classify(singularizedName) %> | undefined;
|
|
22
24
|
|
|
23
|
-
constructor(
|
|
24
|
-
|
|
25
|
-
router: Router) {
|
|
26
|
-
super(facade, <%= camelize(singularizedName) %>GridState, router);
|
|
25
|
+
constructor() {
|
|
26
|
+
super(inject(<%= classify(singularizedName) %>ListFacade), <%= camelize(singularizedName) %>GridState, inject(Router));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public addItem(): void {
|
|
@@ -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 { IDataDeleteFacade } from 'imng-kendo-data-entry';
|
|
4
4
|
import { IKendoODataGridFacade } from 'imng-kendo-grid-odata';
|
|
@@ -8,13 +8,13 @@ import { <%= camelize(pluralizedStoreName) %>Feature, <%= camelize(storeName) %>
|
|
|
8
8
|
|
|
9
9
|
@Injectable()
|
|
10
10
|
export class <%= classify(singularizedName) %>ListFacade implements IKendoODataGridFacade<I<%= classify(name) %>>, IDataDeleteFacade<I<%= classify(name) %>> {
|
|
11
|
+
private readonly store = inject(Store);
|
|
12
|
+
|
|
11
13
|
loading$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectLoading);
|
|
12
14
|
gridData$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectGridData);
|
|
13
15
|
gridPagerSettings$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectGridPagerSettings);
|
|
14
16
|
gridODataState$ = this.store.select(<%= camelize(pluralizedStoreName) %>Feature.selectGridODataState);
|
|
15
17
|
|
|
16
|
-
constructor(private readonly store: Store) {}
|
|
17
|
-
|
|
18
18
|
public loadEntities(state: ODataState): void {
|
|
19
19
|
this.store.dispatch(<%= camelize(storeName) %>ActionTypes.load<%= classify(pluralizedName) %>Request(state));
|
|
20
20
|
}
|
package/schematics/imng-module/files/+state/__singularizedName@dasherize__-crud.effects.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
1
|
+
import { Injectable, inject } from '@angular/core';
|
|
2
2
|
import { createEffect, Actions, ofType } from '@ngrx/effects';
|
|
3
3
|
import { ODataService } from 'imng-kendo-odata';
|
|
4
4
|
import { handleEffectError } from 'imng-ngrx-utils';
|
|
@@ -10,11 +10,10 @@ import { <%= classify(singularizedName) %>ApiService } from '../<%= dasherize(pl
|
|
|
10
10
|
<% } %>
|
|
11
11
|
@Injectable()
|
|
12
12
|
export class <%= classify(singularizedName) %>CrudEffects {
|
|
13
|
-
|
|
14
|
-
private readonly
|
|
15
|
-
private readonly
|
|
16
|
-
|
|
17
|
-
) {}
|
|
13
|
+
private readonly actions$ = inject(Actions);
|
|
14
|
+
private readonly odataService = inject(ODataService);
|
|
15
|
+
private readonly <%= camelize(singularizedName) %>ApiService = inject(<%= classify(singularizedName) %>ApiService);
|
|
16
|
+
|
|
18
17
|
<% if (openApiJsonUrl || openApiJsonFileName) { %>
|
|
19
18
|
save<%= classify(singularizedName) %>Effect$ = createEffect(() => {
|
|
20
19
|
return this.actions$.pipe(
|
package/schematics/imng-module/files/+state/__singularizedName@dasherize__-list.effects.ts.template
CHANGED
|
@@ -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 } from '@ngrx/effects';
|
|
4
4
|
import { concatLatestFrom } from '@ngrx/operators';
|
|
@@ -12,11 +12,10 @@ import { environment } from '@env';
|
|
|
12
12
|
|
|
13
13
|
@Injectable()
|
|
14
14
|
export class <%= classify(singularizedName) %>ListEffects {
|
|
15
|
-
|
|
16
|
-
private readonly
|
|
17
|
-
private readonly
|
|
18
|
-
|
|
19
|
-
) {}
|
|
15
|
+
private readonly actions$ = inject(Actions);
|
|
16
|
+
private readonly odataService = inject(ODataService);
|
|
17
|
+
private readonly store = inject(Store);
|
|
18
|
+
|
|
20
19
|
<% if (openApiJsonUrl || openApiJsonFileName) { %>
|
|
21
20
|
load<%= classify(pluralizedName) %>Effect$ = createEffect(() => {
|
|
22
21
|
return this.actions$.pipe(
|