diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index efa2465b8c..0000000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,278 +0,0 @@
-{
- "root": true,
- "ignorePatterns": ["projects/**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["tsconfig.json"],
- "createDefaultProgram": true
- },
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:@angular-eslint/recommended",
- "plugin:@angular-eslint/template/process-inline-templates"
- ],
- "plugins": ["sonarjs"],
- "rules": {
- "@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/no-this-alias": "off",
- "@typescript-eslint/no-unused-vars": "off",
- "@typescript-eslint/no-array-constructor": "off",
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": ["element", "attribute"],
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@angular-eslint/no-output-native": "off",
- "@angular-eslint/no-output-on-prefix": "off",
- "@angular-eslint/no-conflicting-lifecycle": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-non-null-assertion": "off",
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-unused-expressions": "off",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "camelcase": "off",
- "@typescript-eslint/naming-convention": [
- "error",
- {
- "selector": "default",
- "format": ["camelCase"]
- },
- {
- "selector": "variable",
- "format": ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": "import",
- "format": ["camelCase", "PascalCase"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": "classProperty",
- "format": ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": "parameter",
- "format": ["camelCase"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": "memberLike",
- "modifiers": ["private"],
- "format": ["camelCase"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": "typeLike",
- "format": ["PascalCase", "camelCase"]
- },
- {
- "selector": "enumMember",
- "format": ["UPPER_CASE", "camelCase", "PascalCase"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": ["objectLiteralMethod"],
- "format": ["PascalCase", "camelCase", "snake_case", "UPPER_CASE"],
- "leadingUnderscore": "allow"
- },
- {
- "selector": ["objectLiteralProperty"],
- "format": null,
- "leadingUnderscore": "allow"
- },
- {
- "selector": "function",
- "format": ["PascalCase", "camelCase"],
- "leadingUnderscore": "allow"
- }
- ],
- "@typescript-eslint/member-ordering": [
- "error",
- {
- "default": ["signature", "field", "constructor", "method"]
- }
- ],
- "arrow-parens": ["off", "always"],
- "arrow-body-style": ["error", "as-needed"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": [
- "error",
- {
- "allowTernary": true
- }
- ],
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "jsdoc/no-types": "off",
- "jsdoc/newline-after-description": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"],
- "@angular-eslint/prefer-standalone": "off",
- "@typescript-eslint/no-unsafe-function-type": "off",
- "@typescript-eslint/no-empty-object-type": "off",
- "@angular-eslint/prefer-inject": "off"
- }
- },
- {
- "files": ["*.html"],
- "extends": ["plugin:@angular-eslint/template/recommended"],
- "rules": {
- "@angular-eslint/template/prefer-control-flow": "warn"
- }
- }
- ]
-}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 556f001e5f..c45949889b 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -10,7 +10,7 @@ assignees: ''
#### Reprodução
-Utilize StackBlitz (https://stackblitz.com/edit/po-ui) para reproduzir o bug relatado na issue.
+Utilize StackBlitz (https://stackblitz.com/edit/poui-module) para reproduzir o bug relatado na issue.
Passos para reproduzir:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e33fb6c51b..eacb97c1cc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -94,6 +94,7 @@ jobs:
node-version: 24
- run: npm i
+ - run: npm run build:schematics
- run: npm run build:ui:lite
- run: npm run test:templates
- run: npm run test:templates:schematics
@@ -112,6 +113,7 @@ jobs:
node-version: 24
- run: npm i
+ - run: npm run build:schematics
- run: npm run test:code-editor
- run: npm run test:code-editor:schematics
@@ -178,6 +180,7 @@ jobs:
node-version: 24
- run: npm i
+ - run: npm run build:schematics
- run: npm run build:storage:lite
- run: npm run test:sync
- run: npm run test:sync:schematics
diff --git a/.github/workflows/publish_po_angular_ci.yml b/.github/workflows/publish_po_angular_ci.yml
index cbd8fa6446..a04ae8a8a7 100644
--- a/.github/workflows/publish_po_angular_ci.yml
+++ b/.github/workflows/publish_po_angular_ci.yml
@@ -58,7 +58,7 @@ jobs:
;;
next)
echo "npm_tag=next" >> "$GITHUB_OUTPUT"
- echo "required_branch=refs/heads/master" >> "$GITHUB_OUTPUT"
+ echo "required_branch=refs/heads/22.x.x" >> "$GITHUB_OUTPUT"
echo "with_mcp=true" >> "$GITHUB_OUTPUT"
;;
latest)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e00cb74112..4033c4ea7d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,47 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+## [22.0.0-rc.0](https://github.com/po-ui/po-angular/compare/v22.0.0-next.0...v22.0.0-rc.0) (2026-10-28)
+
+### Features
+
+* **schematics:** detecta e preserva o nome da classe do App ([155530f](https://github.com/po-ui/po-angular/commit/155530fe7baa7db5fe958900c98582487979d72c))
+
+## [22.0.0-next.0](https://github.com/po-ui/po-angular/compare/v21.33.0...v22.0.0-next.0) (2026-10-09)
+
+
+### ⚠ BREAKING CHANGES
+
+* **schematics:** removidos os schematics de ng generate de páginas
+
+Os comandos "ng generate @po-ui/ng-templates:po-page-*" e
+"ng generate @po-ui/ng-components:po-page-*" para geração de páginas
+deixam de existir. A alternativa recomendada passa a ser o uso do
+MCP do PO UI para geração de páginas e componentes, conforme a
+documentação em https://po-ui.io/documentation/ia-tools-mcp.
+
+* **gauge:** removido componente po-gauge
+
+O componente po-gauge foi removido por completo da biblioteca.
+Utilize o po-chart com type=gauge como alternativa. A migração pode
+ser aplicada automaticamente via ng update do PO UI para a v22.
+
+Antes:
+
+
+Depois:
+
+
+### Features
+
+* **angular:** atualiza projeto para o Angular 22 ([cd1917c](https://github.com/po-ui/po-angular/commit/cd1917c47c9d42a3f38cee3da891282d52746c2e))
+* **gauge:** remove componente po-gauge depreciado ([8166802](https://github.com/po-ui/po-angular/commit/8166802a6571f7631d5aa3e7ad5b96a41a2c7fba))
+* **schematics:** remove ng generate de páginas e templates ([2900b06](https://github.com/po-ui/po-angular/commit/2900b06370dcd9485f0b53ae05d460383b00b563))
+
### [21.35.0](https://github.com/po-ui/po-angular/compare/v21.34.1...v21.35.0) (2026-10-27)
Compatibilidade com @totvs/thf-components@21.35.0
diff --git a/README.md b/README.md
index 836d8f29c2..1e1d6c255e 100644
--- a/README.md
+++ b/README.md
@@ -20,16 +20,16 @@ Biblioteca de componentes de UI para Angular.
### Pré-requisitos
-Para começar a utilizar o **PO UI** é pré-requisito ter o `Node.js` instalado (versão 20.11.x ou acima) e o seu gerenciador de pacote favorito na versão mais atual. Caso você ainda não tenha instalado o pacote `@angular/cli`, instale-o via `npm` ou `yarn`.
+Para começar a utilizar o **PO UI** é pré-requisito ter o `Node.js` instalado (versão 24.22.1 e acima) e o seu gerenciador de pacote favorito na versão mais atual. Caso você ainda não tenha instalado o pacote `@angular/cli`, instale-o via `npm` ou `yarn`.
Instalando com npm:
```
-npm i -g @angular/cli@21
+npm i -g @angular/cli@22
```
Caso prefira instalar com o yarn:
```
-yarn global add @angular/cli@21
+yarn global add @angular/cli@22
```
### Passo 1 - Crie o seu primeiro projeto
@@ -53,26 +53,24 @@ Veja abaixo a lista de dependências e as versões compatíveis, elas devem ser
```json
"dependencies": {
- "@angular/animations": "~21.2.17",
- "@angular/common": "~21.2.17",
- "@angular/compiler": "~21.2.17",
- "@angular/core": "~21.2.17",
- "@angular/forms": "~21.2.17",
- "@angular/platform-browser": "~21.2.17",
- "@angular/platform-browser-dynamic": "~21.2.17",
- "@angular/router": "~21.2.17",
+ "@angular/common": "~22.2.1",
+ "@angular/compiler": "~22.2.1",
+ "@angular/core": "~22.2.1",
+ "@angular/forms": "~22.2.1",
+ "@angular/platform-browser": "~22.2.1",
+ "@angular/router": "~22.2.1",
"rxjs": "~7.8.1",
"tslib": "^2.6.2",
"zone.js": "~0.15.0"
...
},
"devDependencies": {
- "@angular-devkit/build-angular": "~21.2.17",
- "@angular-devkit/schematics": "~21.2.17",
- "@angular/cli": "~21.2.17",
- "@angular/compiler-cli": "~21.2.17",
+ "@angular-devkit/schematics": "~22.2.1",
+ "@angular/build": "~22.2.1",
+ "@angular/cli": "~22.2.1",
+ "@angular/compiler-cli": "~22.2.1",
...
- "typescript": "~5.9.3"
+ "typescript": "~6.0.3"
}
```
@@ -90,14 +88,14 @@ Caso prefira instalar com o yarn:
yarn install
```
-### Passo 2 - Adiconando o pacote @po-ui/ng-components
+### Passo 2 - Adicionando o pacote @po-ui/ng-components
Utilizando o comando `ng add` do [Angular CLI](https://cli.angular.io/), vamos adicionar o **Po** em seu projeto e o mesmo se encarregará de configurar o tema, instalar o guia de primeiros passos **Po**. Além de importar também o modulo **HttpClientModule**.
Execute o comando abaixo na pasta raiz do seu projeto:
```
-ng add @po-ui/ng-components
+ng add @po-ui/ng-components@next
```
> Ao executar o comando acima, será perguntado se deseja incluir uma estrutura inicial em seu projeto com menu lateral, página e toolbar, utilizando componentes do **Po**, **caso desejar, apenas informe: `Y`**.
@@ -138,7 +136,7 @@ Agora é só abrir seu **editor / IDE** favorito e começar a trabalhar no seu p
Caso você queira utilizar nossos componentes de templates, como o **[po-page-login](https://po-ui.io/documentation/po-page-login)**, **[po-modal-password-recovery](https://po-ui.io/documentation/po-modal-password-recovery)**, **[po-page-blocked-user](https://po-ui.io/documentation/po-page-blocked-user)**, **[po-page-dynamic-table](https://po-ui.io/documentation/po-page-dynamic-table)** entre outros, basta adicionar o pacote `@po-ui/ng-templates` executando o comando abaixo:
```
-ng add @po-ui/ng-templates
+ng add @po-ui/ng-templates@next
```
> Ao executar este comando, será instalado o pacote `@po-ui/ng-templates` e configurado o `PoTemplatesModules` no `app.module`.
diff --git a/angular.json b/angular.json
index fdaee13f89..f532db6c94 100644
--- a/angular.json
+++ b/angular.json
@@ -10,7 +10,7 @@
"prefix": "po",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:ng-packagr",
+ "builder": "@angular/build:ng-packagr",
"options": {
"tsConfig": "projects/ui/tsconfig.lib.json",
"project": "projects/ui/ng-package.json"
@@ -22,11 +22,12 @@
}
},
"test": {
- "builder": "@angular-devkit/build-angular:karma",
+ "builder": "@angular/build:karma",
"options": {
"main": "projects/ui/src/test.ts",
"tsConfig": "projects/ui/tsconfig.spec.json",
- "karmaConfig": "projects/ui/karma.conf.js"
+ "karmaConfig": "projects/ui/karma.conf.js",
+ "codeCoverageExclude": ["projects/ui/src/lib/components/po-grid/**"]
}
},
"lint": {
@@ -45,7 +46,7 @@
"prefix": "app",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:application",
+ "builder": "@angular/build:application",
"options": {
"outputPath": {
"base": "dist/app"
@@ -112,7 +113,7 @@
}
},
"serve": {
- "builder": "@angular-devkit/build-angular:dev-server",
+ "builder": "@angular/build:dev-server",
"options": {
"open": true,
"host": "0.0.0.0",
@@ -138,7 +139,7 @@
"sourceRoot": "projects/storage/src",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:ng-packagr",
+ "builder": "@angular/build:ng-packagr",
"options": {
"tsConfig": "projects/storage/tsconfig.lib.json",
"project": "projects/storage/ng-package.json"
@@ -150,7 +151,7 @@
}
},
"test": {
- "builder": "@angular-devkit/build-angular:karma",
+ "builder": "@angular/build:karma",
"options": {
"main": "projects/storage/src/test.ts",
"tsConfig": "projects/storage/tsconfig.spec.json",
@@ -171,7 +172,7 @@
"sourceRoot": "projects/sync/src",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:ng-packagr",
+ "builder": "@angular/build:ng-packagr",
"options": {
"tsConfig": "projects/sync/tsconfig.lib.json",
"project": "projects/sync/ng-package.json"
@@ -183,8 +184,9 @@
}
},
"test": {
- "builder": "@angular-devkit/build-angular:karma",
+ "builder": "@angular/build:karma",
"options": {
+ "polyfills": ["zone.js", "zone.js/testing"],
"main": "projects/sync/src/test.ts",
"tsConfig": "projects/sync/tsconfig.spec.json",
"karmaConfig": "projects/sync/karma.conf.js"
@@ -205,7 +207,7 @@
"prefix": "po",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:ng-packagr",
+ "builder": "@angular/build:ng-packagr",
"options": {
"tsConfig": "projects/templates/tsconfig.lib.json",
"project": "projects/templates/ng-package.json"
@@ -217,8 +219,9 @@
}
},
"test": {
- "builder": "@angular-devkit/build-angular:karma",
+ "builder": "@angular/build:karma",
"options": {
+ "polyfills": ["zone.js", "zone.js/testing"],
"main": "projects/templates/src/test.ts",
"tsConfig": "projects/templates/tsconfig.spec.json",
"karmaConfig": "projects/templates/karma.conf.js"
@@ -239,7 +242,7 @@
"prefix": "po",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:ng-packagr",
+ "builder": "@angular/build:ng-packagr",
"options": {
"tsConfig": "projects/code-editor/tsconfig.lib.json",
"project": "projects/code-editor/ng-package.json"
@@ -251,8 +254,9 @@
}
},
"test": {
- "builder": "@angular-devkit/build-angular:karma",
+ "builder": "@angular/build:karma",
"options": {
+ "polyfills": ["zone.js", "zone.js/testing"],
"main": "projects/code-editor/src/test.ts",
"tsConfig": "projects/code-editor/tsconfig.spec.json",
"karmaConfig": "projects/code-editor/karma.conf.js"
@@ -274,7 +278,7 @@
"prefix": "app",
"architect": {
"build": {
- "builder": "@angular-devkit/build-angular:application",
+ "builder": "@angular/build:application",
"options": {
"outputPath": {
"base": "dist/portal"
@@ -322,7 +326,8 @@
"sourceMap": true,
"optimization": false,
"namedChunks": true,
- "browser": "projects/portal/src/main.ts"
+ "browser": "projects/portal/src/main.ts",
+ "externalDependencies": ["marked-katex-extension", "katex"]
},
"configurations": {
"production": {
@@ -353,7 +358,7 @@
}
},
"serve": {
- "builder": "@angular-devkit/build-angular:dev-server",
+ "builder": "@angular/build:dev-server",
"options": {
"buildTarget": "portal:build"
},
@@ -364,7 +369,7 @@
}
},
"extract-i18n": {
- "builder": "@angular-devkit/build-angular:extract-i18n",
+ "builder": "@angular/build:extract-i18n",
"options": {
"buildTarget": "portal:build"
}
diff --git a/docs/guides/browser-support.md b/docs/guides/browser-support.md
index 360cf8a145..58019c68f0 100644
--- a/docs/guides/browser-support.md
+++ b/docs/guides/browser-support.md
@@ -15,24 +15,16 @@ Atualmente o PO está homologado para os seguintes navegadores:
| Chrome |
- versões mais recentes (latest) |
+ 2 versões mais recentes |
| Firefox |
- versões mais recentes (latest) |
+ versão mais recente e versão de suporte estendido (ESR) |
| Edge |
2 últimas versões principais |
-
- | Safari |
- 2 últimas versões principais |
-
-
- | IOS |
- 2 últimas versões principais |
-
| Android |
2 últimas versões principais |
@@ -43,10 +35,10 @@ Atualmente o PO está homologado para os seguintes navegadores:
> Nossa homologação tem como base os navegadores que o Angular suporta nativamente. Para saber mais, acesse o guia
-[*Browser support*](https://angular.io/guide/browser-support) do Angular.
+[*Browser support*](https://angular.dev/reference/versions#browser-support) do Angular.
> Caso precise de algum *polyfill* em sua aplicação ou precisa de mais informação sobre como funciona um *polyfill*
-acesse a documentação [*Browser support*](https://angular.io/guide/browser-support) do Angular.
+acesse a documentação [*Browser support*](https://angular.dev/reference/versions#browser-support) do Angular.
## Executando a aplicação localmente
diff --git a/docs/guides/deprecations.md b/docs/guides/deprecations.md
index e6318ac55f..d56d183f32 100644
--- a/docs/guides/deprecations.md
+++ b/docs/guides/deprecations.md
@@ -25,11 +25,16 @@ A tabela a seguir lista todos os recursos depreciados, organizados pelo release
-
- | PoNavbar |
+
+ | PoNavbar |
Componente descontinuado |
v23 |
+
+ | PoGauge |
+ Componente descontinuado |
+ v22 |
+
| PoTabs |
p-small |
@@ -71,6 +76,43 @@ A tabela a seguir lista todos os recursos depreciados, organizados pelo release
Esta seção contém uma lista completa de todos os recursos obsoletos com detalhes para ajudá-lo a planejar sua migração.
+### PoGauge
+
+
+
+O componente `po-gauge` foi removido. Utilize o `po-chart` com `p-type="gauge"` como alternativa.
+
+Antes:
+```
+
+```
+
+Depois:
+```
+
+```
+
### PoButton
@@ -222,6 +264,12 @@ Depois - Animalia Icons (atual)
+
+ | PoGauge |
+ Componente descontinuado |
+ PoChart (type=gauge) |
+ v22 |
+
| PoNavbar |
Componente descontinuado |
diff --git a/docs/guides/development-flow.md b/docs/guides/development-flow.md
index 7222cee2a4..e6d5e3ffd9 100644
--- a/docs/guides/development-flow.md
+++ b/docs/guides/development-flow.md
@@ -55,7 +55,7 @@ Este guia tem por objetivo definir as regras para criação de *Issues* relacion
Crie uma nova aplicação em Angular incluindo o componente e o comportamento reportado para nossa análise.
Adicione o mínimo de código necessário para reprodução do bug, facilitando assim a verificação da situação.
Publique a aplicação no GitHub e inclua o link ao criar a issue.
- Pode-se também usar o Stackblitz para reproduzir o bug relatado na issue.
+ Pode-se também usar o Stackblitz para reproduzir o bug relatado na issue.
Certifique-se de incluir os passos para reprodução da issue. Estes passos devem ser claros e simples de seguir.
diff --git a/docs/guides/getting-started.md b/docs/guides/getting-started.md
index cac977a40b..4e2d43d6ad 100644
--- a/docs/guides/getting-started.md
+++ b/docs/guides/getting-started.md
@@ -3,16 +3,16 @@
### Pré-requisitos
-Para começar a utilizar o **PO UI** é pré-requisito ter o `Node.js` instalado (versão 20.11.x ou acima) e o seu gerenciador de pacote favorito na versão mais atual. Caso você ainda não tenha instalado o pacote `@angular/cli`, instale-o via `npm` ou `yarn`.
+Para começar a utilizar o **PO UI** é pré-requisito ter o `Node.js` instalado (versão 24.22.1 e acima) e o seu gerenciador de pacote favorito na versão mais atual. Caso você ainda não tenha instalado o pacote `@angular/cli`, instale-o via `npm` ou `yarn`.
Instalando com npm:
```
-npm i -g @angular/cli@21
+npm i -g @angular/cli@22
```
Caso prefira instalar com o yarn:
```
-yarn global add @angular/cli@21
+yarn global add @angular/cli@22
```
### Passo 1 - Crie o seu primeiro projeto
@@ -36,26 +36,24 @@ Veja abaixo a lista de dependências e as versões compatíveis, elas devem ser
```json
"dependencies": {
- "@angular/animations": "~21.2.17",
- "@angular/common": "~21.2.17",
- "@angular/compiler": "~21.2.17",
- "@angular/core": "~21.2.17",
- "@angular/forms": "~21.2.17",
- "@angular/platform-browser": "~21.2.17",
- "@angular/platform-browser-dynamic": "~21.2.17",
- "@angular/router": "~21.2.17",
+ "@angular/common": "~22.2.1",
+ "@angular/compiler": "~22.2.1",
+ "@angular/core": "~22.2.1",
+ "@angular/forms": "~22.2.1",
+ "@angular/platform-browser": "~22.2.1",
+ "@angular/router": "~22.2.1",
"rxjs": "~7.8.1",
"tslib": "^2.6.2",
"zone.js": "~0.15.0"
...
},
"devDependencies": {
- "@angular-devkit/build-angular": "~21.2.17",
- "@angular-devkit/schematics": "~21.2.17",
- "@angular/cli": "~21.2.17",
- "@angular/compiler-cli": "~21.2.17",
+ "@angular-devkit/schematics": "~22.2.1",
+ "@angular/build": "~22.2.1",
+ "@angular/cli": "~22.2.1",
+ "@angular/compiler-cli": "~22.2.1",
...
- "typescript": "~5.9.3"
+ "typescript": "~6.0.3"
}
```
@@ -71,27 +69,11 @@ Caso prefira instalar com o yarn:
yarn install
```
-### Observação para Angular 19+/21+
+### Observação para Angular 19+
-Em versões mais recentes do Angular, o projeto pode utilizar o novo build system baseado em **@angular/build**. Caso ocorra o erro:
+Em versões mais recentes do Angular, o projeto utiliza, por padrão, novo build system baseado em **@angular/build**.
-```
-Could not find the @angular/build:dev-server builder's package
-```
-
-Verifique se o pacote está declarado em **devDependencies**:
-
-```
-npm install -D @angular/build
-```
-
-ou
-
-```
-pnpm install -D @angular/build
-```
-
-Além disso, valide no arquivo angular.json se o builder está configurado para **@angular/build:***:
+Verifique se o pacote está declarado em **devDependencies**. Além disso, valide no arquivo angular.json se o builder está configurado para **@angular/build:***:
```
"projects": {
@@ -108,17 +90,16 @@ Além disso, valide no arquivo angular.json se o builder está configurado para
}
```
-Se o **builder** for **@angular/build:***, o pacote **@angular/build** deve estar instalado. Caso esteja utilizando **@angular-devkit/build-angular**, o comportamento será o modelo tradicional.
Para maiores informações veja na documentação oficial do [Angular](https://angular.dev/tools/cli/build-system-migration).
-### Passo 2 - Adiconando o pacote @po-ui/ng-components
+### Passo 2 - Adicionando o pacote @po-ui/ng-components
Utilizando o comando `ng add` do [Angular CLI](https://cli.angular.io/), vamos adicionar o **Po** em seu projeto e o mesmo se encarregará de configurar o tema, instalar o pacote e importar o módulo do **Po**. Além de importar também o modulo **HttpClientModule**.
Execute o comando abaixo na pasta raiz do seu projeto:
```
-ng add @po-ui/ng-components
+ng add @po-ui/ng-components@next
```
> Ao executar o comando acima, será perguntado se deseja incluir uma estrutura inicial em seu projeto com menu lateral, página e toolbar, utilizando componentes do **Po**, **caso desejar, apenas informe: `Y`**.
@@ -146,7 +127,7 @@ Agora é só abrir seu **editor / IDE** favorito e começar a trabalhar no seu p
Caso você queira utilizar nossos componentes de templates, como o **[po-page-login](/documentation/po-page-login)**, **[po-modal-password-recovery](/documentation/po-modal-password-recovery)**, **[po-page-blocked-user](/documentation/po-page-blocked-user)**, **[po-page-dynamic-table](/documentation/po-page-dynamic-table)** entre outros, basta adicionar o pacote `@po-ui/ng-templates` executando o comando abaixo:
```
-ng add @po-ui/ng-templates
+ng add @po-ui/ng-templates@next
```
> Ao executar este comando, será instalado o pacote `@po-ui/ng-templates` e configurado o `PoTemplatesModules` no `app.module` somente se sua aplicação for configurada com módulos.
diff --git a/docs/guides/migration-poui.md b/docs/guides/migration-poui.md
index 0cfa0cceae..0562c97e17 100644
--- a/docs/guides/migration-poui.md
+++ b/docs/guides/migration-poui.md
@@ -13,8 +13,7 @@ Antes de atualizar a versão do PO UI, é importante que você tenha atualizado
o Angular que o PO UI está homologado, veja nossa
[tabela de compatibilidade](https://github.com/po-ui/po-angular/wiki#vers%C3%B5es-angular-x-po-ui) em nosso Github Wiki.
-> Caso o seu projeto esteja na versão Angular@20:
-Realize a instalação do pacote Schematics do Angular para o nosso script de atualização funcionar corretamente:
+> Caso o seu projeto não possua a dependência `@angular-devkit/schematics`, realize a instalação do pacote para o nosso script de atualização funcionar corretamente:
```
npm install @angular-devkit/schematics --save-dev
@@ -29,7 +28,7 @@ ng update @angular/cli@ @angular/core@ --force
Por exemplo:
```
-ng update @angular/cli@21 @angular/core@21 --force
+ng update @angular/cli@22 @angular/core@22 --force
```
> Para realizar a migração completa e avaliar se não precisa fazer alguma alteração veja o [**Guia de Upgrade do Angular**](https://update.angular.io/).
@@ -60,21 +59,11 @@ ng update @po-ui/ng-components@ --allow-dirty --force
Por exemplo:
```
-ng update @po-ui/ng-components --allow-dirty --force
+ng update @po-ui/ng-components@next --allow-dirty --force
```
> Caso ocorra um erro ao concluir o comando acima pode ser necessário fazer uma instalação limpa no projeto apagando a pasta `node_modules` e o arquivo `package-lock.json` e executando o comando `npm i --legacy-peer-deps` antes de realizar o `ng update`.
-> Caso sua aplicação seja configurada com módulos, pode ser necessária a inclusão da seguinte `devDependencies`:
-
-```json
- "devDependencies": {
- ...,
- "@angular-devkit/schematics": "~21.2.17",
- ...
- }
-```
-
O `ng update` ajudará nas alterações necessárias para seu projeto seguir atualizado, que são elas:
- Caso houver *breaking changes*, serão realizados as alterações possíveis, mas fique atento ao
[CHANGELOG](https://github.com/po-ui/po-angular/blob/master/CHANGELOG.md);
@@ -103,13 +92,44 @@ ng update @po-ui/ng-sync@ --allow-dirty --force
Por exemplo:
```
-ng update @po-ui/ng-sync --allow-dirty --force
+ng update @po-ui/ng-sync@next --allow-dirty --force
```
O `ng update` ajudará nas alterações necessárias para seu projeto, que será atualizar as versões dos pacotes:
- `@po-ui/ng-sync`;
- `@po-ui/ng-storage`;
+> Pode ocorrer o seguinte erro `TypeError: Failed to fetch dynamically imported module...`, sendo necessário adicionar ao arquivo `angular.json` as seguintes configurações:
+> ```json
+> {
+> "projects": {
+> "app": {
+> ...
+> "architect": {
+> ...
+> "build": {
+> ...
+> "options": {
+> ...
+> "polyfills": ["zone.js"],
+> },
+> },
+> "serve": {
+> ...
+> "builder": "@angular/build:dev-server",
+> "options": {
+> ...
+> "prebundle": {
+> "exclude": ["@ionic/angular", "@ionic/core", "ionicons"]
+> }
+> }
+> },
+> }
+> }
+> },
+> }
+> ```
+
## Depreciações e Breaking Changes
Possuimos uma documentação que lista as depreciações correntes e os *breaking changes* já realizados na biblioteca,
diff --git a/docs/guides/releases.md b/docs/guides/releases.md
index 815ef7d455..6b46443a0a 100644
--- a/docs/guides/releases.md
+++ b/docs/guides/releases.md
@@ -41,7 +41,12 @@ Consulte abaixo nossos guias de migração de versão para obter mais informaç
-
+
+ | 22.0.0 |
+ 22.0.0 |
+ Migração do PO UI |
+
+
| 21.0.0 |
21.0.0 |
Migração do PO UI |
diff --git a/docs/guides/schematics.md b/docs/guides/schematics.md
index 2a1a3c2643..fa5ced785a 100644
--- a/docs/guides/schematics.md
+++ b/docs/guides/schematics.md
@@ -13,7 +13,7 @@ Caso esteja iniciando uma aplicação com PO, indica-se utilizar o comando abaix
no qual será instalado o pacote `@po-ui/ng-components` e realizadas algumas configurações, que serão descritas em seguida:
```
-ng add @po-ui/ng-components
+ng add @po-ui/ng-components@next
```
- Substitui o `AppComponent` com uma estrutura incial de um projeto, utilizando os components `po-page-default`, `po-toolbar`, e `po-menu`;
@@ -26,127 +26,8 @@ Para a utilização de componentes de template o processo para inclusão é seme
Primeiramente, deve-se utilizar o comando abaixo, no qual será instalado o pacote `@po-ui/ng-templates`:
```
-ng add @po-ui/ng-templates
+ng add @po-ui/ng-templates@next
```
- Importa o módulo do PO;
- Configura o tema do PO no projeto caso não possua;
-
-## Generate Schematics
-
-O `PO` vem com vários `schematics` que podem ser usados para gerar componentes facilmente.
-
-Para gerar o componente, execute o comando abaixo, onde `package` é o pacote e ```schematic-name``` o componente que deseja:
-
-```
-ng generate :
-```
-
-> A lista de opções disponíveis que o CLI oferece para o *ng generate* é vista acrescentando `--help` no comando.
-
-### PO UI Components
-
-```
-ng generate @po-ui/ng-components:
-```
-
-
-
-
-
-
-
-
-
- | po-page-list
- |
-
- Componente que deve ser utilizado como o container principal para as telas de listagem de dados, podendo ser apresentado como lista ou tabela.
- |
-
-
- |
- po-page-default
- |
- Componente que deve ser utilizado como o container principal para as telas sem um template definido. |
-
-
- | po-page-edit
- |
- Componente que deve ser utilizado como container principal para tela de edição ou adição de um registro. |
-
-
- | po-page-detail
- |
- Componente que deve ser utilizado como container principal para a tela de detalhamento de um registro. |
-
-
-
-
-
-
-### Po UI Templates
-```
-ng generate @po-ui/ng-templates:
-```
-
-
-
-
-
-
-
-
-
- | po-page-dynamic-table
- |
- Página que exibe uma lista de registros em uma tabela baseado em uma lista de fields, o mesmo também suporta metadados conforme especificado na documentação.
- |
-
-
- |
- po-page-dynamic-detail
- |
- Página que serve para exibir registros em detalhes, o mesmo também suporta metadados conforme especificado na documentação.
- |
-
-
- | po-page-dynamic-edit |
- Página que pode servir para editar ou criar novos registros, o mesmo também suporta metadados conforme especificado na documentação.
- |
-
-
- | po-page-dynamic-search |
- Componente com as ações de pesquisa já definidas, bastando que o desenvolvedor implemente apenas a chamada para as APIs e exiba as informações.
- |
-
-
- | po-page-job-scheduler |
- Página que serve para criação e atualização de agendamentos da execução de processos (Job Scheduler), como por exemplo: a geração da folha de pagamento dos funcionários. Para utilizá-la, basta informar o serviço (endpoint) para consumo, sem a necessidade de criar componentes e tratamentos dos dados.
- |
-
-
- | po-page-login |
- Página utilizada como template para tela de login. Com ele é possível definirmos valores para usuário, senha e definir ações para recuperação de senha e gravação de dados do usuário. Também é possível inserir uma imagem em conjunto com um texto de destaque.
- |
-
-
- | po-page-change-password |
- Página utilizada como template para tela de cadastro ou alteração de senha.
- |
-
-
- | po-page-blocked-user |
- Página utilizada como template para tela de bloqueio de usuário.
- |
-
-
-
-
-
diff --git a/docs/guides/sync-get-started.md b/docs/guides/sync-get-started.md
index 6499a14c51..8e79ae9c26 100644
--- a/docs/guides/sync-get-started.md
+++ b/docs/guides/sync-get-started.md
@@ -9,13 +9,13 @@ Para maiores detalhes sobre os serviços e métodos utilizados neste tutorial, c
### Pré-requisitos
- [Node.js e NPM](https://nodejs.org/en/)
-- [Angular CLI](https://cli.angular.io/) (~21.2.17):
+- [Angular CLI](https://cli.angular.io/) (~22.2.1):
- ```shell
- npm install -g @angular/cli@21
+ npm install -g @angular/cli@22
```
-- [Ionic](https://ionicframework.com/docs/cli/) (^7.2.0):
+- [Ionic](https://ionicframework.com/docs/cli/):
- ```shell
- npm install -g @ionic/cli@7
+ npm install -g @ionic/cli
```
@@ -23,8 +23,6 @@ Para maiores detalhes sobre os serviços e métodos utilizados neste tutorial, c
### Passo 1 - Criando o aplicativo
-> Atualmente, a Ionic CLI cria novos projetos utilizando Angular 20 como versão base, independentemente da versão final desejada do Angular.
-
Para a aplicação de exemplo usaremos o template *blank* do Ionic. Para isso, execute o seguinte comando:
```shell
@@ -35,34 +33,24 @@ Caso surja a questão relacionada ao framework desejado, opte por `Angular`.
### Passo 2 - Instalando as dependências
-É necessário realizar alguns ajustes de compatibilidade do PO para o projeto criado.
+É necessário realizar alguns ajustes de compatibilidade do PO UI para o projeto criado.
Navegue até a pasta do aplicativo:
```shell
cd po-sync-getting-started
```
-Antes de instalar o po-sync, é necessário atualizar o projeto para o Angular 21, garantindo compatibilidade com o PO UI.
-
-```shell
-ng update @angular/core@21 @angular/cli@21
-```
-
-> Esse passo é necessário porque o projeto foi inicialmente criado com Angular 20, e o upgrade garante compatibilidade com as versões utilizadas pelo PO UI.
-
Veja abaixo a lista de dependências e as versões compatíveis, elas devem ser conferidas e se necessário, ajustadas no seu projeto.
```json
...
"dependencies": {
- "@angular/animations": "~21.2.17",
- "@angular/common": "~21.2.17",
- "@angular/compiler": "~21.2.17",
- "@angular/core": "~21.2.17",
- "@angular/forms": "~21.2.17",
- "@angular/platform-browser": "~21.2.17",
- "@angular/platform-browser-dynamic": "~21.2.17",
- "@angular/router": "~21.2.17",
+ "@angular/common": "~22.2.1",
+ "@angular/compiler": "~22.2.1",
+ "@angular/core": "~22.2.1",
+ "@angular/forms": "~22.2.1",
+ "@angular/platform-browser": "~22.2.1",
+ "@angular/router": "~22.2.1",
"@capacitor/app": "8.0.0",
"@capacitor/core": "8.0.1",
"@capacitor/haptics": "8.0.0",
@@ -76,22 +64,31 @@ Veja abaixo a lista de dependências e as versões compatíveis, elas devem ser
"zone.js": "~0.15.0"
},
"devDependencies": {
- "@angular-devkit/schematics": "~21.2.17",
- ...
- "@angular/cli": "~21.2.17",
- "@angular/compiler-cli": "~21.2.17",
- "@angular/language-service": "~21.2.17",
+ "@angular-devkit/schematics": "~22.2.1",
+ "@angular/build": "~22.2.1",
+ "@angular/cli": "~22.2.1",
+ "@angular/compiler-cli": "~22.2.1",
+ "@angular/language-service": "~22.2.1",
"@capacitor/cli": "8.0.1",
"@ionic/angular-toolkit": "^12.0.0",
...
- "typescript": "~5.9.3"
+ "typescript": "~6.0.3"
},
...
```
+> **Nota para projetos com módulos (NgModule)**: A CLI do Ionic pode gerar projetos com o arquivo `src/main.ts` utilizando o `platformBrowserDynamic`. Caso isso aconteça, será necessário adicionar o pacote `@angular/platform-browser-dynamic` no arquivo `package.json` (dentro de `dependencies`), juntamente com as outras dependências listadas acima:
+> ```json
+> "dependencies": {
+> ...
+> "@angular/platform-browser-dynamic": "~22.2.1",
+> ...
+> }
+> ```
+
> Após configurar seu arquivo, certifique-se de salvar as alterações realizadas.
-Execute o seguinte comando para instalar as dependências:
+Realize a limpeza do arquivo `package-lock.json` e da pasta `node_modules/`, para então executar o seguinte comando para instalar as dependências:
```shell
npm install
@@ -102,14 +99,14 @@ npm install
Para instalar o `po-sync` no aplicativo execute o seguinte comando:
```shell
-ng add @po-ui/ng-sync
+ng add @po-ui/ng-sync@next
```
### Passo 4 - Utilizando o po-sync
#### Passo 4.1 (NgModule) - Importando o `po-sync` e o `po-storage`
-No arquivo `src/app/app.module.ts`, adicione a importação dos módulos do `po-storage` e do `po-sync`:
+No arquivo `src/app/app.module.ts`, adicione a importação dos módulos do `po-storage` e do `po-sync`:
```typescript
import { NgModule } from '@angular/core';
@@ -145,7 +142,7 @@ export class AppModule {}
#### Passo 4.1 (Standalone) - Importando o `po-sync` e o `po-storage`
-No arquivo `src/main.ts`, adicione a importação dos módulos do `po-storage` e do `po-sync`:
+No arquivo `src/main.ts`, avalie se foi feita a importação dos módulos do `po-storage` e do `po-sync`:
```typescript
import { bootstrapApplication } from '@angular/platform-browser';
@@ -201,7 +198,7 @@ Após ter o seu primeiro *schema* criado, configure o seu aplicativo utilizando
Substitua o conteúdo do arquivo pelo conteúdo abaixo:
```typescript
-import { Component } from '@angular/core';
+import { Component, OnInit, inject } from '@angular/core';
import { Capacitor } from '@capacitor/core';
import { Platform } from '@ionic/angular';
import { SplashScreen } from '@capacitor/splash-screen';
@@ -215,8 +212,11 @@ import { conferenceSchema } from './home/conference-schema.constants';
styleUrls: ['app.component.scss'],
standalone: false
})
-export class AppComponent {
- constructor(private platform: Platform, private poSync: PoSyncService) {
+export class AppComponent implements OnInit {
+ private readonly platform = inject(Platform);
+ private readonly poSync = inject(PoSyncService);
+
+ ngOnInit() {
this.initializeApp();
}
@@ -249,7 +249,7 @@ Após utilizar o método `PoSyncService.prepare()`, a aplicação estará pronta
Substitua o conteúdo do arquivo pelo conteúdo abaixo:
```typescript
-import { Component } from '@angular/core';
+import { Component, OnInit, inject } from '@angular/core';
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
import { Capacitor } from '@capacitor/core';
import { Platform } from '@ionic/angular';
@@ -264,10 +264,11 @@ import { conferenceSchema } from './home/conference-schema.constants';
templateUrl: 'app.component.html',
imports: [IonApp, IonRouterOutlet],
})
-export class AppComponent {
- constructor(
- private platform: Platform, private poSync: PoSyncService
- ) {
+export class AppComponent implements OnInit {
+ private readonly platform = inject(Platform);
+ private readonly poSync = inject(PoSyncService);
+
+ ngOnInit() {
this.initializeApp();
}
@@ -297,10 +298,35 @@ export class AppComponent {
### Passo 6 (NgModule) - Acessando os dados
+Caso o projeto tenha sido gerado em uma versão anterior a 9.x do `@ionic/angular`, no arquivo `po-sync-getting-started/src/app/home/home.module.ts`, atualize a importação do `IonicModule` para utilizar o caminho `import { IonicModule } from '@ionic/angular';`:
+
+```typescript
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { IonicModule } from '@ionic/angular';
+import { FormsModule } from '@angular/forms';
+import { HomePage } from './home.page';
+
+import { HomePageRoutingModule } from './home-routing.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ HomePageRoutingModule
+ ],
+ declarations: [HomePage]
+})
+export class HomePageModule {}
+```
+
+> **Nota sobre importação do `IonicModule`**: As versões anteriores à 9.x do `@ionic/angular` não possuem o export `lazy`, devendo ser feito o import de `@ionic/angular`. A partir da versão 9.x, o import de `@ionic/angular/lazy` funciona normalmente (sendo o padrão da CLI do ionic para projetos standalone).
+
Localize o arquivo `src/app/home/home.page.ts` e faça as seguintes alterações:
```typescript
-import { Component } from '@angular/core';
+import { Component, inject, signal } from '@angular/core';
import { PoSyncService } from '@po-ui/ng-sync';
@@ -311,21 +337,21 @@ import { PoSyncService } from '@po-ui/ng-sync';
standalone: false
})
export class HomePage {
+ private readonly poSync = inject(PoSyncService);
- conference: any;
+ readonly conference = signal(null);
- constructor(private poSync: PoSyncService) {
+ constructor() {
this.poSync.onSync().subscribe(() => this.loadHomePage());
}
async loadHomePage() {
- this.conference = await this.poSync.getModel('conference').findOne().exec();
+ this.conference.set(await this.poSync.getModel('conference').findOne().exec());
}
clear() {
- this.conference = null;
+ this.conference.set(null);
}
-
}
```
@@ -336,31 +362,38 @@ No construtor, foi realizado uma inscrição no método `PoSyncService.onSync()`
Localize o arquivo `src/app/home/home.page.ts` e faça as seguintes alterações:
```typescript
-import { Component } from '@angular/core';
-import { NgIf } from '@angular/common';
-
-import { IonicModule } from '@ionic/angular';
+import { Component, inject, signal } from '@angular/core';
+
+import {
+ IonContent,
+ IonButton,
+ IonCard,
+ IonCardContent,
+ IonCardTitle
+} from '@ionic/angular/standalone';
import { PoSyncService } from '@po-ui/ng-sync';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
- imports: [IonicModule, NgIf],
+ imports: [IonContent, IonButton, IonCard, IonCardContent, IonCardTitle],
})
export class HomePage {
- conference: any;
+ private readonly poSync = inject(PoSyncService);
+
+ readonly conference = signal(null);
- constructor(private poSync: PoSyncService) {
+ constructor() {
this.poSync.onSync().subscribe(() => this.loadHomePage());
}
async loadHomePage() {
- this.conference = await this.poSync.getModel('conference').findOne().exec();
+ this.conference.set(await this.poSync.getModel('conference').findOne().exec());
}
clear() {
- this.conference = null;
+ this.conference.set(null);
}
}
@@ -371,18 +404,20 @@ export class HomePage {
No arquivo `src/app/home/home.page.html` crie a seguinte estrutura:
```html
- Buscar informações
- Apagar informações
-
-
-
-
- {{ conference.title }}
-
- {{ conference.description }}
- {{ conference.location }}
-
-
+ Buscar informações
+ Apagar informações
+
+ @if (conference(); as conference) {
+
+
+
+ {{ conference.title }}
+
+ {{ conference.description }}
+ {{ conference.location }}
+
+
+ }
```
@@ -390,7 +425,38 @@ No arquivo `src/app/home/home.page.html` crie a seguinte estrutura:
Execute o comando `ionic serve` e verifique o funcionamento do aplicativo Ionic com `po-sync`.
-> Pode ocorrer o seguinte erro `TS2320: Interface 'HTMLIonIconElement' cannot simultaneously extend types 'IonIcon' and 'HTMLStencilElement'` por conta da versão do TypeScript (5.2.x) conforme esta [issue](https://github.com/ionic-team/ionicons/issues/1011), neste caso adicione no arquivo **tsconfig.json** `"skipLibCheck": true`.
+> Pode ocorrer o seguinte erro `TypeError: Failed to fetch dynamically imported module...`, sendo necessário adicionar ao arquivo `angular.json` as seguintes configurações:
+> ```json
+> {
+> "projects": {
+> "app": {
+> ...
+> "architect": {
+> ...
+> "build": {
+> ...
+> "options": {
+> ...
+> "polyfills": ["zone.js"],
+> },
+> },
+> "serve": {
+> ...
+> "builder": "@angular/build:dev-server",
+> "options": {
+> ...
+> "prebundle": {
+> "exclude": ["@ionic/angular", "@ionic/core", "ionicons"]
+> }
+> }
+> },
+> }
+> }
+> },
+> }
+> ```
+
+> Pode ocorrer o seguinte erro `TS2320: Interface 'HTMLIonIconElement' cannot simultaneously extend types 'IonIcon' and 'HTMLStencilElement'` por conta da versão do TypeScript conforme esta [issue](https://github.com/ionic-team/ionicons/issues/1011), neste caso adicione no arquivo **tsconfig.json** `"skipLibCheck": true`.
> Ao executar um projeto standalone, pode ocorrer o seguinte erro: `[ERROR] Invalid project type: angular-standalone (project config: ./ionic.config.json).`. Para corrigir, edite o arquivo `ionic.config.json` e ajuste a propriedade `type` para o valor `angular`.
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 0000000000..a3aaffd3ed
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,248 @@
+// Flat config (ESLint 9 / angular-eslint 22 / typescript-eslint 8).
+//
+// Migrado a partir dos arquivos .eslintrc.json legados. As regras foram
+// preservadas conforme o modelo anterior. Os presets "recommended" do
+// @angular-eslint e do @typescript-eslint sao carregados via os pacotes
+// umbrella (angular-eslint / typescript-eslint), ja que os pacotes granulares
+// da v22 nao expoem os shareable configs no formato eslintrc usado pelo
+// FlatCompat.
+import tseslint from 'typescript-eslint';
+import angular from 'angular-eslint';
+import sonarjs from 'eslint-plugin-sonarjs';
+
+export default tseslint.config(
+ {
+ ignores: [
+ 'dist/**',
+ 'node_modules/**',
+ '.angular/**',
+ 'coverage/**',
+ 'out-tsc/**',
+ // Fixtures de teste manual da migracao do po-gauge: arquivos de entrada
+ // propositalmente crafted (usos de po-gauge, @ts-ignore, etc.) que servem
+ // de material para a schematic transformar; nao devem ser lintados.
+ 'projects/ui/schematics/ng-update/v22/gauge-manual-test/**'
+ ]
+ },
+ {
+ // O modelo legado (.eslintrc.json) nao reportava diretivas eslint-disable
+ // nao utilizadas; mantem o mesmo comportamento.
+ linterOptions: {
+ reportUnusedDisableDirectives: 'off'
+ }
+ },
+ {
+ files: ['**/*.ts'],
+ extends: [
+ // Baseline "recommended" equivalente ao modelo legado
+ // (plugin:@typescript-eslint/recommended + plugin:@angular-eslint/recommended).
+ ...tseslint.configs.recommended,
+ ...angular.configs.tsRecommended
+ ],
+ // Habilita o processamento de templates inline dos componentes
+ // (equivalente a plugin:@angular-eslint/template/process-inline-templates).
+ processor: angular.processInlineTemplates,
+ plugins: {
+ sonarjs
+ },
+ languageOptions: {
+ parserOptions: {
+ // Usa o Project Service do typescript-eslint (v8+) em vez de listar
+ // manualmente todos os tsconfigs. O Project Service resolve o tsconfig
+ // correto por arquivo sob demanda e reaproveita Programs, reduzindo
+ // drasticamente o consumo de memoria (evita OOM ao manter 14 Programs
+ // TypeScript vivos ao mesmo tempo).
+ projectService: true,
+ tsconfigRootDir: import.meta.dirname
+ }
+ },
+ rules: {
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-this-alias': 'off',
+ '@typescript-eslint/no-unused-vars': 'off',
+ '@typescript-eslint/no-array-constructor': 'off',
+ '@angular-eslint/component-selector': [
+ 'error',
+ { type: ['element', 'attribute'], prefix: '', style: 'kebab-case' }
+ ],
+ '@angular-eslint/directive-class-suffix': 'off',
+ '@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: '', style: 'kebab-case' }],
+ '@angular-eslint/no-input-rename': 'off',
+ '@angular-eslint/no-output-rename': 'off',
+ '@angular-eslint/no-output-native': 'off',
+ '@angular-eslint/no-output-on-prefix': 'off',
+ '@angular-eslint/no-conflicting-lifecycle': 'off',
+ '@typescript-eslint/array-type': ['error', { default: 'generic' }],
+ '@typescript-eslint/await-thenable': 'error',
+ '@typescript-eslint/consistent-type-assertions': 'off',
+ '@typescript-eslint/consistent-type-definitions': 'error',
+ '@typescript-eslint/dot-notation': 'off',
+ '@typescript-eslint/explicit-member-accessibility': ['off', { accessibility: 'explicit' }],
+ '@typescript-eslint/no-empty-interface': 'off',
+ '@typescript-eslint/no-for-in-array': 'error',
+ '@typescript-eslint/no-inferrable-types': ['off', { ignoreParameters: true }],
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error',
+ '@typescript-eslint/no-unused-expressions': 'off',
+ '@typescript-eslint/no-var-requires': 'error',
+ '@typescript-eslint/prefer-for-of': 'off',
+ '@typescript-eslint/require-array-sort-compare': ['error', { ignoreStringArrays: true }],
+ camelcase: 'off',
+ '@typescript-eslint/naming-convention': [
+ 'error',
+ { selector: 'default', format: ['camelCase'] },
+ { selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'snake_case', 'PascalCase'], leadingUnderscore: 'allow' },
+ { selector: 'import', format: ['camelCase', 'PascalCase'], leadingUnderscore: 'allow' },
+ { selector: 'classProperty', format: ['camelCase', 'UPPER_CASE', 'snake_case', 'PascalCase'], leadingUnderscore: 'allow' },
+ { selector: 'parameter', format: ['camelCase'], leadingUnderscore: 'allow' },
+ { selector: 'memberLike', modifiers: ['private'], format: ['camelCase'], leadingUnderscore: 'allow' },
+ { selector: 'typeLike', format: ['PascalCase', 'camelCase'] },
+ { selector: 'enumMember', format: ['UPPER_CASE', 'camelCase', 'PascalCase'], leadingUnderscore: 'allow' },
+ { selector: ['objectLiteralMethod'], format: ['PascalCase', 'camelCase', 'snake_case', 'UPPER_CASE'], leadingUnderscore: 'allow' },
+ { selector: ['objectLiteralProperty'], format: null, leadingUnderscore: 'allow' },
+ { selector: 'function', format: ['PascalCase', 'camelCase'], leadingUnderscore: 'allow' }
+ ],
+ '@typescript-eslint/member-ordering': ['error', { default: ['signature', 'field', 'constructor', 'method'] }],
+ 'arrow-parens': ['off', 'always'],
+ 'arrow-body-style': ['error', 'as-needed'],
+ 'brace-style': ['off', 'off'],
+ 'default-case-last': 'error',
+ 'dot-notation': 'off',
+ 'eol-last': 'off',
+ 'id-blacklist': 'off',
+ 'id-match': 'off',
+ indent: 'off',
+ 'linebreak-style': 'off',
+ 'max-len': 'off',
+ 'max-lines-per-function': ['off', { max: 200 }],
+ 'max-params': ['error', { max: 8 }],
+ 'new-parens': 'off',
+ 'newline-per-chained-call': 'off',
+ 'no-empty-function': 'off',
+ 'no-empty-pattern': 'off',
+ 'no-extra-parens': 'off',
+ 'no-extra-semi': 'error',
+ 'no-irregular-whitespace': 'off',
+ 'no-multi-str': 'error',
+ 'no-self-assign': 'error',
+ 'no-shadow': 'off',
+ 'no-trailing-spaces': 'off',
+ 'no-underscore-dangle': 'off',
+ // No modelo legado, o preset @typescript-eslint/recommended desligava a
+ // regra core `no-unused-expressions` (em favor da versao TS, que estava
+ // `off`). O efeito liquido era nenhuma das duas ativa; mantido igual.
+ 'no-unused-expressions': 'off',
+ '@typescript-eslint/no-unused-expressions': 'off',
+ 'no-use-before-define': 'off',
+ 'object-shorthand': 'off',
+ 'padded-blocks': ['off', { blocks: 'never' }, { allowSingleLineBlocks: true }],
+ 'quote-props': 'off',
+ semi: 'off',
+ 'sonarjs/cognitive-complexity': 'off',
+ 'sonarjs/max-switch-cases': 'error',
+ 'sonarjs/no-all-duplicated-branches': 'error',
+ 'sonarjs/no-collapsible-if': 'error',
+ 'sonarjs/no-collection-size-mischeck': 'error',
+ 'sonarjs/no-duplicate-string': 'off',
+ 'sonarjs/no-duplicated-branches': 'off',
+ 'sonarjs/no-element-overwrite': 'error',
+ 'sonarjs/no-identical-conditions': 'error',
+ 'sonarjs/no-identical-expressions': 'error',
+ 'sonarjs/no-identical-functions': 'off',
+ 'sonarjs/no-inverted-boolean-check': 'error',
+ 'sonarjs/no-redundant-boolean': 'error',
+ 'sonarjs/no-redundant-jump': 'error',
+ 'sonarjs/no-same-line-conditional': 'error',
+ 'sonarjs/no-small-switch': 'error',
+ 'sonarjs/no-unused-collection': 'error',
+ 'sonarjs/no-use-of-empty-return-value': 'error',
+ 'sonarjs/no-useless-catch': 'error',
+ 'sonarjs/prefer-immediate-return': 'error',
+ 'space-before-function-paren': 'off',
+ 'space-in-parens': ['off', 'never'],
+ '@angular-eslint/prefer-standalone': 'off',
+ '@typescript-eslint/no-unsafe-function-type': 'off',
+ '@typescript-eslint/no-empty-object-type': 'off',
+ '@angular-eslint/prefer-inject': 'off',
+ // Nao fazia parte do preset "recommended" legado do @angular-eslint (v21);
+ // o preset da v22 passou a inclui-la. Desligada para preservar o
+ // comportamento anterior.
+ '@angular-eslint/prefer-on-push-component-change-detection': 'off'
+ }
+ },
+ // Arquivos de schematics sao compilados com tsconfig.schematics.json
+ // (strictNullChecks: true). Type-checa-los com o mesmo tsconfig evita que
+ // regras type-aware (ex.: no-unnecessary-type-assertion) divirjam do build:
+ // sem isso, o lint usa o tsconfig.lib.json (strict: false) e considera
+ // desnecessarios os `!`/casts que o build strict realmente exige.
+ // Com o Project Service habilitado no bloco base, a associacao arquivo ->
+ // tsconfig e resolvida automaticamente (inclusive para os tsconfigs de
+ // schematics). Por isso nao e mais necessario declarar `project` aqui; fazer
+ // isso gera erro "Enabling 'project' does nothing when 'projectService' is
+ // enabled". Os blocos abaixo permanecem apenas como marcadores/documentacao
+ // do escopo, sem override de parserOptions.
+
+ // ---------------------------------------------------------------------------
+ // Overrides por projeto (equivalentes aos .eslintrc.json de cada projeto).
+ // Aplicados apos o bloco compartilhado; em flat config, blocos posteriores
+ // sobrescrevem os anteriores para os arquivos correspondentes.
+ // ---------------------------------------------------------------------------
+
+ // projects/ui: directive-selector como "warn"; specs e alguns arquivos
+ // excluidos das regras TS; regras extras desligadas.
+ {
+ ignores: ['projects/ui/**/util-expect.spec.ts']
+ },
+ {
+ files: ['projects/ui/**/*.ts'],
+ ignores: [
+ 'projects/ui/**/test.ts',
+ 'projects/ui/**/*.spec.ts',
+ 'projects/ui/**/*.po.ts',
+ 'projects/ui/src/lib/util-test/util-expect.spec.ts'
+ ],
+ rules: {
+ '@angular-eslint/directive-selector': ['warn', { type: 'attribute', prefix: '', style: 'kebab-case' }],
+ // Nota: @angular-eslint/no-host-metadata-property foi removida na v22 e
+ // por isso nao e mais referenciada (era `off` no modelo legado, sem efeito).
+ 'prefer-spread': 'off'
+ }
+ },
+
+ // projects/sync: selectors com prefixo "lib".
+ {
+ files: ['projects/sync/**/*.ts'],
+ rules: {
+ '@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'lib', style: 'kebab-case' }],
+ '@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: 'lib', style: 'camelCase' }]
+ }
+ },
+
+ // projects/portal: selectors com prefixo "app"; pastas de docs/samples ignoradas.
+ {
+ ignores: ['projects/portal/docs/**/*', 'projects/portal/src/app/documentation/samples/**/*']
+ },
+ {
+ files: ['projects/portal/**/*.ts'],
+ rules: {
+ '@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'app', style: 'kebab-case' }],
+ '@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: 'app', style: 'camelCase' }]
+ }
+ },
+
+ // projects/app: no-extra-parens habilitado como erro.
+ {
+ files: ['projects/app/**/*.ts'],
+ rules: {
+ 'no-extra-parens': 'error'
+ }
+ },
+
+ {
+ files: ['**/*.html'],
+ extends: [...angular.configs.templateRecommended],
+ rules: {
+ '@angular-eslint/template/prefer-control-flow': 'warn'
+ }
+ }
+);
diff --git a/package.json b/package.json
index 93914b08d4..daab11d93b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "po-ui-sources",
- "version": "21.35.0",
+ "version": "22.0.0-rc.0",
"description": "PO UI",
"homepage": "https://po-ui.io",
"license": "MIT",
@@ -27,7 +27,7 @@
"test:sync:schematics": "gulp build:schematics --lib sync && jasmine \"dist/ng-sync/schematics/**/*.spec.js\"",
"test:sync:browse": "ng test sync --code-coverage --browsers=Chrome --source-map",
"test:ui": "ng test ui --watch=false --code-coverage --browsers=ChromeHeadless --source-map",
- "test:ui:schematics": "gulp build:schematics --lib ui && jasmine \"./dist/ng-components/schematics/**/*.spec.js\"",
+ "test:ui:schematics": "gulp clean:schematics --lib ui && gulp build:schematics:lib && gulp build:schematics:spec --lib ui && jasmine \"./dist/ng-components/schematics/**/*.spec.js\"",
"test:ui:browse": "ng test ui --code-coverage --browsers=Chrome --source-map",
"test:templates": "ng test templates --watch=false --code-coverage --browsers=ChromeHeadless --source-map",
"test:templates:schematics": "gulp build:schematics --lib templates && jasmine \"dist/ng-templates/schematics/**/*.spec.js\"",
@@ -68,18 +68,16 @@
},
"private": true,
"dependencies": {
- "@angular/animations": "~21.2.17",
- "@angular/cdk": "~21.2.14",
- "@angular/common": "~21.2.17",
- "@angular/compiler": "~21.2.17",
- "@angular/core": "~21.2.17",
- "@angular/forms": "~21.2.17",
- "@angular/platform-browser": "~21.2.17",
- "@angular/platform-browser-dynamic": "~21.2.17",
- "@angular/router": "~21.2.17",
+ "@angular/cdk": "~22.2.1",
+ "@angular/common": "~22.2.1",
+ "@angular/compiler": "~22.2.1",
+ "@angular/core": "~22.2.1",
+ "@angular/forms": "~22.2.1",
+ "@angular/platform-browser": "~22.2.1",
+ "@angular/router": "~22.2.1",
"@capacitor/core": "5.7.2",
"@capacitor/network": "^5.0.7",
- "@po-ui/style": "21.35.0",
+ "@po-ui/style": "22.0.0-rc.0",
"custom-idle-queue": "4.0.0",
"driver.js": "~1.4.0",
"echarts": "^6.1.0",
@@ -92,19 +90,21 @@
"zone.js": "~0.15.0"
},
"devDependencies": {
- "@angular-devkit/build-angular": "~21.2.17",
- "@angular-eslint/builder": "^21.1.0",
- "@angular-eslint/eslint-plugin": "^21.1.0",
- "@angular-eslint/eslint-plugin-template": "^21.1.0",
- "@angular-eslint/schematics": "^21.1.0",
- "@angular-eslint/template-parser": "^21.1.0",
- "@angular/cli": "~21.2.17",
- "@angular/compiler-cli": "~21.2.17",
- "@angular/language-service": "~21.2.17",
+ "@angular-eslint/builder": "^22.0.0",
+ "@angular-eslint/eslint-plugin": "^22.0.0",
+ "@angular-eslint/eslint-plugin-template": "^22.0.0",
+ "@angular-eslint/schematics": "^22.0.0",
+ "@angular-eslint/template-parser": "^22.0.0",
+ "@angular/build": "~22.2.1",
+ "@angular/cli": "~22.2.1",
+ "@angular/compiler-cli": "~22.2.1",
+ "@angular/language-service": "~22.2.1",
"@animaliads/animalia-icon": "^1.1.0",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-angular": "^18.4.3",
- "@po-ui/ng-schematics": "^18.0.0",
+ "@eslint/eslintrc": "^3.3.7",
+ "@eslint/js": "^9.39.5",
+ "@po-ui/ng-schematics": "file:dist/ng-schematics",
"@types/jasmine": "~5.1.4",
"@types/jasminewd2": "~2.0.13",
"@types/node": "25.0.1",
@@ -112,6 +112,7 @@
"@types/systemjs": "^6.13.5",
"@typescript-eslint/eslint-plugin": "^8.33.1",
"@typescript-eslint/parser": "^8.33.1",
+ "angular-eslint": "^22.2.0",
"capitalize": "^2.0.4",
"colors": "1.4.0",
"core-js": "3.33.3",
@@ -129,6 +130,7 @@
"gulp-tap": "^2.0.0",
"highlight.js": "^11.9.0",
"husky": "^8.0.0",
+ "istanbul-lib-instrument": "^6.0.3",
"jasmine": "2.8.0",
"jasmine-core": "5.1.1",
"jasmine-spec-reporter": "7.0.0",
@@ -139,16 +141,16 @@
"karma-jasmine-html-reporter": "2.1.0",
"lint-staged": "^15.1.0",
"mkdirp": "3.0.1",
- "ng-packagr": "~21.2.5",
- "ngx-markdown": "^21.0.1",
- "prettier": "^3.9.4",
+ "ng-packagr": "~22.0.0",
+ "ngx-markdown": "^22.0.0",
+ "prettier": "^3.1.0",
"rollup": "4.60.1",
"run-sequence": "^2.2.1",
"rxjs-compat": "~6.6.7",
"standard-version": "^9.5.0",
"ts-node": "~10.9.1",
"typemoq": "^2.1.0",
- "typescript": "~5.9.3",
+ "typescript": "~6.0.3",
"validate.js": "file:libs/validate.js-v0.13.2.tgz",
"yargs": "^17.7.2"
},
diff --git a/projects/app/.eslintrc.json b/projects/app/.eslintrc.json
deleted file mode 100644
index 410dd78e8e..0000000000
--- a/projects/app/.eslintrc.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "extends": "../../.eslintrc.json",
- "ignorePatterns": ["!**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["projects/app/tsconfig.app.json", "projects/app/tsconfig.spec.json"],
- "createDefaultProgram": true
- },
- "plugins": ["sonarjs"],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": ["element", "attribute"],
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "arrow-parens": ["off", "always"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "error",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": "error",
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"]
- }
- },
- {
- "files": ["*.html"],
- "rules": {}
- }
- ]
-}
diff --git a/projects/app/src/app/app.component.ts b/projects/app/src/app/app.component.ts
index 7bf08e2511..9de48f8882 100644
--- a/projects/app/src/app/app.component.ts
+++ b/projects/app/src/app/app.component.ts
@@ -1,8 +1,9 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class AppComponent {}
diff --git a/projects/app/src/app/app.module.ts b/projects/app/src/app/app.module.ts
index 919d44b3de..57d48ac7f7 100644
--- a/projects/app/src/app/app.module.ts
+++ b/projects/app/src/app/app.module.ts
@@ -1,4 +1,4 @@
-import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
+import { provideHttpClient, withInterceptorsFromDi, withXhr } from '@angular/common/http';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { NgModule } from '@angular/core';
@@ -12,6 +12,6 @@ import { AppComponent } from './app.component';
declarations: [AppComponent],
bootstrap: [AppComponent],
imports: [BrowserModule, FormsModule, RouterModule.forRoot([], {}), PoModule],
- providers: [provideHttpClient(withInterceptorsFromDi())]
+ providers: [provideHttpClient(withXhr(), withInterceptorsFromDi())]
})
export class AppModule {}
diff --git a/projects/app/src/main.ts b/projects/app/src/main.ts
index e4a844c38a..f77aa4e348 100644
--- a/projects/app/src/main.ts
+++ b/projects/app/src/main.ts
@@ -1,5 +1,5 @@
import { enableProdMode, provideZoneChangeDetection } from '@angular/core';
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { platformBrowser } from '@angular/platform-browser';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
@@ -8,6 +8,6 @@ if (environment.production) {
enableProdMode();
}
-platformBrowserDynamic()
+platformBrowser()
.bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] })
.catch(err => console.error('Error in app bootstrap:', err));
diff --git a/projects/app/tsconfig.app.json b/projects/app/tsconfig.app.json
index cc10af0398..e1e7730a29 100644
--- a/projects/app/tsconfig.app.json
+++ b/projects/app/tsconfig.app.json
@@ -5,5 +5,8 @@
"types": []
},
"files": ["src/main.ts", "src/polyfills.ts"],
- "include": ["src/**/*.d.ts"]
+ "include": ["src/**/*.d.ts"],
+ "angularCompilerOptions": {
+ "strictTemplates": false
+ }
}
diff --git a/projects/code-editor/.eslintrc.json b/projects/code-editor/.eslintrc.json
deleted file mode 100644
index 9de0388323..0000000000
--- a/projects/code-editor/.eslintrc.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "extends": "../../.eslintrc.json",
- "ignorePatterns": ["!**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["projects/code-editor/tsconfig.lib.json", "projects/code-editor/tsconfig.spec.json"],
- "createDefaultProgram": true
- },
- "plugins": ["sonarjs"],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": ["element", "attribute"],
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "arrow-parens": ["off", "always"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": "error",
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"]
- }
- },
- {
- "files": ["*.html"],
- "rules": {}
- }
- ]
-}
diff --git a/projects/code-editor/karma.conf.js b/projects/code-editor/karma.conf.js
index 011cc1dbb4..48e41f9154 100644
--- a/projects/code-editor/karma.conf.js
+++ b/projects/code-editor/karma.conf.js
@@ -9,8 +9,7 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
+ require('karma-coverage')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
diff --git a/projects/code-editor/package.json b/projects/code-editor/package.json
index 0676c54d14..c8801a8bdc 100644
--- a/projects/code-editor/package.json
+++ b/projects/code-editor/package.json
@@ -19,9 +19,9 @@
"tslib": "^2.6.2"
},
"peerDependencies": {
- "@angular/common": "^21",
- "@angular/core": "^21",
- "@angular/forms": "^21",
+ "@angular/common": "^22",
+ "@angular/core": "^22",
+ "@angular/forms": "^22",
"@po-ui/ng-components": "0.0.0-PLACEHOLDER",
"monaco-editor": "0.44.0",
"zone.js": "~0.15.0"
diff --git a/projects/code-editor/src/lib/components/po-code-editor/po-code-editor.component.ts b/projects/code-editor/src/lib/components/po-code-editor/po-code-editor.component.ts
index ee14c79755..9f57fc5cd3 100644
--- a/projects/code-editor/src/lib/components/po-code-editor/po-code-editor.component.ts
+++ b/projects/code-editor/src/lib/components/po-code-editor/po-code-editor.component.ts
@@ -1,4 +1,14 @@
-import { AfterViewInit, Component, DoCheck, ElementRef, forwardRef, NgZone, ViewChild, Provider } from '@angular/core';
+import {
+ AfterViewInit,
+ Component,
+ DoCheck,
+ ElementRef,
+ forwardRef,
+ NgZone,
+ ViewChild,
+ Provider,
+ ChangeDetectionStrategy
+} from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { PoCodeEditorBaseComponent } from './po-code-editor-base.component';
@@ -60,6 +70,7 @@ const providers: Array = [
selector: 'po-code-editor',
templateUrl: './po-code-editor.component.html',
providers,
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class PoCodeEditorComponent extends PoCodeEditorBaseComponent implements AfterViewInit, DoCheck {
diff --git a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-basic/sample-po-code-editor-basic.component.ts b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-basic/sample-po-code-editor-basic.component.ts
index c684b8c0e1..adc106e705 100644
--- a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-basic/sample-po-code-editor-basic.component.ts
+++ b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-basic/sample-po-code-editor-basic.component.ts
@@ -1,8 +1,9 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'sample-po-code-editor-basic',
templateUrl: './sample-po-code-editor-basic.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class SamplePoCodeEditorBasicComponent {}
diff --git a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-diff/sample-po-code-editor-diff.component.ts b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-diff/sample-po-code-editor-diff.component.ts
index 1884a96c6a..befc3a0a55 100644
--- a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-diff/sample-po-code-editor-diff.component.ts
+++ b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-diff/sample-po-code-editor-diff.component.ts
@@ -1,8 +1,9 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'sample-po-code-editor-diff',
templateUrl: './sample-po-code-editor-diff.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class SamplePoCodeEditorDiffComponent {
diff --git a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-labs/sample-po-code-editor-labs.component.ts b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-labs/sample-po-code-editor-labs.component.ts
index cc80b5510d..bcef0e9cfb 100644
--- a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-labs/sample-po-code-editor-labs.component.ts
+++ b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-labs/sample-po-code-editor-labs.component.ts
@@ -1,10 +1,11 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { PoCheckboxGroupOption, PoSelectOption } from '@po-ui/ng-components';
@Component({
selector: 'sample-po-code-editor-labs',
templateUrl: './sample-po-code-editor-labs.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class SamplePoCodeEditorLabsComponent implements OnInit {
diff --git a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-suggestion/sample-po-code-editor-suggestion.component.ts b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-suggestion/sample-po-code-editor-suggestion.component.ts
index d21c4f15f6..df2ae7126c 100644
--- a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-suggestion/sample-po-code-editor-suggestion.component.ts
+++ b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-suggestion/sample-po-code-editor-suggestion.component.ts
@@ -1,8 +1,9 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'sample-po-code-editor-suggestion',
templateUrl: './sample-po-code-editor-suggestion.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class SamplePoCodeEditorSuggestionComponent {
diff --git a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-terraform/sample-po-code-editor-terraform.component.ts b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-terraform/sample-po-code-editor-terraform.component.ts
index f16e7e57e3..253b93737b 100644
--- a/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-terraform/sample-po-code-editor-terraform.component.ts
+++ b/projects/code-editor/src/lib/components/po-code-editor/samples/sample-po-code-editor-terraform/sample-po-code-editor-terraform.component.ts
@@ -1,8 +1,9 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'sample-po-code-editor-terraform',
templateUrl: './sample-po-code-editor-terraform.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class SamplePoCodeEditorTerraformComponent {}
diff --git a/projects/code-editor/src/test.ts b/projects/code-editor/src/test.ts
index 8f714a3c85..89c3949e89 100644
--- a/projects/code-editor/src/test.ts
+++ b/projects/code-editor/src/test.ts
@@ -1,11 +1,15 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
-import 'zone.js';
-import 'zone.js/testing';
+import { NgModule, provideZoneChangeDetection } from '@angular/core';
import { getTestBed } from '@angular/core/testing';
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
+@NgModule({
+ providers: [provideZoneChangeDetection()]
+})
+class AppTestingModule {}
+
// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {
+getTestBed().initTestEnvironment([BrowserTestingModule, AppTestingModule], platformBrowserTesting(), {
teardown: { destroyAfterEach: false }
});
diff --git a/projects/code-editor/tsconfig.lib.json b/projects/code-editor/tsconfig.lib.json
index cf6fbcdce5..7033507129 100644
--- a/projects/code-editor/tsconfig.lib.json
+++ b/projects/code-editor/tsconfig.lib.json
@@ -10,9 +10,9 @@
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
- "fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
- "enableResourceInlining": true
+ "enableResourceInlining": true,
+ "strictTemplates": false
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}
diff --git a/projects/code-editor/tsconfig.schematics.json b/projects/code-editor/tsconfig.schematics.json
index 08454e09fb..0c5918d4dd 100644
--- a/projects/code-editor/tsconfig.schematics.json
+++ b/projects/code-editor/tsconfig.schematics.json
@@ -1,11 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
- "baseUrl": "../../",
"lib": ["es2018", "dom"],
"declaration": true,
- "module": "commonjs",
- "moduleResolution": "node",
+ "module": "node16",
+ "moduleResolution": "node16",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false,
diff --git a/projects/code-editor/tsconfig.spec.json b/projects/code-editor/tsconfig.spec.json
index 519c167a68..92ff656bd5 100644
--- a/projects/code-editor/tsconfig.spec.json
+++ b/projects/code-editor/tsconfig.spec.json
@@ -6,5 +6,8 @@
"skipLibCheck": true
},
"files": ["src/test.ts"],
- "include": ["**/*.spec.ts", "**/*.d.ts"]
+ "include": ["**/*.spec.ts", "**/*.d.ts"],
+ "angularCompilerOptions": {
+ "strictTemplates": false
+ }
}
diff --git a/projects/mcp/tsconfig.json b/projects/mcp/tsconfig.json
index 8fa72b5cb0..a754d1dd25 100644
--- a/projects/mcp/tsconfig.json
+++ b/projects/mcp/tsconfig.json
@@ -1,10 +1,9 @@
{
"compilerOptions": {
- "baseUrl": ".",
"lib": ["es2022"],
"declaration": true,
- "module": "commonjs",
- "moduleResolution": "node",
+ "module": "node16",
+ "moduleResolution": "node16",
"noEmitOnError": false,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
diff --git a/projects/portal/.eslintrc.json b/projects/portal/.eslintrc.json
deleted file mode 100644
index a8a4c3d7a6..0000000000
--- a/projects/portal/.eslintrc.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "extends": "../../.eslintrc.json",
- "ignorePatterns": ["!**/*", "docs/**/*", "src/app/documentation/samples/**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["projects/portal/tsconfig.app.json", "projects/portal/tsconfig.spec.json"],
- "createDefaultProgram": true
- },
- "plugins": ["sonarjs"],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": "element",
- "prefix": "app",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "app",
- "style": "camelCase"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "arrow-parens": ["off", "always"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": "error",
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"]
- }
- },
- {
- "files": ["*.html"],
- "rules": {}
- }
- ]
-}
diff --git a/projects/portal/docs/processors/helpers/file-writer.js b/projects/portal/docs/processors/helpers/file-writer.js
index 7184d75bad..73a442c450 100644
--- a/projects/portal/docs/processors/helpers/file-writer.js
+++ b/projects/portal/docs/processors/helpers/file-writer.js
@@ -79,11 +79,12 @@ module.exports = {
generateApiComponentFile: function (docName, component) {
const componentSource = `
-import { Component } from '@angular/core';
+import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'sample-{{docName}}-doc',
templateUrl: './sample-{{docName}}-doc.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class Sample{{component}}DocComponent { }
@@ -109,11 +110,12 @@ export class Sample{{component}}DocComponent { }
},
generateSampleViewComponentFile: function (docName, name, component) {
const componentSource = `
-import { Component } from '@angular/core';
+import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'sample-{{name}}-view',
templateUrl: './sample-{{name}}-view.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class Sample{{component}}ViewComponent {
@@ -191,10 +193,11 @@ export class Doc{{component}}RoutingModule { }
const componentSource = `
import { ActivatedRoute, Router } from '@angular/router';
-import { Component, OnInit, OnDestroy } from '@angular/core';
+import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core';
@Component({
templateUrl: './doc-{{docName}}.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class Doc{{component}}Component implements OnInit, OnDestroy {
diff --git a/projects/portal/src/app/app.component.ts b/projects/portal/src/app/app.component.ts
index c6165948e7..a9ee15f66e 100644
--- a/projects/portal/src/app/app.component.ts
+++ b/projects/portal/src/app/app.component.ts
@@ -1,9 +1,9 @@
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, OnDestroy, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { Router } from '@angular/router';
import { PoMenuItem, PoNavbarIconAction, PoNavbarItem, PoThemeA11yEnum } from '@po-ui/ng-components';
-import { PoDensityMode } from 'projects/ui/src/lib/enums/po-density-mode.enum';
+import { PoDensityMode } from '../../../ui/src/lib/enums/po-density-mode.enum';
import { firstValueFrom } from 'rxjs';
import { PoThemeService, PoThemeTypeEnum } from '../../../ui/src/lib';
import { poThemeConstant } from './shared/po-theme.constant';
@@ -12,6 +12,7 @@ import { VersionService } from './shared/version.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class AppComponent implements OnInit, OnDestroy {
diff --git a/projects/portal/src/app/app.module.ts b/projects/portal/src/app/app.module.ts
index 6ccbfee28e..0fe04da1b4 100644
--- a/projects/portal/src/app/app.module.ts
+++ b/projects/portal/src/app/app.module.ts
@@ -1,5 +1,4 @@
import { BrowserModule } from '@angular/platform-browser';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { SharedModule } from './shared/shared.module';
@@ -7,13 +6,13 @@ import { SharedModule } from './shared/shared.module';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { MenuService } from './menu.service';
-import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
+import { provideHttpClient, withInterceptorsFromDi, withXhr } from '@angular/common/http';
@NgModule({
declarations: [AppComponent],
exports: [],
bootstrap: [AppComponent],
- imports: [BrowserModule, BrowserAnimationsModule, SharedModule, AppRoutingModule],
- providers: [MenuService, provideHttpClient(withInterceptorsFromDi())]
+ imports: [BrowserModule, SharedModule, AppRoutingModule],
+ providers: [MenuService, provideHttpClient(withXhr(), withInterceptorsFromDi())]
})
export class AppModule {}
diff --git a/projects/portal/src/app/documentation/documentation-list.component.ts b/projects/portal/src/app/documentation/documentation-list.component.ts
index 92dedcc380..fc5dd4b56a 100644
--- a/projects/portal/src/app/documentation/documentation-list.component.ts
+++ b/projects/portal/src/app/documentation/documentation-list.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { Router } from '@angular/router';
import { PoListViewAction, PoListViewFieldProperties } from '@po-ui/ng-components';
@@ -8,6 +8,7 @@ import { DocumentationService } from '../documentation/documentation.service';
@Component({
templateUrl: './documentation-list.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class DocumentationListComponent implements OnInit {
diff --git a/projects/portal/src/app/documentation/documentation.component.ts b/projects/portal/src/app/documentation/documentation.component.ts
index 65171eee8b..06f86ec35c 100644
--- a/projects/portal/src/app/documentation/documentation.component.ts
+++ b/projects/portal/src/app/documentation/documentation.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { MenuComponentsService } from './menu-components.service';
@@ -6,6 +6,7 @@ import { MenuComponentsService } from './menu-components.service';
@Component({
templateUrl: './documentation.component.html',
providers: [MenuComponentsService],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class DocumentationComponent implements OnInit {
diff --git a/projects/portal/src/app/documentation/ia-tools-llms/ia-tools-llms.component.ts b/projects/portal/src/app/documentation/ia-tools-llms/ia-tools-llms.component.ts
index 57e99edacb..1ac78631c5 100644
--- a/projects/portal/src/app/documentation/ia-tools-llms/ia-tools-llms.component.ts
+++ b/projects/portal/src/app/documentation/ia-tools-llms/ia-tools-llms.component.ts
@@ -1,4 +1,4 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
templateUrl: './ia-tools-llms.component.html',
@@ -13,6 +13,7 @@ import { Component } from '@angular/core';
}
`
],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class IaToolsLlmsComponent {}
diff --git a/projects/portal/src/app/documentation/ia-tools-mcp/ia-tools-mcp.component.ts b/projects/portal/src/app/documentation/ia-tools-mcp/ia-tools-mcp.component.ts
index 4710b5c465..171b3d851e 100644
--- a/projects/portal/src/app/documentation/ia-tools-mcp/ia-tools-mcp.component.ts
+++ b/projects/portal/src/app/documentation/ia-tools-mcp/ia-tools-mcp.component.ts
@@ -1,4 +1,4 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
@Component({
templateUrl: './ia-tools-mcp.component.html',
@@ -13,6 +13,7 @@ import { Component } from '@angular/core';
}
`
],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class IaToolsMcpComponent {}
diff --git a/projects/portal/src/app/guide/guides.components.ts b/projects/portal/src/app/guide/guides.components.ts
index 524e5e65af..1193b6915b 100644
--- a/projects/portal/src/app/guide/guides.components.ts
+++ b/projects/portal/src/app/guide/guides.components.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { MenuGuidesService } from './menu-guides.service';
@@ -6,6 +6,7 @@ import { MenuGuidesService } from './menu-guides.service';
@Component({
templateUrl: './guides.component.html',
providers: [MenuGuidesService],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class GuidesComponent implements OnInit {
diff --git a/projects/portal/src/app/home/home-colorful/home-colorful.component.ts b/projects/portal/src/app/home/home-colorful/home-colorful.component.ts
index a148baad08..5a4c84f964 100644
--- a/projects/portal/src/app/home/home-colorful/home-colorful.component.ts
+++ b/projects/portal/src/app/home/home-colorful/home-colorful.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { pluck } from 'rxjs/operators';
import { HomeColorfulService } from './home-colorful.service';
@@ -6,6 +6,7 @@ import { HomeColorfulService } from './home-colorful.service';
selector: 'app-home-colorful',
templateUrl: './home-colorful.component.html',
styleUrls: ['./home-colorful.component.css'],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class HomeColorfulComponent implements OnInit {
diff --git a/projects/portal/src/app/home/home.component.ts b/projects/portal/src/app/home/home.component.ts
index 3f38cfb0f3..40d31f9aa6 100644
--- a/projects/portal/src/app/home/home.component.ts
+++ b/projects/portal/src/app/home/home.component.ts
@@ -1,10 +1,11 @@
-import { Component } from '@angular/core';
+import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-home',
templateUrl: 'home.component.html',
styleUrls: ['home.component.css'],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class HomeComponent {
diff --git a/projects/portal/src/app/icons/icons.component.ts b/projects/portal/src/app/icons/icons.component.ts
index 4714c584cd..0d28932a33 100644
--- a/projects/portal/src/app/icons/icons.component.ts
+++ b/projects/portal/src/app/icons/icons.component.ts
@@ -1,11 +1,12 @@
import { HttpClient } from '@angular/common/http';
-import { Component, ViewChild } from '@angular/core';
+import { Component, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { PoComboOption, PoNotificationService, PoSearchComponent, PoSearchFilterMode } from '../../../../ui/src/lib';
@Component({
selector: 'app-icons',
templateUrl: './icons.component.html',
styleUrls: ['icons.component.css'],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class IconsComponent {
diff --git a/projects/portal/src/app/theme-builder/theme-builder.component.ts b/projects/portal/src/app/theme-builder/theme-builder.component.ts
index d3298602f0..79830f1ed2 100644
--- a/projects/portal/src/app/theme-builder/theme-builder.component.ts
+++ b/projects/portal/src/app/theme-builder/theme-builder.component.ts
@@ -5,7 +5,8 @@ import {
ElementRef,
OnInit,
ViewChild,
- ViewEncapsulation
+ ViewEncapsulation,
+ ChangeDetectionStrategy
} from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
@@ -35,6 +36,7 @@ import {
templateUrl: './theme-builder.component.html',
styleUrls: ['theme-builder.component.css'],
encapsulation: ViewEncapsulation.None,
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class ThemeBuilderComponent implements AfterViewInit, OnInit {
diff --git a/projects/portal/src/app/tools/tools-dynamic-form/tools-dynamic-form.component.ts b/projects/portal/src/app/tools/tools-dynamic-form/tools-dynamic-form.component.ts
index 6a92a29e8f..5ae4dbb34f 100644
--- a/projects/portal/src/app/tools/tools-dynamic-form/tools-dynamic-form.component.ts
+++ b/projects/portal/src/app/tools/tools-dynamic-form/tools-dynamic-form.component.ts
@@ -1,4 +1,4 @@
-import { Component, ViewChild } from '@angular/core';
+import { Component, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { NgForm } from '@angular/forms';
import {
@@ -11,12 +11,13 @@ import {
PoTableColumn,
PoToasterOrientation
} from '@po-ui/ng-components';
-import { PoButtonType } from 'projects/ui/src/lib';
+import { PoButtonType } from '@po-ui/ng-components';
@Component({
selector: 'app-tools-dynamic-form',
templateUrl: 'tools-dynamic-form.component.html',
styleUrls: ['tools-dynamic-form.component.css'],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class ToolsDynamicFormComponent {
diff --git a/projects/portal/src/app/tools/tools-dynamic-view/tools-dynamic-view.component.ts b/projects/portal/src/app/tools/tools-dynamic-view/tools-dynamic-view.component.ts
index 94b4ba6c56..067d3716ff 100644
--- a/projects/portal/src/app/tools/tools-dynamic-view/tools-dynamic-view.component.ts
+++ b/projects/portal/src/app/tools/tools-dynamic-view/tools-dynamic-view.component.ts
@@ -1,6 +1,5 @@
-import { Component, ViewChild } from '@angular/core';
+import { Component, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { NgForm } from '@angular/forms';
-import { trigger, state, style, transition, animate } from '@angular/animations';
import {
PoDynamicFormField,
@@ -18,6 +17,7 @@ import {
selector: 'app-tools-dynamic-view',
templateUrl: 'tools-dynamic-view.component.html',
styleUrls: ['tools-dynamic-view.component.css'],
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class ToolsDynamicViewComponent {
diff --git a/projects/portal/src/main.ts b/projects/portal/src/main.ts
index 9a13dc9636..e3e564a866 100644
--- a/projects/portal/src/main.ts
+++ b/projects/portal/src/main.ts
@@ -1,5 +1,5 @@
import { enableProdMode, provideZoneChangeDetection } from '@angular/core';
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { platformBrowser } from '@angular/platform-browser';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
@@ -8,4 +8,4 @@ if (environment.production) {
enableProdMode();
}
-platformBrowserDynamic().bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] });
+platformBrowser().bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] });
diff --git a/projects/portal/src/test.ts b/projects/portal/src/test.ts
index 2005284d1d..1fdf199a87 100644
--- a/projects/portal/src/test.ts
+++ b/projects/portal/src/test.ts
@@ -8,7 +8,7 @@ import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import { getTestBed } from '@angular/core/testing';
-import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
+import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare const __karma__: any;
@@ -18,7 +18,7 @@ declare const require: any;
__karma__.loaded = () => {};
// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
+getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
diff --git a/projects/portal/src/tsconfig.app.json b/projects/portal/src/tsconfig.app.json
index d0c26f13be..b58113889c 100644
--- a/projects/portal/src/tsconfig.app.json
+++ b/projects/portal/src/tsconfig.app.json
@@ -2,7 +2,6 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
- "baseUrl": "",
"types": ["node"],
"typeRoots": ["node_modules/@types"]
},
diff --git a/projects/portal/src/tsconfig.spec.json b/projects/portal/src/tsconfig.spec.json
index afb1dac35b..bf4d14b44e 100644
--- a/projects/portal/src/tsconfig.spec.json
+++ b/projects/portal/src/tsconfig.spec.json
@@ -2,7 +2,6 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
- "baseUrl": "",
"typeRoots": ["node_modules/@types"],
"types": ["jasmine", "node"]
},
diff --git a/projects/portal/tsconfig.app.json b/projects/portal/tsconfig.app.json
index cc10af0398..e1e7730a29 100644
--- a/projects/portal/tsconfig.app.json
+++ b/projects/portal/tsconfig.app.json
@@ -5,5 +5,8 @@
"types": []
},
"files": ["src/main.ts", "src/polyfills.ts"],
- "include": ["src/**/*.d.ts"]
+ "include": ["src/**/*.d.ts"],
+ "angularCompilerOptions": {
+ "strictTemplates": false
+ }
}
diff --git a/projects/schematics/package.json b/projects/schematics/package.json
index cb6ea550fb..9c1990bd1f 100644
--- a/projects/schematics/package.json
+++ b/projects/schematics/package.json
@@ -14,9 +14,9 @@
"postbuild": "gulp replaceVersion && cd ../../dist/ng-schematics && npm pack"
},
"peerDependencies": {
- "@angular-devkit/core": "^21",
- "@angular-devkit/schematics": "^21",
- "@schematics/angular": "^21"
+ "@angular-devkit/core": "^22",
+ "@angular-devkit/schematics": "^22",
+ "@schematics/angular": "^22"
},
"dependencies": {
"jsonc-parser": "^3.2.0"
diff --git a/projects/schematics/src/build-component/build-component.ts b/projects/schematics/src/build-component/build-component.ts
index 3c90879c5f..f4606e48e6 100644
--- a/projects/schematics/src/build-component/build-component.ts
+++ b/projects/schematics/src/build-component/build-component.ts
@@ -17,12 +17,28 @@ import { parseName } from '@schematics/angular/utility/parse-name';
import { validateHtmlSelector } from '@schematics/angular/utility/validation';
import { supportedCssExtensions } from '../utils/supported-css-extensions';
+import { detectFileNameStyleGuide, FileNameStyleGuide, getFileNameSuffixes } from '../utils/file-name-style-guide';
import { getProjectFromWorkspace, getDefaultPath, getWorkspaceConfigGracefully, getProjectMainFile } from '../project';
import { addModuleImportToModule, addDeclarationComponentToModule, addExportComponentToModule } from '../module';
import { Schema as ComponentOptions } from './schema';
import { WorkspaceSchema } from '@schematics/angular/utility/workspace-models';
import { isStandaloneApp } from '@schematics/angular/utility/ng-ast-utils';
+/**
+ * Returns the dasherized base file names (without extension) for the generated component,
+ * module and routing module, honoring the resolved file name style guide.
+ */
+export function getFileNames(name: string, styleGuide: FileNameStyleGuide) {
+ const dasherizedName = strings.dasherize(name);
+ const suffixes = getFileNameSuffixes(styleGuide);
+
+ return {
+ componentFileName: `${dasherizedName}${suffixes.componentSuffix}`,
+ moduleFileName: `${dasherizedName}${suffixes.moduleSuffix}`,
+ routingFileName: `${dasherizedName}${suffixes.routingModuleSuffix}`
+ };
+}
+
export function buildComponent(options: ComponentOptions): Rule {
return (host: Tree) => {
const workspace = getWorkspaceConfigGracefully(host) ?? ({} as WorkspaceSchema);
@@ -31,6 +47,10 @@ export function buildComponent(options: ComponentOptions): Rule {
const isStandAlone = isStandaloneApp(host, browserEntryPoint);
const urlFile = !isStandAlone ? './files' : './files-standalone';
+ // Use the explicit option when provided, otherwise auto-detect the style already used by the project.
+ const styleGuide: FileNameStyleGuide =
+ options.fileNameStyleGuide ?? detectFileNameStyleGuide(host, browserEntryPoint);
+
if (options.path === undefined && project) {
options.path = getDefaultPath(project);
}
@@ -51,19 +71,22 @@ export function buildComponent(options: ComponentOptions): Rule {
validateName(options.name);
validateHtmlSelector((options).selector);
+ const fileNames = getFileNames(options.name, styleGuide);
+
const templateSource = apply(url(urlFile), [
- options.routing ? noop() : filter(path => !path.endsWith('-routing.module.ts.template')),
- options.createModule ? noop() : filter(path => !path.endsWith('.module.ts.template')),
+ options.routing ? noop() : filter(path => !path.endsWith('__routingFileName__.ts.template')),
+ options.createModule ? noop() : filter(path => !path.endsWith('__moduleFileName__.ts.template')),
options.skipTests ? filter(path => !path.endsWith('.spec.ts.template')) : noop(),
applyTemplates({
...strings,
- ...options
+ ...options,
+ ...fileNames
}),
move(null as any, parsedPath.path)
]);
return chain([
- options.createModule ? addImportToModule(options) : addDeclarationToModule(options),
+ options.createModule ? addImportToModule(options, styleGuide) : addDeclarationToModule(options, styleGuide),
mergeWith(templateSource)
]);
};
@@ -87,16 +110,15 @@ function buildSelector(options: ComponentOptions, projectPrefix: string) {
return selector;
}
-function addImportToModule(options: ComponentOptions): Rule {
+function addImportToModule(options: ComponentOptions, styleGuide: FileNameStyleGuide): Rule {
return (tree: Tree) => {
if (!options.module || options.routing) {
return tree;
}
const modulePath = options.module;
+ const { moduleFileName } = getFileNames(options.name, styleGuide);
- const componentModulePath = normalize(
- `/${options.path}/` + strings.dasherize(options.name) + '/' + strings.dasherize(options.name) + '.module'
- );
+ const componentModulePath = normalize(`/${options.path}/` + strings.dasherize(options.name) + '/' + moduleFileName);
const relativePath = buildRelativePath(modulePath, componentModulePath);
const classifiedModuleName = strings.classify(`${options.name}Module`);
@@ -105,17 +127,16 @@ function addImportToModule(options: ComponentOptions): Rule {
};
}
-function addDeclarationToModule(options: ComponentOptions): Rule {
+function addDeclarationToModule(options: ComponentOptions, styleGuide: FileNameStyleGuide): Rule {
return (tree: Tree) => {
if (!options.module) {
return tree;
}
const modulePath = options.module;
+ const { componentFileName } = getFileNames(options.name, styleGuide);
- const componentPath = normalize(
- `/${options.path}/` + strings.dasherize(options.name) + '/' + strings.dasherize(options.name) + '.component'
- );
+ const componentPath = normalize(`/${options.path}/` + strings.dasherize(options.name) + '/' + componentFileName);
const relativePath = buildRelativePath(modulePath, componentPath);
const classifiedName = strings.classify(`${options.name}Component`);
diff --git a/projects/schematics/src/build-component/schema.ts b/projects/schematics/src/build-component/schema.ts
index 263d5b868e..cb9a31180b 100644
--- a/projects/schematics/src/build-component/schema.ts
+++ b/projects/schematics/src/build-component/schema.ts
@@ -40,4 +40,14 @@ export interface Schema {
/** When true, create a component module. */
createModule?: boolean;
+
+ /**
+ * The file naming convention to use for generated files.
+ *
+ * - `2016`: classic Angular Style Guide suffixes (e.g. `name.component.ts`, `name.module.ts`).
+ * - `2025`: current Angular convention without type suffixes (e.g. `name.ts`, `name-module.ts`).
+ *
+ * When omitted, the convention already used by the project is auto-detected.
+ */
+ fileNameStyleGuide?: '2016' | '2025';
}
diff --git a/projects/schematics/src/standalone/standalone.ts b/projects/schematics/src/standalone/standalone.ts
index 3ac6e2764d..59080af1a6 100644
--- a/projects/schematics/src/standalone/standalone.ts
+++ b/projects/schematics/src/standalone/standalone.ts
@@ -1,6 +1,6 @@
import { Rule, Tree } from '@angular-devkit/schematics';
-import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
+import * as ts from 'typescript';
import { WorkspaceSchema } from '@schematics/angular/utility/workspace-models';
import { addRootProvider } from '@schematics/angular/utility';
import { applyToUpdateRecorder } from '@schematics/angular/utility/change';
@@ -15,7 +15,7 @@ export function importProvidersFrom(
moduleName: string,
packageName: string,
argsImportProvidersFrom: string
-) {
+): Rule {
return (host: Tree) => {
const workspace = getWorkspaceConfigGracefully(host) ?? ({} as WorkspaceSchema);
const project: any = getProjectFromWorkspace(workspace, options.project);
@@ -44,7 +44,7 @@ function addProvider(
return addRootProvider(
projectName,
({ code, external }) => code`${external('importProvidersFrom', '@angular/core')}(${argsImportProvidersFrom})`
- );
+ ) as unknown as Rule;
}
function addImport(host: Tree, filePath: string, symbolName: string, moduleName: string): void {
diff --git a/projects/schematics/src/utils/file-name-style-guide.ts b/projects/schematics/src/utils/file-name-style-guide.ts
new file mode 100644
index 0000000000..3ccf1ef94b
--- /dev/null
+++ b/projects/schematics/src/utils/file-name-style-guide.ts
@@ -0,0 +1,252 @@
+import { Tree } from '@angular-devkit/schematics';
+import { getAppModulePath } from '@schematics/angular/utility/ng-ast-utils';
+import * as ts from 'typescript';
+
+/**
+ * Supported Angular file name style guides.
+ *
+ * - `2016`: classic Angular Style Guide, file names include the type suffix
+ * (e.g. `app.component.ts`, `app.module.ts`).
+ * - `2025`: current Angular convention, file names omit the type suffix
+ * (e.g. `app.ts`, `app-module.ts`).
+ */
+export type FileNameStyleGuide = '2016' | '2025';
+
+/**
+ * The file name suffixes applied to generated files for each style guide.
+ */
+export interface FileNameSuffixes {
+ componentSuffix: string;
+ moduleSuffix: string;
+ routingModuleSuffix: string;
+}
+
+/**
+ * Returns the file name suffixes to apply to generated files for the given style guide.
+ */
+export function getFileNameSuffixes(styleGuide: FileNameStyleGuide): FileNameSuffixes {
+ const isStyleGuide2016 = styleGuide === '2016';
+
+ return {
+ componentSuffix: isStyleGuide2016 ? '.component' : '',
+ moduleSuffix: isStyleGuide2016 ? '.module' : '-module',
+ routingModuleSuffix: isStyleGuide2016 ? '-routing.module' : '-routing-module'
+ };
+}
+
+/**
+ * Detects the file name style guide already used by the project by inspecting the root
+ * symbol (component or module) bootstrapped in the given main file.
+ *
+ * The import path of the bootstrapped symbol reveals the convention:
+ * - `./app/app.component` or `./app/app.module` => `2016`
+ * - `./app/app` or `./app/app-module` => `2025`
+ *
+ * When the main file can not be read or parsed, it falls back to `2025` (the current default).
+ */
+export function detectFileNameStyleGuide(host: Tree, mainPath: string): FileNameStyleGuide {
+ const bootstrapImportPath = getBootstrapImportPath(host, mainPath);
+
+ if (!bootstrapImportPath) {
+ return '2025';
+ }
+
+ const fileName = bootstrapImportPath.split('/').pop() ?? '';
+
+ return fileName.endsWith('.component') || fileName.endsWith('.module') ? '2016' : '2025';
+}
+
+/**
+ * Detects the name of the root component class already used by the project, so a schematic
+ * that overwrites the root component keeps the class name expected by the existing imports.
+ *
+ * - Standalone apps bootstrap the component directly (`bootstrapApplication(App)`), so the
+ * bootstrapped symbol is the component name (e.g. `App` or `AppComponent`).
+ * - NgModule apps bootstrap the module (`bootstrapModule(AppModule)`), so the component is
+ * read from the `bootstrap: [...]` array of the module's `@NgModule` decorator.
+ *
+ * Returns `undefined` when the name can not be resolved, so callers can fall back to their
+ * own convention.
+ */
+export function detectRootComponentClassName(host: Tree, mainPath: string): string | undefined {
+ const mainSource = readSourceFile(host, mainPath);
+
+ if (!mainSource) {
+ return undefined;
+ }
+
+ const bootstrapCall = getBootstrapCall(mainSource);
+
+ if (!bootstrapCall) {
+ return undefined;
+ }
+
+ // Standalone: the bootstrapped symbol is the root component itself.
+ if (bootstrapCall.callName === 'bootstrapApplication') {
+ return bootstrapCall.symbolName;
+ }
+
+ // NgModule: resolve the module file and read the bootstrap component from its decorator.
+ let appModulePath: string;
+
+ try {
+ appModulePath = getAppModulePath(host, mainPath);
+ } catch {
+ return undefined;
+ }
+
+ const moduleSource = readSourceFile(host, appModulePath);
+
+ if (!moduleSource) {
+ return undefined;
+ }
+
+ return getNgModuleBootstrapComponent(moduleSource);
+}
+
+/**
+ * Reads the main file and returns the module specifier of the imported symbol that is passed
+ * to `bootstrapApplication(...)` (standalone) or `bootstrapModule(...)` (NgModule).
+ */
+function getBootstrapImportPath(host: Tree, mainPath: string): string | undefined {
+ const source = readSourceFile(host, mainPath);
+
+ if (!source) {
+ return undefined;
+ }
+
+ const bootstrapSymbol = getBootstrappedSymbolName(source);
+
+ if (!bootstrapSymbol) {
+ return undefined;
+ }
+
+ return getImportSpecifierForSymbol(source, bootstrapSymbol);
+}
+
+/** Describes the bootstrap call found in a main file. */
+interface BootstrapCall {
+ /** The bootstrap function name: `bootstrapApplication` (standalone) or `bootstrapModule` (NgModule). */
+ callName: 'bootstrapApplication' | 'bootstrapModule';
+ /** The identifier passed as the first argument (the root component or the root module). */
+ symbolName: string;
+}
+
+/**
+ * Finds the bootstrap call in the source and returns the function name along with the
+ * symbol passed as its first argument.
+ */
+function getBootstrapCall(source: ts.SourceFile): BootstrapCall | undefined {
+ let result: BootstrapCall | undefined;
+
+ const visit = (node: ts.Node): void => {
+ if (result) {
+ return;
+ }
+
+ if (ts.isCallExpression(node)) {
+ // The bootstrap call may be a direct identifier (`bootstrapApplication(...)`) or a
+ // chained method (`platformBrowser().bootstrapModule(...)`), where the callee is a
+ // property access expression. Resolve the called name from either shape.
+ const callee = node.expression;
+ const calledName = ts.isIdentifier(callee)
+ ? callee.text
+ : ts.isPropertyAccessExpression(callee)
+ ? callee.name.text
+ : undefined;
+
+ if (calledName === 'bootstrapApplication' || calledName === 'bootstrapModule') {
+ const firstArgument = node.arguments[0];
+
+ if (firstArgument && ts.isIdentifier(firstArgument)) {
+ result = { callName: calledName, symbolName: firstArgument.text };
+ return;
+ }
+ }
+ }
+
+ ts.forEachChild(node, visit);
+ };
+
+ ts.forEachChild(source, visit);
+
+ return result;
+}
+
+/** Finds the name of the symbol bootstrapped in the given source (component or module). */
+function getBootstrappedSymbolName(source: ts.SourceFile): string | undefined {
+ return getBootstrapCall(source)?.symbolName;
+}
+
+/**
+ * Extracts the first component name listed in the `bootstrap: [...]` array of an `@NgModule`
+ * decorator found in the given module source.
+ */
+function getNgModuleBootstrapComponent(source: ts.SourceFile): string | undefined {
+ let componentName: string | undefined;
+
+ const visit = (node: ts.Node): void => {
+ if (componentName) {
+ return;
+ }
+
+ if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'bootstrap') {
+ if (ts.isArrayLiteralExpression(node.initializer)) {
+ const firstElement = node.initializer.elements[0];
+
+ if (firstElement && ts.isIdentifier(firstElement)) {
+ componentName = firstElement.text;
+ return;
+ }
+ }
+ }
+
+ ts.forEachChild(node, visit);
+ };
+
+ ts.forEachChild(source, visit);
+
+ return componentName;
+}
+
+/** Reads a file from the tree and parses it into a TypeScript source file. */
+function readSourceFile(host: Tree, filePath: string): ts.SourceFile | undefined {
+ if (!host.exists(filePath)) {
+ return undefined;
+ }
+
+ const content = host.read(filePath)?.toString('utf-8');
+
+ if (!content) {
+ return undefined;
+ }
+
+ return ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
+}
+
+/**
+ * Returns the module specifier used to import the given symbol name.
+ */
+function getImportSpecifierForSymbol(source: ts.SourceFile, symbolName: string): string | undefined {
+ for (const statement of source.statements) {
+ if (
+ !ts.isImportDeclaration(statement) ||
+ !statement.importClause ||
+ !statement.importClause.namedBindings ||
+ !ts.isNamedImports(statement.importClause.namedBindings) ||
+ !ts.isStringLiteral(statement.moduleSpecifier)
+ ) {
+ continue;
+ }
+
+ const importsSymbol = statement.importClause.namedBindings.elements.some(
+ element => element.name.text === symbolName
+ );
+
+ if (importsSymbol) {
+ return statement.moduleSpecifier.text;
+ }
+ }
+
+ return undefined;
+}
diff --git a/projects/schematics/src/utils/index.ts b/projects/schematics/src/utils/index.ts
index be8239e5d0..67c7f76e53 100644
--- a/projects/schematics/src/utils/index.ts
+++ b/projects/schematics/src/utils/index.ts
@@ -1 +1,2 @@
export * from './supported-css-extensions';
+export * from './file-name-style-guide';
diff --git a/projects/schematics/tsconfig.json b/projects/schematics/tsconfig.json
index b0e38bebab..8d734c7aff 100644
--- a/projects/schematics/tsconfig.json
+++ b/projects/schematics/tsconfig.json
@@ -1,10 +1,9 @@
{
"compilerOptions": {
- "baseUrl": ".",
"lib": ["es2022", "dom"],
"declaration": true,
- "module": "commonjs",
- "moduleResolution": "node",
+ "module": "node16",
+ "moduleResolution": "node16",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false,
diff --git a/projects/storage/.eslintrc.json b/projects/storage/.eslintrc.json
deleted file mode 100644
index dc546d54bc..0000000000
--- a/projects/storage/.eslintrc.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "extends": "../../.eslintrc.json",
- "ignorePatterns": ["!**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["projects/storage/tsconfig.lib.json", "projects/storage/tsconfig.spec.json"],
- "createDefaultProgram": true
- },
- "plugins": ["sonarjs"],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": ["element", "attribute"],
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "arrow-parens": ["off", "always"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": "error",
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"]
- }
- },
- {
- "files": ["*.html"],
- "rules": {}
- }
- ]
-}
diff --git a/projects/storage/karma.conf.js b/projects/storage/karma.conf.js
index 87203560d5..ad4103b113 100644
--- a/projects/storage/karma.conf.js
+++ b/projects/storage/karma.conf.js
@@ -9,8 +9,7 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
+ require('karma-coverage')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
diff --git a/projects/storage/package.json b/projects/storage/package.json
index a36769dd60..aae7c4acb4 100644
--- a/projects/storage/package.json
+++ b/projects/storage/package.json
@@ -18,7 +18,7 @@
"tslib": "^2.6.2"
},
"peerDependencies": {
- "@angular/core": "^21",
+ "@angular/core": "^22",
"custom-idle-queue": "3.0.1",
"localforage": "1.10.0",
"lokijs": "1.5.12",
diff --git a/projects/storage/src/lib/drivers/lokijs/po-loki-driver.spec.ts b/projects/storage/src/lib/drivers/lokijs/po-loki-driver.spec.ts
index 6fa29925c4..9929230d6b 100644
--- a/projects/storage/src/lib/drivers/lokijs/po-loki-driver.spec.ts
+++ b/projects/storage/src/lib/drivers/lokijs/po-loki-driver.spec.ts
@@ -170,7 +170,7 @@ describe('PoLokiDriver', () => {
it('initStorage: should call `configureLokiStorage` and `databaseInitialize.bind`', () => {
spyOn(poLokiDriver, 'configureLokiStorage');
- spyOn(poLokiDriver['databaseInitialize'], 'bind');
+ spyOn(poLokiDriver['databaseInitialize'] as any, 'bind');
poLokiDriver['initStorage'](getConfigMock());
diff --git a/projects/storage/src/lib/services/po-storage.service.spec.ts b/projects/storage/src/lib/services/po-storage.service.spec.ts
index 6178c3d8e9..99af39bd8e 100644
--- a/projects/storage/src/lib/services/po-storage.service.spec.ts
+++ b/projects/storage/src/lib/services/po-storage.service.spec.ts
@@ -666,11 +666,10 @@ describe('PoStorageService:', () => {
it('getStorageInstance: should return localForage instance', async () => {
const localForageMock: LocalForage = createLocalForageInstance();
- spyOn(LocalForage, 'createInstance').and.returnValue(localForageMock);
spyOn(PoStorageService, 'getDefaultConfig').and.returnValue({});
- spyOn(poStorageService, 'setDriver').and.returnValue(Promise.resolve());
+ spyOn(poStorageService, 'defineLocalForageDriver').and.returnValue(Promise.resolve(localForageMock));
- expect(await poStorageService['getStorageInstance'](getConfigMock())).toEqual(localForageMock);
+ expect(await poStorageService['getStorageInstance'](getConfigMock())).toBe(localForageMock);
});
});
});
diff --git a/projects/storage/tsconfig.lib.json b/projects/storage/tsconfig.lib.json
index cf6fbcdce5..7033507129 100644
--- a/projects/storage/tsconfig.lib.json
+++ b/projects/storage/tsconfig.lib.json
@@ -10,9 +10,9 @@
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
- "fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
- "enableResourceInlining": true
+ "enableResourceInlining": true,
+ "strictTemplates": false
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}
diff --git a/projects/storage/tsconfig.schematics.json b/projects/storage/tsconfig.schematics.json
index 2ae8422dc0..7684ef6ffa 100644
--- a/projects/storage/tsconfig.schematics.json
+++ b/projects/storage/tsconfig.schematics.json
@@ -1,11 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
- "baseUrl": "../../",
"lib": ["es2022", "dom"],
"declaration": true,
- "module": "commonjs",
- "moduleResolution": "node",
+ "module": "node16",
+ "moduleResolution": "node16",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false,
diff --git a/projects/storage/tsconfig.spec.json b/projects/storage/tsconfig.spec.json
index 519c167a68..92ff656bd5 100644
--- a/projects/storage/tsconfig.spec.json
+++ b/projects/storage/tsconfig.spec.json
@@ -6,5 +6,8 @@
"skipLibCheck": true
},
"files": ["src/test.ts"],
- "include": ["**/*.spec.ts", "**/*.d.ts"]
+ "include": ["**/*.spec.ts", "**/*.d.ts"],
+ "angularCompilerOptions": {
+ "strictTemplates": false
+ }
}
diff --git a/projects/sync/.eslintrc.json b/projects/sync/.eslintrc.json
deleted file mode 100644
index a3e99ce887..0000000000
--- a/projects/sync/.eslintrc.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "extends": "../../.eslintrc.json",
- "ignorePatterns": ["!**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["projects/sync/tsconfig.lib.json", "projects/sync/tsconfig.spec.json"],
- "createDefaultProgram": true
- },
- "plugins": ["sonarjs"],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": "element",
- "prefix": "lib",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "lib",
- "style": "camelCase"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "arrow-parens": ["off", "always"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": "error",
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"]
- }
- },
- {
- "files": ["*.html"],
- "rules": {}
- }
- ]
-}
diff --git a/projects/sync/README.md b/projects/sync/README.md
index 3dcb95f171..19926b547a 100644
--- a/projects/sync/README.md
+++ b/projects/sync/README.md
@@ -6,7 +6,7 @@ O **PO Sync** é uma biblioteca para aplicações Angular que possibilita armaze
Instalando com schematic(recomendado):
```
-ng add @po-ui/ng-sync
+ng add @po-ui/ng-sync@next
```
Instalando com npm:
diff --git a/projects/sync/karma.conf.js b/projects/sync/karma.conf.js
index b38aa86405..b4e6878935 100644
--- a/projects/sync/karma.conf.js
+++ b/projects/sync/karma.conf.js
@@ -9,8 +9,7 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
+ require('karma-coverage')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
diff --git a/projects/sync/package.json b/projects/sync/package.json
index 4a66812107..98f9362898 100644
--- a/projects/sync/package.json
+++ b/projects/sync/package.json
@@ -26,8 +26,8 @@
"tslib": "^2.6.2"
},
"peerDependencies": {
- "@angular/core": "^21",
- "@angular-devkit/schematics": "^21",
+ "@angular/core": "^22",
+ "@angular-devkit/schematics": "^22",
"@capacitor/core": "^6.2.0",
"@capacitor/network": "^6.0.1",
"@po-ui/ng-storage": "0.0.0-PLACEHOLDER",
diff --git a/projects/sync/schematics/migrations.json b/projects/sync/schematics/migrations.json
index fe1bc76e8b..46c618d747 100644
--- a/projects/sync/schematics/migrations.json
+++ b/projects/sync/schematics/migrations.json
@@ -65,6 +65,11 @@
"version": "0.0.0-PLACEHOLDER",
"description": "Atualiza @po-ui/ng-sync para v21",
"factory": "./ng-update/v21/index"
+ },
+ "migration-v22": {
+ "version": "0.0.0-PLACEHOLDER",
+ "description": "Atualiza @po-ui/ng-sync para v22",
+ "factory": "./ng-update/v22/index"
}
}
}
diff --git a/projects/sync/schematics/ng-add/setup-project.ts b/projects/sync/schematics/ng-add/setup-project.ts
index 3c6b371747..d19b550ca0 100644
--- a/projects/sync/schematics/ng-add/setup-project.ts
+++ b/projects/sync/schematics/ng-add/setup-project.ts
@@ -133,7 +133,7 @@ function addProviderToModuleProvider(
) {
const moduleSource = getSourceFile(tree, modulePath);
const changes = addProviderToModule(
- moduleSource as any,
+ moduleSource,
modulePath,
`
${provider}`,
diff --git a/projects/sync/schematics/ng-update/v22/changes.ts b/projects/sync/schematics/ng-update/v22/changes.ts
new file mode 100644
index 0000000000..197dbab8a9
--- /dev/null
+++ b/projects/sync/schematics/ng-update/v22/changes.ts
@@ -0,0 +1,12 @@
+import { UpdateDependencies } from '@po-ui/ng-schematics/package-config';
+
+export const updateDepedenciesVersion: UpdateDependencies = {
+ dependencies: [
+ '@po-ui/ng-components',
+ '@po-ui/ng-code-editor',
+ '@po-ui/ng-templates',
+ '@po-ui/ng-storage',
+ '@po-ui/ng-sync',
+ '@po-ui/style'
+ ]
+};
diff --git a/projects/sync/schematics/ng-update/v22/index.ts b/projects/sync/schematics/ng-update/v22/index.ts
new file mode 100644
index 0000000000..4a806ce232
--- /dev/null
+++ b/projects/sync/schematics/ng-update/v22/index.ts
@@ -0,0 +1,16 @@
+import { chain, Tree, SchematicContext } from '@angular-devkit/schematics';
+import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
+
+import { updatePackageJson } from '@po-ui/ng-schematics/package-config';
+
+import { updateDepedenciesVersion } from './changes';
+
+export default function () {
+ return chain([updatePackageJson('0.0.0-PLACEHOLDER', updateDepedenciesVersion), postUpdate()]);
+}
+
+function postUpdate() {
+ return (_: Tree, context: SchematicContext) => {
+ context.addTask(new NodePackageInstallTask());
+ };
+}
diff --git a/projects/sync/schematics/package.json b/projects/sync/schematics/package.json
new file mode 100644
index 0000000000..5bbefffbab
--- /dev/null
+++ b/projects/sync/schematics/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/projects/sync/src/lib/models/po-entity/po-entity.model.spec.ts b/projects/sync/src/lib/models/po-entity/po-entity.model.spec.ts
index eab9b589c2..8d5620563a 100644
--- a/projects/sync/src/lib/models/po-entity/po-entity.model.spec.ts
+++ b/projects/sync/src/lib/models/po-entity/po-entity.model.spec.ts
@@ -133,7 +133,7 @@ describe('PoEntity:', () => {
const limitedCallWrapReturn = 'limitedCallWrap return';
spyOn(poEntity['poSchemaService'], 'limitedCallWrap').and.returnValue(limitedCallWrapReturn);
- spyOn(poEntity['selectSaveType'], 'bind');
+ spyOn(poEntity['selectSaveType'] as any, 'bind');
const result = await poEntity.save(modelMock, customRequestId);
diff --git a/projects/sync/src/lib/services/po-event-sourcing/po-event-sourcing.service.spec.ts b/projects/sync/src/lib/services/po-event-sourcing/po-event-sourcing.service.spec.ts
index d7ee4636c2..14d6b52607 100644
--- a/projects/sync/src/lib/services/po-event-sourcing/po-event-sourcing.service.spec.ts
+++ b/projects/sync/src/lib/services/po-event-sourcing/po-event-sourcing.service.spec.ts
@@ -1,5 +1,5 @@
import { provideHttpClientTesting } from '@angular/common/http/testing';
-import { HttpResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
+import { HttpResponse, provideHttpClient, withInterceptorsFromDi, withXhr } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { TestBed } from '@angular/core/testing';
@@ -70,7 +70,7 @@ describe('PoEventSourcingService:', () => {
{ provide: PoSchemaService, useClass: PoSchemaService },
{ provide: PoSchemaDefinitionService, useClass: PoSchemaDefinitionService },
{ provide: PoHttpClientService, useClass: PoHttpClientService },
- provideHttpClient(withInterceptorsFromDi()),
+ provideHttpClient(withXhr(), withInterceptorsFromDi()),
provideHttpClientTesting()
]
});
diff --git a/projects/sync/src/lib/services/po-http-client/po-http-client.service.spec.ts b/projects/sync/src/lib/services/po-http-client/po-http-client.service.spec.ts
index 728a3a301e..96d7d7bcf8 100644
--- a/projects/sync/src/lib/services/po-http-client/po-http-client.service.spec.ts
+++ b/projects/sync/src/lib/services/po-http-client/po-http-client.service.spec.ts
@@ -1,5 +1,5 @@
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
-import { HttpResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
+import { HttpResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi, withXhr } from '@angular/common/http';
import { TestBed } from '@angular/core/testing';
import { of } from 'rxjs';
@@ -15,7 +15,11 @@ describe('PoHttpClientService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [],
- providers: [PoHttpClientService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
+ providers: [
+ PoHttpClientService,
+ provideHttpClient(withXhr(), withInterceptorsFromDi()),
+ provideHttpClientTesting()
+ ]
});
poHttpClientService = TestBed.inject(PoHttpClientService);
diff --git a/projects/sync/src/lib/services/po-sync/po-sync.service.spec.ts b/projects/sync/src/lib/services/po-sync/po-sync.service.spec.ts
index c6c54e4d69..8801f1e1ab 100644
--- a/projects/sync/src/lib/services/po-sync/po-sync.service.spec.ts
+++ b/projects/sync/src/lib/services/po-sync/po-sync.service.spec.ts
@@ -1,8 +1,6 @@
-import { HttpResponse } from '@angular/common/http';
import { fakeAsync, tick } from '@angular/core/testing';
-import { of, Subscriber } from 'rxjs';
-import { TestScheduler } from 'rxjs/testing';
-import * as TypeMoq from 'typemoq';
+import { of, Subject, Subscriber } from 'rxjs';
+
import { PoNetworkType } from '../../models/po-network-type.enum';
import { PoUtils as utilsFunctions } from '../../utils/utils';
import { PoEventSourcingService } from '../po-event-sourcing/po-event-sourcing.service';
@@ -36,17 +34,13 @@ class CustomDataTransform extends PoDataTransform {
}
}
-xdescribe('PoSyncService:', () => {
- const scheduler = new TestScheduler((actual, expected) => {
- expect(actual).toEqual(expected);
- });
-
+describe('PoSyncService:', () => {
let poSync: PoSyncService;
- let poNetworkServiceMock: TypeMoq.IMock;
- let poEventSourcing: TypeMoq.IMock;
- let poSchemaDefinition: TypeMoq.IMock;
- let poSchemaService: TypeMoq.IMock;
- let http: TypeMoq.IMock;
+ let poEventSourcing: jasmine.SpyObj;
+ let poSchemaDefinition: jasmine.SpyObj;
+ let poSchemaService: jasmine.SpyObj;
+ let poNetworkServiceMock: jasmine.SpyObj;
+ let http: jasmine.SpyObj;
const customerSchema: PoSyncSchema = {
idField: 'code',
@@ -70,32 +64,39 @@ xdescribe('PoSyncService:', () => {
};
beforeEach(() => {
- http = TypeMoq.Mock.ofType(PoHttpClientService);
-
- poEventSourcing = TypeMoq.Mock.ofType(PoEventSourcingService);
-
- poEventSourcing.setup(e => e.syncGet()).returns(() => Promise.resolve({}));
-
- poEventSourcing.setup(e => e.syncSend()).returns(() => Promise.resolve({}));
-
- poEventSourcing.setup(e => e.onSaveData()).returns(() => of(null));
-
- poNetworkServiceMock = TypeMoq.Mock.ofType(PoNetworkService);
-
- poNetworkServiceMock.setup(e => e.onChange()).returns(() => of({ status: undefined, type: undefined }));
-
- poSchemaDefinition = TypeMoq.Mock.ofType(PoSchemaDefinitionService);
-
- poSchemaService = TypeMoq.Mock.ofType(PoSchemaService);
-
- poNetworkServiceMock.setup(e => e.getConnectionStatus()).returns(() => new PoNetworkStatus('wifi'));
+ http = jasmine.createSpyObj('PoHttpClientService', ['get']);
+
+ poEventSourcing = jasmine.createSpyObj('PoEventSourcingService', [
+ 'syncGet',
+ 'syncSend',
+ 'onSaveData',
+ 'responsesSubject',
+ 'httpCommand',
+ 'removeEventSourcingItem',
+ 'destroyEventSourcingQueue'
+ ]);
+ poEventSourcing.syncGet.and.returnValue(Promise.resolve({}));
+ poEventSourcing.syncSend.and.returnValue(Promise.resolve({}));
+ poEventSourcing.onSaveData.and.returnValue(of(null));
+
+ poNetworkServiceMock = jasmine.createSpyObj('PoNetworkService', ['getConnectionStatus', 'onChange']);
+ poNetworkServiceMock.onChange.and.returnValue(of({ status: undefined, type: undefined }));
+ poNetworkServiceMock.getConnectionStatus.and.returnValue(new PoNetworkStatus('wifi'));
+
+ poSchemaDefinition = jasmine.createSpyObj('PoSchemaDefinitionService', ['getAll', 'saveAll', 'destroy']);
+
+ poSchemaService = jasmine.createSpyObj('PoSchemaService', [
+ 'limitedCallWrap',
+ 'destroySchemasRecords',
+ 'updateAll'
+ ]);
poSync = new PoSyncService(
- poEventSourcing.object,
- http.object,
- poNetworkServiceMock.object,
- poSchemaDefinition.object,
- poSchemaService.object
+ poEventSourcing as any,
+ http as any,
+ poNetworkServiceMock as any,
+ poSchemaDefinition as any,
+ poSchemaService as any
);
});
@@ -112,36 +113,30 @@ xdescribe('PoSyncService:', () => {
describe('Methods:', () => {
it('destroy: should call poSchemaService.limitedCallWrap and return its value', async () => {
const limitedCallWrapReturn = 'limitedCallWrap return';
-
- spyOn(poSync['poSchemaService'], 'limitedCallWrap').and.returnValue(limitedCallWrapReturn);
+ poSchemaService.limitedCallWrap.and.returnValue(limitedCallWrapReturn as any);
const result = await poSync.destroy();
- expect(poSync['poSchemaService']['limitedCallWrap']).toHaveBeenCalled();
+ expect(poSchemaService.limitedCallWrap).toHaveBeenCalled();
expect(result).toBe(limitedCallWrapReturn);
});
it('destroy: should call poSchemaDefinitionService.destroy, destroySchemasRecords, destroyEventSourcingQueue', async () => {
- poSync['schemas'] = [customerSchema];
-
- spyOn(poSync['poSchemaService'], 'limitedCallWrap').and.callFake(callback => callback());
-
- spyOn(poSync['poSchemaDefinitionService'], 'destroy');
- spyOn(poSync['poSchemaService'], 'destroySchemasRecords');
- spyOn(poSync['poEventSourcingService'], 'destroyEventSourcingQueue');
+ poSchemaService.limitedCallWrap.and.callFake((callback: any) => callback());
+ poSchemaDefinition.destroy.and.returnValue(Promise.resolve());
+ poSchemaService.destroySchemasRecords.and.returnValue(Promise.resolve());
+ poEventSourcing.destroyEventSourcingQueue.and.returnValue(Promise.resolve());
await poSync.destroy();
- expect(poSync['poSchemaDefinitionService'].destroy).toHaveBeenCalled();
- expect(poSync['poSchemaService'].destroySchemasRecords).toHaveBeenCalled();
- expect(poSync['poEventSourcingService'].destroyEventSourcingQueue).toHaveBeenCalled();
+ expect(poSchemaDefinition.destroy).toHaveBeenCalled();
+ expect(poSchemaService.destroySchemasRecords).toHaveBeenCalled();
+ expect(poEventSourcing.destroyEventSourcingQueue).toHaveBeenCalled();
});
it('disableSync: should set isSyncEnabled with false', () => {
poSync['isSyncEnabled'] = true;
-
poSync.disableSync();
-
expect(poSync['isSyncEnabled']).toBeFalsy();
});
@@ -149,37 +144,28 @@ xdescribe('PoSyncService:', () => {
const fakeThis = {
isSyncEnabled: true,
timer: 'mock timer',
- subscription: {
- unsubscribe: () => {}
- }
+ subscription: { unsubscribe: jasmine.createSpy('unsubscribe') }
};
- spyOn(fakeThis.subscription, 'unsubscribe');
-
poSync.disableSync.apply(fakeThis);
- expect(fakeThis['subscription'].unsubscribe).toHaveBeenCalled();
+ expect(fakeThis.subscription.unsubscribe).toHaveBeenCalled();
});
- it('disableSync: should not call subscription.unsubscribe if timer is undefined and subscription is defined', () => {
+ it('disableSync: should not call subscription.unsubscribe if timer is undefined', () => {
const fakeThis = {
isSyncEnabled: true,
timer: undefined,
- subscription: {
- unsubscribe: () => {}
- }
+ subscription: { unsubscribe: jasmine.createSpy('unsubscribe') }
};
- spyOn(fakeThis.subscription, 'unsubscribe');
-
poSync.disableSync.apply(fakeThis);
- expect(fakeThis['subscription'].unsubscribe).not.toHaveBeenCalled();
+ expect(fakeThis.subscription.unsubscribe).not.toHaveBeenCalled();
});
it('enableSync: should set isSyncEnabled with true and call createSubscribe', () => {
poSync['isSyncEnabled'] = false;
-
spyOn(poSync, 'createSubscribe');
poSync.enableSync();
@@ -189,10 +175,10 @@ xdescribe('PoSyncService:', () => {
});
it('getResponses: should call responsesSubject', done => {
- spyOn(poSync['poEventSourcingService'], 'responsesSubject').and.returnValue(of({}));
+ poEventSourcing.responsesSubject.and.returnValue(of({}) as any);
poSync.getResponses().subscribe(() => {
- expect(poSync['poEventSourcingService']['responsesSubject']).toHaveBeenCalled();
+ expect(poEventSourcing.responsesSubject).toHaveBeenCalled();
done();
});
});
@@ -209,30 +195,26 @@ xdescribe('PoSyncService:', () => {
expect(result).toThrowError(Error, 'Model not found: Clients');
});
- it(`insertHttpCommand: should call validateParameter with records inside an object and httpCommand with PoHttpRequestData`, async () => {
+ it('insertHttpCommand: should call validateParameter and httpCommand', async () => {
const requestDataMock: PoHttpRequestData = { url: 'http://url-test.com', method: PoHttpRequestType.GET };
-
spyOn(utilsFunctions, 'validateParameter');
- spyOn(poSync['poEventSourcingService'], 'httpCommand').and.returnValue(Promise.resolve());
+ poEventSourcing.httpCommand.and.returnValue(Promise.resolve(1));
await poSync.insertHttpCommand(requestDataMock);
- expect(poSync['poEventSourcingService']['httpCommand']).toHaveBeenCalledWith(requestDataMock, undefined);
+ expect(poEventSourcing.httpCommand).toHaveBeenCalledWith(requestDataMock, undefined);
expect(utilsFunctions.validateParameter).toHaveBeenCalledWith({ requestData: requestDataMock });
});
- it(`insertHttpCommand: should should call validateParameter with records inside an object and httpCommand with
- customRequestId`, async () => {
+ it('insertHttpCommand: should call httpCommand with customRequestId', async () => {
const requestDataMock: PoHttpRequestData = { url: 'http://url-test.com', method: PoHttpRequestType.GET };
- const customRequestId: string = '123';
-
+ const customRequestId = '123';
spyOn(utilsFunctions, 'validateParameter');
- spyOn(poSync['poEventSourcingService'], 'httpCommand').and.returnValue(Promise.resolve());
+ poEventSourcing.httpCommand.and.returnValue(Promise.resolve(1));
await poSync.insertHttpCommand(requestDataMock, customRequestId);
- expect(poSync['poEventSourcingService']['httpCommand']).toHaveBeenCalledWith(requestDataMock, customRequestId);
- expect(utilsFunctions.validateParameter).toHaveBeenCalledWith({ requestData: requestDataMock });
+ expect(poEventSourcing.httpCommand).toHaveBeenCalledWith(requestDataMock, customRequestId);
});
it('loadData: should load api data', done => {
@@ -251,15 +233,10 @@ xdescribe('PoSyncService:', () => {
it('onSync: should return the same eventSub observable', done => {
poSync['eventSub'] = of({ data: 'value' });
- poSync.onSync().subscribe(
- result => {
- expect(result).toEqual({ data: 'value' });
- done();
- },
- err => {
- fail(err);
- }
- );
+ poSync.onSync().subscribe(result => {
+ expect(result).toEqual({ data: 'value' });
+ done();
+ });
});
it('onSync: should emitter to be a Subscriber instance', () => {
@@ -268,19 +245,16 @@ xdescribe('PoSyncService:', () => {
expect(poSync['emitter'] instanceof Subscriber).toBeTruthy();
});
- it('prepare: should call validateArray with mySchemas inside an object', async () => {
+ it('prepare: should call validateArray with schemas', async () => {
const mySchemas = [customerSchema];
- const validateArrayParam = { schemas: mySchemas };
-
spyOn(poSync, 'startTimer');
spyOn(poSync, 'reactiveSync');
spyOn(utilsFunctions, 'validateArray');
- spyOn(poSync['poEventSourcingService'], 'onSaveData').and.returnValue(of());
- spyOn(poSync, 'saveSchemas').and.returnValue({ then: () => {} });
+ spyOn(poSync, 'saveSchemas').and.returnValue(Promise.resolve());
await poSync.prepare(mySchemas);
- expect(utilsFunctions.validateArray).toHaveBeenCalledWith(validateArrayParam);
+ expect(utilsFunctions.validateArray).toHaveBeenCalledWith({ schemas: mySchemas });
});
it('prepare: should prepare all configs to sync', async () => {
@@ -289,13 +263,11 @@ xdescribe('PoSyncService:', () => {
period: 30,
dataTransform: new CustomDataTransform()
};
-
const mySchemas = [customerSchema];
spyOn(poSync, 'startTimer');
spyOn(poSync, 'reactiveSync');
spyOn(utilsFunctions, 'validateArray');
- spyOn(poSync['poEventSourcingService'], 'onSaveData').and.returnValue(of());
spyOn(poSync, 'saveSchemas').and.returnValue(Promise.resolve());
await poSync.prepare(mySchemas, myConfig);
@@ -305,282 +277,192 @@ xdescribe('PoSyncService:', () => {
expect(poSync['poEventSourcingService']['config']).toEqual(myConfig);
expect(poSync['startTimer']).toHaveBeenCalled();
expect(poSync['reactiveSync']).toHaveBeenCalled();
- expect(poSync['poEventSourcingService']['onSaveData']).toHaveBeenCalled();
expect(poSync['saveSchemas']).toHaveBeenCalled();
expect(poSync['models']['Customers'] instanceof PoEntity).toBeTruthy();
- expect(poSync['models']['Customers']['schema']).toEqual(customerSchema);
});
- it('prepare: should set default config to sync', async () => {
- const defaultConfig: PoSyncConfig = {
- type: poSync['poNetworkService']['getConnectionStatus']().type,
- period: 60,
- dataTransform: new PoDataMessage()
- };
-
+ it('prepare: should set default config when no config is passed', async () => {
const mySchemas = [customerSchema];
+ spyOn(poSync, 'startTimer');
+ spyOn(poSync, 'reactiveSync');
+ spyOn(poSync, 'saveSchemas').and.returnValue(Promise.resolve());
await poSync.prepare(mySchemas);
- expect(poSync['config']).toEqual(defaultConfig);
+ expect(poSync['config'].period).toBe(60);
+ expect(poSync['config'].dataTransform instanceof PoDataMessage).toBeTruthy();
});
- it('prepare: should set config without DataTransform', async () => {
+ it('prepare: should set dataTransform to PoDataMessage when config has no dataTransform', async () => {
const mySchemas = [customerSchema];
- const myConfig: PoSyncConfig = {
- type: PoNetworkType.wifi,
- period: 60
- };
+ const myConfig: PoSyncConfig = { type: PoNetworkType.wifi, period: 60 };
+
+ spyOn(poSync, 'startTimer');
+ spyOn(poSync, 'reactiveSync');
+ spyOn(poSync, 'saveSchemas').and.returnValue(Promise.resolve());
await poSync.prepare(mySchemas, myConfig);
- expect(poSync['config']['dataTransform']).toEqual(new PoDataMessage());
+ expect(poSync['config']['dataTransform'] instanceof PoDataMessage).toBeTruthy();
});
- it('removeItemOfSync: should call poEventSourcingService.removeItemEventSourcing with id', async () => {
- const idEventSourcingMock = jasmine.any(Number);
- spyOn(poSync['poEventSourcingService'], 'removeEventSourcingItem').and.returnValue(Promise.resolve());
-
- await poSync.removeItemOfSync(idEventSourcingMock);
-
- expect(poSync['poEventSourcingService']['removeEventSourcingItem']).toHaveBeenCalledWith(idEventSourcingMock);
+ it('removeItemOfSync: should call removeEventSourcingItem with id', async () => {
+ poEventSourcing.removeEventSourcingItem.and.returnValue(Promise.resolve());
+ await poSync.removeItemOfSync(123);
+ expect(poEventSourcing.removeEventSourcingItem).toHaveBeenCalledWith(123);
});
- it('resumeSync: should call sync and finishSyncSubject.asObservable when canSync is false', async () => {
- spyOn(poSync, 'canSync').and.returnValue(false);
- const spySync = spyOn(poSync, 'sync').and.returnValue(Promise.resolve());
- spyOn(poSync['finishSyncSubject'], 'asObservable').and.callThrough();
+ it('resumeSync: should call sync when canSync is true', async () => {
+ spyOn(poSync, 'canSync').and.returnValue(true);
+ spyOn(poSync, 'sync').and.returnValue(Promise.resolve());
await poSync.resumeSync();
- poSync['finishSyncSubject']['next'](null);
-
- expect(poSync['finishSyncSubject']['asObservable']).toHaveBeenCalledBefore(spySync);
expect(poSync.sync).toHaveBeenCalled();
});
- it(`resumeSync: should call sync and not call finishSyncSubject.asObservable
- when canSync is true`, async () => {
- spyOn(poSync, 'canSync').and.returnValue(true);
- spyOn(poSync, 'sync');
- spyOn(poSync['finishSyncSubject'], 'asObservable').and.returnValue(of());
+ it('resumeSync: should subscribe to finishSyncSubject when canSync is false', async () => {
+ spyOn(poSync, 'canSync').and.returnValue(false);
+ const spySync = spyOn(poSync, 'sync').and.returnValue(Promise.resolve());
+ spyOn(poSync['finishSyncSubject'], 'asObservable').and.callThrough();
await poSync.resumeSync();
+ poSync['finishSyncSubject'].next(null);
+
+ expect(poSync['finishSyncSubject'].asObservable).toHaveBeenCalledBefore(spySync);
expect(poSync.sync).toHaveBeenCalled();
- expect(poSync['finishSyncSubject']['asObservable']).not.toHaveBeenCalled();
});
- it('sync: syncError should be called when syncGet error happen', done => {
+ it('sync: should call startSync and finishSync when canSync returns true', async () => {
spyOn(poSync, 'canSync').and.returnValue(true);
spyOn(poSync, 'startSync');
- spyOn(poSync['poEventSourcingService'], 'syncGet').and.throwError('Error on sync');
- spyOn(poSync, 'syncError');
+ spyOn(poSync, 'finishSync');
- poSync
- .sync()
- .then(() => {
- expect(poSync['startSync']).toHaveBeenCalled();
- expect(poSync['syncError']).toHaveBeenCalled();
- done();
- })
- .catch(err => {
- fail();
- });
- });
+ await poSync.sync();
- it('sync: should call startSync and finishSync when canSync returns true', done => {
- spyOn(poSync, 'canSync').and.returnValue(true);
- spyOn(poSync, 'startSync');
- spyOn(poSync, 'finishSync');
- poSync
- .sync()
- .then(() => {
- expect(poSync['startSync']).toHaveBeenCalled();
- expect(poSync['finishSync']).toHaveBeenCalled();
- done();
- })
- .catch(err => {
- fail(err);
- });
+ expect(poSync['startSync']).toHaveBeenCalled();
+ expect(poSync['finishSync']).toHaveBeenCalled();
});
- it('sync: should not call startSync and finishSync when canSync returns false', done => {
+ it('sync: should not call startSync when canSync returns false', async () => {
spyOn(poSync, 'canSync').and.returnValue(false);
spyOn(poSync, 'startSync');
spyOn(poSync, 'finishSync');
- poSync
- .sync()
- .then(() => {
- expect(poSync['startSync']).not.toHaveBeenCalled();
- expect(poSync['finishSync']).not.toHaveBeenCalled();
- done();
- })
- .catch(err => {
- fail(err);
- });
+
+ await poSync.sync();
+
+ expect(poSync['startSync']).not.toHaveBeenCalled();
+ expect(poSync['finishSync']).not.toHaveBeenCalled();
});
it('sync: should call emitter.next() when emitter is defined', async () => {
spyOn(poSync, 'canSync').and.returnValue(true);
- spyOn(poSync['poEventSourcingService'], 'syncGet').and.returnValue(Promise.resolve());
- spyOn(poSync['poEventSourcingService'], 'syncSend').and.returnValue(Promise.resolve());
- poSync['emitter'] = {
- next: () => {}
- };
- spyOn(poSync['emitter'], 'next');
+ poSync['emitter'] = { next: jasmine.createSpy('next') };
+
await poSync.sync();
- expect(poSync['emitter']['next']).toHaveBeenCalled();
- });
- it('sync: should call canSync always', done => {
- spyOn(poSync, 'canSync');
- poSync
- .sync()
- .then(() => {
- expect(poSync['canSync']).toHaveBeenCalledTimes(1);
- done();
- })
- .catch(err => {
- fail(err);
- });
+ expect(poSync['emitter'].next).toHaveBeenCalled();
});
- it('canSync: should returns false if syncing is true and isSyncEnabled is false', () => {
- poSync['syncing'] = true;
- poSync['isSyncEnabled'] = false;
+ it('sync: syncError should be called when syncGet throws error', async () => {
+ spyOn(poSync, 'canSync').and.returnValue(true);
+ spyOn(poSync, 'startSync');
+ spyOn(poSync, 'syncError');
+ poEventSourcing.syncSend.and.returnValue(Promise.resolve());
+ poEventSourcing.syncGet.and.returnValue(Promise.reject('Error'));
- const canSync = poSync['canSync']();
+ await poSync.sync();
- expect(canSync).toBeFalsy();
+ expect(poSync['startSync']).toHaveBeenCalled();
+ expect(poSync['syncError']).toHaveBeenCalled();
});
- it('canSync: should returns false if syncing is true and isSyncEnabled is true', () => {
+ it('canSync: should return false if syncing is true', () => {
poSync['syncing'] = true;
poSync['isSyncEnabled'] = true;
-
- const canSync = poSync['canSync']();
-
- expect(canSync).toBeFalsy();
+ expect(poSync['canSync']()).toBeFalsy();
});
- it('canSync: should returns false if syncing is false and isSyncEnabled is false', () => {
+ it('canSync: should return false if isSyncEnabled is false', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = false;
-
- const canSync = poSync['canSync']();
-
- expect(canSync).toBeFalsy();
+ expect(poSync['canSync']()).toBeFalsy();
});
- it('canSync: should returns false if network status is false and config is undefined', () => {
+ it('canSync: should return true if network status is true and config is undefined', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = true;
poSync['config'] = undefined;
+ poNetworkServiceMock.getConnectionStatus.and.returnValue({ status: true, type: undefined } as any);
- spyOn(poSync['poNetworkService'], 'getConnectionStatus').and.returnValue({ status: false, type: undefined });
-
- const canSync = poSync['canSync']();
- expect(canSync).toBeFalsy();
+ expect(poSync['canSync']()).toBeTruthy();
});
- it('canSync: should returns true if network status is true and config is undefined', () => {
+ it('canSync: should return false if network status is false', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = true;
poSync['config'] = undefined;
+ poNetworkServiceMock.getConnectionStatus.and.returnValue({ status: false, type: undefined } as any);
- spyOn(poSync['poNetworkService'], 'getConnectionStatus').and.returnValue({ status: true, type: undefined });
-
- const canSync = poSync['canSync']();
- expect(canSync).toBeTruthy();
+ expect(poSync['canSync']()).toBeFalsy();
});
- it('canSync: should returns false if network status is true, network type != ethernet', () => {
+ it('canSync: should return true if network type matches config type', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = true;
- poSync['config'] = { type: PoNetworkType.ethernet };
-
- spyOn(poSync['poNetworkService'], 'getConnectionStatus').and.returnValue({
- status: true,
- type: PoNetworkType.wifi
- });
-
- const canSync = poSync['canSync']();
+ poSync['config'] = { type: PoNetworkType.wifi };
+ poNetworkServiceMock.getConnectionStatus.and.returnValue({ status: true, type: PoNetworkType.wifi } as any);
- expect(canSync).toBeFalsy();
+ expect(poSync['canSync']()).toBeTruthy();
});
- it('canSync: should returns true if network status is true, network type == wifi', () => {
+ it('canSync: should return false if network type does not match config type', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = true;
- poSync['config'] = { type: PoNetworkType.wifi };
- spyOn(poSync['poNetworkService'], 'getConnectionStatus').and.returnValue({
- status: true,
- type: PoNetworkType.wifi
- });
-
- const canSync = poSync['canSync']();
+ poSync['config'] = { type: PoNetworkType.ethernet };
+ poNetworkServiceMock.getConnectionStatus.and.returnValue({ status: true, type: PoNetworkType.wifi } as any);
- expect(canSync).toBeTruthy();
+ expect(poSync['canSync']()).toBeFalsy();
});
- it('canSync: should returns true if network status is true and isConfigIncludesType is true', () => {
+ it('canSync: should return true if config type is an array and includes current type', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = true;
poSync['config'] = { type: [PoNetworkType.wifi, PoNetworkType._2g] };
+ poNetworkServiceMock.getConnectionStatus.and.returnValue({ status: true, type: PoNetworkType.wifi } as any);
- spyOn(poSync['poNetworkService'], 'getConnectionStatus').and.returnValue({
- status: true,
- type: PoNetworkType.wifi
- });
-
- const canSync = poSync['canSync']();
-
- expect(canSync).toBeTruthy();
+ expect(poSync['canSync']()).toBeTruthy();
});
- it(`canSync: should returns false if network status is true, isConfiguredConnection and isConfigIncludesType is false`, () => {
+ it('canSync: should return false if config type is an array and does not include current type', () => {
poSync['syncing'] = false;
poSync['isSyncEnabled'] = true;
poSync['config'] = { type: [PoNetworkType.wifi, PoNetworkType._2g] };
+ poNetworkServiceMock.getConnectionStatus.and.returnValue({ status: true, type: PoNetworkType.ethernet } as any);
- spyOn(poSync['poNetworkService'], 'getConnectionStatus').and.returnValue({
- status: true,
- type: PoNetworkType.ethernet
- });
-
- const canSync = poSync['canSync']();
-
- expect(canSync).toBeFalsy();
+ expect(poSync['canSync']()).toBeFalsy();
});
- it('createSubscribe: should call sync and startTimer if timer is undefined', () => {
- const fakeThis = {
- timer: undefined,
- sync: () => {},
- startTimer: () => {}
- };
+ it('createSubscribe: should not call sync if timer is undefined', () => {
+ poSync['timer'] = undefined;
+ spyOn(poSync, 'sync');
- spyOn(fakeThis, 'sync');
- spyOn(fakeThis, 'startTimer');
+ poSync['createSubscribe']();
- poSync['createSubscribe'].call(fakeThis);
- expect(fakeThis.timer).toBeUndefined();
- expect(fakeThis.sync).not.toHaveBeenCalled();
- expect(fakeThis.startTimer).not.toHaveBeenCalled();
+ expect(poSync.sync).not.toHaveBeenCalled();
});
- it('createSubscribe: should call sync and startTimer', fakeAsync(() => {
+ it('createSubscribe: should call sync and startTimer when timer emits', fakeAsync(() => {
spyOn(poSync, 'sync').and.returnValue(Promise.resolve());
spyOn(poSync, 'startTimer');
poSync['timer'] = of(0);
- poSync['config'] = { type: poSync['poNetworkService']['getConnectionStatus']().type, period: 10 };
+ poSync['config'] = { type: PoNetworkType.wifi, period: 10 };
poSync['createSubscribe']();
-
tick(300);
- expect(poSync['sync']).toHaveBeenCalled();
+ expect(poSync.sync).toHaveBeenCalled();
expect(poSync['timer']).toBeNull();
expect(poSync['subscription']).toBeNull();
expect(poSync['startTimer']).toHaveBeenCalledWith(10);
@@ -588,165 +470,92 @@ xdescribe('PoSyncService:', () => {
it('finishSync: should set syncing to false and call finishSyncSubject.next', () => {
poSync['syncing'] = true;
- spyOn(poSync['finishSyncSubject'], 'next');
+ spyOn(poSync['finishSyncSubject'], 'next');
poSync['finishSync']();
expect(poSync['syncing']).toBeFalsy();
- expect(poSync['finishSyncSubject']['next']).toHaveBeenCalled();
+ expect(poSync['finishSyncSubject'].next).toHaveBeenCalled();
});
- describe('getOnePage: ', () => {
- const myItems = [
- { id: 1, name: 'Customer Z' },
- { id: 2, name: 'Customer X' }
- ];
- const response = of(new HttpResponse({ body: { hasNext: true, items: myItems }, status: 200 }));
- const correctlyUrl = 'http://localhost:8200/api/v1/customers?pageSize=2&page=';
-
- it('should add sync fields to body.items and call http.get with correctly url', done => {
- spyOn(poSync['poHttpClient'], 'get').and.returnValue(response);
- poSync['config'] = {
- type: PoNetworkType.wifi,
- period: 10,
- dataTransform: new PoDataMessage()
- };
+ it('startSync: should set syncing to true', () => {
+ poSync['syncing'] = false;
+ poSync['startSync']();
+ expect(poSync['syncing']).toBeTruthy();
+ });
- spyOn(poSync['poSchemaService'], 'updateAll').and.returnValue(Promise.resolve());
+ it('startTimer: should call createSubscribe if period and isSyncEnabled are truthy', () => {
+ poSync['isSyncEnabled'] = true;
+ spyOn(poSync, 'createSubscribe');
- poSync['getOnePage'](customerSchema).subscribe(body => {
- expect(body.items[0].id).toBe(1);
- expect(body.items[0].name).toBe('Customer Z');
- expect(body.items[0].SyncUpdatedDateTime).toBeNull();
- expect(body.items[0].SyncExclusionDateTime).toBeNull();
- expect(body.items[0].SyncDeleted).toBeFalsy();
- expect(body.items[0].SyncStatus).toBe(2);
- expect(poSync['poHttpClient']['get']).toHaveBeenCalledWith(`${correctlyUrl}1`);
- done();
- });
- });
+ poSync['startTimer'](5);
- it('should call http.get with correctly url and the page 2', done => {
- spyOn(poSync['poSchemaService'], 'updateAll').and.returnValue(Promise.resolve());
- spyOn(poSync['poHttpClient'], 'get').and.returnValue(response);
- poSync['config'] = {
- type: PoNetworkType.wifi,
- period: 10,
- dataTransform: new PoDataMessage()
- };
-
- poSync['getOnePage'](customerSchema, 2).subscribe(body => {
- expect(poSync['poHttpClient']['get']).toHaveBeenCalledWith(`${correctlyUrl}2`);
- done();
- });
- });
+ expect(poSync['createSubscribe']).toHaveBeenCalled();
+ expect(poSync['timer']).toBeDefined();
+ });
- it('should call poSchemaService.updateAll with schema', done => {
- spyOn(poSync['poHttpClient'], 'get').and.returnValue(response);
- spyOn(poSync['poSchemaService'], 'updateAll').and.returnValue(Promise.resolve());
+ it('startTimer: should not call createSubscribe if period is undefined', () => {
+ poSync['isSyncEnabled'] = true;
+ spyOn(poSync, 'createSubscribe');
- poSync['config'] = {
- type: PoNetworkType.wifi,
- period: 10,
- dataTransform: new PoDataMessage()
- };
+ poSync['startTimer'](undefined);
- poSync['getOnePage'](customerSchema).subscribe(body => {
- expect(poSync['poSchemaService'].updateAll).toHaveBeenCalled();
- done();
- });
- });
+ expect(poSync['createSubscribe']).not.toHaveBeenCalled();
});
- it('loadEntityData: should request data from schema url', done => {
- const pageOneData = [
- { id: 1, name: 'Customer 1' },
- { id: 2, name: 'Customer 2' }
- ];
- const pageTwoData = [
- { id: 3, name: 'Customer 3' },
- { id: 4, name: 'Customer 4' }
- ];
-
- poSync['config'] = {
- type: PoNetworkType.wifi,
- period: 10,
- dataTransform: new PoDataMessage()
- };
+ it('startTimer: should not call createSubscribe if period is zero', () => {
+ poSync['isSyncEnabled'] = true;
+ spyOn(poSync, 'createSubscribe');
- spyOn(poSync, 'getOnePage').and.returnValues(
- of({ hasNext: true, items: pageOneData }),
- of({ hasNext: false, items: pageTwoData })
- );
+ poSync['startTimer'](0);
- poSync['loadEntityData'](customerSchema).subscribe(entity => {
- expect(entity.entity).toBe(customerSchema.name);
- expect(entity.data).toEqual([...pageOneData, ...pageTwoData]);
- done();
- });
+ expect(poSync['createSubscribe']).not.toHaveBeenCalled();
});
- it('reactiveSync: should call unsubscribe when is defined and network status is undefined', () => {
- const fakeThis = {
- subscription: { unsubscribe: () => {} },
- poNetworkService: { onChange: () => of({ type: undefined }) }
- };
+ it('startTimer: should not call createSubscribe if isSyncEnabled is false', () => {
+ poSync['isSyncEnabled'] = false;
+ spyOn(poSync, 'createSubscribe');
- spyOn(fakeThis.subscription, 'unsubscribe');
+ poSync['startTimer'](5);
- poSync['reactiveSync'].call(fakeThis);
+ expect(poSync['createSubscribe']).not.toHaveBeenCalled();
+ });
- expect(fakeThis.subscription.unsubscribe).toHaveBeenCalled();
+ it('syncError: should call finishSync', () => {
+ spyOn(poSync, 'finishSync');
+ poSync['syncError']();
+ expect(poSync['finishSync']).toHaveBeenCalled();
});
- it('reactiveSync: should call start, sync and not unsubscribe', () => {
- const periodConfig = jasmine.any(Number);
+ it('reactiveSync: should call startTimer and sync when network status is true', () => {
+ const networkSubject = new Subject();
+ poNetworkServiceMock.onChange.and.returnValue(networkSubject.asObservable());
- const fakeThis = {
- subscription: { unsubscribe: () => {} },
- startTimer: (period: number) => {},
- config: { period: periodConfig },
- sync: () => {},
- poNetworkService: {
- onChange: () => of({ status: true })
- }
- };
+ spyOn(poSync, 'startTimer');
+ spyOn(poSync, 'sync');
- spyOn(fakeThis.subscription, 'unsubscribe');
- spyOn(fakeThis, 'startTimer');
- spyOn(fakeThis, 'sync');
+ poSync['config'] = { period: 10 } as any;
+ poSync['reactiveSync']();
- poSync['reactiveSync'].call(fakeThis);
+ networkSubject.next({ status: true });
- expect(fakeThis.subscription.unsubscribe).not.toHaveBeenCalled();
- expect(fakeThis.startTimer).toHaveBeenCalledWith(periodConfig);
- expect(fakeThis.sync).toHaveBeenCalled();
+ expect(poSync['startTimer']).toHaveBeenCalledWith(10);
+ expect(poSync.sync).toHaveBeenCalled();
});
- it(`reactiveSync: should not call unsubscribe, startTimer and sync when subscription and
- networkStatus is undefined`, () => {
- const fakeThis = {
- subscription: '',
- unsubscribe: () => {},
- startTimer: () => {},
- sync: () => {},
- poNetworkService: { onChange: () => of({ type: undefined }) }
- };
+ it('reactiveSync: should call subscription.unsubscribe when network status is falsy and subscription exists', () => {
+ const networkSubject = new Subject();
+ poNetworkServiceMock.onChange.and.returnValue(networkSubject.asObservable());
- spyOn(fakeThis, 'unsubscribe');
- spyOn(fakeThis, 'startTimer');
- spyOn(fakeThis, 'sync');
+ poSync['subscription'] = { unsubscribe: jasmine.createSpy('unsubscribe') } as any;
+ poSync['reactiveSync']();
- poSync['reactiveSync'].call(fakeThis);
+ networkSubject.next({ status: false });
- expect(fakeThis.unsubscribe).not.toHaveBeenCalled();
- expect(fakeThis.startTimer).not.toHaveBeenCalled();
- expect(fakeThis.sync).not.toHaveBeenCalled();
+ expect(poSync['subscription'].unsubscribe).toHaveBeenCalled();
});
it('saveSchemas: should call poSchemaDefinitionService.getAll and saveAll', async () => {
- spyOn(PoSchemaUtil, 'getLastSync');
-
const schemasStorage: Array = [
{
idField: '',
@@ -760,136 +569,85 @@ xdescribe('PoSyncService:', () => {
];
poSync['schemas'] = [customerSchema, userSchema];
- spyOn(poSync['poSchemaDefinitionService'], 'getAll').and.returnValue(schemasStorage);
- spyOn(poSync['poSchemaDefinitionService'], 'saveAll');
+ poSchemaDefinition.getAll.and.returnValue(Promise.resolve(schemasStorage) as any);
+ poSchemaDefinition.saveAll.and.returnValue(Promise.resolve([]) as any);
+ spyOn(PoSchemaUtil, 'getLastSync');
await poSync['saveSchemas']();
- expect(poSync['poSchemaDefinitionService']['saveAll']).toHaveBeenCalledWith([customerSchema, userSchema]);
- expect(poSync['poSchemaDefinitionService']['getAll']).toHaveBeenCalled();
+ expect(poSchemaDefinition.saveAll).toHaveBeenCalledWith([customerSchema, userSchema]);
+ expect(poSchemaDefinition.getAll).toHaveBeenCalled();
});
- it('saveSchemas: should update lastSync of schemas and call PoSchemaUtil.getLastSync', async () => {
- const dateNow = new Date().toISOString();
-
- spyOn(PoSchemaUtil, 'getLastSync').and.returnValue(dateNow);
-
- const schemasStorage: Array = [
- {
- idField: '',
- name: '',
- getUrlApi: '',
- diffUrlApi: 'http://localhost:8200/api/v1/customers/diff',
- fields: ['code', 'name'],
- pageSize: 20,
- deletedField: 'deleted',
- lastSync: dateNow
- },
- {
- idField: 'code',
- name: 'Users',
- getUrlApi: 'http://localhost:8200/api/v1/users',
- diffUrlApi: 'http://localhost:8200/api/v1/users/diff',
- fields: ['code', 'name'],
- pageSize: 20,
- deletedField: 'deleted',
- lastSync: dateNow
- }
+ describe('getOnePage:', () => {
+ const myItems = [
+ { id: 1, name: 'Customer Z' },
+ { id: 2, name: 'Customer X' }
];
- poSync['schemas'] = [customerSchema, userSchema];
-
- spyOn(poSync['poSchemaDefinitionService'], 'getAll').and.returnValue(schemasStorage);
- spyOn(poSync['poSchemaDefinitionService'], 'saveAll');
-
- await poSync['saveSchemas']();
-
- expect(PoSchemaUtil.getLastSync).toHaveBeenCalledWith(schemasStorage, poSync['schemas'][0].name);
- expect(PoSchemaUtil.getLastSync).toHaveBeenCalledWith(schemasStorage, poSync['schemas'][1].name);
- expect(poSync['schemas'][0].lastSync === dateNow);
- expect(poSync['schemas'][1].lastSync === dateNow);
- });
-
- it('startSync: should set syncing to true', () => {
- poSync['syncing'] = false;
- poSync['startSync']();
- expect(poSync['syncing']).toBeTruthy();
- });
-
- it(`startTimer: should call createSubscribe and set timer with observable emitted in 5000ms if period is defined and
- isSyncEnabled is true`, () => {
- scheduler.run(helpers => {
- const { expectObservable } = helpers;
- const period = 5;
- poSync['isSyncEnabled'] = true;
- const expected = '5000ms (a|)';
-
- spyOn(poSync, 'createSubscribe');
-
- poSync['startTimer'](period);
+ it('should add sync fields to body items and call http.get with correctly url', done => {
+ const response = of({ body: { hasNext: true, items: myItems } });
+ http.get.and.returnValue(response as any);
+ poSchemaService.updateAll.and.returnValue(Promise.resolve());
+ poSync['config'] = { type: PoNetworkType.wifi, period: 10, dataTransform: new PoDataMessage() };
- expectObservable(poSync['timer']).toBe(expected, { a: 0 });
- expect(poSync['createSubscribe']).toHaveBeenCalled();
+ poSync['getOnePage'](customerSchema).subscribe(body => {
+ expect(body.items[0].SyncUpdatedDateTime).toBeNull();
+ expect(body.items[0].SyncExclusionDateTime).toBeNull();
+ expect(body.items[0].SyncDeleted).toBeFalsy();
+ expect(body.items[0].SyncStatus).toBe(2);
+ expect(http.get).toHaveBeenCalledWith('http://localhost:8200/api/v1/customers?pageSize=2&page=1');
+ done();
+ });
});
- });
- it('startTimer: should not call createSubscribe if period of syncronize is undefined and isSyncEnabled is true.', () => {
- poSync['isSyncEnabled'] = true;
+ it('should call http.get with page 2', done => {
+ const response = of({ body: { hasNext: true, items: myItems } });
+ http.get.and.returnValue(response as any);
+ poSchemaService.updateAll.and.returnValue(Promise.resolve());
+ poSync['config'] = { type: PoNetworkType.wifi, period: 10, dataTransform: new PoDataMessage() };
- spyOn(poSync, 'createSubscribe');
-
- poSync['startTimer'](undefined);
-
- expect(poSync['createSubscribe']).not.toHaveBeenCalled();
- });
-
- it('startTimer: should not call createSubscribe if period of syncronize is undefined and isSyncEnabled is false.', () => {
- poSync['isSyncEnabled'] = false;
-
- spyOn(poSync, 'createSubscribe');
-
- poSync['startTimer'](undefined);
-
- expect(poSync['createSubscribe']).not.toHaveBeenCalled();
- });
-
- it('startTimer: should not call createSubscribe if period of syncronize is defined and isSyncEnabled is false.', () => {
- poSync['isSyncEnabled'] = false;
- const period = 1;
-
- spyOn(poSync, 'createSubscribe');
-
- poSync['startTimer'](period);
-
- expect(poSync['createSubscribe']).not.toHaveBeenCalled();
- });
-
- it('startTimer: should not call createSubscribe if period of syncronize is zero and isSyncEnabled is true.', () => {
- poSync['isSyncEnabled'] = true;
-
- spyOn(poSync, 'createSubscribe');
+ poSync['getOnePage'](customerSchema, 2).subscribe(() => {
+ expect(http.get).toHaveBeenCalledWith('http://localhost:8200/api/v1/customers?pageSize=2&page=2');
+ done();
+ });
+ });
- poSync['startTimer'](0);
+ it('should call poSchemaService.updateAll', done => {
+ const response = of({ body: { hasNext: true, items: myItems } });
+ http.get.and.returnValue(response as any);
+ poSchemaService.updateAll.and.returnValue(Promise.resolve());
+ poSync['config'] = { type: PoNetworkType.wifi, period: 10, dataTransform: new PoDataMessage() };
- expect(poSync['createSubscribe']).not.toHaveBeenCalled();
+ poSync['getOnePage'](customerSchema).subscribe(() => {
+ expect(poSchemaService.updateAll).toHaveBeenCalled();
+ done();
+ });
+ });
});
- it('startTimer: should not call createSubscribe if period of syncronize is zero and isSyncEnabled is false.', () => {
- poSync['isSyncEnabled'] = false;
-
- spyOn(poSync, 'createSubscribe');
-
- poSync['startTimer'](0);
-
- expect(poSync['createSubscribe']).not.toHaveBeenCalled();
- });
+ it('loadEntityData: should request data from schema url', done => {
+ const pageOneData = [
+ { id: 1, name: 'Customer 1' },
+ { id: 2, name: 'Customer 2' }
+ ];
+ const pageTwoData = [
+ { id: 3, name: 'Customer 3' },
+ { id: 4, name: 'Customer 4' }
+ ];
- it('syncError: should call finishSync', () => {
- spyOn(poSync, 'finishSync');
+ poSync['config'] = { type: PoNetworkType.wifi, period: 10, dataTransform: new PoDataMessage() };
- poSync['syncError']();
+ spyOn(poSync, 'getOnePage').and.returnValues(
+ of({ hasNext: true, items: pageOneData }),
+ of({ hasNext: false, items: pageTwoData })
+ );
- expect(poSync['finishSync']).toHaveBeenCalled();
+ poSync['loadEntityData'](customerSchema).subscribe(entity => {
+ expect(entity.entity).toBe(customerSchema.name);
+ expect(entity.data).toEqual([...pageOneData, ...pageTwoData]);
+ done();
+ });
});
});
});
diff --git a/projects/sync/src/test.ts b/projects/sync/src/test.ts
index 8f714a3c85..89c3949e89 100644
--- a/projects/sync/src/test.ts
+++ b/projects/sync/src/test.ts
@@ -1,11 +1,15 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
-import 'zone.js';
-import 'zone.js/testing';
+import { NgModule, provideZoneChangeDetection } from '@angular/core';
import { getTestBed } from '@angular/core/testing';
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
+@NgModule({
+ providers: [provideZoneChangeDetection()]
+})
+class AppTestingModule {}
+
// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {
+getTestBed().initTestEnvironment([BrowserTestingModule, AppTestingModule], platformBrowserTesting(), {
teardown: { destroyAfterEach: false }
});
diff --git a/projects/sync/tsconfig.lib.json b/projects/sync/tsconfig.lib.json
index e1f7191ad3..a422c21d91 100644
--- a/projects/sync/tsconfig.lib.json
+++ b/projects/sync/tsconfig.lib.json
@@ -12,7 +12,7 @@
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true,
- "fullTemplateTypeCheck": true
+ "strictTemplates": false
},
"exclude": ["node_modules", "src/test.ts", "**/*.spec.ts"]
}
diff --git a/projects/sync/tsconfig.schematics.json b/projects/sync/tsconfig.schematics.json
index 529c70bcb4..a4df1c46f9 100644
--- a/projects/sync/tsconfig.schematics.json
+++ b/projects/sync/tsconfig.schematics.json
@@ -1,11 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
- "baseUrl": "../..",
"lib": ["es2022", "dom"],
"declaration": true,
- "module": "commonjs",
- "moduleResolution": "node",
+ "module": "node16",
+ "moduleResolution": "node16",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false,
diff --git a/projects/sync/tsconfig.spec.json b/projects/sync/tsconfig.spec.json
index 519c167a68..92ff656bd5 100644
--- a/projects/sync/tsconfig.spec.json
+++ b/projects/sync/tsconfig.spec.json
@@ -6,5 +6,8 @@
"skipLibCheck": true
},
"files": ["src/test.ts"],
- "include": ["**/*.spec.ts", "**/*.d.ts"]
+ "include": ["**/*.spec.ts", "**/*.d.ts"],
+ "angularCompilerOptions": {
+ "strictTemplates": false
+ }
}
diff --git a/projects/templates/.eslintrc.json b/projects/templates/.eslintrc.json
deleted file mode 100644
index fea366f397..0000000000
--- a/projects/templates/.eslintrc.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "extends": "../../.eslintrc.json",
- "ignorePatterns": ["!**/*"],
- "overrides": [
- {
- "files": ["*.ts"],
- "parserOptions": {
- "project": ["projects/templates/tsconfig.lib.json", "projects/templates/tsconfig.spec.json"],
- "createDefaultProgram": true
- },
- "plugins": ["sonarjs"],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": ["element", "attribute"],
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/directive-class-suffix": "off",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/no-input-rename": "off",
- "@angular-eslint/no-output-rename": "off",
- "@typescript-eslint/array-type": [
- "error",
- {
- "default": "generic"
- }
- ],
- "@typescript-eslint/await-thenable": "error",
- "@typescript-eslint/ban-types": [
- "off",
- {
- "types": {
- "String": {
- "message": "Use string instead",
- "fixWith": "string"
- },
- "Boolean": {
- "message": "Use boolean instead",
- "fixWith": "boolean"
- },
- "Number": {
- "message": "Use number instead",
- "fixWith": "number"
- }
- }
- }
- ],
- "@typescript-eslint/consistent-type-assertions": "off",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-member-accessibility": [
- "off",
- {
- "accessibility": "explicit"
- }
- ],
- "@typescript-eslint/member-delimiter-style": [
- "off",
- {
- "multiline": {
- "delimiter": "none",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": false
- }
- }
- ],
- "@typescript-eslint/no-empty-interface": "off",
- "@typescript-eslint/no-for-in-array": "error",
- "@typescript-eslint/no-inferrable-types": [
- "off",
- {
- "ignoreParameters": true
- }
- ],
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
- "@typescript-eslint/no-var-requires": "error",
- "@typescript-eslint/prefer-for-of": "off",
- "@typescript-eslint/quotes": [
- "off",
- "single",
- {
- "allowTemplateLiterals": true
- }
- ],
- "@typescript-eslint/require-array-sort-compare": [
- "error",
- {
- "ignoreStringArrays": true
- }
- ],
- "@typescript-eslint/semi": ["off", null],
- "@typescript-eslint/type-annotation-spacing": "off",
- "arrow-parens": ["off", "always"],
- "brace-style": ["off", "off"],
- "default-case-last": "error",
- "dot-notation": "off",
- "eol-last": "off",
- "id-blacklist": "off",
- "id-match": "off",
- "indent": "off",
- "linebreak-style": "off",
- "max-len": "off",
- "max-lines-per-function": [
- "off",
- {
- "max": 200
- }
- ],
- "max-params": [
- "error",
- {
- "max": 8
- }
- ],
- "new-parens": "off",
- "newline-per-chained-call": "off",
- "no-empty-function": "off",
- "no-empty-pattern": "off",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-irregular-whitespace": "off",
- "no-multi-str": "error",
- "no-self-assign": "error",
- "no-shadow": "off",
- "no-trailing-spaces": "off",
- "no-underscore-dangle": "off",
- "no-unused-expressions": "error",
- "no-use-before-define": "off",
- "object-shorthand": "off",
- "padded-blocks": [
- "off",
- {
- "blocks": "never"
- },
- {
- "allowSingleLineBlocks": true
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "off",
- "quote-props": "off",
- "semi": "off",
- "sonarjs/cognitive-complexity": "off",
- "sonarjs/max-switch-cases": "error",
- "sonarjs/no-all-duplicated-branches": "error",
- "sonarjs/no-collapsible-if": "error",
- "sonarjs/no-collection-size-mischeck": "error",
- "sonarjs/no-duplicate-string": "off",
- "sonarjs/no-duplicated-branches": "off",
- "sonarjs/no-element-overwrite": "error",
- "sonarjs/no-identical-conditions": "error",
- "sonarjs/no-identical-expressions": "error",
- "sonarjs/no-identical-functions": "off",
- "sonarjs/no-inverted-boolean-check": "error",
- "sonarjs/no-one-iteration-loop": "off",
- "sonarjs/no-redundant-boolean": "error",
- "sonarjs/no-redundant-jump": "error",
- "sonarjs/no-same-line-conditional": "error",
- "sonarjs/no-small-switch": "error",
- "sonarjs/no-unused-collection": "error",
- "sonarjs/no-use-of-empty-return-value": "error",
- "sonarjs/no-useless-catch": "error",
- "sonarjs/prefer-immediate-return": "error",
- "space-before-function-paren": "off",
- "space-in-parens": ["off", "never"]
- }
- },
- {
- "files": ["*.html"],
- "rules": {}
- }
- ]
-}
diff --git a/projects/templates/karma.conf.js b/projects/templates/karma.conf.js
index d847eb4547..e0d1c4119d 100644
--- a/projects/templates/karma.conf.js
+++ b/projects/templates/karma.conf.js
@@ -9,8 +9,7 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
+ require('karma-coverage')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
diff --git a/projects/templates/package.json b/projects/templates/package.json
index d80c0725ab..38d0c30d5b 100644
--- a/projects/templates/package.json
+++ b/projects/templates/package.json
@@ -16,14 +16,12 @@
"tslib": "^2.6.2"
},
"peerDependencies": {
- "@angular/animations": "^21",
- "@angular/common": "^21",
- "@angular/compiler": "^21",
- "@angular/core": "^21",
- "@angular/forms": "^21",
- "@angular/platform-browser": "^21",
- "@angular/platform-browser-dynamic": "^21",
- "@angular/router": "^21",
+ "@angular/common": "^22",
+ "@angular/compiler": "^22",
+ "@angular/core": "^22",
+ "@angular/forms": "^22",
+ "@angular/platform-browser": "^22",
+ "@angular/router": "^22",
"@po-ui/ng-components": "0.0.0-PLACEHOLDER",
"rxjs": "~7.8.1",
"zone.js": "~0.15.0"
diff --git a/projects/templates/schematics/collection.json b/projects/templates/schematics/collection.json
index 6a0c1fa97a..25184461c2 100644
--- a/projects/templates/schematics/collection.json
+++ b/projects/templates/schematics/collection.json
@@ -5,46 +5,6 @@
"description": "Add my library to the project.",
"factory": "./ng-add/index",
"schema": "./ng-add/schema.json"
- },
- "po-page-dynamic-table": {
- "description": "Create a component with po-page-dynamic-table",
- "factory": "./ng-generate/po-page-dynamic-table/index",
- "schema": "./ng-generate/po-page-dynamic-table/schema.json"
- },
- "po-page-dynamic-edit": {
- "description": "Create a component with po-page-dynamic-edit",
- "factory": "./ng-generate/po-page-dynamic-edit/index",
- "schema": "./ng-generate/po-page-dynamic-edit/schema.json"
- },
- "po-page-dynamic-detail": {
- "description": "Create a component with po-page-dynamic-detail",
- "factory": "./ng-generate/po-page-dynamic-detail/index",
- "schema": "./ng-generate/po-page-dynamic-detail/schema.json"
- },
- "po-page-dynamic-search": {
- "description": "Create a component with po-page-dynamic-search",
- "factory": "./ng-generate/po-page-dynamic-search/index",
- "schema": "./ng-generate/po-page-dynamic-search/schema.json"
- },
- "po-page-job-scheduler": {
- "description": "Create a component with po-page-job-scheduler",
- "factory": "./ng-generate/po-page-job-scheduler/index",
- "schema": "./ng-generate/po-page-job-scheduler/schema.json"
- },
- "po-page-blocked-user": {
- "description": "Create a component with po-page-blocked-user",
- "factory": "./ng-generate/po-page-blocked-user/index",
- "schema": "./ng-generate/po-page-blocked-user/schema.json"
- },
- "po-page-change-password": {
- "description": "Create a component with po-page-change-password",
- "factory": "./ng-generate/po-page-change-password/index",
- "schema": "./ng-generate/po-page-change-password/schema.json"
- },
- "po-page-login": {
- "description": "Create a component with po-page-login",
- "factory": "./ng-generate/po-page-login/index",
- "schema": "./ng-generate/po-page-login/schema.json"
}
}
}
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index bff95fdbbe..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 4e953e6dd2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageBlockedUserModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageBlockedUserModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index b91a580769..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageBlockedUserModule } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageBlockedUserModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index bff95fdbbe..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index b6c5463286..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageBlockedUserModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageBlockedUserModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 021ed143f7..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index 4ab8315236..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageBlockedUserModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageBlockedUserModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-blocked-user/index.spec.ts
deleted file mode 100644
index aa154e03e2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/index.spec.ts
+++ /dev/null
@@ -1,185 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-blocked-user:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-blocked-user',
- { ...componentOptions, name: componentName },
- appTree
- );
-
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-blocked-user', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-blocked-user', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/index.ts b/projects/templates/schematics/ng-generate/po-page-blocked-user/index.ts
deleted file mode 100644
index f6d28becd1..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageBlockedUserComponent(options)]);
-}
-
-function createPageBlockedUserComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/schema.json b/projects/templates/schematics/ng-generate/po-page-blocked-user/schema.json
deleted file mode 100644
index 224c57c741..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageBlockedUser",
- "title": "Page Blocked User Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-blocked-user/schema.ts b/projects/templates/schematics/ng-generate/po-page-blocked-user/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-blocked-user/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index d6bcb9ba2d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 56429ded66..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageChangePasswordModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageChangePasswordModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index d288044213..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageChangePasswordModule } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageChangePasswordModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index d6bcb9ba2d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index e4ca00dc7d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageChangePasswordModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageChangePasswordModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 021ed143f7..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index eca5dcff1c..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageChangePasswordModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageChangePasswordModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-change-password/index.spec.ts
deleted file mode 100644
index 3744b1f20b..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/index.spec.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-change-password:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-change-password',
- { ...componentOptions, name: componentName },
- appTree
- );
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-change-password', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-change-password', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-change-password', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/index.ts b/projects/templates/schematics/ng-generate/po-page-change-password/index.ts
deleted file mode 100644
index 6cd8cedb0e..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageChangePasswordComponent(options)]);
-}
-
-function createPageChangePasswordComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/schema.json b/projects/templates/schematics/ng-generate/po-page-change-password/schema.json
deleted file mode 100644
index cb215dac8c..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageChangePassword",
- "title": "Page Change Password Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-change-password/schema.ts b/projects/templates/schematics/ng-generate/po-page-change-password/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-change-password/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 832b587fcf..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 499addfd9f..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicDetailModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicDetailModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index dfcf705d11..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageDynamicDetailModule, PoPageDynamicDetailField } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageDynamicDetailModule
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- readonly fields: Array = [
- { property: 'id', label: 'User ID', key: true },
- ];
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 832b587fcf..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 45f5a0d6a6..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicDetailModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicDetailModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 8c1009db08..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-import { PoPageDynamicDetailField } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- readonly fields: Array = [
- { property: 'id', label: 'User ID', key: true },
- ];
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index 20be42a154..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageDynamicDetailModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageDynamicDetailModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/index.spec.ts
deleted file mode 100644
index 812da56c14..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/index.spec.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-dynamic-detail:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-dynamic-detail',
- { ...componentOptions, name: componentName },
- appTree
- );
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-dynamic-detail', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-detail', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/index.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/index.ts
deleted file mode 100644
index 9339554327..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageDynamicDetailComponent(options)]);
-}
-
-function createPageDynamicDetailComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/schema.json b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/schema.json
deleted file mode 100644
index caff096c30..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageDynamicDetail",
- "title": "Page Dynamic Detail Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/schema.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-detail/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-detail/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index c151d1a85b..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 816e4b789e..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicEditModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicEditModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 175cbbb6c8..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-import { CommonModule } from '@angular/common';
-
-import { PoPageDynamicEditModule } from '@po-ui/ng-templates';
-import { PoPageDynamicEditField } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageDynamicEditModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- readonly fields: Array = [
- { property: 'id', label: 'User ID', key: true },
- ];
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index c151d1a85b..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index dd4b4e798e..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicEditModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicEditModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index a39deb9e81..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-import { PoPageDynamicEditField } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- readonly fields: Array = [
- { property: 'id', label: 'User ID', key: true },
- ];
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index 54435e6e57..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageDynamicEditModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageDynamicEditModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/index.spec.ts
deleted file mode 100644
index e692d04f7c..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/index.spec.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-dynamic-edit:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-dynamic-edit',
- { ...componentOptions, name: componentName },
- appTree
- );
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-dynamic-edit', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-edit', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/index.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/index.ts
deleted file mode 100644
index bbd17c0903..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageDynamicEditComponent(options)]);
-}
-
-function createPageDynamicEditComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/schema.json b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/schema.json
deleted file mode 100644
index 3239d1a31a..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageDynamicEdit",
- "title": "Page Dynamic Edit Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/schema.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-edit/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-edit/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 5293e89aaa..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 6a1a71ee9f..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicSearchModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicSearchModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 12066e982e..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageDynamicSearchModule } from '@po-ui/ng-templates';
-
-import { PoPageAction, PoDynamicFormField } from '@po-ui/ng-components';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageDynamicSearchModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- readonly actions: Array = [
- { label: 'Adicionar', action: this.add.bind(this) }
- ];
-
- readonly filter: Array = [
- { property: 'name' }
- ];
-
- constructor() { }
-
- ngOnInit() { }
-
- add() {
- alert('ADD');
- }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 5293e89aaa..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 7fb5ca80aa..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicSearchModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicSearchModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 75ea9f7aaf..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-import { PoPageAction, PoDynamicFormField } from '@po-ui/ng-components';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- readonly actions: Array = [
- { label: 'Adicionar', action: this.add.bind(this) }
- ];
-
- readonly filter: Array = [
- { property: 'name' }
- ];
-
- constructor() { }
-
- ngOnInit() { }
-
- add() {
- alert('ADD');
- }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index ab0d96885a..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageDynamicSearchModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageDynamicSearchModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-search/index.spec.ts
deleted file mode 100644
index 602d1ddb5c..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/index.spec.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-dynamic-search:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-dynamic-search',
- { ...componentOptions, name: componentName },
- appTree
- );
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-dynamic-search', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-search', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/index.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-search/index.ts
deleted file mode 100644
index 0668538b7a..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageDynamicSearchComponent(options)]);
-}
-
-function createPageDynamicSearchComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/schema.json b/projects/templates/schematics/ng-generate/po-page-dynamic-search/schema.json
deleted file mode 100644
index da4609117c..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageDynamicSearch",
- "title": "Page Dynamic Search Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-search/schema.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-search/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-search/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 80ab266341..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index f89632cc51..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicTableModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicTableModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index d13df7e21a..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,27 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageDynamicTableModule } from '@po-ui/ng-templates';
-import { PoPageDynamicTableActions } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageDynamicTableModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- readonly actions: PoPageDynamicTableActions = { };
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 80ab266341..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index fb2dd2f3c8..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageDynamicTableModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageDynamicTableModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index ca3eacb583..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-import { PoPageDynamicTableActions } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- readonly actions: PoPageDynamicTableActions = { };
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index 87f5db5348..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageDynamicTableModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageDynamicTableModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-table/index.spec.ts
deleted file mode 100644
index 9412be080f..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/index.spec.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-dynamic-table:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-dynamic-table',
- { ...componentOptions, name: componentName },
- appTree
- );
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-dynamic-table', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-dynamic-table', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/index.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-table/index.ts
deleted file mode 100644
index 5d2392a7db..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageDynamicTableComponent(options)]);
-}
-
-function createPageDynamicTableComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/schema.json b/projects/templates/schematics/ng-generate/po-page-dynamic-table/schema.json
deleted file mode 100644
index 0e325e6778..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageDynamicTable",
- "title": "Page Dynamic Table Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-dynamic-table/schema.ts b/projects/templates/schematics/ng-generate/po-page-dynamic-table/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-dynamic-table/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index a0f6a54bd2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index dabeb530d9..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageJobSchedulerModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageJobSchedulerModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 253d885129..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageJobSchedulerModule } from '@po-ui/ng-templates';
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageJobSchedulerModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index a0f6a54bd2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 6d5b91b1ad..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageJobSchedulerModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageJobSchedulerModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 3c4ebde1fb..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- // PLEASE ADD THE API URL SERVICE HERE
- readonly apiService = 'http://localhost:8080/api';
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index a84063cc15..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageJobSchedulerModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageJobSchedulerModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-job-scheduler/index.spec.ts
deleted file mode 100644
index c1b0f1f478..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/index.spec.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-job-scheduler:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic(
- 'po-page-job-scheduler',
- { ...componentOptions, name: componentName },
- appTree
- );
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-job-scheduler', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-job-scheduler', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/index.ts b/projects/templates/schematics/ng-generate/po-page-job-scheduler/index.ts
deleted file mode 100644
index 6aa9424ec3..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageJobSchedulerComponent(options)]);
-}
-
-function createPageJobSchedulerComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/schema.json b/projects/templates/schematics/ng-generate/po-page-job-scheduler/schema.json
deleted file mode 100644
index 0e28a7bdd2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageJobScheduler",
- "title": "Page Job Scheduler Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-job-scheduler/schema.ts b/projects/templates/schematics/ng-generate/po-page-job-scheduler/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-job-scheduler/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 1620011e8d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index 14390f5afc..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,33 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageLoginModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageLoginModule
- ],
- providers: [provideHttpClient()]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index e0c8d6013a..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files-standalone/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { PoPageLoginModule } from '@po-ui/ng-templates';
-
-
-@Component({
- selector: '<%= selector %>',
- imports: [
- CommonModule,
- PoPageLoginModule,
- ],
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template b/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
deleted file mode 100644
index 08a37212f2..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__-routing.module.ts.template
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-const routes: Routes = [
- { path: '', component: <%= classify(name) %>Component }
-];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
-})
-export class <%= classify(name) %>RoutingModule { }
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template b/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.__style__.template
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template b/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
deleted file mode 100644
index 1620011e8d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.html.template
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template b/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
deleted file mode 100644
index ca22130871..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.spec.ts.template
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { provideHttpClient } from '@angular/common/http';
-
-import { PoPageLoginModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
-
-describe('<%= classify(name) %>Component', () => {
- let component: <%= classify(name) %>Component;
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule,
- PoPageLoginModule
- ],
- providers: [provideHttpClient()],
- declarations: [ <%= classify(name) %>Component ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template b/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
deleted file mode 100644
index 021ed143f7..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.component.ts.template
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
- selector: '<%= selector %>',
- templateUrl: './<%= dasherize(name) %>.component.html',
- styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>'],
- standalone: false
-})
-export class <%= classify(name) %>Component implements OnInit {
-
- constructor() { }
-
- ngOnInit() { }
-
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template b/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
deleted file mode 100644
index 05554564e9..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/files/__path__/__name@dasherize__/__name@dasherize__.module.ts.template
+++ /dev/null
@@ -1,19 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-
-import { PoPageLoginModule } from '@po-ui/ng-templates';
-
-import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% if (routing) { %>
-import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
-
-@NgModule({
- declarations: [
- <%= classify(name) %>Component
- ],
- imports: [
- CommonModule,
- PoPageLoginModule,<% if (routing) { %>
- <%= classify(name) %>RoutingModule<% } %>
- ]
-})
-export class <%= classify(name) %>Module { }
diff --git a/projects/templates/schematics/ng-generate/po-page-login/index.spec.ts b/projects/templates/schematics/ng-generate/po-page-login/index.spec.ts
deleted file mode 100644
index 34a64f5401..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/index.spec.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-import { Tree } from '@angular-devkit/schematics';
-import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
-import { Schema as WorkspaceOptions } from '@schematics/angular/workspace/schema';
-import * as path from 'path';
-
-const collectionPath = path.join(__dirname, '../../collection.json');
-
-xdescribe('po-page-login:', () => {
- const runner = new SchematicTestRunner('schematics', collectionPath);
-
- const workspaceOptions: WorkspaceOptions = {
- name: 'workspace',
- newProjectRoot: 'projects',
- version: '6.0.0'
- };
-
- const componentOptions: any = {
- name: 'po',
- style: 'css',
- skipTests: false
- };
-
- let appTree: UnitTestTree;
-
- beforeEach(async () => {
- appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', workspaceOptions);
- appTree = await runner.runExternalSchematic('@schematics/angular', 'application', componentOptions, appTree);
- });
-
- it('should create component', async () => {
- const componentName = 'supply';
- const tree = await runner.runSchematic('po-page-login', { ...componentOptions, name: componentName }, appTree);
- const files: Array = tree.files;
-
- const fullFilePath = (ext: string) =>
- `/projects/${componentOptions.name}/src/app/${componentName}/${componentName}.component.${ext}`;
-
- expect(files).toContain(fullFilePath('ts'));
- expect(files).toContain(fullFilePath('html'));
- expect(files).toContain(fullFilePath('spec.ts'));
- expect(files).toContain(fullFilePath(componentOptions.style));
- });
-
- it('should create component and module', async () => {
- const componentName = 'supply';
- const createModule = true;
-
- const options = { ...componentOptions, name: componentName, createModule, project: 'po' };
-
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const files: Array = tree.files;
-
- expect(files).toContain(`/projects/${options.project}/src/app/${componentName}/${componentName}.module.ts`);
- });
-
- it('should add declaration component in closest module by default', async () => {
- const options = { ...componentOptions, name: 'customers' };
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersComponent.*from '.\/customers\/customers.component'/);
- expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+CustomersComponent\r?\n/m);
- });
-
- it('should import component module if createModule is true', async () => {
- const options = { ...componentOptions, name: 'customers', createModule: true };
-
- const tree = await runner.runSchematic('po-page-login', options, appTree);
- const moduleContent = getFileContent(tree, `/projects/${componentOptions.name}/src/app/app.module.ts`);
-
- expect(moduleContent).toMatch(/import.*CustomersModule.*from '.\/customers\/customers.module'/);
- expect(moduleContent).toMatch(/imports:\s*\[[^\]]+?,\r?\n\s+CustomersModule\r?\n/m);
- });
-
- it('should generate component.less if style is `less`', async () => {
- const options = { ...componentOptions, name: 'customers', style: 'less' };
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(
- `/projects/${componentOptions.name}/src/app/customers/customers.component.${options.style}`
- );
- });
-
- it('should generate component with stylesheet `css` if options.style is empty', async () => {
- const options = { ...componentOptions, name: 'customers', style: '' };
-
- const tree = await runner.runSchematic('po-page-login', options, appTree);
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.css`);
- });
-
- it('shouldn`t generate component spec if `skipTests` is true', async () => {
- const options = { ...componentOptions, name: 'customers', skipTests: true };
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const files = tree.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.ts`);
- expect(files).not.toContain(`/projects/${componentOptions.name}/src/app/customers/customers.component.spec.ts`);
- });
-
- it('should generate component in path informed', async () => {
- // create customers component module to use with path option
- const options = { ...componentOptions, name: 'customers', createModule: true };
- await runner.runSchematic('po-page-login', options, appTree);
-
- const optionsPath = {
- ...componentOptions,
- name: 'wms',
- path: `/projects/${componentOptions.name}/src/app/customers`
- };
-
- const treePath = await runner.runSchematic('po-page-login', optionsPath, appTree);
-
- const files = treePath.files;
-
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.spec.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.ts`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.html`);
- expect(files).toContain(`/projects/${componentOptions.name}/src/app/customers/wms/wms.component.${options.style}`);
- });
-
- it('should use the custom prefix when create component', async () => {
- const prefix = 'wms';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: '${prefix}-customers'`));
- });
-
- it('should use the default prefix when create component if prefix is null', async () => {
- const prefix = undefined;
-
- const options = { ...componentOptions, name: 'customers', sample: true, prefix };
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'app-customers'`));
- });
-
- it('should use only the name how prefix when create component if prefix is ""', async () => {
- const prefix = '';
-
- const options = { ...componentOptions, name: 'customers', prefix };
- const tree = await runner.runSchematic('po-page-login', options, appTree);
-
- const componentContent = getFileContent(
- tree,
- `/projects/${componentOptions.name}/src/app/customers/customers.component.ts`
- );
-
- expect(componentContent).toMatch(new RegExp(`selector: 'customers'`));
- });
-});
-
-/** Gets the content of a specified file from a schematic tree. */
-function getFileContent(tree: Tree, filePath: string): string {
- const contentBuffer = tree.read(filePath);
-
- if (!contentBuffer) {
- throw new Error(`Cannot read "${filePath}" because it does not exist.`);
- }
-
- return contentBuffer.toString();
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-login/index.ts b/projects/templates/schematics/ng-generate/po-page-login/index.ts
deleted file mode 100644
index 978e118f2e..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { chain, Rule } from '@angular-devkit/schematics';
-
-import { buildComponent } from '@po-ui/ng-schematics/build-component';
-
-import { Schema as ComponentOptions } from './schema';
-
-/** Scaffolds a new component with */
-export default function (options: ComponentOptions): Rule {
- return chain([createPageLoginComponent(options)]);
-}
-
-function createPageLoginComponent(options: ComponentOptions): Rule {
- return buildComponent(options);
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-login/schema.json b/projects/templates/schematics/ng-generate/po-page-login/schema.json
deleted file mode 100644
index 536d54789a..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/schema.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "$schema": "http://json-schema.org/schema",
- "$id": "SchematicsPOPageLogin",
- "title": "Page Login Options Schema",
- "type": "object",
- "properties": {
- "style": {
- "description": "The file extension or preprocessor to use for style files.",
- "type": "string",
- "default": "css"
- },
- "project": {
- "type": "string",
- "description": "The name of the project.",
- "$default": {
- "$source": "projectName"
- }
- },
- "routing": {
- "type": "boolean",
- "description": "When true, creates a routing module.",
- "default": false
- },
- "createModule": {
- "type": "boolean",
- "description": "When true, create a component module.",
- "default": false
- },
- "name": {
- "type": "string",
- "description": "The name to use for the component",
- "$default": {
- "$source": "argv",
- "index": 0
- },
- "x-prompt": "What name would you like to use for the component?"
- },
- "skipTests": {
- "description": "When true, does not create \"spec.ts\" test files for the app.",
- "type": "boolean",
- "default": false,
- "alias": "S",
- "x-user-analytics": 12
- },
- "path": {
- "type": "string",
- "format": "path",
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
- "visible": false
- },
- "prefix": {
- "type": "string",
- "description": "The prefix to apply to the generated component selector.",
- "alias": "p",
- "oneOf": [
- {
- "maxLength": 0
- },
- {
- "minLength": 1,
- "format": "html-selector"
- }
- ]
- }
- },
- "required": ["name"]
-}
diff --git a/projects/templates/schematics/ng-generate/po-page-login/schema.ts b/projects/templates/schematics/ng-generate/po-page-login/schema.ts
deleted file mode 100644
index 0e5e0a349d..0000000000
--- a/projects/templates/schematics/ng-generate/po-page-login/schema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Schema as ComponentSchema } from '@po-ui/ng-schematics/build-component';
-
-export interface Schema extends ComponentSchema {}
diff --git a/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery-error-message/po-modal-password-recovery-error-message.component.ts b/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery-error-message/po-modal-password-recovery-error-message.component.ts
index 88896971c0..244ab62e73 100644
--- a/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery-error-message/po-modal-password-recovery-error-message.component.ts
+++ b/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery-error-message/po-modal-password-recovery-error-message.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input } from '@angular/core';
+import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
/**
* @docsPrivate
@@ -10,6 +10,7 @@ import { Component, Input } from '@angular/core';
@Component({
selector: 'po-modal-password-recovery-error-message',
templateUrl: './po-modal-password-recovery-error-message.component.html',
+ changeDetection: ChangeDetectionStrategy.Eager,
standalone: false
})
export class PoModalPasswordRecoveryErrorMessageComponent {
diff --git a/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.html b/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.html
index e1a7175094..0bed89b5cb 100644
--- a/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.html
+++ b/projects/templates/src/lib/components/po-modal-password-recovery/po-modal-password-recovery.component.html
@@ -2,117 +2,134 @@
#recoveryModal
p-hide-close
p-size="auto"
- [ngSwitch]="modalType"
[p-components-size]="componentsSize"
[p-primary-action]="primaryAction"
[p-secondary-action]="secondaryAction"
[p-title]="modalTitle"
>
-
-
- {{ emailModalPhrases.firstPhrase }}
-
-