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(ui): Resolves filename truncation if file contains more than one dot in Namespace Files Editor #6362

Merged
merged 11 commits into from
Dec 9, 2024

Conversation

shivam221098
Copy link
Contributor

@shivam221098 shivam221098 commented Dec 8, 2024

Closes #5956

Changes

  • A logical error was in ui/src/components/inputs/EditorSidebar.vue while parsing filename & extension from the file path.
  • Logic to parse filename & extension from file path is changed in stored in a separate function, that's then accessed wherever we have to extract the file details.
  • For removing the redundancy, a similar sort of local function separateString is replaced by the new function that contains the logic for parsing filename & extension.
  • For getting extension part of the file, .split(".")[1] is replaced with .split(".").pop() at various places.

QA

  • Uploaded a file with multiple dots test.0.0.0.0.0.0.0.txt, when the file is uploaded, it was visible with same name and when the page is reloaded, it was still with the same name.

  • Created files with multiple dots within the folder and and outside the folder, file names are visible without any changes
    image

  • Ran simple flow to verify file read operations
    image

  • Flow

id: pip_namespace_files
namespace: company.sales
inputs:
  - id: date
    type: STRING
    defaults: "12/24/2024"
    displayName: Delivery Date
tasks:
  - id: python
    type: io.kestra.plugin.scripts.python.Script
    namespaceFiles:
      enabled: true
    script: |
      with open("test/test.0.0.0.0.0.0.0.txt") as file:
        print(file.read())
      
      with open("test/test_inner/test.ef.txt") as file:
        print(file.read())
      
      with open("out.0.0.1.side.txt") as file:
        print(file.read())

@shivam221098 shivam221098 changed the title Resolves filename truncation if file contains more than one dot in Namespace Files Editor fix(ui): Resolves filename truncation if file contains more than one dot in Namespace Files Editor Dec 8, 2024
@shivam221098 shivam221098 marked this pull request as ready for review December 8, 2024 17:45
@MilosPaunovic MilosPaunovic self-requested a review December 9, 2024 07:12
@MilosPaunovic MilosPaunovic self-assigned this Dec 9, 2024
Copy link
Member

@MilosPaunovic MilosPaunovic left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@MilosPaunovic MilosPaunovic merged commit b860cd6 into kestra-io:develop Dec 9, 2024
MilosPaunovic added a commit that referenced this pull request Dec 9, 2024
#6362)

Co-authored-by: Miloš Paunović <paun992@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Namespace Files editor truncates the filename if it contains dots which are not part of the file extension
2 participants