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

2128/confirm prompt validator not invoked as expected #2378

Merged
merged 26 commits into from
Oct 31, 2024

Conversation

longieirl
Copy link
Contributor

@longieirl longieirl commented Sep 17, 2024

Fix for #2128

  • The confirm SCP prompt has a validator method attached which is not invoked for all flows i.e. CLI and YUI, refer to inquirer API. However, the abap-inq was written as if this validator was invoked for both YUI and CLI. This PR removes the validator method and ensures the scp prompt state is maintained correctly by adding a scp setter prompt to handle both flows, CLI and YUI.
  • If the user selects a SAP system, the client prompt will no longer be shown, this causes issues with the connectivity flow if the user tries to switch client ID's as then the saved system properties will not be used
  • Tests added
  • Validated locally on VSC and on BAS

Example1;

ui5.yaml

        backend:
          - scp: true
            path: /sap
            url: https://example.ondemand.com

Prompts;

Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Select Target system abap-05 (BTP) [tester@example]
? SAPUI5 ABAP Repository (ZTEST) 

Example2;

ui5.yaml

        backend:
          - scp: false
            path: /sap
            url: https://example.ondemand.com
            client: 300

Prompts;

Adding deploy-config to the project.
info Add:Deploy-config Using: @sap/fiori:deploy-config
? Select Target system abap-05 (BTP) [[email protected]]
? SAPUI5 ABAP Repository (ZTEST) 

Example3;

Prompts;

info Add:Deploy-config Using: @sap/fiori:deploy-config
? Select Target system Enter Target System URL
? Target System URL https://example.net.sap:44300
? Is this an SAP Business Technology Platform system? Yes
? SAPUI5 ABAP Repository (ZTEST) 

Example4;

info Add:Deploy-config Using: @sap/fiori:deploy-config
? Select Target system Enter Target System URL
? Target System URL https://example.net.sap:44300
? Is this an SAP Business Technology Platform system? No
? Client (Use arrow keys)
❯ Use project defined client 300 
  Enter client 
  Use default system client 

Example5;

info Add:Deploy-config Using: @sap/fiori:deploy-config
? Select Target system Enter Target System URL
? Target System URL https://example.devint.net.sap:44300
? Is this an SAP Business Technology Platform system? No
? Enter client 

Screenshot 2024-09-17 at 16 32 20

Screenshot 2024-09-17 at 16 32 06

Copy link

changeset-bot bot commented Sep 17, 2024

🦋 Changeset detected

Latest commit: d145a2d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@sap-ux/abap-deploy-config-inquirer Patch
@sap-ux/create Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@longieirl longieirl force-pushed the 2128/confirm-validator-not-invoked branch from be5a3dd to 0fdd6b4 Compare September 17, 2024 13:43
@longieirl longieirl force-pushed the 2128/confirm-validator-not-invoked branch from b64bd12 to 0e0aa15 Compare September 17, 2024 14:37
@longieirl longieirl force-pushed the 2128/confirm-validator-not-invoked branch from 7ddbb0a to b244201 Compare September 17, 2024 16:31
@longieirl longieirl marked this pull request as ready for review September 18, 2024 08:27
@longieirl longieirl changed the title 2128/confirm validator not invoked 2128/confirm prompt validator not invoked as expected Sep 18, 2024
cianmSAP
cianmSAP previously approved these changes Sep 18, 2024
Copy link
Contributor

@cianmSAP cianmSAP left a comment

Choose a reason for hiding this comment

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

Update looks good
Not manually tested
Tests to cover
Changeset ✅

@longieirl longieirl self-assigned this Sep 25, 2024
@longieirl longieirl force-pushed the 2128/confirm-validator-not-invoked branch from 1f18bc2 to 55782f8 Compare October 8, 2024 10:36
Copy link
Contributor

@cianmSAP cianmSAP left a comment

Choose a reason for hiding this comment

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

Re-approving

Copy link
Contributor

@IainSAP IainSAP left a comment

Choose a reason for hiding this comment

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

Thanks @longieirl

  • Understandability of the client prompt condition could be clearer but defer to the author
  • Tests updated

Copy link

sonarcloud bot commented Oct 31, 2024

@longieirl longieirl merged commit d69070a into main Oct 31, 2024
13 checks passed
@longieirl longieirl deleted the 2128/confirm-validator-not-invoked branch October 31, 2024 14:59
devinea added a commit that referenced this pull request Nov 1, 2024
…e_reuse_libs

* origin/main:
  chore: apply latest changesets
  fix(ui5-info): fix fallback logic for retrieving maintained versions (#2516)
  chore: apply latest changesets
  2128/confirm prompt validator not invoked as expected (#2378)
  chore: apply latest changesets
  fix: Create Custom Table Column quick action bug fix (#2513)
  chore: apply latest changesets
  Fix: npm i after executing a create command fails on Windows (#2508)
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