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

merge changes into release branch #522

Merged
merged 50 commits into from
Nov 29, 2024
Merged

merge changes into release branch #522

merged 50 commits into from
Nov 29, 2024

Conversation

jadzlnds
Copy link
Contributor

@jadzlnds jadzlnds commented Nov 29, 2024

Summary by Sourcery

Merge changes into the release branch, introducing a new filter management system with the FilterProvider, enhancing the dataset search and filter functionalities, and updating dependencies and CI configurations. The changes also include refactoring components for better state management and user interaction, as well as updating tests to align with the new data structures.

New Features:

  • Introduce a new FilterProvider to manage filter state across the application, allowing for more dynamic and flexible filter management.
  • Add support for active filters display and management, including the ability to add, remove, and clear filters.
  • Implement a new EntriesFilterContent component to handle entry-based filters.

Enhancements:

  • Refactor the FreeTextFilterContent component to improve state management and user interaction.
  • Update the dataset search options to use 'rows' instead of 'limit' and 'start' instead of 'offset' for pagination.
  • Replace the PublisherList component with a more generic ValueList component to handle various types of value lists.

Build:

  • Update several dependencies in package.json, including @opentelemetry packages, date-fns, next, and tailwindcss to their latest versions.

CI:

  • Update the SonarQube Scan and REUSE Compliance Check actions in the GitHub workflows to use newer versions.

Deployment:

  • Update the base image in the Dockerfile to a newer version of the nodejs-20-minimal image from Red Hat.

Tests:

  • Add tests for the new filterValuesList function to ensure it correctly fetches filter values from the API.
  • Update existing tests to reflect changes in the data structure, such as replacing 'organization' with 'publishers'.

Chores:

  • Remove unused SVG files and their licenses from the public/themes directory.

admy7 and others added 30 commits November 12, 2024 15:27
* fix: free text values sync with global states

* feat: provide user feedback for incorrect free text values
…try.access.redhat.com-ubi9-nodejs-20-minimal-9.x

chore(deps): update registry.access.redhat.com/ubi9/nodejs-20-minimal docker tag to v9
…source-sonarqube-scan-action-4.x

chore(deps): update sonarsource/sonarqube-scan-action action to v4
…ortal-frontend-and-dds-display-themes-and-publisher-from-backend

feat: ART-9692/add themes and publishers
…ovate/registry.access.redhat.com-ubi9-nodejs-20-minimal-9.x

Revert "chore(deps): update registry.access.redhat.com/ubi9/nodejs-20-minimal docker tag to v9"
…ortal-frontend-and-dds-display-themes-and-publisher-from-backend

feat: ART-9692/change themes in homepage
…reuse-action-5.x

chore(deps): update fsfe/reuse-action action to v5
…-nextjs-monorepo

fix(deps): update dependency next to v14.2.18
…-devdependencies

chore(deps): update dependency eslint-config-next to v14.2.18
This is needed because latest UBI image has a bug and trivy is not capable to fetch vulnerability lists.

aquasecurity/trivy-db#435
* fix: ART-9692/displaying themes on homepage correctly

* add test

* fix prettier

* fix compliance
…-devdependencies

chore(deps): update dependency tailwindcss to v3.4.15
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…_and_yarn/cross-spawn-7.0.6

chore(deps): bump cross-spawn from 7.0.3 to 7.0.6
…portal-frontend-not-showing-filter-labels-in-applied-filters

fix: ART-10765/not showing filter labels in applied filters
…fns-4.x

fix(deps): update dependency date-fns to v4
Renovate Bot and others added 20 commits November 18, 2024 16:03
…elemetry-js-monorepo

fix(deps): update opentelemetry-js monorepo to ^0.55.0 (minor)
…-nextjs-monorepo

fix(deps): update dependency next to v15
…ovate/major-nextjs-monorepo

Revert "fix(deps): update dependency next to v15"
…ecurity-trivy-action-0.x

chore(deps): update aquasecurity/trivy-action action to v0.29.0
…try.access.redhat.com-ubi9-nodejs-20-minimal-9.x

chore(deps): update registry.access.redhat.com/ubi9/nodejs-20-minimal docker tag to v9
…try.access.redhat.com-ubi9-nodejs-20-minimal-9.5.x

chore(deps): update registry.access.redhat.com/ubi9/nodejs-20-minimal docker tag to v9.5-1732617235
Copy link
Contributor

sourcery-ai bot commented Nov 29, 2024

Reviewer's Guide by Sourcery

