Skip to content

fix(platform): Combine Sorting, Filtering, and Grouping Settings into a Single Dialog #12502

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

Merged
merged 35 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a5a6abc
refactor(platform): Refactor to leverage signals and combine sorting,…
dpavlenishvili Oct 2, 2024
883a1b2
refactor(platform, docs): generate tests, add combined settings example
dpavlenishvili Oct 3, 2024
830debb
fix(platform): add cursor pointer style to filter list items
dpavlenishvili Oct 3, 2024
51d98d3
fix(platform): remove cursor pointer style temp fix to filter list it…
dpavlenishvili Oct 9, 2024
2b18f76
Merge branch 'main' into 12441-table-settings-dialog-revisit
dpavlenishvili Oct 9, 2024
f08631d
fix(platform): merge conflict missing parts
dpavlenishvili Oct 9, 2024
5cf2261
Merge branch 'main' into 12441-table-settings-dialog-revisit
dpavlenishvili Oct 14, 2024
40b4983
fix(docs): sync settings dialog and table data in platform table exam…
dpavlenishvili Oct 14, 2024
aae72fa
fix(platform): remove settings dialog scss file and set height style …
dpavlenishvili Oct 14, 2024
ecec3b6
Merge branch 'main' into 12441-table-settings-dialog-revisit
dpavlenishvili Nov 26, 2024
3b48e63
fix(docs): update i18n
dpavlenishvili Nov 26, 2024
a418d19
fix(docs): reset platform table settings to default.
dpavlenishvili Nov 26, 2024
db3b187
fix(platform, docs): address settings dialog implementation and usage…
dpavlenishvili Nov 26, 2024
88664b4
fix(deps): repair nx
dpavlenishvili Dec 18, 2024
de9401b
Merge remote-tracking branch 'origin/main' into 12441-table-settings-…
dpavlenishvili Dec 18, 2024
5026e0f
Merge branch 'main' into 12441-table-settings-dialog-revisit
droshev Dec 19, 2024
b9254ff
fix(docs): settings dialog e2e
dpavlenishvili Dec 20, 2024
40d2864
Merge branch 'main' into 12441-table-settings-dialog-revisit
dpavlenishvili Dec 23, 2024
4ccf2e3
Merge branch 'main' into 12441-table-settings-dialog-revisit
dpavlenishvili Dec 23, 2024
172b084
fix(deps): fix merge conflicts
dpavlenishvili Dec 23, 2024
d50d482
Merge branch 'main' into 12441-table-settings-dialog-revisit
mikerodonnell89 Jan 2, 2025
85680b5
fix(platform): table unit test
mikerodonnell89 Jan 3, 2025
6df31d4
Merge branch 'main' into 12441-table-settings-dialog-revisit
mikerodonnell89 Jan 8, 2025
55aefb6
fix: merge conflict
mikerodonnell89 Jan 14, 2025
af2a73d
fix: merge conflicts
mikerodonnell89 Feb 3, 2025
ae24f10
Merge branch 'main' into 12441-table-settings-dialog-revisit
mikerodonnell89 Feb 3, 2025
2c1f37c
fix(platform): fix build error from type incompatibility
mikerodonnell89 Feb 3, 2025
db15a70
fix: merge conflicts
mikerodonnell89 Feb 5, 2025
4b238b3
fix: merge conflict
mikerodonnell89 Feb 6, 2025
46061b6
fix: update yarn.lock
mikerodonnell89 Feb 7, 2025
2237289
fix: restore yarn.lock
mikerodonnell89 Feb 7, 2025
8dd1429
fix: unit test
mikerodonnell89 Feb 7, 2025
58c610c
Merge branch 'main' into 12441-table-settings-dialog-revisit
droshev Feb 12, 2025
d2134dd
Merge branch 'main' into 12441-table-settings-dialog-revisit
droshev Feb 13, 2025
574d034
Merge branch 'main' into 12441-table-settings-dialog-revisit
mikerodonnell89 Feb 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,28 @@
<fdp-platform-table-groupable-example></fdp-platform-table-groupable-example>
</component-example>
<code-example [exampleFiles]="groupableTableFiles"></code-example>

<separator></separator>

<fd-docs-section-title id="combined-settings" componentName="table">
Combined Table Settings Dialog</fd-docs-section-title
>
<description>
<p>
The <code>fdp-table-view-settings-dialog</code> component allows users to manage sorting, filtering, and
grouping settings in one convenient dialog.
</p>
<p>
By using the properties <code>[sortable]="true"</code>, <code>[filterable]="true"</code>, and
<code>[groupable]="true"</code>, developers can enable the respective functionalities directly in the table
columns.
</p>
<p>
This dialog streamlines user interactions, making it easier to adjust table settings without navigating through
multiple interfaces.
</p>
</description>
<component-example>
<fdp-platform-table-settings-dialog-example></fdp-platform-table-settings-dialog-example>
</component-example>
<code-example [exampleFiles]="settingsTableFiles"></code-example>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '@fundamental-ngx/docs/shared';
import { PlatformTableFilterableExampleComponent } from '../../examples/platform-table-filterable-example.component';
import { PlatformTableGroupableExampleComponent } from '../../examples/platform-table-groupable-example.component';
import { PlatformTableSettingsDialogExampleComponent } from '../../examples/platform-table-settings-dialog-example.component';
import { PlatformTableSortableExampleComponent } from '../../examples/platform-table-sortable-example.component';

