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

✨ Implement the Task Manager drawer #1955

Merged
merged 10 commits into from
Jun 20, 2024
Merged

✨ Implement the Task Manager drawer #1955

merged 10 commits into from
Jun 20, 2024

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Jun 12, 2024

Resolves: #1938

Add a queued tasks count badge and a task list drawer.

  • Add a TaskManagerContext to control the count indicator and visibility of the drawer. This is a top level context so the task manager is available on all pages. The context itself monitors the task queue report endpoint1 that drives the notification badge count.

  • Use the standard NotificationDrawer attached to the Page layout to render the task manager item drawer.

  • The TaskNotificationBadge is integrated to the application's HeaderApp.

  • The TaskManagerDrawer shows the list of currently "queued" tasks2 in task id descending sort order (most recently created tasks on the top).

  • Each task item is rendered in a "collapsed" state and after a click will render "expanded". The expanded state include the started timestamp.

  • Note 1: Until fetch more / infinite scroll is implemented in the task manager drawer list, only the first 20 queued tasks will be displayed.

  • Note 2: Task actions need to be added to the task items. These should reuse the same set of actions as the task table in ✨ Task table #1957.

Related changes:

  • Update the HeaderApp to handle visibility of masthead toolbar items at the ToolbarGroup level.

  • Rename SSOMenu to SsoToolbarItem.

  • Updated the typing on a few task related API functions.

Footnotes

  1. https://github.com/konveyor/tackle2-hub/issues/641

  2. https://github.com/konveyor/tackle2-hub/pull/640

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 34.59119% with 104 lines in your changes missing coverage. Please review.

Project coverage is 42.33%. Comparing base (b654645) to head (75626b5).
Report is 168 commits behind head on main.

Files Patch % Lines
.../app/components/task-manager/TaskManagerDrawer.tsx 20.83% 57 Missing ⚠️
client/src/app/layout/HeaderApp/SsoToolbarItem.tsx 29.03% 22 Missing ⚠️
...ent/src/app/layout/DefaultLayout/DefaultLayout.tsx 27.27% 7 Missing and 1 partial ⚠️
...app/components/task-manager/TaskManagerContext.tsx 50.00% 7 Missing ⚠️
client/src/app/queries/tasks.ts 45.45% 6 Missing ⚠️
client/src/app/api/rest.ts 40.00% 3 Missing ⚠️
.../components/task-manager/TaskNotificaitonBadge.tsx 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1955      +/-   ##
==========================================
+ Coverage   39.20%   42.33%   +3.13%     
==========================================
  Files         146      169      +23     
  Lines        4857     5405     +548     
  Branches     1164     1365     +201     
==========================================
+ Hits         1904     2288     +384     
- Misses       2939     3000      +61     
- Partials       14      117     +103     
Flag Coverage Δ
client 42.33% <34.59%> (+3.13%) ⬆️
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 added a commit to sjd78/tackle2-ui that referenced this pull request Jun 14, 2024
Update the `Task` interface, and related, to follow
the current definitions of Task REST resource[1] on
the hub.

Supports: konveyor#1955, konveyor#1956, konveyor#1957

[1] - https://github.com/konveyor/tackle2-hub/blob/1366d95b62ac7717826fd9f64c9e268013107008/api/task.go#L725-L748

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
@sjd78 sjd78 added this to the v0.5.0 milestone Jun 14, 2024
sjd78 added a commit to sjd78/tackle2-ui that referenced this pull request Jun 14, 2024
Update the `Task` interface, and related, to follow
the current definitions of Task REST resource[1] on
the hub.

Supports: konveyor#1955, konveyor#1956, konveyor#1957

[1] - https://github.com/konveyor/tackle2-hub/blob/1366d95b62ac7717826fd9f64c9e268013107008/api/task.go#L725-L748

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit that referenced this pull request Jun 14, 2024
Update the `Task` interface, and related, to follow the current
definitions of Task REST resource[^1] on the hub.

Supports: #1955, #1956, #1957

[^1]:
https://github.com/konveyor/tackle2-hub/blob/1366d95b62ac7717826fd9f64c9e268013107008/api/task.go#L725-L748

---------

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
@sjd78 sjd78 force-pushed the task-manager branch 3 times, most recently from 21a3798 to d8b67c0 Compare June 19, 2024 15:27
@sjd78 sjd78 marked this pull request as ready for review June 19, 2024 15:52
@sjd78 sjd78 changed the title ✨ [WIP] Implement the Task Manager drawer ✨ Implement the Task Manager drawer Jun 19, 2024
client/src/app/api/rest.ts Show resolved Hide resolved
id: task.id ?? -1,
createUser: task.createUser ?? "",
updateUser: task.updateUser ?? "",
createTime: task.createTime ?? "", // TODO: date?
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. with "flat" object approach it makes sense to pre-format the props - so I would use string-formatted dates
  2. similar logic for retrieving/formatting values is used in toCells mapper - we might won't to use common step at some point.

Copy link
Member Author

Choose a reason for hiding this comment

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

Potential future work to harmonize the display formatting of the task's fields.

Copy link
Member Author

Choose a reason for hiding this comment

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

I opened #1969 to capture this work once all the main task functions are merged.

sjd78 added 10 commits June 20, 2024 11:35
Resolves: konveyor#1938

Add a queued tasks count badge plus and item drawer.

  - Use the standard `NotificationDrawer` attached to
    the `Page` layout to render the task manager item
    drawer.

  - Add a `TaskManagerContext` to control the count indicator
    and visibility of the drawer.  This is a top level context
    so the task manager is available on all pages.

  - Add `TaskQueue` and query for the notification badge

__Still Needs__:
  - Task rows in the notification drawer
  - Infinite scroll on the task list (or at least a load more link/icon,
    maybe a visual indicator that more can be fetched on scroll or click)
  - Individual task actions

Related changes:
  - Update the `HeaderApp` to handle visibility of masthead
    toolbar items at the `ToolbarGroup` level.

  - Rename `SSOMenu` to `SsoToolbarItem`.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Task Manager drawer
2 participants