devextreme-schematics 1.3.0-beta.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/package.json +10 -8
  2. package/src/add-app-template/index.js +2 -1
  3. package/src/add-app-template/index.js.map +1 -1
  4. package/src/add-app-template/index.ts +30 -0
  5. package/src/add-app-template/index_spec.js +6 -5
  6. package/src/add-app-template/index_spec.js.map +1 -1
  7. package/src/add-app-template/index_spec.ts +73 -0
  8. package/src/add-app-template/schema.json +7 -3
  9. package/src/add-layout/files/devextreme.json +1 -1
  10. package/src/add-layout/files/src/app/__name__.component.html +3 -3
  11. package/src/add-layout/files/src/app/__name__.component.ts +1 -1
  12. package/src/add-layout/files/src/app/app-routing.module.ts +1 -1
  13. package/src/add-layout/files/src/app/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.component.ts +13 -11
  14. package/src/add-layout/files/src/app/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.component.ts +10 -9
  15. package/src/add-layout/files/src/app/layouts/single-card/single-card.component.ts +4 -4
  16. package/src/add-layout/files/src/app/not-authorized-container.ts +2 -0
  17. package/src/add-layout/files/src/app/shared/components/change-password-form/change-password-form.component.html +8 -6
  18. package/src/add-layout/files/src/app/shared/components/change-password-form/change-password-form.component.ts +6 -15
  19. package/src/add-layout/files/src/app/shared/components/create-account-form/create-account-form.component.html +9 -7
  20. package/src/add-layout/files/src/app/shared/components/create-account-form/create-account-form.component.ts +4 -13
  21. package/src/add-layout/files/src/app/shared/components/header/header.component.ts +11 -6
  22. package/src/add-layout/files/src/app/shared/components/login-form/login-form.component.html +8 -6
  23. package/src/add-layout/files/src/app/shared/components/login-form/login-form.component.ts +2 -12
  24. package/src/add-layout/files/src/app/shared/components/reset-password-form/reset-password-form.component.html +8 -6
  25. package/src/add-layout/files/src/app/shared/components/reset-password-form/reset-password-form.component.ts +2 -12
  26. package/src/add-layout/files/src/app/shared/components/side-navigation-menu/side-navigation-menu.component.ts +8 -7
  27. package/src/add-layout/files/src/app/shared/components/user-panel/user-panel.component.html +5 -2
  28. package/src/add-layout/files/src/app/shared/components/user-panel/user-panel.component.ts +3 -2
  29. package/src/add-layout/files/src/app/shared/services/auth.service.ts +11 -5
  30. package/src/add-layout/files/src/app/shared/services/screen.service.ts +2 -2
  31. package/src/add-layout/files/src/app/unauthenticated-content.ts +53 -0
  32. package/src/add-layout/files/src/dx-styles.scss +4 -0
  33. package/src/add-layout/index.js +45 -31
  34. package/src/add-layout/index.js.map +1 -1
  35. package/src/add-layout/index.ts +384 -0
  36. package/src/add-layout/index_spec.js +42 -28
  37. package/src/add-layout/index_spec.js.map +1 -1
  38. package/src/add-layout/index_spec.ts +340 -0
  39. package/src/add-layout/schema.json +6 -2
  40. package/src/add-sample-views/files/pages/home/home.component.html +5 -5
  41. package/src/add-sample-views/files/pages/profile/profile.component.ts +1 -1
  42. package/src/add-sample-views/files/pages/tasks/tasks.component.html +1 -0
  43. package/src/add-sample-views/index.js +13 -4
  44. package/src/add-sample-views/index.js.map +1 -1
  45. package/src/add-sample-views/index.ts +141 -0
  46. package/src/add-sample-views/index_spec.js +5 -4
  47. package/src/add-sample-views/index_spec.js.map +1 -1
  48. package/src/add-sample-views/index_spec.ts +74 -0
  49. package/src/add-sample-views/schema.json +1 -1
  50. package/src/add-view/index.d.ts +2 -2
  51. package/src/add-view/index.js +33 -22
  52. package/src/add-view/index.js.map +1 -1
  53. package/src/add-view/index.ts +166 -0
  54. package/src/add-view/index_spec.js +12 -12
  55. package/src/add-view/index_spec.js.map +1 -1
  56. package/src/add-view/index_spec.ts +155 -0
  57. package/src/add-view/schema.json +4 -4
  58. package/src/collection.json +2 -1
  59. package/src/install/index.js +16 -3
  60. package/src/install/index.js.map +1 -1
  61. package/src/install/index.ts +88 -0
  62. package/src/install/index_spec.js +10 -9
  63. package/src/install/index_spec.js.map +1 -1
  64. package/src/install/index_spec.ts +106 -0
  65. package/src/install/schema.json +2 -2
  66. package/src/utility/array.js +1 -0
  67. package/src/utility/array.js.map +1 -1
  68. package/src/utility/array.ts +3 -0
  69. package/src/utility/change.js +1 -0
  70. package/src/utility/change.js.map +1 -1
  71. package/src/utility/change.ts +66 -0
  72. package/src/utility/latest-versions.d.ts +1 -1
  73. package/src/utility/latest-versions.js +3 -2
  74. package/src/utility/latest-versions.js.map +1 -1
  75. package/src/utility/latest-versions.ts +6 -0
  76. package/src/utility/modify-json-file.d.ts +1 -0
  77. package/src/utility/modify-json-file.js +7 -3
  78. package/src/utility/modify-json-file.js.map +1 -1
  79. package/src/utility/modify-json-file.ts +16 -0
  80. package/src/utility/project.d.ts +4 -4
  81. package/src/utility/project.js +35 -12
  82. package/src/utility/project.js.map +1 -1
  83. package/src/utility/project.ts +30 -0
  84. package/src/utility/routing.js +1 -0
  85. package/src/utility/routing.js.map +1 -1
  86. package/src/utility/routing.ts +44 -0
  87. package/src/utility/source.js +1 -0
  88. package/src/utility/source.js.map +1 -1
  89. package/src/utility/source.ts +16 -0
  90. package/src/utility/string.js +1 -0
  91. package/src/utility/string.js.map +1 -1
  92. package/src/utility/string.ts +5 -0
  93. package/src/utility/styles.d.ts +1 -2
  94. package/src/utility/styles.js +3 -4
  95. package/src/utility/styles.js.map +1 -1
  96. package/src/utility/styles.ts +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devextreme-schematics",
