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 'Create Bucket' form (via S3-compat API) #1608

Merged

Conversation

alfonsomthd
Copy link
Collaborator

Screenshot from 2024-10-03 09-26-09
Screenshot from 2024-10-03 09-26-26

packages/odf/components/mcg/CreateObjectBucketClaim.tsx Outdated Show resolved Hide resolved
packages/shared/src/s3/commands.ts Outdated Show resolved Hide resolved
<div className="col-xs-1 co-empty__header" />
</div>
{pairElems}
{hideHeaderWhenNoItems && _.isEmpty(pairElems) ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

we are already passing hideHeaderWhenNoItems, why not add _.isEmpty(pairElems) condition is the same as well ??

const hideHeaderWhenNoItems = _.isEmpty(pairElems) && OTHER_CONDITIONS; and pass hideHeaderWhenNoItems as a prop.

Copy link
Collaborator

Choose a reason for hiding this comment

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

_.isEmpty(pairElems) will only execute anyway when hideHeaderWhenNoItems is true...

Copy link
Collaborator

Choose a reason for hiding this comment

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

^ optional comment...

Copy link
Collaborator Author

@alfonsomthd alfonsomthd Oct 3, 2024

Choose a reason for hiding this comment

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

_.isEmpty(pairElems) will only execute anyway when hideHeaderWhenNoItems is true...

That's intended: The intention is not to alter the current behavior: so i added a new flag (hideHeaderWhenNoItems) for the new behavior and isEmpty is the condition to check on the new behavior: it's been tested and it works as intended.

@SanjalKatiyar
Copy link
Collaborator

SanjalKatiyar commented Oct 3, 2024

Screenshot from 2024-10-03 09-26-09

Isn't the selected tile supposed to get expanded (with blue line on bottom) ?? Here looks like when "S3" option is selected, tile is shrinking instead, do we need some CSS fix ??
Maybe I am wrong, just confirming both "OBC" and "S3" tiles have similar look 'n' feel when selected. If that's the case we are good, u can ignore this comment.

@alfonsomthd
Copy link
Collaborator Author

Screenshot from 2024-10-03 09-26-09

Isn't the selected tile supposed to get expanded (with blue line on bottom) ?? Here looks like when "S3" option is selected, tile is shrinking instead, do we need some CSS fix ?? Maybe I am wrong, just confirming both "OBC" and "S3" tiles have similar look 'n' feel when selected. If that's the case we are good, u can ignore this comment.

The behavior is the PF one:

@SanjalKatiyar
Copy link
Collaborator

/lgtm

Copy link
Contributor

openshift-ci bot commented Oct 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alfonsomthd, SanjalKatiyar

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:
  • OWNERS [SanjalKatiyar,alfonsomthd]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 2c5dfc0 into red-hat-storage:master Oct 3, 2024
5 checks passed
@alfonsomthd alfonsomthd deleted the bucket-create branch October 4, 2024 08:50
@@ -1,5 +1,7 @@
import * as React from 'react';
import { CreateOBC } from '@odf/core/components/mcg/CreateObjectBucketClaim';
import CreateBucketForm from '@odf/core/components/s3-browser/create-bucket/CreateBucketForm';
Copy link
Contributor

Choose a reason for hiding this comment

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

no issues in this import, it just looks very longer than './create-bucket/CreateBucketForm';
it just need an import from its own directory

Copy link
Contributor

Choose a reason for hiding this comment

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

i can see all the files have following similar way of import, so its ok to skip this comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IMHO we should favor absolute imports (vscode intellisense does it) vs relative imports due to the confusion created by the relative path hell ('../../../../../../../../../../../oh-my.ts')

@@ -1,5 +1,7 @@
import * as React from 'react';
import { CreateOBC } from '@odf/core/components/mcg/CreateObjectBucketClaim';
import CreateBucketForm from '@odf/core/components/s3-browser/create-bucket/CreateBucketForm';
import { NoobaaS3Provider } from '@odf/core/components/s3-browser/noobaa-context';
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

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

Successfully merging this pull request may close these issues.

3 participants