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: remove show done message if no files are generated #846

Merged
merged 2 commits into from
Aug 18, 2024

Conversation

alex-gilin
Copy link
Contributor

@alex-gilin alex-gilin commented Jul 21, 2024

Implements: #844

Additional logic to check if no files generated and targetPath is null,
doGeneratorDone empty string passed for message. No pop-up.

Copy link
Collaborator

@martinjanus-sap martinjanus-sap left a comment

Choose a reason for hiding this comment

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

Approach verified and tested with UI Service Generator:

No longer containing The files have been generated message when there are no files generated:

image

Thanks @alex-gilin

@martinjanus-sap
Copy link
Collaborator

martinjanus-sap commented Jul 22, 2024

Further testing:

Issue, not displaying pop-up in BAS when generating and path is /home/user/ ?

VSCODE:

  • Ui Service Gen ✅:
    image

  • Fiori Gen through App Wizard ✅:
    image

  • Fiori Gen through command Palette ✅:
    image

  • Fiori: Open Reusable Library Generator ✅:
    image

  • Fiori: Add Reference to SAP Fiori Reusable Libraries ❓:
    no popup - but I think this is expected, as no files are generated.

  • Fiori: Add Deployment Configuration: ❓
    no popup - although ui5-deploy.yaml is generated within project folder.

BAS:

  • Fiori Gen through command Palette - /home/user/projects/: ✅
    image

  • Fiori Gen through command palette - /home/user/
    no pop-up

  • Fiori Gen through App Wizard - /home/user/projects/
    image

  • Fiori: Open Reusable Library Generator ✅:
    image

  • Fiori: Add Reference to SAP Fiori Reusable Libraries ❓:
    no popup - but I think this is expected, as no files are generated.

  • Fiori: Add Deployment Configuration: ❓
    no popup - although ui5-deploy.yaml is generated within project folder.

  • Fiori Ui Service Generator: ✅
    image

When running Fiori Generator on path /home/user/ in BAS, home directory in BAS is set as home/user/projects -
Relevant code:
https://github.com/SAP/yeoman-ui/blob/master/packages/backend/src/utils/constants.ts#L8
https://github.com/SAP/yeoman-ui/blob/master/packages/backend/src/yeomanui.ts#L354-L362
https://github.com/SAP/yeoman-ui/blob/master/packages/backend/src/yeomanui.ts#L203
Since targetFolder in SBAS is always set to home/user/projects , the logic comparing files generated before and after if it is not in home/user/projects will be 0 and pop-up message is not shown

@alex-gilin
Copy link
Contributor Author

Further testing:

Issue, not displaying pop-up in BAS when generating and path is /home/user/ ?

VSCODE:

  • Ui Service Gen ✅:
    image
  • Fiori Gen through App Wizard ✅:
    image
  • Fiori Gen through command Palette ✅:
    image
  • Fiori: Open Reusable Library Generator ✅:
    image

BAS:

  • Fiori Gen through command Palette - /home/user/projects/: ✅
    image
  • Fiori Gen through command palette - /home/user/
    no pop-up

When running Fiori Generator on path /home/user/ in BAS, home directory in BAS is set as home/user/projects - Relevant code: https://github.com/SAP/yeoman-ui/blob/master/packages/backend/src/utils/constants.ts#L8 https://github.com/SAP/yeoman-ui/blob/master/packages/backend/src/yeomanui.ts#L354-L362 https://github.com/SAP/yeoman-ui/blob/master/packages/backend/src/yeomanui.ts#L203 Since targetFolder in SBAS is always set to home/user/projects , the logic comparing files generated before and after if it is not in home/user/projects will be 0 and pop-up message is not shown

YUI is not guess to the specific execution details of individual generators, as this information is internal to each generator's logic. BAS does provide best practice guidelines that specify a default target directory for generator output. It's worth noting that users can easily modify this parameter through the ApplicationWizard.TargetFolder setting. In my opinion, if a user chooses not to follow the BAS recommendations, it doesn't pose a significant issue.

@alex-gilin alex-gilin merged commit eed513e into master Aug 18, 2024
4 checks passed
@alex-gilin alex-gilin deleted the no-success-message branch August 18, 2024 09:03
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.

2 participants