systelab / systelab-components

Systelab Angular common components
MIT License
14 stars 8 forks source link
angular typescript typescript-library

Codacy Badge Build Status codecov npm version Known Vulnerabilities

systelab-components

Library with common UI components to speed up your Angular developments. You can take a look to the components in our showcase at https://systelab.github.io/components.

Please, read the documentation at https://github.com/systelab/systelab-components/tree/master/projects/systelab-components

Working with the repo

In order to clone the repository and test the library use the following commands:

git clone https://github.com/systelab/systelab-components.git
cd systelab-components
npm ci
npm run build-lib
ng serve

This will bootstrap a showcase application to test the different components.

Use watch in the library build to detect file changes automatically (except from css). Start application in a different terminal:

Terminal 1

ng build systelab-components --watch

Terminal 2

ng serve

Test

Unit

ng test

E2E

For E2E testing purposes, the strategy chosen is Snapshot Testing.

Snapshot tests are a very useful tool whenever you want to make sure your UI does not change unexpectedly.

A typical snapshot test case for a mobile app renders a UI component, takes a screenshot, then compares it to a reference image stored alongside the test. The test will fail if the two images do not match: either the change is unexpected, or the screenshot needs to be updated to the new version of the UI component.

In order to run the test, run the command:

ng e2e

If you want to update the snapshots, run the command:

npm run update-snapshots

Publish the Library

In order to publish the library, an authorized npm user is required. Once set, update the version in the package.json, and run the npm publish script:

npm run build-lib
cd dist/systelab-components
npm publish

Breaking changes

Version 18.x.x - Angular 18

Angular 18 news

Version 17.x.x - Angular 17

Angular 17 news

Version 16.x.x - Angular 16

Angular 16 news

Version 15.x.x - Angular 15

Tree component migrated to use Angular CDK Tree

  1. Add CdkTreeModule to modules using Tree components
  2. Replace abstract-tree-status.component.html for abstract-tree.component.html
  3. Replace

import { TreeNode } from 'primeng/api';

for

import { TreeNode } from 'systelab-components';

  1. Review any usages and overrides of CSS classes related to previous PrimeNG Tree (p-tree, p-treenode-label, ...)

Angular 15 news

Version 14.x.x - Angular 14

Angular 13 news

Angular 14 news

The following steps should be considered when upgrade to systelab-components 14.x.x

Version 13.x.x Angular 12

IE11 support has been deprecated due to the upgrade to Angular 12

Use of Ivy, applications that uses this library have to use Angular 12 and Ivy rendering.

Added --noImplicitOverride flag to allow override methods and get error for unintentionally overrides https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-3.html#override-and-the---noimplicitoverride-flag

Version 11.x.x

The following steps should be considered when migrating from Angular 10 to 11

  1. Angular now requires TypeScript 4.0. ng update will migrate you automatically.
  2. Browsers Support

Support for IE9, IE10, and IE mobile has been removed. This was announced in the v10 update.

Run this command to update the browsers npx browserslist@latest --update-db

  1. Upgrade Primeng 11

PrimeIcons should be upgraded to 4.1.0 as components like table utilize new icons in the library

locale property functionality of Datepicker is removed in favor of the new global i18n API. The datepicker components inject PrimeNGConfig

  1. Use 'karma-coverage' because 'karma-coverage-istanbul-reporter' usage has been deprecated since version 11

Version 10.x.x

Many changes where introduce in version 10 in order to standardize the library and support Angular 9. The following steps should be considered when migrating from version 9.

  1. When importing the module do not use .forRoot(); In WebStorm, replace in path:
- SystelabComponentsModule.forRoot\(\)
- SystelabComponentsModule
  1. When importing services and modules import them from systelab-components root. In WebStorm, replace in path:
- from 'systelab-components/lib.+
- from 'systelab-components';
  1. DialogService and MessagePopupServices are provided in root, so there is no need to provide them in any module. The option here is with WebStorm manually search for any of those services and remove them.

  2. entryComponents for Modals or Cell renderers will no longer be needed and could be a problem for future Angular versions. In WebStorm, try to replace in path with the following regular expression (second parameter is nothing):

- ,\n?entryComponents: [^\]]*
- (blank)

Finally, update your package.json in order to add the peer dependencies:

"ag-grid-angular": "^28.2.0",
"ag-grid-community": "^28.2.0",
"angular-split": "^4.0.0",
"bootstrap": "^4.5.2",
"date-fns": "^2.15.0",
"jquery": "^3.5.1",
"mobile-drag-drop": "^2.3.0-rc.2",
"popper.js": "^1.16.1",
"primeicons": "^6.0.1",
"primeng": "^14.1.2",
"systelab-preferences": "^14.0.1",
"systelab-translate": "^14.0.6",
"pako": "^1.0.6",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",