imng-kendo-schematics 7.285.6 → 7.291.2
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-sub-list/files/+state/__singularizedName@dasherize__.reducers.ts.template +47 -0
- package/schematics/imng-sub-list/files/+state/__singularizedName@dasherize__.selectors.ts.template +1 -1
- package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.component.html.template +1 -1
- package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.component.ts.template +1 -1
- package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.facade.spec.ts.template +4 -4
- package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.facade.ts.template +1 -1
package/package.json
CHANGED
package/schematics/imng-sub-list/files/+state/__singularizedName@dasherize__.reducers.ts.template
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { on } from '@ngrx/store';
|
|
2
|
+
import * as <%= camelize(singularizedName) %>ActionTypes from './<%= dasherize(singularizedName) %>.actions';
|
|
3
|
+
import { State } from './<%= dasherize(parentName) %>.feature';
|
|
4
|
+
import { findAndModify } from 'imng-ngrx-utils';
|
|
5
|
+
import { getODataPagerSettings } from 'imng-kendo-grid-odata';
|
|
6
|
+
|
|
7
|
+
export const <%= camelize(singularizedName) %>Reducers = [
|
|
8
|
+
on(<%= camelize(singularizedName) %>ActionTypes.load<%= classify(pluralizedName) %>Request,
|
|
9
|
+
(state: State, { payload }): State =>
|
|
10
|
+
({
|
|
11
|
+
...state,
|
|
12
|
+
loading: true,
|
|
13
|
+
gridData: {
|
|
14
|
+
...state.gridData,
|
|
15
|
+
data: findAndModify(
|
|
16
|
+
state.gridData.data,
|
|
17
|
+
payload.<%= camelize(parentName) %>Id,
|
|
18
|
+
(rec) => (rec.<%= camelize(singularizedName) %>ODataState = payload.odataState),
|
|
19
|
+
)
|
|
20
|
+
},
|
|
21
|
+
})),
|
|
22
|
+
on(<%= camelize(singularizedName) %>ActionTypes.reload<%= classify(pluralizedName) %>Request,
|
|
23
|
+
(state: state): State =>
|
|
24
|
+
({
|
|
25
|
+
...state,
|
|
26
|
+
loading: true
|
|
27
|
+
})),
|
|
28
|
+
on(<%= camelize(singularizedName) %>ActionTypes.load<%= classify(pluralizedName) %>Success,
|
|
29
|
+
<%= camelize(singularizedName) %>ActionTypes.reload<%= classify(pluralizedName) %>Success,
|
|
30
|
+
(state: State, { payload }): State =>
|
|
31
|
+
({
|
|
32
|
+
...state,
|
|
33
|
+
loading: false,
|
|
34
|
+
gridData: {
|
|
35
|
+
...state.gridData,
|
|
36
|
+
data: findAndModify(
|
|
37
|
+
state.gridData.data,
|
|
38
|
+
payload.<%= camelize(parentName) %>Id,
|
|
39
|
+
(rec) => {
|
|
40
|
+
rec.<%= camelize(singularizedName) %>OData = payload.odataResult;
|
|
41
|
+
rec.<%= camelize(singularizedName) %>PagerSettings = getODataPagerSettings({
|
|
42
|
+
gridData: payload.odataResult,
|
|
43
|
+
gridODataState: rec.<%= camelize(singularizedName) %>ODataState,
|
|
44
|
+
});
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
}))];
|
package/schematics/imng-sub-list/files/+state/__singularizedName@dasherize__.selectors.ts.template
CHANGED
|
@@ -2,7 +2,7 @@ import { createSelector } from '@ngrx/store';
|
|
|
2
2
|
import { PagerSettings } from '@progress/kendo-angular-grid';
|
|
3
3
|
import { createEmptyODataResult } from 'imng-kendo-odata';
|
|
4
4
|
import { getById } from 'imng-ngrx-utils';
|
|
5
|
-
import { <%= camelize(pluralizedStoreName) %>Feature } from './<%= dasherize(singularizedStoreName) %>.
|
|
5
|
+
import { <%= camelize(pluralizedStoreName) %>Feature } from './<%= dasherize(singularizedStoreName) %>.feature';
|
|
6
6
|
<% if (openApiJsonUrl || openApiJsonFileName) { %>
|
|
7
7
|
const select<%= classify(pluralizedName) %> = (<%= camelize(parentName) %>Id: string) => createSelector(
|
|
8
8
|
<%= camelize(pluralizedStoreName) %>Feature.selectGridData,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<kendo-grid [height]="375" kendoGridFocusable [imngODataGrid]="this">
|
|
2
2
|
<ng-template kendoGridToolbarTemplate>
|
|
3
3
|
<div class="w-100 d-flex justify-content-between">
|
|
4
|
-
<
|
|
4
|
+
<h4><%= startCasedPluralName %></h4>
|
|
5
5
|
<imng-kendo-odata-grid-header
|
|
6
6
|
(reloadEntitiesClicked)="reloadEntities()"
|
|
7
7
|
[hideClearFilters]="true"
|
package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.component.ts.template
CHANGED
|
@@ -22,7 +22,7 @@ const initialGridState: ODataState = {
|
|
|
22
22
|
})
|
|
23
23
|
export class <%= classify(singularizedName) %>ListComponent extends KendoODataBasedComponent<I<%= classify(singularizedName) %>, <%= classify(singularizedName) %>ListFacade> {
|
|
24
24
|
public readonly props = <%= classify(singularizedName) %>Properties;<% swaggerObjectProperties.filter(t=> !t.enum).forEach(function(swaggerProperty){ %>
|
|
25
|
-
public readonly <%= camelize(swaggerProperty.name) %>
|
|
25
|
+
public readonly <%= camelize(swaggerProperty.name) %>Props = <%= classify(swaggerProperty.propertyTypeName) %>Properties;<% }) %>
|
|
26
26
|
public currentItem: I<%= classify(singularizedName) %> | undefined;
|
|
27
27
|
|
|
28
28
|
constructor(facade: <%= classify(singularizedName) %>ListFacade) {
|
|
@@ -11,9 +11,9 @@ import { Observable, of } from 'rxjs';
|
|
|
11
11
|
import * as <%= camelize(parentName) %>ActionTypes from '../+state/<%= dasherize(parentName) %>.actions';
|
|
12
12
|
import * as <%= camelize(singularizedName) %>ActionTypes from '../+state/<%= dasherize(singularizedName) %>.actions';
|
|
13
13
|
import { <%= classify(singularizedName) %>Effects } from '../+state/<%= dasherize(singularizedName) %>.effects';
|
|
14
|
-
import { <%= camelize(pluralizedStoreName) %>Feature } from '../+state/<%= dasherize(singularizedStoreName) %>.
|
|
14
|
+
import { <%= camelize(pluralizedStoreName) %>Feature } from '../+state/<%= dasherize(singularizedStoreName) %>.feature';
|
|
15
15
|
import { <%= classify(singularizedName) %>ListFacade } from './list.facade';
|
|
16
|
-
import { <%= classify(parentName) %>
|
|
16
|
+
import { <%= classify(parentName) %>ListEffects } from '../+state/<%= dasherize(parentName) %>-list.effects';
|
|
17
17
|
import { environment } from '@env';
|
|
18
18
|
|
|
19
19
|
describe('<%= classify(singularizedName) %>ListFacade', () => {
|
|
@@ -29,7 +29,7 @@ describe('<%= classify(singularizedName) %>ListFacade', () => {
|
|
|
29
29
|
@NgModule({
|
|
30
30
|
imports: [
|
|
31
31
|
StoreModule.forFeature(<%= camelize(pluralizedStoreName) %>Feature),
|
|
32
|
-
EffectsModule.forFeature([<%= classify(singularizedStoreName) %>Effects, <%= classify(singularizedName) %>
|
|
32
|
+
EffectsModule.forFeature([<%= classify(singularizedStoreName) %>Effects, <%= classify(singularizedName) %>ListEffects]),
|
|
33
33
|
],
|
|
34
34
|
providers: [
|
|
35
35
|
<%= classify(singularizedName) %>ListFacade,
|
|
@@ -67,7 +67,7 @@ describe('<%= classify(singularizedName) %>ListFacade', () => {
|
|
|
67
67
|
|
|
68
68
|
list = await readFirst(facade.gridData$);
|
|
69
69
|
const loading = await readFirst(facade.loading$);
|
|
70
|
-
expect(list
|
|
70
|
+
expect(list?.data.length).toBe(1);
|
|
71
71
|
expect(loading).toBe(false);
|
|
72
72
|
|
|
73
73
|
const gridPagerSettings$ = await readFirst(facade.gridPagerSettings$);
|
package/schematics/imng-sub-list/files/__pluralizedName@dasherize__-list/list.facade.ts.template
CHANGED
|
@@ -7,7 +7,7 @@ import { applyFilter, ODataResult, ODataState } from 'imng-kendo-odata';
|
|
|
7
7
|
import { BehaviorSubject, Observable, switchMap } from 'rxjs';
|
|
8
8
|
|
|
9
9
|
import * as <%= camelize(singularizedName) %>ActionTypes from '../+state/<%= dasherize(singularizedName) %>.actions';
|
|
10
|
-
import { <%= camelize(pluralizedStoreName) %>Feature } from '../+state/<%= dasherize(singularizedStoreName) %>.
|
|
10
|
+
import { <%= camelize(pluralizedStoreName) %>Feature } from '../+state/<%= dasherize(singularizedStoreName) %>.feature';
|
|
11
11
|
import { <%= camelize(singularizedName) %>Selectors } from '../+state/<%= dasherize(singularizedName) %>.selectors';
|
|
12
12
|
|
|
13
13
|
@Injectable()
|