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
52 changes: 52 additions & 0 deletions .github/actions/module-size-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
description: 'Git ref to get .github/actions from (for testing older refs that lack these actions)'
required: false
default: ''
source-ref:
description: 'Git ref to get source code from (swaps src folders for ag-grid-community, ag-grid-enterprise, ag-grid-react). When set, uses ref for tooling but source-ref for actual source code.'
required: false
default: ''

runs:
using: composite
Expand All @@ -51,6 +55,54 @@ runs:
cp -r .actions-temp/.github/actions .github/actions
rm -rf .actions-temp

- name: Checkout source from source-ref
if: inputs.source-ref != '' && inputs.source-ref != inputs.ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.source-ref }}
sparse-checkout: |
packages/ag-grid-community/src
packages/ag-grid-enterprise/src
packages/ag-grid-react/src
path: .source-temp

- name: Swap src folders from source-ref
if: inputs.source-ref != '' && inputs.source-ref != inputs.ref
shell: bash
run: |
echo "Swapping src folders from ${{ inputs.source-ref }} into ${{ inputs.ref }} tooling..."

# Swap ag-grid-community/src
if [ -d ".source-temp/packages/ag-grid-community/src" ]; then
rm -rf packages/ag-grid-community/src
cp -r .source-temp/packages/ag-grid-community/src packages/ag-grid-community/src
echo "✓ Swapped ag-grid-community/src"
else
echo "⚠ Warning: ag-grid-community/src not found in source-ref"
fi

# Swap ag-grid-enterprise/src
if [ -d ".source-temp/packages/ag-grid-enterprise/src" ]; then
rm -rf packages/ag-grid-enterprise/src
cp -r .source-temp/packages/ag-grid-enterprise/src packages/ag-grid-enterprise/src
echo "✓ Swapped ag-grid-enterprise/src"
else
echo "⚠ Warning: ag-grid-enterprise/src not found in source-ref"
fi

# Swap ag-grid-react/src
if [ -d ".source-temp/packages/ag-grid-react/src" ]; then
rm -rf packages/ag-grid-react/src
cp -r .source-temp/packages/ag-grid-react/src packages/ag-grid-react/src
echo "✓ Swapped ag-grid-react/src"
else
echo "⚠ Warning: ag-grid-react/src not found in source-ref"
fi

# Clean up
rm -rf .source-temp
echo "Source swap complete."

- name: Setup
uses: ./.github/actions/setup-nx
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/module-size-vs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
base-ref: latest

# Build and run module size tests on release tag (sharded) - only if cache miss
# Uses latest branch tooling with source code from the release tag
module-size-release:
name: Module Size Release (${{ matrix.shard }}/${{ strategy.job-total }})
runs-on: ubuntu-latest
Expand All @@ -130,12 +131,12 @@ jobs:
- name: Run module size tests
uses: ./.github/actions/module-size-test
with:
ref: ${{ needs.prepare.outputs.release-tag }}
ref: latest
shard: ${{ matrix.shard }}
total-shards: ${{ strategy.job-total }}
artifact-prefix: module-size-release
base-ref: ${{ needs.prepare.outputs.release-tag }}
actions-ref: latest
base-ref: latest
source-ref: ${{ needs.prepare.outputs.release-tag }}

# Cache release results (only when we had to build)
cache-release-results:
Expand Down
3 changes: 0 additions & 3 deletions .yarnrc

This file was deleted.

20 changes: 19 additions & 1 deletion packages/ag-grid-enterprise/src/formula/formulaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import type {
} from 'ag-grid-community';
import { BeanStub, _convertColumnEventSourceType, _isExpressionString, _warn } from 'ag-grid-community';

import type {
RangeSelectionExtension,
RangeSelectionExtensionRegistry,
} from '../rangeSelection/rangeSelectionExtensions';
import { parseFormula } from './ast/parsers';
import { serializeFormula } from './ast/serializer';
import type { FormulaNode } from './ast/utils';
Expand Down Expand Up @@ -91,7 +95,7 @@ interface FormulaFrame {
ast: FormulaNode;
unresolvedDepIterator: Generator<Addr>;
}
export class FormulaService extends BeanStub implements IFormulaService, NamedBean {
export class FormulaService extends BeanStub implements IFormulaService, NamedBean, RangeSelectionExtension {
public readonly beanName = 'formula' as const;

/** Cache: row -> (column -> CellFormula) */
Expand Down Expand Up @@ -150,6 +154,7 @@ export class FormulaService extends BeanStub implements IFormulaService, NamedBe

public postConstruct(): void {
this.setupFunctions();
this.registerRangeSelectionExtension();

const refreshFormulas = () => {
if (this.active) {
Expand Down Expand Up @@ -181,6 +186,19 @@ export class FormulaService extends BeanStub implements IFormulaService, NamedBe
});
}

public shouldSuppressRangeSelection(eventTarget: EventTarget | null): boolean {
return !!(eventTarget as HTMLElement | null)?.closest?.('.ag-formula-input-field');
}

private registerRangeSelectionExtension(): void {
const rangeSvc = this.beans.rangeSvc as RangeSelectionExtensionRegistry | undefined;
if (!rangeSvc) {
return;
}
rangeSvc.registerRangeSelectionExtension(this);
this.addDestroyFunc(() => rangeSvc.unregisterRangeSelectionExtension?.(this));
}

public updateFormulaByOffset(params: {
value: string;
rowDelta?: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { AgColumn, CellPosition, CellRange } from 'ag-grid-community';

export interface RangeSelectionExtension {
shouldSuppressRangeSelection?(eventTarget: EventTarget | null): boolean;
shouldSkipColumn?(column: AgColumn): boolean;
isAllColumnsSelectionCell?(cellPosition: CellPosition): boolean;
isAllColumnsRange?(range: CellRange, allColumns: AgColumn[]): boolean;
}

export interface RangeSelectionExtensionRegistry {
registerRangeSelectionExtension(extension: RangeSelectionExtension): void;
unregisterRangeSelectionExtension?(extension: RangeSelectionExtension): void;
}
Loading
Loading