Skip to content

980 upgrade from angular 18 to angular 19 #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

jferrer1W
Copy link
Contributor

@jferrer1W jferrer1W commented Jun 3, 2025

PR Details

  • Update from angular 18 to 19
  • Update eslint from 18 to 19
  • Update PrimeNG from 16 to 17
  • Update primeicons from 6 to 7
  • Update ag-grid-angular from 28 to 33
  • Update ag-grid-comunity from 28 to 33
  • Update systelab-preferences from 18 to 19 (Angular 19)
  • Update systelab-translate from 18 to 19 (Angular)

Description

This PR has several changes regarded with the next upgrades:

  • Upgrade from angular 18 to 19

    • The components are standalone by default , needs to specify standalone: false in the @component decorator.
    • The @import in scss is deprecated and needs to be replaces by @use and @forward.
  • Upgrade ag-grid from 28 to 33

    • The gridOptions.api is deprecated now the gridApi is into GridReadyEvent that comes from onGridReady event.
    • The ColumnAPi is deprecated , his methods are into gridApi
    • The ag-theme-fresh is deprecated (the new used them is ag-theme-alpine).
    • Now the ag-grid modules must to be used with ModuleRegistry method in order to load only the neccessary modules.
    • The RangeSelectionCell has been disabled because belongs to ag-grid-enterprise library and wasn't use.
    • The multiple and single selection are changes now needs to be use multiRow and singleRow.
    • Several attributes now are functions like as node.selected that now is node.isSelected().
    • Needs to init the infiniteInitialRowCount with 1 instead of 0.
    • setDataSource is deprecated now needs to be use the setGridOptions and updateGridOptions.
    • cellEditorFramework is deprecated with cellEditor
    • suppressRowClickSelection is deprecated now needs to be used enableClickSelection.
    • node.selectThisNode is deprecated now needs to be use node.setSelected.
    • Needs to be scope the theme variables to be used in specific theme.
  • Fixes and improves

Related Issue

Motivation and Context

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly (README.md for each UI component)
  • I have added tests to cover my changes (at least 1 spec for each UI component with the same coverage as the master branch)
  • All new and existing tests passed
  • A new branch needs to be created from master to evolve previous versions
  • Increase version in package.json following Semantic Versioning
  • All UI components must be added into the showcase (at least 1 component with the default settings)
  • Add the issue into the right project with the proper status (In progress)

@jferrer1W jferrer1W linked an issue Jun 3, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 55.72917% with 85 lines in your changes missing coverage. Please review.

Project coverage is 57.54%. Comparing base (c3a989f) to head (c99aab6).

Files with missing lines Patch % Lines
...ents/src/lib/listbox/abstract-listbox.component.ts 33.33% 25 Missing and 1 partial ⚠️
...ts/src/lib/combobox/abstract-combobox.component.ts 65.11% 12 Missing and 3 partials ⚠️
...components/src/lib/grid/abstract-grid.component.ts 70.45% 10 Missing and 3 partials ⚠️
...-components/src/lib/helper/autosize-grid-helper.ts 61.90% 7 Missing and 1 partial ⚠️
...nents/src/lib/searcher/searcher.table.component.ts 22.22% 5 Missing and 2 partials ⚠️
...utocomplete/autocomplete-api-combobox.component.ts 45.45% 5 Missing and 1 partial ⚠️
.../src/lib/listbox/abstract-api-listbox.component.ts 0.00% 6 Missing ⚠️
.../renderer/combobox-favourite-renderer.component.ts 0.00% 2 Missing ⚠️
...onents/src/lib/grid/abstract-api-grid.component.ts 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #993      +/-   ##
==========================================
- Coverage   58.38%   57.54%   -0.85%     
==========================================
  Files         136      136              
  Lines        3809     3811       +2     
  Branches      677      674       -3     
==========================================
- Hits         2224     2193      -31     
- Misses       1471     1513      +42     
+ Partials      114      105       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jferrer1W jferrer1W requested review from fjaguado and carlosra85 June 3, 2025 08:42
@@ -80,6 +82,9 @@ $context-menu-width: 39px;
.ag-header-cell-resize {
cursor: ew-resize;
border-right: 5px solid var(--slab_table_border_color);
&::after {
display: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ag-theme-fresh theme is deprecated, and the new ag-theme-alpine has a little line, an icon on the header cell borders indicating that you can drag to resize the column. To leave the theme like we had it before, I simply hide it.

@@ -140,6 +145,10 @@ $context-menu-width: 39px;
border: 1px dashed var(--primary_light) !important;
}

&.ag-cell-wrapper .ag-drag-handle.ag-row-drag {
display: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ag-theme-fresh theme is deprecated, and the new ag-theme-alpine has a little line, an icon on the header cell borders indicating that you can drag to resize the column. To leave the theme like we had it before, I simply hide it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can study the option to adopt this UX improvement instead to hide it? @carlosra85

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for me its ok

vvinuelas
vvinuelas previously approved these changes Jun 4, 2025
Copy link
Contributor

@vvinuelas vvinuelas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really great work!

@@ -164,6 +166,7 @@ const clickMenuHeaderOnRow = (fixture: ComponentFixture<GridTestComponent>) => {
};

const clickOption = (fixture: ComponentFixture<GridTestComponent>, option: number) => {
console.log(fixture.debugElement.nativeElement.querySelectorAll('li'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log forgotten

@@ -190,7 +193,7 @@ const clickCloseButton = (fixture: ComponentFixture<GridTestComponent>, buttonId

describe('Systelab Grid', () => {
let fixture: ComponentFixture<GridTestComponent>;

ModuleRegistry.registerModules([AllCommunityModule]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

@@ -41,8 +41,8 @@ export abstract class AbstractApiComboBox<T> extends AbstractComboBox<T> impleme
public abstract getTotalItems(): number;

public override refresh(params: any): boolean {
if (this.gridOptions && this.gridOptions.api) {
this.gridOptions.api.setDatasource(this);
if (this.gridOptions && this.gridApi) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed to check gridOptions because now we do not acces to gridOptions.api

You can remove the full if and use this.gridApi?.setGridOption the method only will be executed if this.gridApi is defined.
Same to all the other ifs like this.

Copy link
Contributor

@vinyulis vinyulis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update README.md?

@@ -32,7 +33,6 @@ export abstract class AbstractApiGrid<T> extends AbstractGrid<T> implements IDat
protected abstract getData(page: number, itemsPerPage: number): Observable<Array<T>>;

public getRows(params: IGetRowsParams): void {
this.gridOptions.api.showLoadingOverlay();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is showing "Loading" now?


public override doGridReady(event: any) {
super.doGridReady(event);
this.refresh();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review if this.refresh() is needed

protected getRowSelectionType(): RowSelectionOptions {
return {
mode: this.multipleSelection ? 'multiRow' : 'singleRow',
checkboxes: false,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in some modes we use checkboxes, is still working with this flag?

@vinyulis
Copy link
Contributor

Check again methods showLoadingOverlay (deprecated) and showNoRowsOverlay (not deprecated) vs hideOverlay (not deprecated) to know if hideOverlay hides overlay for Loading or only No Rows overlay


@HostListener('focus', ['$event'])
onFocus(event: FocusEvent) {
console.log(event);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade from Angular 18 to Angular 19
5 participants