-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AG-13294 - add framework tests, make rule more specific to cellRender…
…erParams
- Loading branch information
1 parent
7d8fd00
commit 1f512ee
Showing
27 changed files
with
498 additions
and
59 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...options/__fixtures__/scenarios/frameworks/sparkline-angular-external/input.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div> | ||
<ag-grid-angular | ||
[columnDefs]="[[{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}]]" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
<ag-grid-angular | ||
[columnDefs]="columnDefs" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
</div> |
27 changes: 27 additions & 0 deletions
27
...s-options/__fixtures__/scenarios/frameworks/sparkline-angular-external/input.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// @ts-nocheck | ||
import { ColDef, ColGroupDef, GridReadyEvent } from '@ag-grid-community/core'; | ||
import { AgGridAngular } from '@ag-grid-community/angular'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { IOlympicData } from './interfaces'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
templateUrl: './component.html', | ||
}) | ||
export class AppComponent { | ||
@ViewChild(AgGridAngular) private grid!: AgGridAngular; | ||
public columnDefs: (ColDef | ColGroupDef)[] = [{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}]; | ||
public rowData!: IOlympicData[]; | ||
|
||
constructor(private http: HttpClient) { | ||
} | ||
|
||
onGridReady(params: GridReadyEvent<IOlympicData>) { | ||
this.http | ||
.get<IOlympicData[]>('https://www.ag-grid.com/example-assets/olympic-winners.json') | ||
.subscribe((data) => { | ||
this.rowData = data; | ||
}); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ptions/__fixtures__/scenarios/frameworks/sparkline-angular-external/output.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div> | ||
<ag-grid-angular | ||
[columnDefs]="[[{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}]]" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
<ag-grid-angular | ||
[columnDefs]="columnDefs" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
...-options/__fixtures__/scenarios/frameworks/sparkline-angular-external/output.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// @ts-nocheck | ||
import { ColDef, ColGroupDef, GridReadyEvent } from '@ag-grid-community/core'; | ||
import { AgGridAngular } from '@ag-grid-community/angular'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { IOlympicData } from './interfaces'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
templateUrl: './component.html', | ||
}) | ||
export class AppComponent { | ||
@ViewChild(AgGridAngular) private grid!: AgGridAngular; | ||
public columnDefs: (ColDef | ColGroupDef)[] = [{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: { | ||
type: "bar", | ||
direction: "vertical" | ||
}}}]; | ||
public rowData!: IOlympicData[]; | ||
|
||
constructor(private http: HttpClient) { | ||
} | ||
|
||
onGridReady(params: GridReadyEvent<IOlympicData>) { | ||
this.http | ||
.get<IOlympicData[]>('https://www.ag-grid.com/example-assets/olympic-winners.json') | ||
.subscribe((data) => { | ||
this.rowData = data; | ||
}); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...es-options/__fixtures__/scenarios/frameworks/sparkline-angular-external/output.errors.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
1 change: 1 addition & 0 deletions
1
...-options/__fixtures__/scenarios/frameworks/sparkline-angular-external/output.warnings.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
16 changes: 16 additions & 0 deletions
16
...klines-options/__fixtures__/scenarios/frameworks/sparkline-angular-external/scenario.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"scenario": { | ||
"input": "input.component.ts", | ||
"output": "output.component.ts", | ||
"errors": "output.errors.cjs", | ||
"warnings": "output.warnings.cjs" | ||
}, | ||
"files": { | ||
"input": { | ||
"component.html": "input.component.html" | ||
}, | ||
"expected": { | ||
"component.html": "output.component.html" | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...nes-options/__fixtures__/scenarios/frameworks/sparkline-angular-inline/input.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// @ts-nocheck | ||
import { AdvancedFilterModel, ColDef, ColGroupDef, GridReadyEvent } from '@ag-grid-community/core'; | ||
import { AgGridAngular } from '@ag-grid-community/angular'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { IOlympicData } from './interfaces'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
template: `<div> | ||
<ag-grid-angular | ||
[columnDefs]="columnDefs" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
<ag-grid-angular | ||
[columnDefs]="[{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}]" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
</div>`, | ||
}) | ||
export class AppComponent { | ||
@ViewChild(AgGridAngular) private grid!: AgGridAngular; | ||
public columnDefs: (ColDef | ColGroupDef)[] = [{ | ||
field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}} | ||
}]; | ||
public rowData!: IOlympicData[]; | ||
|
||
constructor(private http: HttpClient) { | ||
} | ||
|
||
onGridReady(params: GridReadyEvent<IOlympicData>) { | ||
this.http | ||
.get<IOlympicData[]>('https://www.ag-grid.com/example-assets/olympic-winners.json') | ||
.subscribe((data) => { | ||
this.rowData = data; | ||
}); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...es-options/__fixtures__/scenarios/frameworks/sparkline-angular-inline/output.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// @ts-nocheck | ||
import { AdvancedFilterModel, ColDef, ColGroupDef, GridReadyEvent } from '@ag-grid-community/core'; | ||
import { AgGridAngular } from '@ag-grid-community/angular'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { IOlympicData } from './interfaces'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
template: `<div> | ||
<ag-grid-angular | ||
[columnDefs]="columnDefs" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
<ag-grid-angular | ||
[columnDefs]="[{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}]" | ||
[rowData]="rowData" | ||
(gridReady)="onGridReady($event)" | ||
></ag-grid-angular> | ||
</div>`, | ||
}) | ||
export class AppComponent { | ||
@ViewChild(AgGridAngular) private grid!: AgGridAngular; | ||
public columnDefs: (ColDef | ColGroupDef)[] = [{ | ||
field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: { | ||
type: "bar", | ||
direction: "vertical" | ||
}} | ||
}]; | ||
public rowData!: IOlympicData[]; | ||
|
||
constructor(private http: HttpClient) { | ||
} | ||
|
||
onGridReady(params: GridReadyEvent<IOlympicData>) { | ||
this.http | ||
.get<IOlympicData[]>('https://www.ag-grid.com/example-assets/olympic-winners.json') | ||
.subscribe((data) => { | ||
this.rowData = data; | ||
}); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ines-options/__fixtures__/scenarios/frameworks/sparkline-angular-inline/output.errors.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
1 change: 1 addition & 0 deletions
1
...es-options/__fixtures__/scenarios/frameworks/sparkline-angular-inline/output.warnings.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
8 changes: 8 additions & 0 deletions
8
...arklines-options/__fixtures__/scenarios/frameworks/sparkline-angular-inline/scenario.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"scenario": { | ||
"input": "input.component.ts", | ||
"output": "output.component.ts", | ||
"errors": "output.errors.cjs", | ||
"warnings": "output.warnings.cjs" | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...orms/migrate-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-jsx/input.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { AgGridReact } from '@ag-grid-community/react'; | ||
|
||
function MyComponent(props) { | ||
|
||
const shouldntChange0 = { | ||
sparklineOptions: { | ||
type: 'column' | ||
} | ||
} | ||
|
||
const anotherColumn = { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: 'column' | ||
} | ||
} | ||
} | ||
|
||
return ( | ||
<div> | ||
<AgGridReact columnDefs={[{ | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: 'line' | ||
} | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: 'area' | ||
} | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
sparklineOptions: { | ||
type: 'bar' | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: 'column' | ||
} | ||
} | ||
}, anotherColumn, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
sparklineOptions: { | ||
type: 'column' | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
sparklineOptions: { | ||
type: 'asdadasqda' | ||
} | ||
}]} rowData={[]}/> | ||
</div> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
...rate-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-jsx/output.errors.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
70 changes: 70 additions & 0 deletions
70
...rms/migrate-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-jsx/output.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { AgGridReact } from '@ag-grid-community/react'; | ||
|
||
function MyComponent(props) { | ||
|
||
const shouldntChange0 = { | ||
sparklineOptions: { | ||
type: 'column' | ||
} | ||
} | ||
|
||
const anotherColumn = { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: "bar", | ||
direction: "vertical" | ||
} | ||
} | ||
} | ||
|
||
return ( | ||
(<div> | ||
<AgGridReact columnDefs={[{ | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: 'line' | ||
} | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: 'area' | ||
} | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
sparklineOptions: { | ||
type: 'bar' | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
cellRendererParams: { | ||
sparklineOptions: { | ||
type: "bar", | ||
direction: "vertical" | ||
} | ||
} | ||
}, anotherColumn, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
sparklineOptions: { | ||
type: 'column' | ||
} | ||
}, { | ||
field: 'test', | ||
cellRenderer: 'agSparklineCellRenderer', | ||
sparklineOptions: { | ||
type: 'asdadasqda' | ||
} | ||
}]} rowData={[]}/> | ||
</div>) | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
...te-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-jsx/output.warnings.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
8 changes: 8 additions & 0 deletions
8
.../migrate-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-jsx/scenario.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"scenario": { | ||
"input": "input.jsx", | ||
"output": "output.jsx", | ||
"errors": "output.errors.cjs", | ||
"warnings": "output.warnings.cjs" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
.../migrate-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-vue-sfc/input.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<div> | ||
<ag-grid-vue | ||
:columnDefs="[[{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}]" | ||
:rowData="rowData" | ||
@grid-ready="onGridReady" | ||
></ag-grid-vue> | ||
<ag-grid-vue | ||
:columnDefs="columnDefs" | ||
:rowData="rowData" | ||
@grid-ready="onGridReady" | ||
></ag-grid-vue> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { AgGridVue } from '@ag-grid-community/vue'; | ||
export default { | ||
components: { | ||
'ag-grid-vue': AgGridVue, | ||
}, | ||
data() { | ||
return { | ||
columnDefs: [{field: 'test', cellRenderer: 'agSparklineRenderer', cellRendererParams: {sparklineOptions: {type: 'column'}}}], | ||
rowData: [], | ||
}; | ||
}, | ||
methods: { | ||
onGridReady(params) { | ||
}, | ||
}, | ||
}; | ||
</script> |
1 change: 1 addition & 0 deletions
1
...-sparklines-options/__fixtures__/scenarios/frameworks/sparkline-vue-sfc/output.errors.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = []; |
Oops, something went wrong.