Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 6 additions & 1 deletion packages/iris-grid/src/IrisGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,11 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {

rollupConfig,
rollupSelectedColumns: [],
aggregationSettings,
aggregationSettings:
// Fix aggregations to the top if the grid is editable, so that the bottom is reserved for pending rows
isEditableGridModel(model) && model.isEditable
? { ...aggregationSettings, showOnTop: true }
: aggregationSettings,
selectedAggregation: null,

openOptions: [],
Expand Down Expand Up @@ -4833,6 +4837,7 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
<Aggregations
settings={aggregationSettings}
isRollup={isRollup}
isEditable={isEditableGridModel(model) && model.isEditable}
onChange={this.handleAggregationsChange}
onEdit={this.handleAggregationEdit}
dh={model.dh}
Expand Down
10 changes: 7 additions & 3 deletions packages/iris-grid/src/sidebar/aggregations/Aggregations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type AggregationSettings = {

export type AggregationsProps = {
isRollup: boolean;
isEditable: boolean;
settings: AggregationSettings;
onChange: (
settings: AggregationSettings,
Expand All @@ -52,6 +53,7 @@ export type AggregationsProps = {

function Aggregations({
isRollup,
isEditable,
settings,
onChange,
onEdit,
Expand Down Expand Up @@ -219,7 +221,7 @@ function Aggregations({
const isRollupProhibited = AggregationUtils.isRollupProhibited(
item.operation
);
const isEditable = !isClone && !isRollupOperation;
const isItemEditable = !isClone && !isRollupOperation;
return (
<>
<div
Expand Down Expand Up @@ -254,7 +256,7 @@ function Aggregations({
icon={vsEdit}
tooltip="Edit Columns"
onClick={() => onEdit(item)}
disabled={!isEditable}
disabled={!isItemEditable}
/>
<Button
kind="ghost"
Expand Down Expand Up @@ -309,7 +311,9 @@ function Aggregations({
value={`${showOnTop}`}
>
<Radio value="true">Top</Radio>
<Radio value="false">Bottom</Radio>
<Radio value="false" isDisabled={isEditable}>
Bottom
</Radio>
</RadioGroup>
</div>
)}
Expand Down
Loading