devextreme-schematics 1.2.19 → 1.2.23
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/src/add-app-template/index.ts +30 -0
- package/src/add-app-template/index_spec.ts +73 -0
- package/src/add-layout/files/e2e/src/app.e2e-spec.ts +14 -14
- package/src/add-layout/files/e2e/src/app.po.ts +11 -11
- package/src/add-layout/files/src/app/app-navigation.ts +1 -1
- package/src/add-layout/files/src/app/layouts/index.ts +3 -3
- package/src/add-layout/files/src/app/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.component.ts +1 -1
- package/src/add-layout/files/src/app/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.component.ts +1 -1
- package/src/add-layout/files/src/app/shared/components/change-password-form/change-password-form.component.html +8 -6
- package/src/add-layout/files/src/app/shared/components/create-account-form/create-account-form.component.html +9 -7
- package/src/add-layout/files/src/app/shared/components/footer/footer.component.ts +19 -19
- package/src/add-layout/files/src/app/shared/components/login-form/login-form.component.html +8 -6
- package/src/add-layout/files/src/app/shared/components/reset-password-form/reset-password-form.component.html +8 -6
- package/src/add-layout/index.ts +386 -0
- package/src/add-layout/index_spec.ts +340 -0
- package/src/add-sample-views/files/pages/home/home.component.ts +10 -10
- package/src/add-sample-views/files/pages/profile/profile.component.ts +33 -33
- package/src/add-sample-views/index.ts +141 -0
- package/src/add-sample-views/index_spec.ts +74 -0
- package/src/add-view/index.ts +165 -0
- package/src/add-view/index_spec.ts +155 -0
- package/src/install/index.ts +86 -0
- package/src/install/index_spec.ts +106 -0
- package/src/install/schema.json +1 -1
- package/src/utility/array.ts +3 -0
- package/src/utility/change.js +1 -1
- package/src/utility/change.ts +66 -0
- package/src/utility/latest-versions.js +2 -2
- package/src/utility/latest-versions.ts +6 -0
- package/src/utility/modify-json-file.ts +13 -0
- package/src/utility/project.ts +25 -0
- package/src/utility/routing.js +4 -4
- package/src/utility/routing.ts +44 -0
- package/src/utility/source.ts +16 -0
- package/src/utility/string.ts +5 -0
- package/src/utility/styles.ts +33 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "devextreme-schematics",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.23",
|
4
4
|
"description": "DevExtreme schematics",
|
5
5
|
"scripts": {
|
6
6
|
"build": "tsc -p tsconfig.json",
|
@@ -34,5 +34,5 @@
|
|
34
34
|
"jasmine": "^2.8.0",
|
35
35
|
"tslint": "^5.15.0"
|
36
36
|
},
|
37
|
-
"gitHead": "
|
37
|
+
"gitHead": "777e8d2b209c52381f604bb395a5289c8cded7da"
|
38
38
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import {
|
2
|
+
Rule,
|
3
|
+
chain,
|
4
|
+
schematic,
|
5
|
+
} from '@angular-devkit/schematics';
|
6
|
+
|
7
|
+
export default function(options: any): Rule {
|
8
|
+
const rules = [
|
9
|
+
schematic('install', {
|
10
|
+
dxversion: options.dxversion,
|
11
|
+
project: options.project
|
12
|
+
}),
|
13
|
+
schematic('add-layout', {
|
14
|
+
layout: options.layout,
|
15
|
+
resolveConflicts: options.resolveConflicts,
|
16
|
+
project: options.project,
|
17
|
+
skipInstall: true,
|
18
|
+
updateBudgets: options.updateBudgets,
|
19
|
+
globalNgCliVersion: options.globalNgCliVersion
|
20
|
+
})
|
21
|
+
];
|
22
|
+
|
23
|
+
if (!options.empty) {
|
24
|
+
rules.push(schematic('add-sample-views', {
|
25
|
+
project: options.project
|
26
|
+
}));
|
27
|
+
}
|
28
|
+
|
29
|
+
return chain(rules);
|
30
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
|
2
|
+
import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
|
3
|
+
import * as path from 'path';
|
4
|
+
|
5
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
6
|
+
|
7
|
+
const appOptions: any = {
|
8
|
+
name: 'testApp',
|
9
|
+
projectRoot: '',
|
10
|
+
inlineStyle: false,
|
11
|
+
inlineTemplate: false,
|
12
|
+
routing: true,
|
13
|
+
style: 'css',
|
14
|
+
skipTests: false,
|
15
|
+
skipPackageJson: false
|
16
|
+
};
|
17
|
+
|
18
|
+
const workspaceOptions: WorkspaceOptions = {
|
19
|
+
name: 'workspace',
|
20
|
+
version: '6.0.0'
|
21
|
+
};
|
22
|
+
|
23
|
+
const angularSchematicsCollection = require.resolve('../../node_modules/@schematics/angular/collection.json');
|
24
|
+
const schematicRunner = new SchematicTestRunner('@schematics/angular', angularSchematicsCollection);
|
25
|
+
let appTree: UnitTestTree;
|
26
|
+
|
27
|
+
beforeEach(async () => {
|
28
|
+
appTree = await schematicRunner.runSchematicAsync('workspace', workspaceOptions).toPromise();
|
29
|
+
appTree = await schematicRunner.runSchematicAsync('application', appOptions, appTree).toPromise();
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('add-app-template', () => {
|
33
|
+
it('should add DevExtreme', async () => {
|
34
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
35
|
+
const tree = await runner.runSchematicAsync('add-app-template', { }, appTree).toPromise();
|
36
|
+
const packageConfig = JSON.parse(tree.readContent('package.json'));
|
37
|
+
|
38
|
+
expect('devextreme' in packageConfig.dependencies).toBe(true);
|
39
|
+
});
|
40
|
+
|
41
|
+
it('should consider the `project` option', async () => {
|
42
|
+
appTree = await schematicRunner.runSchematicAsync('application', {
|
43
|
+
name: 'testApp2',
|
44
|
+
inlineStyle: false,
|
45
|
+
inlineTemplate: false,
|
46
|
+
routing: true,
|
47
|
+
style: 'scss',
|
48
|
+
projectRoot: 'projects/testApp2'
|
49
|
+
}, appTree).toPromise();
|
50
|
+
|
51
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
52
|
+
const tree = await runner.runSchematicAsync('add-app-template', {
|
53
|
+
project: 'testApp2'
|
54
|
+
}, appTree).toPromise();
|
55
|
+
|
56
|
+
expect(tree.files)
|
57
|
+
.toContain('/devextreme.json');
|
58
|
+
expect(tree.files)
|
59
|
+
.toContain('/projects/testApp2/src/themes/metadata.base.json');
|
60
|
+
expect(tree.files)
|
61
|
+
.toContain('/projects/testApp2/src/app/pages/home/home.component.ts');
|
62
|
+
});
|
63
|
+
|
64
|
+
it('should consider the `updateBudgets` option', async () => {
|
65
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
66
|
+
const tree = await runner.runSchematicAsync('add-app-template', { updateBudgets: true }, appTree).toPromise();
|
67
|
+
|
68
|
+
const angularContent = JSON.parse(tree.readContent('/angular.json'));
|
69
|
+
const budgets = angularContent.projects.testApp.architect.build.configurations.production.budgets;
|
70
|
+
|
71
|
+
expect(budgets[0].maximumWarning).toEqual('4mb');
|
72
|
+
});
|
73
|
+
});
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { AppPage } from './app.po';
|
2
|
-
|
3
|
-
describe('workspace-project App', () => {
|
4
|
-
let page: AppPage;
|
5
|
-
|
6
|
-
beforeEach(() => {
|
7
|
-
page = new AppPage();
|
8
|
-
});
|
9
|
-
|
10
|
-
it('should display welcome message', () => {
|
11
|
-
page.navigateTo();
|
12
|
-
expect(page.getParagraphText()).toEqual('Welcome to <%= title %>!');
|
13
|
-
});
|
14
|
-
});
|
1
|
+
import { AppPage } from './app.po';
|
2
|
+
|
3
|
+
describe('workspace-project App', () => {
|
4
|
+
let page: AppPage;
|
5
|
+
|
6
|
+
beforeEach(() => {
|
7
|
+
page = new AppPage();
|
8
|
+
});
|
9
|
+
|
10
|
+
it('should display welcome message', () => {
|
11
|
+
page.navigateTo();
|
12
|
+
expect(page.getParagraphText()).toEqual('Welcome to <%= title %>!');
|
13
|
+
});
|
14
|
+
});
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { browser, by, element } from 'protractor';
|
2
|
-
|
3
|
-
export class AppPage {
|
4
|
-
navigateTo() {
|
5
|
-
return browser.get('/');
|
6
|
-
}
|
7
|
-
|
8
|
-
getParagraphText() {
|
9
|
-
return element(by.css('app-root .dx-drawer-content .dx-card p:nth-child(2)')).getText();
|
10
|
-
}
|
11
|
-
}
|
1
|
+
import { browser, by, element } from 'protractor';
|
2
|
+
|
3
|
+
export class AppPage {
|
4
|
+
navigateTo() {
|
5
|
+
return browser.get('/');
|
6
|
+
}
|
7
|
+
|
8
|
+
getParagraphText() {
|
9
|
+
return element(by.css('app-root .dx-drawer-content .dx-card p:nth-child(2)')).getText();
|
10
|
+
}
|
11
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export const navigation = [];
|
1
|
+
export const navigation = [];
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from './side-nav-outer-toolbar/side-nav-outer-toolbar.component';
|
2
|
-
export * from './side-nav-inner-toolbar/side-nav-inner-toolbar.component';
|
3
|
-
export * from './single-card/single-card.component';
|
1
|
+
export * from './side-nav-outer-toolbar/side-nav-outer-toolbar.component';
|
2
|
+
export * from './side-nav-inner-toolbar/side-nav-inner-toolbar.component';
|
3
|
+
export * from './single-card/single-card.component';
|
@@ -70,7 +70,7 @@ export class SideNavInnerToolbarComponent implements OnInit {
|
|
70
70
|
}
|
71
71
|
|
72
72
|
navigationChanged(event: TreeViewItemClickEvent) {
|
73
|
-
const path = event.itemData.path;
|
73
|
+
const path = (event.itemData as any).path;
|
74
74
|
const pointerEvent = event.event;
|
75
75
|
|
76
76
|
if (path && this.menuOpened) {
|
@@ -63,7 +63,7 @@ export class SideNavOuterToolbarComponent implements OnInit {
|
|
63
63
|
}
|
64
64
|
|
65
65
|
navigationChanged(event: ItemClickEvent) {
|
66
|
-
const path = event.itemData.path;
|
66
|
+
const path = (event.itemData as any).path;
|
67
67
|
const pointerEvent = event.event;
|
68
68
|
|
69
69
|
if (path && this.menuOpened) {
|
@@ -21,12 +21,14 @@
|
|
21
21
|
</dxi-item>
|
22
22
|
|
23
23
|
<ng-container *dxTemplate="let item of 'changePasswordTemplate'">
|
24
|
-
<
|
25
|
-
<
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
<div>
|
25
|
+
<span class="dx-button-text">
|
26
|
+
<ng-container *ngIf="loading; else notLoading">
|
27
|
+
<dx-load-indicator width="24px" height="24px" [visible]="true"></dx-load-indicator>
|
28
|
+
</ng-container>
|
29
|
+
<ng-template #notLoading>Continue</ng-template>
|
30
|
+
</span>
|
31
|
+
</div>
|
30
32
|
</ng-container>
|
31
33
|
|
32
34
|
</dx-form>
|
@@ -41,13 +41,15 @@
|
|
41
41
|
</dxi-item>
|
42
42
|
|
43
43
|
<ng-container *dxTemplate="let item of 'createAccountTemplate'">
|
44
|
-
<
|
45
|
-
<
|
46
|
-
<
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
44
|
+
<div>
|
45
|
+
<span class="dx-button-text">
|
46
|
+
<ng-container *ngIf="loading; else notLoading">
|
47
|
+
<dx-load-indicator width="24px" height="24px" [visible]="true"></dx-load-indicator>
|
48
|
+
</ng-container>
|
49
|
+
|
50
|
+
<ng-template #notLoading>Create a new account</ng-template>
|
51
|
+
</span>
|
52
|
+
</div>
|
51
53
|
</ng-container>
|
52
54
|
|
53
55
|
</dx-form>
|
@@ -1,19 +1,19 @@
|
|
1
|
-
import { Component, NgModule } from '@angular/core';
|
2
|
-
|
3
|
-
@Component({
|
4
|
-
selector: 'app-footer',
|
5
|
-
template: `
|
6
|
-
<footer><ng-content></ng-content></footer>
|
7
|
-
`,
|
8
|
-
styleUrls: ['./footer.component.scss']
|
9
|
-
})
|
10
|
-
|
11
|
-
export class FooterComponent {
|
12
|
-
|
13
|
-
}
|
14
|
-
|
15
|
-
@NgModule({
|
16
|
-
declarations: [ FooterComponent ],
|
17
|
-
exports: [ FooterComponent ]
|
18
|
-
})
|
19
|
-
export class FooterModule { }
|
1
|
+
import { Component, NgModule } from '@angular/core';
|
2
|
+
|
3
|
+
@Component({
|
4
|
+
selector: 'app-footer',
|
5
|
+
template: `
|
6
|
+
<footer><ng-content></ng-content></footer>
|
7
|
+
`,
|
8
|
+
styleUrls: ['./footer.component.scss']
|
9
|
+
})
|
10
|
+
|
11
|
+
export class FooterComponent {
|
12
|
+
|
13
|
+
}
|
14
|
+
|
15
|
+
@NgModule({
|
16
|
+
declarations: [ FooterComponent ],
|
17
|
+
exports: [ FooterComponent ]
|
18
|
+
})
|
19
|
+
export class FooterModule { }
|
@@ -35,12 +35,14 @@
|
|
35
35
|
</dxi-item>
|
36
36
|
|
37
37
|
<ng-container *dxTemplate="let item of 'signInTemplate'">
|
38
|
-
<
|
39
|
-
<
|
40
|
-
<
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
<div>
|
39
|
+
<span class="dx-button-text">
|
40
|
+
<ng-container *ngIf="loading; else notLoading">
|
41
|
+
<dx-load-indicator width="24px" height="24px" [visible]="true"></dx-load-indicator>
|
42
|
+
</ng-container>
|
43
|
+
<ng-template #notLoading>Sign In</ng-template>
|
44
|
+
</span>
|
45
|
+
</div>
|
44
46
|
</ng-container>
|
45
47
|
|
46
48
|
</dx-form>
|
@@ -20,12 +20,14 @@
|
|
20
20
|
</dxi-item>
|
21
21
|
|
22
22
|
<ng-container *dxTemplate="let item of 'resetPasswordTemplate'">
|
23
|
-
<
|
24
|
-
<
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
<div>
|
24
|
+
<span class="dx-button-text">
|
25
|
+
<ng-container *ngIf="loading; else notLoading">
|
26
|
+
<dx-load-indicator width="24px" height="24px" [visible]="true"></dx-load-indicator>
|
27
|
+
</ng-container>
|
28
|
+
<ng-template #notLoading>Reset my password</ng-template>
|
29
|
+
</span>
|
30
|
+
</div>>
|
29
31
|
</ng-container>
|
30
32
|
|
31
33
|
</dx-form>
|