Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .rulesync/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ packages/ag-grid-community/src/

## Running Tests

### Unit Tests
### Unit Tests (Jest)

Unit tests in `packages/` use Jest. Use `--testPathPattern` and `--testNamePattern`:

```bash
# Run all tests for a package
Expand All @@ -55,13 +57,23 @@ yarn nx test ag-grid-community --testPathPattern="featureName" --testNamePattern
yarn nx e2e ag-grid-docs
```

### Behavioural Tests
### Behavioural Tests (Vitest)

Behavioural tests in `testing/behavioural/` use Vitest via Nx. Use `--run` to execute once (without watch mode):

```bash
# Run behavioural test suite
yarn nx test ag-behavioural-testing
# Run all behavioural tests
yarn nx test ag-behavioural-testing --run

# Run specific test file
yarn nx test ag-behavioural-testing --run "cell-editing-regression"

# Run specific test by name
yarn nx test ag-behavioural-testing --run "cell-editing-regression" -t "should handle"
```

**Note:** Vitest does not support `--testPathPattern` or `--testNamePattern`. Use positional arguments for file matching and `-t` for test name filtering.

## Test Patterns

### Jest Unit Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
CsvExportModule,
ModuleRegistry,
NumberFilterModule,
ProcessCellForExportParams,
ProcessRowGroupForExportParams,
ValidationModule,
createGrid,
} from 'ag-grid-community';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { clickAllButtons, ensureGridReady, test, waitForGridContent } from '@utils/grid/test-utils';

