Skip to content

Commit 3717221

Browse files
committed
Hide Organize Columns
1 parent 205abbd commit 3717221

5 files changed

Lines changed: 38 additions & 7 deletions

File tree

packages/iris-grid/src/IrisGrid.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
11171117
isChartBuilderAvailable: boolean,
11181118
isCustomColumnsAvailable: boolean,
11191119
isFormatColumnsAvailable: boolean,
1120+
isOrganizeColumnsAvailable: boolean,
11201121
isRollupAvailable: boolean,
11211122
isTotalsAvailable: boolean,
11221123
isSelectDistinctAvailable: boolean,
@@ -1139,11 +1140,13 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
11391140
icon: dhGraphLineUp,
11401141
});
11411142
}
1142-
optionItems.push({
1143-
type: OptionType.VISIBILITY_ORDERING_BUILDER,
1144-
title: 'Organize Columns',
1145-
icon: dhEye,
1146-
});
1143+
if (isOrganizeColumnsAvailable) {
1144+
optionItems.push({
1145+
type: OptionType.VISIBILITY_ORDERING_BUILDER,
1146+
title: 'Organize Columns',
1147+
icon: dhEye,
1148+
});
1149+
}
11471150
if (isFormatColumnsAvailable) {
11481151
optionItems.push({
11491152
type: OptionType.CONDITIONAL_FORMATTING,
@@ -4690,6 +4693,7 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
46904693
onCreateChart !== undefined && model.isChartBuilderAvailable,
46914694
model.isCustomColumnsAvailable,
46924695
model.isFormatColumnsAvailable,
4696+
model.isOrganizeColumnsAvailable,
46934697
model.isRollupAvailable,
46944698
model.isTotalsAvailable || isRollup,
46954699
model.isSelectDistinctAvailable,

packages/iris-grid/src/IrisGridModel.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ abstract class IrisGridModel<
428428
return false;
429429
}
430430

431+
/**
432+
* @returns True if this model should allow to organize columns
433+
*/
434+
get isOrganizeColumnsAvailable(): boolean {
435+
return false;
436+
}
437+
431438
/**
432439
* @returns True if the rollup rows functionality is available
433440
*/

packages/iris-grid/src/IrisGridSimplePivotModel.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ const GRAND_TOTAL_VALUE = 'Grand Total';
5252
// - disable Search Bar [DONE]
5353
// - disable Download CSV [DONE]
5454

55-
// - disable Organize columns
56-
// - disable Go to row
55+
// - disable Organize columns [DONE]
56+
// - disable Go to row [DONE]
5757

5858
// - fix sub/unsubscribe on model change
5959
// - totals column move to back
@@ -252,6 +252,18 @@ class IrisGridSimplePivotModel extends IrisGridModel {
252252
return false;
253253
}
254254

255+
get isFormatColumnsAvailable(): boolean {
256+
return false;
257+
}
258+
259+
get isOrganizeColumnsAvailable(): boolean {
260+
return false;
261+
}
262+
263+
get isSeekRowAvailable(): boolean {
264+
return false;
265+
}
266+
255267
get isSelectDistinctAvailable(): boolean {
256268
return false;
257269
}

packages/iris-grid/src/IrisGridTableModelTemplate.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ class IrisGridTableModelTemplate<
460460
return true;
461461
}
462462

463+
get isOrganizeColumnsAvailable(): boolean {
464+
return true;
465+
}
466+
463467
get isTotalsAvailable(): boolean {
464468
return this.table.getTotalsTable != null;
465469
}

packages/iris-grid/src/IrisGridTreeTableModel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ class IrisGridTreeTableModel extends IrisGridTableModelTemplate<
287287
return false;
288288
}
289289

290+
get isOrganizeColumnsAvailable(): boolean {
291+
return true;
292+
}
293+
290294
get isSelectDistinctAvailable(): boolean {
291295
return false;
292296
}

0 commit comments

Comments
 (0)