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

fix: use same date filter in the UI and CLI #11840

Merged
merged 4 commits into from
Sep 20, 2023

Conversation

agilgur5
Copy link
Member

@agilgur5 agilgur5 commented Sep 19, 2023

Fixes #9696 (hopefully final fix for that -- this is not a partial fix, but a holistic fix), fixes #11671
Follow-up to #11792

Motivation

Bring the UX of the CLI and the UI together and reduce a solid amount of user confusion about this

Modifications

  • UI should check against metadata.creationTimestamp and status.finishedAt, same as the CLI, not status.startedAt

    • rename minStartedAt -> createdAfter and maxStartedAt -> finishedBefore
    • modify nullSafeTimeFilter to use the same logic as the Go back-end
  • remove the default 1 month filter on the UI

    • it was different from the CLI, buggy, and caused confusion for users
    • the date filter is also entirely client-side, so the UI was just not showing Workflows it had already retrieved from the API
    • remove no longer needed date modification code as well
  • add "Created Since" and "Finished Before" as titles to the UI date filters

    • matches the CLI as well
  • fix CLI's internal name for finished to finishedBefore

    • it quite literally checks for .Before, and the flag (--older) and flag description are correct as well, so it was just named incorrectly
  • also replace unrelated deprecated usage of string.substr with string.substring

Verification

Manually tested locally:

  • No date filters (now default):
    Screenshot 2023-09-18 at 8 39 07 PM -- no dates default
  • Finished Before filter:
    Screenshot 2023-09-18 at 8 48 56 PM -- only finished before filter
  • Both date filters:
    Screenshot 2023-09-18 at 8 50 21 PM -- both filters

@agilgur5 agilgur5 added area/ui area/cli The `argo` CLI labels Sep 19, 2023
- UI should check against `metadata.creationTimestamp` and `status.finishedAt`, same as the CLI, not `status.startedAt`
  - this brings the UX of the CLI and the UI together and reduces a solid amount of user confusion about this
  - rename `minStartedAt` -> `createdAfter` and `maxStartedAt` -> `finishedBefore`
  - modify `nullSafeTimeFilter` to use the same logic as the Go back-end
- remove the default 1 month filter on the UI
  - it was different from the CLI, buggy, and caused confusion for users
  - the date filter is also [entirely client-side](https://github.com/argoproj/argo-workflows/blob/caedd0ff7ade8211039f3dc858f74cd4eb2b1818/ui/src/app/workflows/components/workflows-list/workflows-list.tsx#L268), so the UI was just not showing Workflows it had already retrieved from the API
- add "Created Since" and "Finished Before" as titles to the UI date filters
  - matches the CLI as well

- fix CLI's internal name for `finished` to `finishedBefore`
  - it quite literally checks for [`.Before`](https://github.com/argoproj/argo-workflows/blob/f5e31f8f36b32883087f783cb1227490bbe36bbd/pkg/apis/workflow/v1alpha1/workflow_types.go#L230), and the flag (`--older`) and flag description says it does correctly as well, so it was just named incorrectly

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Copy link
Member

@isubasinghe isubasinghe left a comment

Choose a reason for hiding this comment

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

Tested locally and it works well! Nice work!

@terrytangyuan terrytangyuan merged commit fa116b6 into argoproj:master Sep 20, 2023
26 checks passed
@agilgur5 agilgur5 deleted the fix-ui-date-filter branch September 20, 2023 14:15
isubasinghe pushed a commit to isubasinghe/argo-workflows that referenced this pull request Mar 12, 2024
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI area/ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI does not show all running workflows (it used to) / UI and argo list differ (missing running workflows)
3 participants