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 application tasks status icon and popover to application table #1985

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Jun 28, 2024

Summary

On the application table's name column, add a status icon. The icon summarizes the status of the various kinds of tasks attached to an application (a single application has 0 or more tasks while a task acts on a single application).

The icon will be driven off looking at the most recent task (by createTime) per kind for an application:

  • If there are no tasks, show the application in No Tasks state
  • Else if any are "running", show the application in Running
  • Else if any are "queued", show the application in Queued state
  • Else if any are "failed", show the application as Failed
  • Else if any are "canceled", show the application as Canceled
  • Else if any are "succeeded", show the application as Success

A popover on hover will render on the application name column to display summary information about the application's
tasks. The popover will have a table that shows the most recent tasks for each kind of task associated to the application.

  • Task id
  • Task status icon with the task kind
  • How long ago the task was started/created (exact time in a tooltip)

Based on refactoring PR #1988 and PR #1989
Closes: #1934
Fixes: #1772

Change Details

  • Created useDecoratedApplications() hook to run all calculations and cross-referencing necessary to render most of the table.

  • Created ColumnApplicationName to handle the application name column with the status icon and popover.

  • Refactored useFetchTasks() hook to only do a simple sort. The filtering based on kind is no longer necessary.

  • The base ApplicationsTable received some basic refactoring to utilize the content of DecoratedApplication

Screen Shots

Base view with various application task statuses:
screenshot-localhost_9000-2024 06 28-02_38_20

Popover details of an application with canceled tasks:
screenshot-localhost_9000-2024 06 28-02_38_39

Popover details of an application with successful tasks:
screenshot-localhost_9000-2024 06 28-02_39_09

Popover details of an application with failed tasks:
screenshot-localhost_9000-2024 06 28-02_39_43

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 42.32%. Comparing base (b654645) to head (8cf2f5e).
Report is 183 commits behind head on main.

Files Patch % Lines
client/src/app/queries/tasks.ts 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1985      +/-   ##
==========================================
+ Coverage   39.20%   42.32%   +3.12%     
==========================================
  Files         146      170      +24     
  Lines        4857     5434     +577     
  Branches     1164     1364     +200     
==========================================
+ Hits         1904     2300     +396     
- Misses       2939     3017      +78     
- Partials       14      117     +103     
Flag Coverage Δ
client 42.32% <33.33%> (+3.12%) ⬆️
server ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjd78 sjd78 changed the title ✨ Add an application tasks status icon and popover ✨ Add application tasks status icon and popover to application table Jun 28, 2024
@sjd78 sjd78 requested a review from pranavgaikwad June 28, 2024 06:33
@sjd78
Copy link
Member Author

sjd78 commented Jun 28, 2024

Note: Once konveyor/tackle-ui-tests#1150 is merged, CI will pass again. The problem fixed isn't from this PR.

@sjd78 sjd78 added this to the v0.5.0 milestone Jun 28, 2024
@sjd78
Copy link
Member Author

sjd78 commented Jul 1, 2024

Created #1988 for the base refactoring that happend in the first few commits of this PR. It'll make this PR much easier to review.

@sjd78
Copy link
Member Author

sjd78 commented Jul 1, 2024

Note: Once konveyor/tackle-ui-tests#1150 is merged, CI will pass again. The problem fixed isn't from this PR.

There is another e2e ui test fail in spec cypress/e2e/tests/migration/applicationinventory/assessment/miscellaneous.test.ts. I'm looking at that issue now.

sjd78 added a commit that referenced this pull request Jul 1, 2024
Includes:
  - Basic refactoring of applications-table.tsx
  - Add radash as a dependency for future use

Pre-work for #1985

---------

Signed-off-by: Scott J Dickerson <[email protected]>
Copy link

@dymurray dymurray left a comment

Choose a reason for hiding this comment

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

I just want to add my approval that I have tested the UI changes in my minikube instance with latest images and can verify the functionality.

Assuming tests are passing I am good to merge

sjd78 added a commit that referenced this pull request Jul 1, 2024
Align `TaskStateIcon` Icon status fields with `IconedStatus`.

This amounts to setting some icons blue instead of black consistently
across tables and the drawer.

Related to #1985

Signed-off-by: Scott J Dickerson <[email protected]>
On the application table's name column, add a status
icon.  The icon summarizes the status of the various
kinds of tasks attached to an application (a single
application has 0 or more tasks while a task acts
on a single application).

The icon will be driven off looking at the most recent
task (by `createTime`) per `kind` for an application:
  - If there are no tasks, show the application in No Tasks state
  - Else if any are "running", show the application in Running
  - Else if any are "queued", show the application in Queued state
  - Else if any are "failed", show the application as Failed
  - Else if any are "canceled", show the application as Canceled
  - Else if any are "succeeded", show the application as Success

A popover on hover will render on the application name
column to display summary information about the application's
tasks.  The popover will have a table that shows the most recent
tasks for each kind of task associated to the application.
  - Task id
  - Task status icon with the task kind
  - How long ago the task was started/created (exact
    time in a tooltip)

Changes:
  - Created `useDecoratedApplications()` hook to run all calculations
    and cross-referencing necessary to render most of the table.

  - Created `ColumnApplicationName` to handle the application name
    column with the status icon and popover.

  - Refactored `useFetchTasks()` hook to only do a simple sort. The
    filtering based on kind is no longer necessary.

  - The base `ApplicationsTable` received some basic refactoring to:
    - group like function together
    - utilize the `DecoratedApplication`

Signed-off-by: Scott J Dickerson <[email protected]>
addon?: string;
kind?: string;
}
export const TaskStates = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

follow-up candidate:

  1. enforce types at least on the "value" part (TaskState[])
  2. the keys are named almost like task state but there are differences that may cause bugs

client/src/app/queries/tasks.ts Show resolved Hide resolved
@rszwajko
Copy link
Collaborator

rszwajko commented Jul 1, 2024

@sjd78
feedback from my smoke tests:

  1. when there are no tasks we could skip the table (see below)
  2. tooltip positioning on larger screen (see below)
  3. seems you fixed [BUG] Application names are not sorted in multi select filter #1772 !
  4. not a bug but feels strange - tooltip is technically part of the row so clicking inside (i.e. by accident because you missed the link) opens a drawer
    image

sjd78 added 4 commits July 1, 2024 14:25
The tasks status looks better being calculated in
the hook than in the component.  Moved it there
and readjusted the component.  Now the summarized
tasks status is available everywhere a
`DecoratedApplication` is used.

Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78
Copy link
Member Author

sjd78 commented Jul 1, 2024

@sjd78 feedback from my smoke tests:

  1. when there are no tasks we could skip the table (see below)

Done!

  1. tooltip positioning on larger screen (see below)

Not much to do about that since the popover wraps IconWithLabel and that will automatically expand the component to fill the space.

  1. seems you fixed [BUG] Application names are not sorted in multi select filter #1772 !

👍

  1. not a bug but feels strange - tooltip is technically part of the row so clicking inside (i.e. by accident because you missed the link) opens a drawer

I'm not worried about that one right now but good to think about in the near future.

@rszwajko rszwajko self-requested a review July 1, 2024 19:51
Copy link
Collaborator

@rszwajko rszwajko left a comment

Choose a reason for hiding this comment

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

LGTM

@JustinXHale
Copy link
Member

@sjd78 this looks great!

@dymurray
Copy link

dymurray commented Jul 2, 2024

Making executive decision to merge in favor of cutting the new alpha, will be fixing the tests tomorrow, thanks @sjd78 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants