Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Partitioned Table UI Enhancements #2110

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4caeb92
feat: Partitioned Table UI Enhancements
AkshatJawne Jun 26, 2024
a2f8b9b
modify data extraction and test case
AkshatJawne Jun 26, 2024
831bae4
change name to baseTable and remove unnecessary border
AkshatJawne Jun 26, 2024
45bc6d8
make changes according to review
AkshatJawne Jun 27, 2024
81bdecc
fix formatting issues
AkshatJawne Jun 27, 2024
42dc49d
fix more formatting issues
AkshatJawne Jun 27, 2024
8cff366
small visual changes
AkshatJawne Jun 28, 2024
8ed8875
resolve merge conflicts
AkshatJawne Jul 2, 2024
a97cf27
fix formatting issues
AkshatJawne Jul 2, 2024
01a3225
make changes based on review
AkshatJawne Jul 4, 2024
16db737
temp workaround
AkshatJawne Jul 4, 2024
bc17e40
refactor logic to update partition options
AkshatJawne Jul 4, 2024
9bf8999
WIP fixing rendering issues
AkshatJawne Jul 5, 2024
99096c2
WIP state not working as intended
AkshatJawne Jul 5, 2024
804592b
fix empty table bug
AkshatJawne Jul 8, 2024
292e1ad
WIP still investigating cause of chromium failures
AkshatJawne Jul 9, 2024
dbf69a2
WIP fix formatting issue
AkshatJawne Jul 9, 2024
420bf9e
WIP small changes
AkshatJawne Jul 12, 2024
0762fbb
WIP fix formatter file not getting pushed
AkshatJawne Jul 12, 2024
82f72cb
WIP wanting to test change
AkshatJawne Jul 12, 2024
41bc31a
WIP test context menu change
AkshatJawne Jul 12, 2024
30226d6
WIP test chamhe
AkshatJawne Jul 12, 2024
1601d84
WIP revert old changes
AkshatJawne Jul 12, 2024
a092033
WIP Bender solution
AkshatJawne Jul 16, 2024
7c82824
fix issues with empty table
AkshatJawne Jul 17, 2024
d9fc4ca
remove null check
AkshatJawne Jul 17, 2024
e588409
remove early return
AkshatJawne Jul 17, 2024
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
10 changes: 7 additions & 3 deletions packages/iris-grid/src/IrisGridPartitionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class IrisGridPartitionSelector extends Component<
? null
: (partitionConfig.partitions[index] as ItemKey)
}
placeholder={'Select an option' as string}
placeholder={'Select a key' as string}
AkshatJawne marked this conversation as resolved.
Show resolved Hide resolved
labelColumn={partitionTables[index].columns[index].name}
onChange={this.getCachedChangeCallback(index)}
isDisabled={isLoading}
Expand All @@ -339,7 +339,11 @@ class IrisGridPartitionSelector extends Component<
<Button
onClick={this.handlePartitionTableClick}
kind="inline"
tooltip="View keys as table"
tooltip={
model.isPartitionAwareSourceTable
? 'View keys as table'
: 'View underlying partition table'
}
icon={vsKey}
active={partitionConfig.mode === 'keys'}
disabled={isLoading}
Expand All @@ -354,7 +358,7 @@ class IrisGridPartitionSelector extends Component<
active={partitionConfig.mode === 'merged'}
disabled={isLoading}
>
{model.isPartitionAwareSourceTable ? 'Merge' : 'Coalesce'}
{model.isPartitionAwareSourceTable ? 'Coalesce' : 'Merge'}
</Button>
</div>
{partitionSelectors}
Expand Down
57 changes: 1 addition & 56 deletions packages/iris-grid/src/IrisGridProxyModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {
) {
if (partitionConfig.mode === 'keys') {
modelPromise = this.originalModel
.partitionBaseTable()
.partitionKeysTable()
AkshatJawne marked this conversation as resolved.
Show resolved Hide resolved
.then(table => makeModel(this.dh, table, this.formatter));
} else if (partitionConfig.mode === 'merged') {
modelPromise = this.originalModel
Expand All @@ -340,13 +340,6 @@ class IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {
return this.originalModel.partitionKeysTable();
}

partitionBaseTable(): Promise<DhType.Table> {
if (!isPartitionedGridModelProvider(this.originalModel)) {
throw new Error('Partitions are not available');
}
return this.originalModel.partitionBaseTable();
}

partitionMergedTable(): Promise<DhType.Table> {
if (!isPartitionedGridModelProvider(this.originalModel)) {
throw new Error('Partitions are not available');
Expand Down Expand Up @@ -441,54 +434,6 @@ class IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {
: false;
}

get isPartitionAwareSourceTable(): boolean {
return isPartitionedGridModelProvider(this.originalModel)
? this.originalModel.isPartitionAwareSourceTable
: false;
}

get isEditable(): boolean {
return isEditableGridModel(this.model) && this.model.isEditable;
}

get isDeletable(): boolean {
return isDeletableGridModel(this.model) && this.model.isDeletable;
}

get isViewportPending(): boolean {
return this.model.isViewportPending;
}

isEditableRange: IrisGridTableModel['isEditableRange'] = (
...args
): boolean => {
if (isEditableGridModel(this.model)) {
return this.model.isEditableRange(...args);
}
return false;
};

isDeletableRange: IrisGridTableModel['isDeletableRange'] = (
...args
): boolean => {
if (isDeletableGridModel(this.model)) {
return this.model.isDeletableRange(...args);
}
return false;
};

isDeletableRanges: IrisGridTableModel['isDeletableRanges'] = (
...args
): boolean => {
if (isDeletableGridModel(this.model)) {
return this.model.isDeletableRanges(...args);
}
return false;
};

isFilterable: IrisGridTableModel['isFilterable'] = (...args) =>
this.model.isFilterable(...args);

setViewport = (
top: number,
bottom: number,
Expand Down
2 changes: 1 addition & 1 deletion packages/iris-grid/src/IrisGridTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class IrisGridTableModel
}

async partitionBaseTable(): Promise<DhType.Table> {
return this.valuesTable(this.columns);
return this.partitionKeysTable();
}

async partitionTable(partitions: unknown[]): Promise<DhType.Table> {
Expand Down
Loading