This pull request implements a new filter management system using React Context and introduces several UI components for handling different types of filters (dropdown, free text, and entries). The changes include refactoring the dataset search functionality to use the new filter system and updating related components to work with the new implementation.

Sequence diagram for Filter Application Process

sequenceDiagram
    actor User
    participant FilterProvider
    participant FilterList
    participant ActiveFilters
    User->>FilterList: Select filter
    FilterList->>FilterProvider: addActiveFilter(filter)
    FilterProvider->>ActiveFilters: Update active filters
    ActiveFilters->>User: Display active filters
    User->>ActiveFilters: Remove filter
    ActiveFilters->>FilterProvider: removeActiveFilter(key, source)
    FilterProvider->>ActiveFilters: Update active filters
    ActiveFilters->>User: Display updated filters
Loading

Class diagram for Filter Management System

classDiagram
    class FilterProvider {
        +Filter[] filters
        +ActiveFilter[] activeFilters
        +boolean isLoading
        +error
        +addActiveFilter(ActiveFilter)
        +removeActiveFilter(string, string)
        +clearActiveFilters()
    }
    class ActiveFilter {
        +string source
        +string type
        +string key
        +string label
        +Value[] values
        +ActiveFilterEntry[] entries
    }
    class Value {
        +string value
        +string label
        +Operator operator
    }
    class ActiveFilterEntry {
        +string key
        +string label
        +string value
    }
    class Filter {
        +string source
        +string type
        +string key
        +string label
        +Value[] values
        +Operator[] operators
        +FilterEntry[] entries
    }
    class FilterEntry {
        +string key
        +string label
    }
    FilterProvider --> ActiveFilter
    ActiveFilter --> Value
    ActiveFilter --> ActiveFilterEntry
    Filter --> Value
    Filter --> FilterEntry
Loading

Class diagram for Dataset Search Types

classDiagram
    class DatasetSearchOptions {
        +string query
        +Facet[] facets
        +string sort
        +number rows
        +number start
        +QueryOperator operator
    }
    class Facet {
        +string source
        +string type
        +string key
        +string value
        +Operator operator
        +FacetEntry[] entries
    }
    class FacetEntry {
        +string key
        +string value
    }
    class ValueLabel {
        +string label
        +string value
        +number count
    }
    DatasetSearchOptions --> Facet
    Facet --> FacetEntry
Loading

File-Level Changes

Change Details Files
Implemented a new filter management system using React Context
  • Created FilterProvider component to manage filter state globally
  • Added support for active filters tracking
  • Implemented filter addition, removal, and clearing functionality
  • Added error handling for filter operations
src/providers/FilterProvider.tsx
src/app/layout.tsx
Refactored filter UI components to work with the new filter system
  • Created new filter content components for different filter types (dropdown, free text, entries)
  • Added active filter display with removal capability
  • Updated filter list to use the new context-based system
  • Implemented filter value validation and error handling
src/app/datasets/FilterList/DropdownFilterContent.tsx
src/app/datasets/FilterList/FreeTextFilterContent.tsx
src/app/datasets/FilterList/EntriesFilterContent.tsx
src/app/datasets/ActiveFilters.tsx
src/app/datasets/ActiveFilterPill.tsx
Updated dataset search and API integration
  • Modified dataset search to use the new filter system
  • Updated API endpoints to handle filter values
  • Refactored dataset provider to work with active filters
  • Added conversion utilities for filter formats
src/services/discovery/types/datasetSearch.types.ts
src/services/discovery/datasetList.ts
src/providers/datasets/DatasetsProvider.tsx
src/app/api/datasets/route.ts
Refactored publisher and theme handling
  • Converted publisher list to use the new filter value system
  • Updated theme handling to use filter values
  • Removed static theme assets
  • Added new filter value list functionality
src/app/publishers/page.tsx
src/app/themes/page.tsx
src/services/discovery/filterValueList.ts
public/themes/*
Updated dependencies and configuration
  • Updated Node.js base image version
  • Updated various npm package versions
  • Updated GitHub workflow configurations
package.json
package-lock.json
Dockerfile
.github/workflows/main.yml
.github/workflows/release.yml
.github/workflows/test.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jadzlnds - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider syncing the filter state with URL parameters to maintain bookmarking and sharing functionality
  • Extract repeated filter matching logic (e.g. finding active filters) into a shared utility function to reduce duplication
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@brunopacheco1 brunopacheco1 merged commit 4fd2dff into releases/v1.3 Nov 29, 2024
7 checks passed
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.

5 participants