3
- "version": "1.3.0-beta.1",
3
+ "version": "1.3.0",
4
4
  "description": "DevExtreme schematics",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -11,8 +11,9 @@
11
11
  "license": "MIT",
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git://github.com/DevExpress/devextreme-schematics.git"
14
+ "url": "https://github.com/DevExpress/devextreme-cli/tree/master/packages/devextreme-schematics"
15
15
  },
16
+ "homepage": "https://www.npmjs.com/package/devextreme-schematics",
16
17
  "files": [
17
18
  "src/**/*",
18
19
  "!*.ts",
@@ -21,16 +22,17 @@
21
22
  ],
22
23
  "schematics": "./src/collection.json",
23
24
  "dependencies": {
24
- "@angular-devkit/core": "^8.0.0",
25
- "@angular-devkit/schematics": "^8.0.0",
26
- "@schematics/angular": "^8.0.0",
25
+ "@angular-devkit/core": "^12.0.0",
26
+ "@angular-devkit/schematics": "^12.0.0",
27
+ "@schematics/angular": "^12.0.0",
27
28
  "rxjs": "~6.4.0",
28
- "typescript": "3.5.3"
29
+ "typescript": "~4.3.1"
29
30
  },
30
31
  "devDependencies": {
31
- "@types/jasmine": "^3.3.8",
32
+ "@types/jasmine": "~3.10.3",
32
33
  "@types/node": "^8.10.39",
33
34
  "jasmine": "^2.8.0",
34
35
  "tslint": "^5.15.0"
35
- }
36
+ },
37
+ "gitHead": "c61a31f44439fe1b0e82449a15c4db8375af34f3"
36
38
  }
