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

[BUG] Dependencies Table: When there are deps with duplicate names, the row selection always selects the first one #1509

Closed
1 task done
pranavgaikwad opened this issue Nov 2, 2023 · 0 comments · Fixed by #1554
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@pranavgaikwad
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

0.3.0.beta-1.2

Priority

Critical

Current Behavior

When there are dependencies with duplicate names (this is a valid case, where dependencies can have same name but differ in versions, sha etc), the row selection does not work as expected:

deps_dups

Expected Behavior

The row selection should work even when there are duplicate dep names. The uniqueness of a dep is defined by not just the name but combination of name, sha, and version.

How Reproducible

Always (Default)

Steps To Reproduce

  1. Add following apps to inventory:
  1. Run analysis for all these apps using Source + Deps mode. The targets don't really matter, as no matter what targets, the dependencies for an app don't change.
  2. Go to dependencies view and notice:

deps_dups

Environment

- OS:

Anything else?

No response

@pranavgaikwad pranavgaikwad added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 2, 2023
@sjd78 sjd78 self-assigned this Nov 14, 2023
@sjd78 sjd78 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 14, 2023
sjd78 added a commit to sjd78/tackle2-ui that referenced this issue Nov 16, 2023
Resolves: konveyor#1509

The Dependencies table was setup to use the `AnalysisDependency`
`.name` as the selected row key.  Since the `.name` field is not
unique across all rows multiple rows would be erroneously selected
at the same time.  To solve the problem, a UI only unique id is
generated after fetching and used for the table selection itemId.

Change details:
  - Dependencies fetch query updated to inject a UI uid and
    return `WithUiId<AnalysisDependency>[]`.  This transform is done
    outside the react-query `useQuery()` handling.

  - Updated the table to use the `WithUiId<>` key `_ui_unique_id`
    for selection.

  - Since the button rendered in the "Found in" column had no function,
    the button was removed.

  - "Found in" column moved to the last column to match the placement
    of matching columns on the Archetypes and Issues tables.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit to sjd78/tackle2-ui that referenced this issue Nov 16, 2023
Resolves: konveyor#1509

The Dependencies table was setup to use the `AnalysisDependency`
`.name` as the selected row key.  Since the `.name` field is not
unique across all rows multiple rows would be erroneously selected
at the same time.  To solve the problem, a UI only unique id is
generated after fetching and used for the table selection itemId.

Change details:
  - Dependencies fetch query updated to inject a UI uid and
    return `WithUiId<AnalysisDependency>[]`.  This transform is done
    outside the react-query `useQuery()` handling.

  - Updated the table to use the `WithUiId<>` key `_ui_unique_id`
    for selection.

  - Since the button rendered in the "Found in" column had no function,
    the button was removed.

  - "Found in" column moved to the last column to match the placement
    of matching columns on the Archetypes and Issues tables.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit to sjd78/tackle2-ui that referenced this issue Nov 17, 2023
Resolves: konveyor#1509

The Dependencies table was setup to use the `AnalysisDependency`
`.name` as the selected row key.  Since the `.name` field is not
unique across all rows multiple rows would be erroneously selected
at the same time.  To solve the problem, a UI only unique id is
generated after fetching and used for the table selection itemId.

Change details:
  - Dependencies fetch query updated to inject a UI uid and
    return `WithUiId<AnalysisDependency>[]`.  This transform is done
    outside the react-query `useQuery()` handling.

  - Updated the table to use the `WithUiId<>` key `_ui_unique_id`
    for selection.

  - Since the button rendered in the "Found in" column had no function,
    the button was removed.

  - "Found in" column moved to the last column to match the placement
    of matching columns on the Archetypes and Issues tables.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit that referenced this issue Nov 17, 2023
Resolves: #1509

The Dependencies table was setup to use the `AnalysisDependency.name` as
the selected row key. Since the `.name` field is not unique across all
rows multiple rows would be erroneously selected at the same time. To
solve the problem, a UI only unique id is generated after fetching and
used for the table selection itemId.

Change details:
  - Dependencies fetch query updated to inject a UI uid and return
    `WithUiId<AnalysisDependency>[]`. This transform is done outside the
    react-query `useQuery()` handling.

  - Updated the table to use the `WithUiId<>` key `_ui_unique_id` for
    selection.

  - Since the button rendered in the "Found in" column had no function,
    the button was removed.

  - "Found in" column moved to the last column to match the placement of
    matching columns on the Archetypes and Issues tables.

  - Use i18next plural aware keys for the "Found in" text to avoid the
    "(s)" suffix.

  - Fixed the `id` and `aria-label` on the table.

  - Added `key` to the label column `Label`s.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants