-
Notifications
You must be signed in to change notification settings - Fork 29
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
RHSTOR-6195: Bucket - list page #1598
base: master
Are you sure you want to change the base?
RHSTOR-6195: Bucket - list page #1598
Conversation
@GowthamShanmugam: This pull request references RHSTOR-6195 which is a valid jira issue. 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 NOT APPROVED This pull-request has been approved by: GowthamShanmugam The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
03573e8
to
8adf721
Compare
@GowthamShanmugam: This pull request references RHSTOR-6195 which is a valid jira issue. 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. |
8adf721
to
a3a6edf
Compare
Signed-off-by: Gowtham Shanmugasundaram <[email protected]>
a3a6edf
to
8b665ba
Compare
@GowthamShanmugam: This pull request references RHSTOR-6195 which is a valid jira issue. 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. |
@GowthamShanmugam: The following test 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. |
"No buckets found": "No buckets found", | ||
"Create bucket": "Create bucket", | ||
"Create and manage your buckets": "Create and manage your buckets", | ||
"Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.": "Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.", |
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.
not in phase 1
"Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.": "Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.", | |
"Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects.": "Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects.", |
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.
ack
@@ -1331,6 +1337,10 @@ | |||
"No resources available": "No resources available", | |||
"Select {{resourceLabel}}": "Select {{resourceLabel}}", | |||
"Error Loading": "Error Loading", | |||
"Loading Empty Page": "Loading Empty Page", |
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.
or it should be capital only ??
"Loading Empty Page": "Loading Empty Page", | |
"Loading empty page": "Loading Empty Page", |
no need for extra "bucket" directory here: Also, IIRC that's what we decided, cc @alfonsomthd to keep me honest. |
const [buckets, filteredData, onFilterChange] = useListPageFilter( | ||
convertS3ListBucketOutputToK8sCompatible(data) | ||
); | ||
const [favorites, setFavorites] = useUserSettings<BucketFavoritesType>( |
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.
useUserSettings
first stores items in a ConfigMap then as a fallback to a local-storage...
for our use case there can be 100s of buckets (probably 1000), so might be too much info for a single CM ??
should we use useUserSettingsLocalStorage
only ??
cc @GowthamShanmugam @bipuladh @alfonsomthd wdyt ?
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.
The data stored in a ConfigMap cannot exceed 1 MiB. Provided that even 1000 buckets (max buckets an accoun can have) do not reach that threshold, then it's a matter of consensus. Otherwise we should definitely not store it in a ConfigMap.
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.
it's a global CM (shared by OCP and all its dynamic plugins), lot other things are stored there...
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.
also, in future when we support more accounts we definitely will have to revert to local storage way only... because CM is still global...
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.
it's a global CM (shared by OCP and all its dynamic plugins), lot other things are stored there...
Then definitely it's not a safe place to store that 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.
Ok! I thought the bucket count wouldn't cross more than 200, so I decided to use the same configMap. And the user won't select all 200 as fav.
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.
But local storage will be a terrible user experience, The user will see different fav in different browsers. And what is they selected 500 buckets as fav and other browser displays nothing
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.
make sense !!
let's confirm with OCP team on what they think.
Also, @GowthamShanmugam just a reminder that on a bucket deletion, we need to update this CM/LocalStorage as well.
noobaaS3.listBuckets() | ||
); | ||
const [buckets, filteredData, onFilterChange] = useListPageFilter( | ||
convertS3ListBucketOutputToK8sCompatible(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.
nits: name too long:P
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.
ya
type BucketFavoritesType = { | ||
[key in string]: boolean; | ||
}; |
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.
better to have a Set
with all the buckets which are marked as favourite...
no need to store the once which are false...
true | ||
); | ||
|
||
const isLoadeddWOAnyError = !isLoading && !error; |
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.
const isLoadeddWOAnyError = !isLoading && !error; | |
const isLoadedWOAnyError = !isLoading && !error; |
const { Name: name, CreationDate: creationDate } = bucket.apiResponse; | ||
const { favorites, setFavorites }: RowExtraPropsType = extraProps; | ||
|
||
const onSetFavorite = React.useCallback( |
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.
no need for useCallback
...
onFavorite
ref below is already changing on re-render, saving onSetFavorite
won't do any good...
@@ -67,6 +71,7 @@ export const ComposableTable: ComposableTableProps = < | |||
translate={null} | |||
aria-label="Composable table" | |||
className="pf-v5-u-mt-md" | |||
variant={isCompact ? TableVariant.compact : null} |
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.
totally optional comment:
variant={isCompact ? TableVariant.compact : null} | |
{...(isCompact ? {variant: ableVariant.compact} : {})} |
}, | ||
"flags": { | ||
"required": ["MCG"] |
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.
no need to remove this IMO...
why are we removing this ??
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.
ok! i accidently removed this
{ | ||
"type": "odf.horizontalNav/tab", | ||
"properties": { | ||
"id": "objectbuckets", | ||
"name": "%plugin__odf-console~Object Buckets%", | ||
"contextId": "odf-object-service", | ||
"after": "namespace-store", | ||
"href": "objectbucket.io~v1alpha1~ObjectBucket", | ||
"component": { | ||
"$codeRef": "ob.ObjectBucketListPage" | ||
} | ||
}, | ||
"flags": { | ||
"required": ["MCG"] | ||
} | ||
}, |
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.
we still need it for non-mcg-standalone deployments...
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.
only time we don't need is for mcg-standalone specifically...
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.
Do you mean this one: https://github.com/red-hat-storage/odf-console/blob/master/plugins/odf/console-extensions.json#L607?
I still keeping the RGW case
@@ -20,21 +24,66 @@ const COUNT_PER_PAGE_NUMBER = 10; | |||
export type PaginatedListPageProps = { | |||
countPerPage?: number; | |||
filteredData: K8sResourceCommon[]; | |||
CreateButton: React.FC<unknown>; |
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.
it's a shared
component, do we really need to change the name ??
need to check the impact (if any) on Fusion side, if we are planning a rename...
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.
No problem. for now, I will keep the name CreateButton. I renamed this to make this paginated component generic to create any kind of list page between MCO and ODF.
https://issues.redhat.com/browse/RHSTOR-6195
ToDo bucket sync button after merging: #1591