@@ -12,7 +12,8 @@ function default_1(options) {
12
12
  resolveConflicts: options.resolveConflicts,
13
13
  project: options.project,
14
14
  skipInstall: true,
15
- updateBudgets: options.updateBudgets
15
+ updateBudgets: options.updateBudgets,
16
+ globalNgCliVersion: options.globalNgCliVersion
16
17
  })
17
18
  ];
18
19
  if (!options.empty) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,2DAIoC;AAEpC,mBAAwB,OAAY;IAClC,MAAM,KAAK,GAAG;QACZ,sBAAS,CAAC,SAAS,EAAE;YACnB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QACF,sBAAS,CAAC,YAAY,EAAE;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC;KACH,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;QAClB,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,kBAAkB,EAAE;YACvC,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC,CAAC;KACL;IAED,OAAO,kBAAK,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC;AAtBD,4BAsBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,2DAIoC;AAEpC,mBAAwB,OAAY;IAClC,MAAM,KAAK,GAAG;QACZ,sBAAS,CAAC,SAAS,EAAE;YACnB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QACF,sBAAS,CAAC,YAAY,EAAE;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;SAC/C,CAAC;KACH,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;QAClB,KAAK,CAAC,IAAI,CAAC,sBAAS,CAAC,kBAAkB,EAAE;YACvC,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC,CAAC;KACL;IAED,OAAO,kBAAK,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC;AAvBD,4BAuBC"}
