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

Create Component from Folder doesn't trim suggested name to last portion of the path on Windows #3127

Closed
datho7561 opened this issue Aug 28, 2023 · 1 comment · Fixed by #3142
Assignees
Labels
Milestone

Comments

@datho7561
Copy link
Contributor

To reproduce:

  • Use Windows
  • Open a project without a devfile as a workspace (eg. run the "Add folder to workspace" command, then select a sample project without a devfile)
  • Right click on the folder, and select "Create Component from Folder"

expected: the "component name" field is populated with the folder name

actual: the "component name" is populated with the absolute path of the folder, using a Windows-style path (with drive letter and \)

datho7561 added a commit to datho7561/vscode-openshift-tools that referenced this issue Aug 30, 2023
Fixes redhat-developer#3127

Signed-off-by: David Thompson <davidethompson@me.com>
@datho7561 datho7561 self-assigned this Aug 30, 2023
@datho7561 datho7561 added this to the 1.7.0 milestone Aug 30, 2023
@rgrunber
Copy link
Member

Speaking of component name, could we try to sanitize the initial component name for git repo imports :

initialComponentName={gitURL.url.substring(gitURL.url.lastIndexOf('/') + 1)}

so that they respect

validationMessage = OpenShiftItem.validateMatches(
`Not a valid component name.
Please use lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character`,
name,
);
. Can be included in a separate PR.

(eg. https://github.com/openshift-evangelists/Wild-West-Frontend fails validation )

datho7561 added a commit that referenced this issue Aug 31, 2023
Fixes #3127

Signed-off-by: David Thompson <davidethompson@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants