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

FUSETOOLS2-2113 - Allows selection of folder when creating projects #1952

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

hdamarcelo
Copy link
Contributor

@hdamarcelo hdamarcelo commented Oct 5, 2024

  • Removes "enablement" for the project creation commands because we will be always choosing a folder work with.
  • Project creation commands do not depend on the workspace root anymore and can be used without one.
  • Refactor existing tests to use the additional folder selection dialog.
  • Opens a new VSCode instance in the newly created project's folder.

@hdamarcelo
Copy link
Contributor Author

Peek 2024-10-04 23-49

@hdamarcelo hdamarcelo force-pushed the FUSETOOLS2-2113 branch 3 times, most recently from 7f7f637 to 6b37f60 Compare October 5, 2024 20:22
'export',
`--runtime=${runtime}`,
`--gav=${gav}`,
`'--directory=${outputPath}'`]);
Copy link
Member

Choose a reason for hiding this comment

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

to double-check the behavior when there is something in the target folder and/or when using the current folder with various version of JBang because there were some issues in the past using this parameter fr another jbang command https://issues.apache.org/jira/browse/CAMEL-21082

Copy link
Contributor Author

@hdamarcelo hdamarcelo Oct 7, 2024

Choose a reason for hiding this comment

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

Tested more locally and issue you mentioned is only solved for the init subcomand. In this JBang task we are using camel export which cleans the contents of the folder especified in the --directory= option.

camelcomand

@hdamarcelo hdamarcelo force-pushed the FUSETOOLS2-2113 branch 3 times, most recently from ba4ee49 to 8c858e6 Compare October 8, 2024 04:20
@hdamarcelo hdamarcelo requested a review from djelinek October 22, 2024 01:37
@djelinek
Copy link
Member

could you also please share the gif with Modal asking for continue?

@hdamarcelo
Copy link
Contributor Author

could you also please share the gif with Modal asking for continue?

Peek 2024-10-24 10-07

Copy link

sonarcloud bot commented Oct 25, 2024

Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

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

  • when exporting in-place, there is the dialog "Files in the selected folder WILL BE DELETED before project creation, continue?" but it should not, this is the previous behavior that must be preserved.

Changelog.md Outdated Show resolved Hide resolved
Comment on lines +43 to +46
// Workaround for an issue during camel jbang execution in windows machines.
// Specifying the --directory option with the complete path when it is equal to the current working directory causes issues.
// Omitting the option or in this case using '.' works as expected.
Copy link
Member

Choose a reason for hiding this comment

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

please ensure that there is an issue in Camel Jira and provide the number of the issue in the comment.
it will allow to track more precisely it and in few years to know when we can drop this workaround code from the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update this comment with an issue number as soon as I report it.

src/ui-test/tests/commands.projects.test.ts Outdated Show resolved Hide resolved
src/commands/NewCamelProjectCommand.ts Outdated Show resolved Hide resolved
src/commands/NewCamelProjectCommand.ts Outdated Show resolved Hide resolved
src/commands/NewCamelProjectCommand.ts Outdated Show resolved Hide resolved
src/commands/NewCamelProjectCommand.ts Outdated Show resolved Hide resolved
@hdamarcelo hdamarcelo force-pushed the FUSETOOLS2-2113 branch 2 times, most recently from 7f04f26 to 9b96769 Compare December 3, 2024 03:29
@hdamarcelo
Copy link
Contributor Author

  • when exporting in-place, there is the dialog "Files in the selected folder WILL BE DELETED before project creation, continue?" but it should not, this is the previous behavior that must be preserved.

Added a check to only show the dialog if the selected folder is diferent from the first folder of the workspace (as it was before). The export command when ran from the same folder it outputs to (with --directory=.) does not delete files.

- Removes "enablement" for the project creation commands because we will
  be always choosing a folder work with.
- Project creation commands do not depend on the workspace root anymore
  and can be used without one.
- Refactor existing tests to use the additional folder selection dialog.
- Adds a modal to confirm the project creation since the 'camel export'
  command can clean the selected output folder.
- Opens a new VSCode instance in the newly created project's folder.

Signed-off-by: Marcelo Henrique Diniz de Araujo <[email protected]>
Copy link

sonarcloud bot commented Dec 3, 2024

@hdamarcelo hdamarcelo requested a review from apupier December 3, 2024 05:30
Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

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

Sounds fine to merge with this granularity.
2 little things:

@hdamarcelo hdamarcelo merged commit ad9c9a6 into camel-tooling:main Dec 3, 2024
20 checks passed
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.

3 participants