-
Notifications
You must be signed in to change notification settings - Fork 659
CONSOLE-4667: Add ResourceDataView component and related code #15375
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
base: main
Are you sure you want to change the base?
Conversation
@vojtechszocs: This pull request references CONSOLE-4667 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a07ff6e
to
a652a44
Compare
@vojtechszocs: This pull request references CONSOLE-4667 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/retest |
frontend/packages/console-app/src/components/data-view/useResourceDataViewFilters.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few observations from when I applied this code in openshift/console-crontab-plugin#45
frontend/packages/console-app/src/components/data-view/useResourceDataViewData.tsx
Outdated
Show resolved
Hide resolved
sortFunction: sort, | ||
props: { | ||
className: props.classes, | ||
sort: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This results in the actions column getting sorting functionality, which is not desired. Sorting should be optional on a per column basis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I believe sorting is broken for all but the first column, but even there the header doesn't correctly indicate the sort direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openshift/console-crontab-plugin@87da69a makes sorting optional.
Still need to troubleshoot the sorting issues in useResourceDataViewSort
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the hard-coded sortBy
object was present in the original DataView PoC code:
- CONSOLE-4529: POC PodList using DataView PF extension #14897 - file
frontend/public/components/data-view-poc/DataViewPodList.tsx
line 489 - [WIP] Data view poc #15057 - file
frontend/public/components/data-view-poc/DataViewPodList.tsx
line 513
sortBy: {
defaultDirection: SortByDirection.asc,
direction: SortByDirection.asc,
index: 0,
}
I think that fixing sorting bugs (beyond any immediate issues) can be done as a follow-up.
This PR was supposed to introduce a reusable ResourceDataView
component by refactoring and restructuring the original DataView PoC code.
a652a44
to
e1cc748
Compare
frontend/packages/console-app/src/components/data-view/useResourceDataViewData.tsx
Outdated
Show resolved
Hide resolved
includes the correct fix so the filters dropdown correctly honors |
Oye. One more change. |
It occurs to me those patches won't apply cleanly since my directory structure in the CronTab plugin doesn't match, but at least they're there. |
I think this patch should work (it should contain all the changes we discussed yesterday). |
@vojtechszocs: This pull request references CONSOLE-4667 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@vojtechszocs: This pull request references CONSOLE-4667 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
4e16c11
to
5ba41f2
Compare
PR rebased and updated, this should cover all of the immediate issues that @rhamilto found while testing |
@vojtechszocs: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
||
if (!hideNameLabelFilters && !hideLabelFilter) { | ||
basicFilters.push( | ||
<DataViewLabelFilter key="labels" filterId="label" title={t('public~Label')} data={data} />, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<DataViewLabelFilter key="labels" filterId="label" title={t('public~Label')} data={data} />, | |
<DataViewLabelFilter key="label" filterId="label" title={t('public~Label')} data={data} />, |
) : ( | ||
<StatusBox | ||
label={label} | ||
data={filteredData} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data={filteredData} | |
data={data} |
<StatusBox | ||
label={label} | ||
data={filteredData} | ||
unfilteredData={data} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfilteredData={data} |
|
||
export type ResourceFilters = { | ||
name: string; | ||
labels: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labels: string; | |
label: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to avoid a conflict with DataView, this needs to be label
.
<Tbody> | ||
<Tr> | ||
<Td colSpan={dataViewColumns.length}> | ||
<Bullseye>{t('public~No Pods found')}</Bullseye> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove Pods
from the empty state text. Ideally this will reflect the resource name, but changing to None found
is probably good enough for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Bullseye>{t('public~No Pods found')}</Bullseye> | |
<Bullseye> | |
{label ? t('public~No {{label}} found', { label }) : t('public~None found')} | |
</Bullseye> |
Plus the related i18n
diff is probably better.
This PR follows up on #14897 and #15057 by introducing a reusable
ResourceDataView
component and related code.Existing resource list tables are not modified; there will be follow-up PRs to put this component into use.
Thanks to @rhamilto for testing the new component in CronTab plugin so we can fix any immediate issues.