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

Enhancement: Filter-type-group component created #1210

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

verena-ifx
Copy link
Contributor

@verena-ifx verena-ifx commented May 2, 2024

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

Description
Filter Type Group component + related sub components added
To be used inside the advanced table

📦 Published PR as canary version: 21.10.0--canary.1210.9f5143c2fbd5e614f57580d3b34852bfe6ffa12e.0

✨ Test out this PR locally via:

npm install @infineon/infineon-design-system-stencil@21.10.0--canary.1210.9f5143c2fbd5e614f57580d3b34852bfe6ffa12e.0
# or 
yarn add @infineon/infineon-design-system-stencil@21.10.0--canary.1210.9f5143c2fbd5e614f57580d3b34852bfe6ffa12e.0

@verena-ifx verena-ifx added the minor minor version bump label May 2, 2024
@verena-ifx verena-ifx linked an issue May 2, 2024 that may be closed by this pull request
@verena-ifx verena-ifx self-assigned this May 2, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://Infineon.github.io/infineon-design-system-stencil/pr-preview-react-example/pr-1210/
on branch gh-pages at 2024-05-27 10:08 UTC

Copy link
Contributor

github-actions bot commented May 2, 2024

--STORYBOOK-PREVIEW--

@tishoyanchev
Copy link
Contributor

It looks good. Just a new notes/issues;

  • is it not better if all filter-components (filter-accordion, filter-entry, filter-search, filter-type-group) are inside the same filter-folder?
  • There should be a cursor mouse on hover over the + icon
  • total items state should not be updated inside componentDidLoad inside filter-accordion
  • should <span>{this.filterName}</span> not be a label bound to the ifx-checkbox? That way, clicking over the label would focus the ifx-checkbox.
  • number-indicator does not update

@verena-ifx
Copy link
Contributor Author

It looks good. Just a new notes/issues;

  • is it not better if all filter-components (filter-accordion, filter-entry, filter-search, filter-type-group) are inside the same filter-folder?
  • There should be a cursor mouse on hover over the + icon
  • total items state should not be updated inside componentDidLoad inside filter-accordion
  • should <span>{this.filterName}</span> not be a label bound to the ifx-checkbox? That way, clicking over the label would focus the ifx-checkbox.
  • number-indicator does not update FIXED

@verena-ifx
Copy link
Contributor Author

It looks good. Just a new notes/issues;

  • is it not better if all filter-components (filter-accordion, filter-entry, filter-search, filter-type-group) are inside the same filter-folder?
  • There should be a cursor mouse on hover over the + icon
  • total items state should not be updated inside componentDidLoad inside filter-accordion
  • should <span>{this.filterName}</span> not be a label bound to the ifx-checkbox? That way, clicking over the label would focus the ifx-checkbox. To be honest here I followed Figma design
  • number-indicator does not update FIXED

@verena-ifx
Copy link
Contributor Author

It looks good. Just a new notes/issues;

  • is it not better if all filter-components (filter-accordion, filter-entry, filter-search, filter-type-group) are inside the same filter-folder?
  • There should be a cursor mouse on hover over the + icon FIXED
  • total items state should not be updated inside componentDidLoad inside filter-accordion FIXED
  • should <span>{this.filterName}</span> not be a label bound to the ifx-checkbox? That way, clicking over the label would focus the ifx-checkbox. To be honest here I followed Figma design
  • number-indicator does not update FIXED

@verena-ifx
Copy link
Contributor Author

It looks good. Just a new notes/issues;

  • is it not better if all filter-components (filter-accordion, filter-entry, filter-search, filter-type-group) are inside the same filter-folder? HMMM to be honest i prefer to have them separate, cause they are separate components after all. Plus none of them show in storybook (apart from the parent component) What do you think?
  • There should be a cursor mouse on hover over the + icon FIXED
  • total items state should not be updated inside componentDidLoad inside filter-accordion FIXED
  • should <span>{this.filterName}</span> not be a label bound to the ifx-checkbox? That way, clicking over the label would focus the ifx-checkbox. To be honest here I followed Figma design
  • number-indicator does not update FIXED

@tishoyanchev
Copy link
Contributor

tishoyanchev commented May 6, 2024

  • cursor mouse is still default when hover over the "+" icon that expands the filter.
  • when you type in the search, the 'delete all' icon does not appear. show-delete-icon should be set to true.
  • why is filter-name emitted for every component? It's a prop manually set by the user. Not sure if there's a need to emit it.
  • What is the purpose of having ifx-filter-entry component? It does nothing more or different than what an ifx-checkbox does. Why not use ifx-checkbox?

