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

[ui-storagebrowser] view file content as text #3823

Merged
merged 41 commits into from
Sep 18, 2024
Merged

Conversation

ramprasadagarwal
Copy link
Collaborator

@ramprasadagarwal ramprasadagarwal commented Aug 19, 2024

What changes were proposed in this pull request?

  • View file content as text in storage browser.
  • Current, Edit API is WIP, hence the placeholder is kept for the implementation at later stage

How was this patch tested?

  • Unit tests have been added to validate the expected behaviour.

Screenshots

image image

Please review Hue Contributing Guide before opening a pull request.

@ramprasadagarwal ramprasadagarwal marked this pull request as ready for review August 20, 2024 06:33
@ramprasadagarwal ramprasadagarwal self-assigned this Aug 20, 2024
Base automatically changed from feat/code-cleanup to master August 20, 2024 16:18
Copy link
Collaborator

@nidhibhatg nidhibhatg left a comment

Choose a reason for hiding this comment

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

LGTM!

Harshg999 and others added 3 commits August 20, 2024 21:55
## What changes were proposed in this pull request?

- There was no API for getting trash path per user.
- Earlier, we were depending on a redirect from backend to the trash path but now having a dedicated API for trash path makes sense for revamping the filebrowser UX.
- This API is mainly for HDFS for now because other supported filesystems dont have a clear trash use-case concept in Hue.

## How was this patch tested?

- Manually
* [ui-core]: feat: add useFetch hook for API calls

* add the license information

* fix lint

* lint fix

* add library

* pin the library version

* revert extra changes

* revert package-lock json

* fix: rename hook

* fix the function name

* typecaste error object
Copy link
Collaborator

@bjornalm bjornalm left a comment

Choose a reason for hiding this comment

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

Nice work!

No major remarks, mostly smaller things. Have a look at BEM for class names and our internal standard for test ids.

{fileMetaData.map((row, index) => (
<div key={'meta-data-group' + index} className="group">
{row.map(item => (
<div key={item.name} className="column" data-testid="meta-data-attribute">
Copy link
Collaborator

Choose a reason for hiding this comment

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

data-testid should uniquely identify an element, here there will be multiple with meta-data-attribute, and it is a bit too generic as well. Don't be afraid to create longer ids see https://github.com/cloudera/hue/blob/master/contributing-frontend.md#adding-data-testid-attribute

Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't look like this was resolved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the final code, I have removed data-testid as it's not required anymore.

@ramprasadagarwal ramprasadagarwal enabled auto-merge (squash) September 16, 2024 17:49
Copy link
Collaborator

@bjornalm bjornalm left a comment

Choose a reason for hiding this comment

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

Really nice work, I think you got most of the feedback. Only two comments that I marked as unresolved. You have 38 commits (some well named some not), don't forget to squash once you merge.

@ramprasadagarwal ramprasadagarwal enabled auto-merge (squash) September 17, 2024 11:20
@ramprasadagarwal ramprasadagarwal merged commit 53e8d58 into master Sep 18, 2024
6 checks passed
@ramprasadagarwal ramprasadagarwal deleted the feat/view-file branch September 18, 2024 10:42
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.

4 participants