@@ -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
+ }
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
4
5
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
6
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
@@ -28,18 +29,18 @@ const workspaceOptions = {
28
29
  const angularSchematicsCollection = require.resolve('../../node_modules/@schematics/angular/collection.json');
29
30
  const schematicRunner = new testing_1.SchematicTestRunner('@schematics/angular', angularSchematicsCollection);
30
31
  let appTree;
31
- beforeEach(() => __awaiter(this, void 0, void 0, function* () {
32
+ beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
32
33
  appTree = yield schematicRunner.runSchematicAsync('workspace', workspaceOptions).toPromise();
33
34
  appTree = yield schematicRunner.runSchematicAsync('application', appOptions, appTree).toPromise();
34
35
  }));
35
36
  describe('add-app-template', () => {
36
- it('should add DevExtreme', () => __awaiter(this, void 0, void 0, function* () {
37
+ it('should add DevExtreme', () => __awaiter(void 0, void 0, void 0, function* () {
37
38
  const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
38
39
  const tree = yield runner.runSchematicAsync('add-app-template', {}, appTree).toPromise();
39
40
  const packageConfig = JSON.parse(tree.readContent('package.json'));
40
41
  expect('devextreme' in packageConfig.dependencies).toBe(true);
41
42
  }));
42
- it('should consider the `project` option', () => __awaiter(this, void 0, void 0, function* () {
43
+ it('should consider the `project` option', () => __awaiter(void 0, void 0, void 0, function* () {
43
44
  appTree = yield schematicRunner.runSchematicAsync('application', {
44
45
  name: 'testApp2',
45
46
  inlineStyle: false,
@@ -59,7 +60,7 @@ describe('add-app-template', () => {
59
60
  expect(tree.files)
60
61
  .toContain('/projects/testApp2/src/app/pages/home/home.component.ts');
61
62
  }));
62
- it('should consider the `updateBudgets` option', () => __awaiter(this, void 0, void 0, function* () {
63
+ it('should consider the `updateBudgets` option', () => __awaiter(void 0, void 0, void 0, function* () {
63
64
  const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
64
65
  const tree = yield runner.runSchematicAsync('add-app-template', { updateBudgets: true }, appTree).toPromise();
65
66
  const angularContent = JSON.parse(tree.readContent('/angular.json'));
@@ -1 +1 @@
1
- {"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,gEAAuF;AAEvF,6BAA6B;AAE7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,MAAM,UAAU,GAAQ;IACtB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,KAAK;IACrB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,KAAK;IAChB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,gBAAgB,GAAqB;IACzC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,2BAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,wDAAwD,CAAC,CAAC;AAC9G,MAAM,eAAe,GAAG,IAAI,6BAAmB,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAAC;AACpG,IAAI,OAAqB,CAAC;AAE1B,UAAU,CAAC,GAAS,EAAE;IACpB,OAAO,GAAG,MAAM,eA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AC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
- "id": "SchematicsDevextremeAddAppTemplate",
3
+ "$id": "SchematicsDevextremeAddAppTemplate",
4
4
  "title": "Add a DevExtreme layout template to an Anular application",
5
5
  "type": "object",
6
6
  "properties": {
@@ -10,7 +10,7 @@
10
10
  "description": "The type of a DevExtreme layout to add",
11
11
  "default": "side-nav-outer-toolbar",
12
12
  "x-prompt": {
13
- "message": "What layout do you want to add?",
13
+ "message": "Specify desired application layout:",
14
14
  "type": "list",
15
15
  "items": [
16
16
  { "value": "side-nav-outer-toolbar", "label": "Side navigation (outer toolbar)" },
@@ -39,7 +39,11 @@
39
39
  "dxversion": {
40
40
  "type": "string",
41
41
  "description": "The DevExtreme version",
42
- "default": "20.1-stable"
42
+ "default": "^20.2.4"
43
+ },
44
+ "globalNgCliVersion": {
45
+ "type":"string",
46
+ "default": "^12.0.0"
43
47
  },
44
48
  "empty": {
45
49
  "type": "boolean",
@@ -1,5 +1,5 @@
1
1
  {
2
- "applicationEngine": "<%= engine %>",
2
+ "applicationEngine": "angular",
3
3
  "build": {
4
4
  "commands": [
5
5
  {
@@ -1,4 +1,4 @@
1
- <ng-container *ngIf="isAutorized(); else notAuthorized">
1
+ <ng-container *ngIf="isAuthenticated(); else unauthenticated">
2
2
  <app-<%= layout %> title="{{appInfo.title}}">
3
3
  <router-outlet></router-outlet>
4
4
  <app-footer>
@@ -9,6 +9,6 @@
9
9
  </app-<%= layout %>>
10
10
  </ng-container>
11
11
 
12
- <ng-template #notAuthorized>
13
- <app-not-authorized-container></app-not-authorized-container>
12
+ <ng-template #unauthenticated>
13
+ <app-unauthenticated-content></app-unauthenticated-content>
14
14
  </ng-template>
@@ -13,7 +13,7 @@ export class <%= strings.classify(name) %>Component {
13
13
 
14
14
  constructor(private authService: AuthService, private screen: ScreenService, public appInfo: AppInfoService) { }
15
15
 
16
- isAutorized() {
16
+ isAuthenticated() {
17
17
  return this.authService.loggedIn;
18
18
  }
19
19
  }
@@ -27,7 +27,7 @@ const routes: Routes = [
27
27
  ];
28
28
 
29
29
  @NgModule({
30
- imports: [RouterModule.forRoot(routes)],
30
+ imports: [RouterModule.forRoot(routes, { useHash: true })],
31
31
  providers: [AuthGuardService],
32
32
  exports: [RouterModule]
33
33
  })
@@ -1,6 +1,8 @@
1
1
  import { Component, OnInit, NgModule, Input, ViewChild } from '@angular/core';
2
2
  import { SideNavigationMenuModule, HeaderModule } from '../../shared/components';
3
3
  import { ScreenService } from '../../shared/services';
4
+ import { ItemClickEvent as TreeViewItemClickEvent } from 'devextreme/ui/tree_view';
5
+ import { ItemClickEvent as ToolbarItemClickEvent } from 'devextreme/ui/toolbar';
4
6
  import { DxDrawerModule } from 'devextreme-angular/ui/drawer';
5
7
  import { DxScrollViewModule, DxScrollViewComponent } from 'devextreme-angular/ui/scroll-view';
6
8
  import { DxToolbarModule } from 'devextreme-angular/ui/toolbar';
@@ -14,14 +16,14 @@ import { Router, NavigationEnd } from '@angular/router';
14
16
  styleUrls: ['./side-nav-inner-toolbar.component.scss']
15
17
  })
16
18
  export class SideNavInnerToolbarComponent implements OnInit {
17
- @ViewChild(DxScrollViewComponent, { static: true }) scrollView: DxScrollViewComponent;
19
+ @ViewChild(DxScrollViewComponent, { static: true }) scrollView!: DxScrollViewComponent;
18
20
  selectedRoute = '';
19
21
 
20
- menuOpened: boolean;
22
+ menuOpened!: boolean;
21
23
  temporaryMenuOpened = false;
22
24
 
23
25
  @Input()
24
- title: string;
26
+ title!: string;
25
27
 
26
28
  menuMode = 'shrink';
27
29
  menuRevealMode = 'expand';
@@ -54,9 +56,9 @@ export class SideNavInnerToolbarComponent implements OnInit {
54
56
  this.shaderEnabled = !isLarge;
55
57
  }
56
58
 
57
- toggleMenu = (e) => {
59
+ toggleMenu = (e: ToolbarItemClickEvent) => {
58
60
  this.menuOpened = !this.menuOpened;
59
- e.event.stopPropagation();
61
+ e.event?.stopPropagation();
60
62
  }
61
63
 
62
64
  get hideMenuAfterNavigation() {
@@ -67,13 +69,13 @@ export class SideNavInnerToolbarComponent implements OnInit {
67
69
  return !this.menuOpened;
68
70
  }
69
71
 
70
- navigationChanged(event) {
71
- const path = event.itemData.path;
72
+ navigationChanged(event: TreeViewItemClickEvent) {
73
+ const path = (event.itemData as any).path;
72
74
  const pointerEvent = event.event;
73
75
 
74
76
  if (path && this.menuOpened) {
75
- if (event.node.selected) {
76
- pointerEvent.preventDefault();
77
+ if (event.node?.selected) {
78
+ pointerEvent?.preventDefault();
77
79
  } else {
78
80
  this.router.navigate([path]);
79
81
  this.scrollView.instance.scrollTo(0);
@@ -82,10 +84,10 @@ export class SideNavInnerToolbarComponent implements OnInit {
82
84
  if (this.hideMenuAfterNavigation) {
83
85
  this.temporaryMenuOpened = false;
84
86
  this.menuOpened = false;
85
- pointerEvent.stopPropagation();
87
+ pointerEvent?.stopPropagation();
86
88
  }
87
89
  } else {
88
- pointerEvent.preventDefault();
90
+ pointerEvent?.preventDefault();
89
91
  }
90
92
  }
91
93
 
@@ -1,6 +1,7 @@
1
1
  import { Component, OnInit, NgModule, Input, ViewChild } from '@angular/core';
2
2
  import { SideNavigationMenuModule, HeaderModule } from '../../shared/components';
3
3
  import { ScreenService } from '../../shared/services';
4
+ import { ItemClickEvent } from 'devextreme/ui/tree_view';
4
5
  import { DxDrawerModule } from 'devextreme-angular/ui/drawer';
5
6
  import { DxScrollViewModule, DxScrollViewComponent } from 'devextreme-angular/ui/scroll-view';
6
7
  import { CommonModule } from '@angular/common';
@@ -13,14 +14,14 @@ import { Router, NavigationEnd } from '@angular/router';
13
14
  styleUrls: ['./side-nav-outer-toolbar.component.scss']
14
15
  })
15
16
  export class SideNavOuterToolbarComponent implements OnInit {
16
- @ViewChild(DxScrollViewComponent, { static: true }) scrollView: DxScrollViewComponent;
17
+ @ViewChild(DxScrollViewComponent, { static: true }) scrollView!: DxScrollViewComponent;
17
18
  selectedRoute = '';
18
19
 
19
- menuOpened: boolean;
20
+ menuOpened!: boolean;
20
21
  temporaryMenuOpened = false;
21
22
 
22
23
  @Input()
23
- title: string;
24
+ title!: string;
24
25
 
25
26
  menuMode = 'shrink';
26
27
  menuRevealMode = 'expand';
@@ -61,13 +62,13 @@ export class SideNavOuterToolbarComponent implements OnInit {
61
62
  return !this.menuOpened;
62
63
  }
63
64
 
64
- navigationChanged(event) {
65
- const path = event.itemData.path;
65
+ navigationChanged(event: ItemClickEvent) {
66
+ const path = (event.itemData as any).path;
66
67
  const pointerEvent = event.event;
67
68
 
68
69
  if (path && this.menuOpened) {
69
- if (event.node.selected) {
70
- pointerEvent.preventDefault();
70
+ if (event.node?.selected) {
71
+ pointerEvent?.preventDefault();
71
72
  } else {
72
73
  this.router.navigate([path]);
73
74
  this.scrollView.instance.scrollTo(0);
@@ -76,10 +77,10 @@ export class SideNavOuterToolbarComponent implements OnInit {
76
77
  if (this.hideMenuAfterNavigation) {
77
78
  this.temporaryMenuOpened = false;
78
79
  this.menuOpened = false;
79
- pointerEvent.stopPropagation();
80
+ pointerEvent?.stopPropagation();
80
81
  }
81
82
  } else {
82
- pointerEvent.preventDefault();
83
+ pointerEvent?.preventDefault();
83
84
  }
84
85
  }
85
86
 
@@ -8,12 +8,12 @@ import { DxScrollViewModule } from 'devextreme-angular/ui/scroll-view';
8
8
  styleUrls: ['./single-card.component.scss']
9
9
  })
10
10
  export class SingleCardComponent {
11
- @Input()
12
- title: string;
11
+ @Input()
12
+ title!: string;
13
13
 
14
14
  @Input()
15
- description: string;
16
-
15
+ description!: string;
16
+
17
17
  constructor() { }
18
18
  }
19
19
 
@@ -29,6 +29,7 @@ export class NotAuthorizedContainerComponent {
29
29
  case 'reset-password': return 'Reset Password';
30
30
  case 'create-account': return 'Sign Up';
31
31
  case 'change-password': return 'Change Password';
32
+ default: return '';
32
33
  }
33
34
  }
34
35
 
@@ -36,6 +37,7 @@ export class NotAuthorizedContainerComponent {
36
37
  const path = this.router.url.split('/')[1];
37
38
  switch (path) {
38
39
  case 'reset-password': return 'Please enter the email address that you used to register, and we will send you a link to reset your password via Email.';
40
+ default: return '';
39
41
  }
40
42
  }
41
43
  }
@@ -21,12 +21,14 @@
21
21
  </dxi-item>
22
22
 
23
23
  <ng-container *dxTemplate="let item of 'changePasswordTemplate'">
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>Continue</ng-template>
29
- </span>
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>
@@ -1,13 +1,9 @@
1
1
  import { CommonModule } from '@angular/common';
2
2
  import { Component, NgModule, OnInit } from '@angular/core';
3
3
  import { ActivatedRoute, Router, RouterModule } from '@angular/router';
4
- import { DxButtonModule } from 'devextreme-angular/ui/button';
5
- import { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';
4
+ import { ValidationCallbackData } from 'devextreme/ui/validation_rules';
6
5
  import { DxFormModule } from 'devextreme-angular/ui/form';
7
6
  import { DxLoadIndicatorModule } from 'devextreme-angular/ui/load-indicator';
8
- import { DxTextBoxModule } from 'devextreme-angular/ui/text-box';
9
- import { DxValidationGroupModule } from 'devextreme-angular/ui/validation-group';
10
- import { DxValidatorModule } from 'devextreme-angular/ui/validator';
11
7
  import notify from 'devextreme/ui/notify';
12
8
  import { AuthService } from '../../services';
13
9
 
@@ -19,17 +15,17 @@ import { AuthService } from '../../services';
19
15
  export class ChangePasswordFormComponent implements OnInit {
20
16
  loading = false;
21
17
  formData: any = {};
22
- recoveryCode: string;
18
+ recoveryCode: string = '';
23
19
 
24
20
  constructor(private authService: AuthService, private router: Router, private route: ActivatedRoute) { }
25
21
 
26
22
  ngOnInit() {
27
23
  this.route.paramMap.subscribe(params => {
28
- this.recoveryCode = params.get('recoveryCode');
24
+ this.recoveryCode = params.get('recoveryCode') || '';
29
25
  });
30
26
  }
31
27
 
32
- async onSubmit(e) {
28
+ async onSubmit(e: Event) {
33
29
  e.preventDefault();
34
30
  const { password } = this.formData;
35
31
  this.loading = true;
@@ -44,7 +40,7 @@ export class ChangePasswordFormComponent implements OnInit {
44
40
  }
45
41
  }
46
42
 
47
- confirmPassword = (e: { value: string }) => {
43
+ confirmPassword = (e: ValidationCallbackData) => {
48
44
  return e.value === this.formData.password;
49
45
  }
50
46
  }
@@ -52,13 +48,8 @@ export class ChangePasswordFormComponent implements OnInit {
52
48
  imports: [
53
49
  CommonModule,
54
50
  RouterModule,
55
- DxButtonModule,
56
- DxCheckBoxModule,
57
- DxTextBoxModule,
58
51
  DxFormModule,
59
- DxValidatorModule,
60
- DxLoadIndicatorModule,
61
- DxValidationGroupModule
52
+ DxLoadIndicatorModule
62
53
  ],
63
54
  declarations: [ ChangePasswordFormComponent ],
64
55
  exports: [ ChangePasswordFormComponent ]
@@ -41,13 +41,15 @@
41
41
  </dxi-item>
42
42
 
43
43
  <ng-container *dxTemplate="let item of 'createAccountTemplate'">
44
- <span class="dx-button-text">
45
- <ng-container *ngIf="loading; else notLoading">
46
- <dx-load-indicator width="24px" height="24px" [visible]="true"></dx-load-indicator>
47
- </ng-container>
48
-
49
- <ng-template #notLoading>Create a new account</ng-template>
50
- </span>
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,13 +1,9 @@
1
1
  import { CommonModule } from '@angular/common';
2
2
  import { Component, NgModule } from '@angular/core';
3
3
  import { Router, RouterModule } from '@angular/router';
4
- import { DxButtonModule } from 'devextreme-angular/ui/button';
5
- import { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';
4
+ import { ValidationCallbackData } from 'devextreme/ui/validation_rules';
6
5
  import { DxFormModule } from 'devextreme-angular/ui/form';
7
6
  import { DxLoadIndicatorModule } from 'devextreme-angular/ui/load-indicator';
8
- import { DxTextBoxModule } from 'devextreme-angular/ui/text-box';
9
- import { DxValidationGroupModule } from 'devextreme-angular/ui/validation-group';
10
- import { DxValidatorModule } from 'devextreme-angular/ui/validator';
11
7
  import notify from 'devextreme/ui/notify';
12
8
  import { AuthService } from '../../services';
13
9
 
@@ -23,7 +19,7 @@ export class CreateAccountFormComponent {
23
19
 
24
20
  constructor(private authService: AuthService, private router: Router) { }
25
21
 
26
- async onSubmit(e) {
22
+ async onSubmit(e: Event) {
27
23
  e.preventDefault();
28
24
  const { email, password } = this.formData;
29
25
  this.loading = true;
@@ -38,7 +34,7 @@ export class CreateAccountFormComponent {
38
34
  }
39
35
  }
40
36
 
41
- confirmPassword = (e: { value: string }) => {
37
+ confirmPassword = (e: ValidationCallbackData) => {
42
38
  return e.value === this.formData.password;
43
39
  }
44
40
  }
@@ -46,13 +42,8 @@ export class CreateAccountFormComponent {
46
42
  imports: [
47
43
  CommonModule,
48
44
  RouterModule,
49
- DxButtonModule,
50
- DxCheckBoxModule,
51
- DxTextBoxModule,
52
45
  DxFormModule,
53
- DxValidatorModule,
54
- DxLoadIndicatorModule,
55
- DxValidationGroupModule
46
+ DxLoadIndicatorModule
56
47
  ],
57
48
  declarations: [ CreateAccountFormComponent ],
58
49
  exports: [ CreateAccountFormComponent ]