@Event() ifxFilterSearchChange: EventEmitter;


@Watch('value')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this? There is no prop called "value", so this @Watch decorator is not listening to anything.


@Listen('ifxChange')
handleFilterEntryChange(event: CustomEvent) {
this.value = event.detail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'value' is set twice. Once here in the @listen, and once inside the @watch.

Copy link
Contributor

@tishoyanchev tishoyanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 - cursor mouse is still default when hover over the "+" icon that expands the filter. Pic related:
one

2 - when you type in the search, the 'delete all' icon does not appear. show-delete-icon prop should be set to true.

3 - I am not sure if there is a point in emitting the filter-name from the ifx-filter-search, and filter-group-name from ifx-filter-accordion since both of these names are manually set by the user, and not dynamically changed.

@State() showMore = false;
@State() selectedCount: number = 0;
@State() totalItems = 0;
@Prop() name = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the Prop is called "list", but in the Storybook snippet, it's called "list-name".

<div class="wrapper">
{this.type === 'checkbox' ? (
<div class="list-entry">
<ifx-checkbox size="s" value={this.value}>{this.label}</ifx-checkbox>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.value is set twice. Once inside @watch, and once inside @listen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the value in both @listen and @watch is necessary because they react to different triggers and perform different actions:

@watch('value'):
The valueChanged method is a watcher for the value prop.
Whenever the value prop changes, regardless of how the change occurred, this watcher will run.
It's responsible for reflecting the new value prop to the host element's attribute, which might be important for CSS styling or other JS that queries the host element for its value attribute.

@listen('ifxChange'):
The handleFilterEntryChange method is an event listener for the ifxChange event.
When ifxChange is emitted, presumably by the ifx-checkbox or ifx-radio-button, this method updates the value prop and emits a new event (ifxListEntryChange) to inform parent components of the change.

componentDidLoad() {
// Dispatch the ifxListUpdate event after the component has been fully loaded
const selectedItems = getInitiallySelectedItems(this.el);
this.count = selectedItems.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Prop should not be updated inside componentDidLoad. It triggers an error warning in the console. It should be updated inside componentWillLoad() lifecycle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to update it in ComponentDidLoad(), because access to the DOM is required to determine the selected items.
The update to this.count depends on the selected items that are obtained from the DOM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also dont get any warnings. Can you send a screenshot here as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accordion

You are not querying the DOM. You are only passing a reference of the component (this.el) to this function getInitiallySelectedItems().

Move these two:

const selectedItems = getInitiallySelectedItems(this.el);
this.count = selectedItems.length;

inside componentWillLoad(), and it will work.

flex: 1 0 0;
border-bottom: 1px solid tokens.$ifxColorEngineering200;

&.expanded {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of this borders causes a movement. I am not sure if this should be prevented or not. If yes, then one solution is to add a transparent border.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(y) will look into this today

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the borders are described like this in the figma file though. Which movement do they cause? Can you send a screenshot?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 < br />

2

@verena-ifx
Copy link
Contributor Author

s are manually set by the user, and not dynamically cha

do you mean the filterGroupName? or the label of the filter? They neeed to be emitted to be used within tihe table. Cause the table columns need to be mapped to the filters

@tishoyanchev
Copy link
Contributor

In addition to my replies to the above comments:
1 - in storybook, the snippet is all in one line.
2 - cursor still arrow and not pointer (see 1 from the above list)
3 - when you click 'delete-all' button on the search-bar, the delete-all button remains even though the field is empty
4 - Even when the max-visible-items is higher than the existing items, the show-more button is still there. (pic for reference)
show more
5 - when I dynamically change the max-visible-items, there's always a second delay before the changes occur.
6 - In storybook, "type=" is applied to the ifx-list and ifx-list-entry, but ifx-list does not have 'type' property.
7 - Is it really correct to apply the type to each entry-item, as opposed to the entire group? In the current way, some items can be checkbox, some can be radio at the same time. I am not sure this is in accordance with how the component should behave.

@tishoyanchev
Copy link
Contributor

1 - remove the console.log
2 - the movement issue from above remains
3 - the warning message issue from above remains
4 - The List component snippet in Storybook is all in one line.

The other issues are fixed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component: Filter Type Group + sub components
2 participants