Skip to content

Commit

Permalink
feat: reimplement highlight row, node-extend & fix few issues (#1134)
Browse files Browse the repository at this point in the history
* feat: reimplement highlight row, node-extend & fix few issues
  • Loading branch information
ghiscoding committed Dec 21, 2023
1 parent aa531f3 commit c047781
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 105 deletions.
13 changes: 7 additions & 6 deletions packages/aurelia-slickgrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
"@aurelia/i18n": "latest",
"@aurelia/runtime": "latest",
"@aurelia/runtime-html": "latest",
"@slickgrid-universal/common": "~4.0.3",
"@slickgrid-universal/custom-footer-component": "~4.0.3",
"@slickgrid-universal/empty-warning-component": "~4.0.3",
"@slickgrid-universal/event-pub-sub": "~4.0.2",
"@slickgrid-universal/pagination-component": "~4.0.3",
"@slickgrid-universal/row-detail-view-plugin": "~4.0.3",
"@slickgrid-universal/common": "~4.1.0",
"@slickgrid-universal/custom-footer-component": "~4.1.0",
"@slickgrid-universal/empty-warning-component": "~4.1.0",
"@slickgrid-universal/event-pub-sub": "~4.1.0",
"@slickgrid-universal/pagination-component": "~4.1.0",
"@slickgrid-universal/row-detail-view-plugin": "~4.1.0",
"@slickgrid-universal/utils": "^4.1.0",
"dequal": "^2.0.3",
"dompurify": "^3.0.6",
"moment-mini": "^2.29.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ import {
emptyElement,
ExtensionName,
GridStateType,
Utils as SlickUtils,
} from '@slickgrid-universal/common';
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
import { SlickPaginationComponent } from '@slickgrid-universal/pagination-component';
import { extend } from '@slickgrid-universal/utils';

import { bindable, BindingMode, CollectionKind, customElement, IContainer, IEventAggregator, IDisposable, IObserverLocator } from 'aurelia';
import { ICollectionSubscriber, ICollectionObserver } from '@aurelia/runtime';
Expand Down Expand Up @@ -1299,7 +1299,7 @@ export class AureliaSlickgridCustomElement {
gridOptions.enablePagination = ((gridOptions.backendServiceApi && gridOptions.enablePagination === undefined) ? true : gridOptions.enablePagination) || false;

// use extend to deep merge & copy to avoid immutable properties being changed in GlobalGridOptions after a route change
const options = SlickUtils.extend(true, {}, GlobalGridOptions, gridOptions) as GridOption;
const options = extend(true, {}, GlobalGridOptions, gridOptions) as GridOption;

// using copy extend to do a deep clone has an unwanted side on objects and pageSizes but ES6 spread has other worst side effects
// so we will just overwrite the pageSizes when needed, this is the only one causing issues so far.
Expand Down
18 changes: 9 additions & 9 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
"@faker-js/faker": "^8.3.1",
"@fnando/sparkline": "^0.3.10",
"@popperjs/core": "^2.11.8",
"@slickgrid-universal/common": "~4.0.3",
"@slickgrid-universal/composite-editor-component": "~4.0.3",
"@slickgrid-universal/custom-tooltip-plugin": "~4.0.3",
"@slickgrid-universal/excel-export": "~4.0.3",
"@slickgrid-universal/graphql": "~4.0.3",
"@slickgrid-universal/odata": "~4.0.3",
"@slickgrid-universal/row-detail-view-plugin": "~4.0.3",
"@slickgrid-universal/rxjs-observable": "~4.0.3",
"@slickgrid-universal/text-export": "~4.0.3",
"@slickgrid-universal/common": "~4.1.0",
"@slickgrid-universal/composite-editor-component": "~4.1.0",
"@slickgrid-universal/custom-tooltip-plugin": "~4.1.0",
"@slickgrid-universal/excel-export": "~4.1.0",
"@slickgrid-universal/graphql": "~4.1.0",
"@slickgrid-universal/odata": "~4.1.0",
"@slickgrid-universal/row-detail-view-plugin": "~4.1.0",
"@slickgrid-universal/rxjs-observable": "~4.1.0",
"@slickgrid-universal/text-export": "~4.1.0",
"aurelia": "latest",
"aurelia-slickgrid": "workspace:*",
"bootstrap": "^5.3.2",
Expand Down
173 changes: 88 additions & 85 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions test/cypress/e2e/example11.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
describe('Example 11 - Add / Update / Highlight a Datagrid Item', () => {
const GRID_ROW_HEIGHT = 35;
const fullTitles = ['', 'Title', 'Duration (days)', '% Complete', 'Start', 'Finish', 'Effort Driven'];

it('should display Example title', () => {
Expand Down Expand Up @@ -93,8 +94,8 @@ describe('Example 11 - Add / Update / Highlight a Datagrid Item', () => {
it('should scroll to top and expect certain rows on top', () => {
cy.get('[data-test="scroll-top-btn"]').click();

cy.get('#grid11').find('.slick-row:visible:nth(0) .slick-cell:nth(1)').should('contain.text', 'Task 1001');
cy.get('#grid11').find('.slick-row:visible:nth(1) .slick-cell:nth(1)').should('contain.text', 'Task 1000');
cy.get('#grid11').find('.slick-row:visible:nth(2) .slick-cell:nth(1)').should('contain.text', 'Task 1');
cy.get(`[style="top: ${GRID_ROW_HEIGHT * 0}px;"] > .slick-cell:nth(1)`).should('contain', 'Task 1001');
cy.get(`[style="top: ${GRID_ROW_HEIGHT * 1}px;"] > .slick-cell:nth(1)`).should('contain', 'Task 100');
cy.get(`[style="top: ${GRID_ROW_HEIGHT * 2}px;"] > .slick-cell:nth(1)`).should('contain', 'Task 1');
});
});

0 comments on commit c047781

Please sign in to comment.