const platformTableSortableSrc = 'platform-table-sortable-example.component.html';
Expand All @@ -21,6 +22,8 @@ const platformTableGroupableSrc = 'platform-table-groupable-example.component.ht
const platformTableGroupableTsSrc = 'platform-table-groupable-example.component.ts';
const platformTableFilterableSrc = 'platform-table-filterable-example.component.html';
const platformTableFilterableTsSrc = 'platform-table-filterable-example.component.ts';
const platformTableSettingsSrc = 'platform-table-settings-dialog-example.component.html';
const platformTableFiSettingsSrc = 'platform-table-settings-dialog-example.component.ts';
@Component({
selector: 'fd-settings-dialog-docs',
templateUrl: './settings-dialog-docs.component.html',
Expand All @@ -36,7 +39,8 @@ const platformTableFilterableTsSrc = 'platform-table-filterable-example.componen
SeparatorComponent,
PlatformTableFilterableExampleComponent,
PlatformTableGroupableExampleComponent,
FdDatetimeModule
FdDatetimeModule,
PlatformTableSettingsDialogExampleComponent
]
})
export class SettingsDialogDocsComponent {
Expand Down Expand Up @@ -89,6 +93,22 @@ export class SettingsDialogDocsComponent {
name: 'platform-table-example.component.ts'
}
];

settingsTableFiles: ExampleFile[] = [
{
language: 'html',
code: getAssetFromModuleAssets(platformTableSettingsSrc),
fileName: 'platform-table-settings-dialog-example',
name: 'platform-table-example.component.html'
},
{
language: 'typescript',
code: getAssetFromModuleAssets(platformTableFiSettingsSrc),
fileName: 'platform-table-settings-dialog-example',
component: 'PlatformTableSettingsDialogExampleComponent',
name: 'platform-table-example.component.ts'
}
];
constructor() {
this.childService.setLink(this.route.snapshot.routeConfig?.path);
}
Expand Down
15 changes: 9 additions & 6 deletions libs/docs/platform/table/e2e/table-settings-dialog.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ describe('Table component test suite', () => {
elem.click();
await expect((await getText(tableCellStatusColor, 2)).trim()).withContext('negative');
});

it('should check filtering by status', async () => {
await scrollIntoView(tableFilterableExample);
await click(tableFilterableExample + toolbarButton);
Expand All @@ -165,14 +164,18 @@ describe('Table component test suite', () => {

it('should check on filter by price reset button is clickable', async () => {
await scrollIntoView(tableFilterableExample);
await click(tableFilterableExample + buttonFilter);
await click(tableFilterableExample + toolbarButton);
const elem = $('li:nth-child(2)');
elem.click();
const rowLength = await getElementArrayLength(tableFilterableExample + tableRow);
for (let i = 0; i < rowLength; i++) {
await expect((await getText(tableFilterableExample + tableCellStatus, i)).trim()).withContext(
'Out of stock'
);
}
await click(dialogFilters);
await setValue(filterInput, '10');
await setValue(filterInput, '40', 1);
await click(filterButtonOk);
await pause(500);
await click(tableFilterableExample + buttonFilter);
await click(dialogFilters);
await expect(await isElementClickable(filterResetButton)).withContext(true, 'reset button not clickable');
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<fdp-table #table [dataSource]="source" (filterChange)="logFilterChange($event)" emptyTableMessage="No data found">
<fdp-table-toolbar title="Order Line Items" [hideItemCount]="false"></fdp-table-toolbar>

<fdp-column name="name" key="name" label="Name" align="start" [groupable]="true" [sortable]="true"></fdp-column>

<fdp-column
name="description"
key="description"
label="Description"
[groupable]="true"
[sortable]="true"
></fdp-column>

<fdp-column
name="price"
key="price.value"
label="Price"
align="end"
[groupable]="true"
[filterable]="true"
[sortable]="true"
></fdp-column>

<fdp-column
name="status"
key="status"
label="Status"
align="center"
[groupable]="true"
[filterable]="true"
[sortable]="true"
></fdp-column>

<fdp-column
name="statusColor"
key="statusColor"
label="Status Color"
align="center"
[groupable]="true"
[filterable]="true"
[sortable]="true"
></fdp-column>
</fdp-table>

<!-- View Settings Dialog-->
<fdp-table-view-settings-dialog [table]="table">
<fdp-table-view-settings-filter column="price" label="Price" [type]="filterTypeEnum.CUSTOM">
<ng-container *fdpViewSettingsFilterCustomDef="let model">
<fdp-form-group #fg1 columnLayout="XL1-L1-M1-S1" labelLayout="vertical">
<fdp-form-field label="Minimum Price">
<fdp-input type="number" name="min" [(ngModel)]="model.min"></fdp-input>
</fdp-form-field>
<fdp-form-field label="Maximum Price">
<fdp-input type="number" name="max" [(ngModel)]="model.max"></fdp-input>
</fdp-form-field>
</fdp-form-group>
</ng-container>
</fdp-table-view-settings-filter>

<fdp-table-view-settings-filter
column="status"
[type]="filterTypeEnum.MULTI"
label="Status"
[values]="statusFilteringValues"
>
</fdp-table-view-settings-filter>

<fdp-table-view-settings-filter
column="statusColor"
[type]="filterTypeEnum.SINGLE"
label="Status Color"
[values]="statusColorFilteringValues"
>
</fdp-table-view-settings-filter>
</fdp-table-view-settings-dialog>
Loading
Loading