-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(platform): introduce variant management component (#9051)
* feat(platform): introduce variant management component * fix(platform): export directive * fix(platform): fix failing unit test * fix(platform): add decorator * fix(platform): pr comments * fix(platform): address pr comments * fix(platform): format file * chore: apply migrations * fix(platform): simplify code
- Loading branch information
Showing
128 changed files
with
4,483 additions
and
115 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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,26 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { Nullable } from '@fundamental-ngx/core/shared'; | ||
|
||
@Pipe({ | ||
name: 'fdFilterStrings' | ||
}) | ||
export class FilterStringsPipe implements PipeTransform { | ||
/** | ||
* Performs filtering. | ||
* @param values Array of items. | ||
* @param params Search parameters. | ||
*/ | ||
transform(values: any[] = [], params: { searchTerm: Nullable<string>; key: string }): any[] { | ||
if (!params.searchTerm) { | ||
return values; | ||
} | ||
if (params.key) { | ||
values = values.filter((item) => | ||
item[params.key].toLocaleLowerCase().includes(params.searchTerm?.toLocaleLowerCase()) | ||
); | ||
} else { | ||
values = values.filter((item) => item.toLocaleLowerCase().includes(params.searchTerm?.toLocaleLowerCase())); | ||
} | ||
return values; | ||
} | ||
} |
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
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
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
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
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,4 @@ | ||
{ | ||
"extends": "../../../../../e2e/tsconfig.json", | ||
"include": ["./**/*.e2e-spec.ts"] | ||
} |
3 changes: 3 additions & 0 deletions
3
libs/docs/platform/variant-management/e2e/variant-management.e2e-spec.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,3 @@ | ||
describe('VariantManagement test', () => { | ||
// Placeholder for writing helpful e2e tests | ||
}); |
88 changes: 88 additions & 0 deletions
88
...orm/variant-management/examples/default/variant-management-default-example.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,88 @@ | ||
<fdp-variant-management-wrapper> | ||
<fdp-smart-filter-bar [liveUpdate]="true" [subject]="subject"> | ||
<fdp-variant-management *fdpSmartFilterBarToolbarItem [variants]="variants" userName="John Doe" #variantManager> | ||
<span *fdpVariantManagementDirtyLabel>changed</span> | ||
</fdp-variant-management> | ||
</fdp-smart-filter-bar> | ||
<br /> | ||
<h4 fd-title>Line Items</h4> | ||
<br /> | ||
<fdp-table | ||
fdp-smart-filter-bar-subject | ||
#subject="fdp-smart-filter-bar-subject" | ||
[dataSource]="source" | ||
[trackBy]="trackBy" | ||
emptyTableMessage="No data found" | ||
> | ||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
[smartFilterBarFilterable]="false" | ||
name="name" | ||
key="name" | ||
label="Name" | ||
defaultSelected="true" | ||
align="start" | ||
> | ||
</fdp-column> | ||
|
||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
name="description" | ||
key="description" | ||
defaultSelected="true" | ||
label="Description" | ||
> | ||
</fdp-column> | ||
|
||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
[dataType]="dataTypeEnum.NUMBER" | ||
name="price" | ||
key="price.value" | ||
label="Price" | ||
align="end" | ||
> | ||
</fdp-column> | ||
|
||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
[filterType]="filterTypeEnum.MULTI" | ||
name="status" | ||
key="status" | ||
label="Status" | ||
required="true" | ||
align="center" | ||
hasOptions="true" | ||
> | ||
</fdp-column> | ||
|
||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
[filterType]="filterTypeEnum.SINGLE" | ||
name="statusColor" | ||
key="statusColor" | ||
label="Status color" | ||
align="center" | ||
hasOptions="true" | ||
> | ||
</fdp-column> | ||
|
||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
[dataType]="dataTypeEnum.DATE" | ||
name="date" | ||
key="date" | ||
label="Date" | ||
></fdp-column> | ||
|
||
<fdp-column | ||
fdp-smart-filter-bar-field-definition | ||
[filterType]="filterTypeEnum.SINGLE" | ||
[dataType]="dataTypeEnum.BOOLEAN" | ||
name="verified" | ||
key="verified" | ||
label="Verified" | ||
hasOptions="true" | ||
></fdp-column> | ||
</fdp-table> | ||
</fdp-variant-management-wrapper> |
Oops, something went wrong.