test.agExample(import.meta, () => {
test.eachFramework('Example', async ({ page }) => {
// PLACEHOLDER - MINIMAL TEST TO ENSURE GRID LOADS WITHOUT ERRORS
await ensureGridReady(page);
await waitForGridContent(page);
await clickAllButtons(page);
// END PLACEHOLDER
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="container">
<div>
<button onclick="onBtExport()" style="margin: 5px 0px; font-weight: bold">Export to Excel</button>
</div>
<div class="grid-wrapper">
<div id="myGrid"></div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type { GridApi, GridOptions } from 'ag-grid-community';
import {
ClientSideRowModelModule,
CsvExportModule,
ModuleRegistry,
NumberFilterModule,
ValidationModule,
createGrid,
} from 'ag-grid-community';
import { ExcelExportModule } from 'ag-grid-enterprise';

ModuleRegistry.registerModules([
ClientSideRowModelModule,
CsvExportModule,
ExcelExportModule,
NumberFilterModule,
...(process.env.NODE_ENV !== 'production' ? [ValidationModule] : []),
]);

interface ReportRow {
department: string;
reportId: string;
owner: string;
cost: number;
}

const rowData: ReportRow[] = [
{ department: 'Security', reportId: 'RPT-001', owner: 'Morgan', cost: 1200 },
{ department: 'Finance', reportId: 'RPT-014', owner: 'Avery', cost: 5400 },
{ department: 'Operations', reportId: 'RPT-082', owner: 'Jordan', cost: 3100 },
{ department: 'Legal', reportId: 'RPT-109', owner: 'Taylor', cost: 2700 },
];

const customMetadata = {
ExportID: 'EXP-2026-001',
ExpirationDate: '2025-01-01T12:00:00Z',
Disclaimer: 'Preliminary data; subject to audit',
};

let gridApi: GridApi<ReportRow>;

const gridOptions: GridOptions<ReportRow> = {
columnDefs: [
{ field: 'department', minWidth: 160 },
{ field: 'reportId', minWidth: 140 },
{ field: 'owner', minWidth: 140 },
{ field: 'cost', filter: 'agNumberColumnFilter', minWidth: 120 },
],
defaultColDef: {
filter: true,
flex: 1,
minWidth: 120,
},
rowData,
defaultExcelExportParams: {
customMetadata: customMetadata,
},
};

function onBtExport() {
gridApi!.exportDataAsExcel();
}

// setup the grid after the page has finished loading
document.addEventListener('DOMContentLoaded', () => {
const gridDiv = document.querySelector<HTMLElement>('#myGrid')!;
gridApi = createGrid(gridDiv, gridOptions);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.details > label {
margin-bottom: 10px;
}

.details > label:first-of-type {
margin-top: 10px;
}

.details > label:last-of-type {
margin-bottom: 0;
}

.option {
display: block;
margin: 5px 10px 5px 0;
}

.grid-wrapper {
display: flex;
flex: 1 1 0px;
}

.grid-wrapper > div {
width: 100%;
height: 100%;
}

.container {
display: flex;
flex-direction: column;
height: 100%;
}

.columns {
display: flex;
flex-direction: row;
align-items: center;
gap: 16px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,36 @@ The following example shows Excel customisations where the exported document has

{% gridExampleRunner title="Excel Export - Customising Column Group Headers" name="excel-export-customising-column-group-headers" /%}

## Custom Metadata

Use `customMetadata` to write custom document properties to the exported file. The values are added as metadata to the Excel file and serialised as strings.

This is useful for attaching internal identifiers, workflow hints, or metadata consumed by downstream systems.

Use cases for custom metadata may include:

- Internal workflow tagging (for example, adding `ExportID` or `GeneratedBy` for tracking in automation scripts).
- Integration with document management systems (for example, embedding `ContractType` or `ExpirationDate` for indexing in SharePoint or similar tools).
- Integration with third-party analytics tools (for example, passing `CampaignID` for BI dashboard automation).

```{% frameworkTransform=true %}
gridApi.exportDataAsExcel({
customMetadata: {
ExportID: 'EXP-2026-001',
ExpirationDate: '2025-01-01T12:00:00Z',
Disclaimer: 'Preliminary data; subject to audit',
},
});
```

{% interfaceDocumentation interfaceName="ExcelExportParams" names=["customMetadata"] /%}

{% note %}
The Grid does not interpret these values or apply labels; it only writes the custom properties provided in the `customMetadata` parameter. This feature does not replace or integrate with officially endorsed labelling systems, such as Microsoft Purview Sensitivity Labels, which require specific SDKs or APIs for enforcement, encryption, and compliance.
{% /note %}

{% gridExampleRunner title="Excel Export - Custom Metadata" name="excel-export-customising-custom-metadata" /%}

## Next Up

Continue to the next section: [Images](./excel-export-images/).
4 changes: 4 additions & 0 deletions documentation/ag-grid-docs/src/content/footer/footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
"name": "Cookies Policy",
"url": "/cookies"
},
{
"name": "Modern Slavery",
"url": "/modern-slavery"
},
{
"name": "Sitemap",
"url": "/sitemap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"prependContent": {
"description": "Content to put at the bottom of the exported sheet. An array of ExcelRow objects, see [Extra Content section](./excel-export-extra-content/)."
},
"customMetadata": {
"description": "Custom metadata to be written to in the exported file. Values are serialised as strings."
},
"fileName": {
"default": "export.xlsx"
}
Expand Down
5 changes: 5 additions & 0 deletions documentation/ag-grid-docs/src/pages/modern-slavery.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
import ModernSlavery from '@ag-website-shared/components/policies/pages/modern-slavery.astro';
---

<ModernSlavery name="AG Grid" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
import Layout from '@layouts/Layout.astro';
import { Content as ModernSlaveryPolicies } from '@ag-website-shared/content/policies/modern-slavery.mdoc';
import styles from '../policyPage.module.scss';

interface Props {
name: string;
}

const { name } = Astro.props;
---

<Layout
title={`${name}: Modern Slavery and
Human Trafficking Statement`}
description="AG Grid Ltd has a zero-tolerance approach to modern slavery. We are committed to acting ethically and with integrity in all our business dealings and relationships and to implementing and enforcing effective systems and controls to ensure modern slavery is not taking place anywhere in our own business or in any of our supply chains."
showSearchBar={true}
showDocsNav={false}
>
<div class:list={styles.policyPage}>
<div class="layout-max-width-small">
<h1>AG Grid Modern Slavery and Human Trafficking Statement</h1>
<hr />

<header>
<div id="meta" class={styles.introduction}>
<p><strong>For the Financial Year Ending 31 December 2026</strong></p>
<p><strong>Version:</strong> 1.0</p>
<p><strong>Effective Date:</strong> 01 January 2026</p>
</div>

<nav>
<ul class="list-style-none">
<li>
<a href="#intro-modern-slavery">1. Introduction</a>
</li>
<li>
<a href="#organisation-structure"> 2. Organisation Structure and Supply Chain</a>
</li>
<li>
<a href="#policies-modern-slavery">3. Policies in Relation to Modern Slavery</a>
</li>
<li>
<a href="#due-diligence">4. Due Diligence Processes</a>
</li>
<li>
<a href="#risk-assessment">5. Risk Assessment</a>
</li>
<li>
<a href="#training-awareness">6. Training and Awareness</a>
</li>
<li>
<a href="#kpis-future">7. Key Performance Indicators and Future Steps</a>
</li>
<li>
<a href="#approval-modern-slavery">8. Approval</a>
</li>
</ul>
</nav>
</header>

<div class={styles.policyList}>
<ModernSlaveryPolicies />
</div>
</div>
</div>
</Layout>
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
font-size: var(--text-fs-xl);
}

ul {
list-style-type: disc;
}

@media screen and (min-width: $breakpoint-policy-page-extra-large) {
list-style: decimal;
padding-left: unset;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
1. ### Introduction {% id="intro-modern-slavery" %}

***

This statement is made pursuant to Section 54 of the Modern Slavery Act 2015. It sets out the steps that AG Grid Ltd has taken and is continuing to take to ensure that modern slavery or human trafficking is not taking place within our business or supply chain.

AG Grid Ltd has a zero-tolerance approach to modern slavery. We are committed to acting ethically and with integrity in all our business dealings and relationships and to implementing and enforcing effective systems and controls to ensure modern slavery is not taking place anywhere in our own business or in any of our supply chains.

2. ### Organisation Structure and Supply Chain {% id="organisation-structure" %}

***

AG Grid Ltd constitutes a software development company headquartered in London, United Kingdom. We specialise in providing JavaScript libraries for charts, grids, and dashboards, alongside the maintenance and support of those libraries. We currently employ approximately 60 staff members.

Our supply chain is relatively simple and primarily supports our office operations and technology infrastructure. Our direct suppliers are predominantly based in the United Kingdom. Given the nature of our business (software development) and our geographical focus, we consider the risk of modern slavery within our direct operations to be low.

However, we remain vigilant, particularly regarding indirect supply chains (such as hardware procurement and office services).

3. ### Policies in Relation to Modern Slavery {% id="policies-modern-slavery" %}

***

We operate several internal policies to ensure that we are conducting business in an ethical and transparent manner. These include:

- **Whistleblowing Policy:** We maintain a policy that encourages all employees to report any concerns related to the direct activities, or the supply chains of, the organisation. This includes any circumstances that may give rise to an enhanced risk of slavery or human trafficking.

- **Recruitment Policy:** We operate a robust recruitment policy, including conducting eligibility to work in the UK checks for all employees to safeguard against human trafficking or individuals being forced to work against their will.

- **Anti-Bribery and Corruption Policy:** We maintain strict policies against bribery and corruption, ensuring all business is conducted lawfully.

4. ### Due Diligence Processes {% id="due-diligence" %}

***

We undertake due diligence when considering taking on new suppliers, and regularly review our existing suppliers. Our current due diligence process includes:

- Conducting internal research and review processes on prospective suppliers.
- Issuing questionnaires to key suppliers to assess their suitability and their own stance on modern slavery.
- Using only approved and reputable recruitment agencies for hiring staff, ensuring they adhere to UK employment laws.

5. ### Risk Assessment {% id="risk-assessment" %}

***

We consider the overall risk of modern slavery within our business to be low, primarily because:

1. Our business is in the high-skilled technology sector.
2. Our operations are based in the UK, a jurisdiction with strong employment protections.
3. Our supply chain consists mainly of professional services and low-volume procurement.

Despite this low risk, we understand that modern slavery can occur in any sector (particularly in indirect areas such as cleaning, catering, or hardware manufacturing) and we are committed to constant vigilance.

6. ### Training and Awareness {% id="training-awareness" %}

***

We have not yet implemented specific Modern Slavery training for all staff, given our low-risk profile. However, our HR and management teams are responsible for ensuring strict compliance with Right to Work checks and employment laws.

7. ### Key Performance Indicators and Future Steps {% id="kpis-future" %}

***

To ensure we continue to improve our approach to combatting modern slavery, we have set the following specific goal for the financial year 2026:

- **Creation of a Supplier Code of Conduct:** We will draft and implement a formal Supplier Code of Conduct. We will require our key suppliers to acknowledge and adhere to this code, which will explicitly prohibit the use of forced, compulsory, or trafficked labour.

8. ### Approval {% id="approval-modern-slavery" %}

***

This statement was approved by the Board of Directors on 2026-01-20.

Signed,

**John Masterson**{% br /%}
CEO AG Grid Ltd
Loading
Loading