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

Add search bar in custom views #3529

Merged
merged 8 commits into from
Apr 2, 2024

Conversation

fritschldwg
Copy link
Contributor

@fritschldwg fritschldwg commented Mar 22, 2024

Add search bar in custom views

Closes: #3212

Description

  • Add search bar for custom views and filter by mode, name and metrics

Definition of Done

A PR is only ready for merge once all the following acceptance criteria are fulfilled:

  • Changes have been manually tested
  • All TODOs related to this PR have been closed
  • There are automated tests for newly written code and bug fixes
  • All bugs discovered while working on this PR have been submitted as issues (if not already an open issue)
  • Documentation (GH-pages, analysis/visualization READMEs, parser READMEs, --help, etc.) has been updated (almost always necessary except for bug fixes)
  • CHANGELOG.md has been updated

@fritschldwg fritschldwg force-pushed the feature/3212/add-search-bar-in-custom-views branch from 7ac05f0 to d3626ed Compare March 22, 2024 10:57
@fritschldwg fritschldwg force-pushed the feature/3212/add-search-bar-in-custom-views branch from ce890dc to c07b04b Compare March 22, 2024 14:26
…ustom-views' into feature/3212/add-search-bar-in-custom-views

# Conflicts:
#	visualization/app/codeCharta/ui/customConfigs/customConfigList/customConfigItemGroup/customConfigItemGroup.component.html
#	visualization/app/codeCharta/ui/customConfigs/customConfigList/customConfigItemGroup/customConfigItemGroup.component.ts
Copy link
Contributor

@Nereboss Nereboss left a comment

Choose a reason for hiding this comment

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

One more thing that i noticed is that when the user manually opens for example the custom views in standard mode, then searches, then deletes the search term, the menu is gets closed. This might be a bit nitpicky but id prefer if we keep it open in that case (could use a boolean that tracks if the user manually opened it)

const lowerCasedSearchTerm = searchTerm.toLocaleLowerCase().trimEnd()
return customConfigItems.filter(customConfigItem => {
const isSearchTermIncludedInName = customConfigItem.name.toLocaleLowerCase().includes(lowerCasedSearchTerm)
const isSearchTermInlcudedInMode = customConfigItem.mapSelectionMode.toLocaleLowerCase().includes(lowerCasedSearchTerm)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo in isSearchTermInlcudedInMode -> it says "inlcuded"

export class FilterCustomConfigDataBySearchTermPipe implements PipeTransform {
transform(customConfigItems: CustomConfigItem[], searchTerm: string) {
const lowerCasedSearchTerm = searchTerm.toLocaleLowerCase().trimEnd()
return customConfigItems.filter(customConfigItem => {
Copy link
Contributor

Choose a reason for hiding this comment

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

i think the filter should be its own private method here, better for readability

Copy link
Contributor

@Nereboss Nereboss left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

sonarcloud bot commented Apr 2, 2024

Copy link

sonarcloud bot commented Apr 2, 2024

Quality Gate Passed Quality Gate passed for 'CodeCharta Analysis'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Nereboss Nereboss merged commit b45e04a into main Apr 2, 2024
7 checks passed
@Nereboss Nereboss deleted the feature/3212/add-search-bar-in-custom-views branch April 2, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add search bar in Custom Views feature
2 participants