Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bundle_templates_p1
Browse files Browse the repository at this point in the history
* origin/main: (38 commits)
  chore: apply latest changesets
  feat: Refactor and enhance Launch Configuration Logic for debugging generated apps in @sap-ux/launch-config (#2274)
  chore: apply latest changesets
  fix(ui5-proxy-middleware): refactoring of directLoad implementation (#2319)
  chore: apply latest changesets
  fix(cpe): outline tree scroll bar (#2283)
  chore: apply latest changesets
  feat: quick actions (#2142)
  chore: apply latest changesets
  feat(fe-fpm-writer): apply context path to a building block based on min ui5 version (#2312)
  chore: apply latest changesets
  fix(abap-deploy-config-inquirer ): remove inquirer package (#2318)
  chore: apply latest changesets
  fix(cf-deploy-config-writer): refactor hasUI5CliV3 to project-access for common reuse (#2313)
  chore: apply latest changesets
  fix(abap-deploy-config-inquirer ): add missing dependencies (#2314)
  chore: apply latest changesets
  fix(odata-service-inquirer): #2309 fix for annotations not retrieved using service url prompt (#2310)
  chore: apply latest changesets
  fix: adjustment of the color of chevron on selection (#2303)
  ...
  • Loading branch information
devinea committed Sep 5, 2024
2 parents 6e5f7d0 + 5fb7617 commit 98e46c5
Show file tree
Hide file tree
Showing 256 changed files with 8,480 additions and 1,114 deletions.
26 changes: 26 additions & 0 deletions examples/fe-fpm-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @sap-ux/fe-fpm-cli

## 0.0.19

### Patch Changes

- Updated dependencies [177cdc8]
- @sap-ux/fe-fpm-writer@0.29.0

## 0.0.18

### Patch Changes

- @sap-ux/fe-fpm-writer@0.28.3

## 0.0.17

### Patch Changes

- @sap-ux/fe-fpm-writer@0.28.2

## 0.0.16

### Patch Changes

- Updated dependencies [b10e3fd]
- @sap-ux/fe-fpm-writer@0.28.1

## 0.0.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/fe-fpm-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/fe-fpm-cli",
"version": "0.0.15",
"version": "0.0.19",
"description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.",
"license": "Apache-2.0",
"private": true,
Expand Down
24 changes: 24 additions & 0 deletions examples/prompting-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @sap-ux/fe-fpm-writer-ui

## 0.0.10

### Patch Changes

- Updated dependencies [ea0674c]
- @sap-ux/ui-components@1.17.9
- @sap-ux/ui-prompting@0.1.8

## 0.0.9

### Patch Changes

- Updated dependencies [b124873]
- @sap-ux/ui-components@1.17.8
- @sap-ux/ui-prompting@0.1.7

## 0.0.8

### Patch Changes

- Updated dependencies [73f905f]
- @sap-ux/ui-components@1.17.7
- @sap-ux/ui-prompting@0.1.6

## 0.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/prompting-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/prompting-ui",
"version": "0.0.7",
"version": "0.0.10",
"description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.",
"license": "Apache-2.0",
"private": true,
Expand Down
38 changes: 38 additions & 0 deletions examples/simple-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# @sap-ux/generator-simple-fe

## 1.0.39

### Patch Changes

- @sap-ux/fiori-elements-writer@1.1.14

## 1.0.38

### Patch Changes

- @sap-ux/fiori-elements-writer@1.1.13
- @sap-ux/fiori-freestyle-writer@1.0.22
- @sap-ux/axios-extension@1.16.5
- @sap-ux/system-access@0.5.10

## 1.0.37

### Patch Changes

- @sap-ux/axios-extension@1.16.5
- @sap-ux/system-access@0.5.10
- @sap-ux/fiori-elements-writer@1.1.12
- @sap-ux/fiori-freestyle-writer@1.0.21

## 1.0.36

### Patch Changes

- Updated dependencies [8cfd71a]
- @sap-ux/fiori-elements-writer@1.1.11
- @sap-ux/fiori-freestyle-writer@1.0.20

## 1.0.35

### Patch Changes

- @sap-ux/fiori-elements-writer@1.1.10

## 1.0.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/generator-simple-fe",
"version": "1.0.34",
"version": "1.0.39",
"description": "Simple example of a yeoman generator for Fiori elements.",
"license": "Apache-2.0",
"private": true,
Expand Down
34 changes: 34 additions & 0 deletions packages/abap-deploy-config-inquirer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# @sap-ux/abap-deploy-config-inquirer

## 0.0.12

### Patch Changes

- 40ce4ca: remove inquirer package

## 0.0.11

### Patch Changes

- @sap-ux/axios-extension@1.16.5
- @sap-ux/fiori-generator-shared@0.3.19
- @sap-ux/system-access@0.5.10

## 0.0.10

### Patch Changes

- 7926d8c: Add missing dependencies

## 0.0.9

### Patch Changes

- 99d7394: adds create command add deploy-config

## 0.0.8

### Patch Changes

- @sap-ux/axios-extension@1.16.5
- @sap-ux/fiori-generator-shared@0.3.18
- @sap-ux/system-access@0.5.10

## 0.0.7

### Patch Changes
Expand Down
9 changes: 5 additions & 4 deletions packages/abap-deploy-config-inquirer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "https://github.com/SAP/open-ux-tools.git",
"directory": "packages/abap-deploy-config-inquirer"
},
"version": "0.0.7",
"version": "0.0.12",
"license": "Apache-2.0",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -38,11 +38,12 @@
"@sap-ux/store": "workspace:*",
"@sap-ux/system-access": "workspace:*",
"@sap-ux/ui5-config": "workspace:*",
"i18next": "23.5.1"
"i18next": "23.5.1",
"@sap-devx/yeoman-ui-types": "1.14.4",
"inquirer-autocomplete-prompt": "2.0.1"
},
"devDependencies": {
"@types/inquirer": "8.2.6",
"@types/inquirer-autocomplete-prompt": "2.0.1",
"@sap-devx/yeoman-ui-types": "1.14.4"
"@types/inquirer-autocomplete-prompt": "2.0.1"
}
}
6 changes: 2 additions & 4 deletions packages/abap-deploy-config-inquirer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ async function prompt(
const abapDeployConfigPrompts = (await getPrompts(promptOptions, logger, isYUI)).prompts;
const answers = await adapter.prompt<AbapDeployConfigAnswersInternal>(abapDeployConfigPrompts);

// Add dervied service answers to the answers object
Object.assign(answers, PromptState.abapDeployConfig);

return reconcileAnswers(answers);
return reconcileAnswers(answers, PromptState.abapDeployConfig);
}

export {
getPrompts,
prompt,
reconcileAnswers,
TargetSystemType,
PackageInputChoices,
TransportChoices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ function defaultOrShowPackageQuestion(): boolean {
* @returns boolean
*/
export function showPackageInputChoiceQuestion(useAutocomplete = false): boolean {
// Only show the input choice (manual/search) when the autocomplete option is true, the prompt is supported; CLI or YUI specific version
return Boolean((!PromptState.isYUI || useAutocomplete) && defaultOrShowPackageQuestion());
if (!useAutocomplete) {
return false;
}
const isPromptSupported = !PromptState.isYUI || (PromptState.isYUI && useAutocomplete);
return isPromptSupported && defaultOrShowPackageQuestion();
}

/**
Expand All @@ -202,7 +205,6 @@ export function defaultOrShowManualPackageQuestion(
packageInputChoice?: string,
useAutocomplete = false
): boolean {
// Until the version of YUI installed supports auto-complete we must continue to show a manual input for packages
return (
(!isCli || packageInputChoice === PackageInputChoices.EnterManualChoice || !useAutocomplete) &&
defaultOrShowPackageQuestion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function getDestinationPrompt(
name: abapDeployConfigInternalPromptNames.destination,
message: t('prompts.target.destination.message'),
guiOptions: {
mandatory: true,
breadcrumb: true
},
default: (): string | undefined => backendTarget?.abapTarget?.destination,
Expand Down Expand Up @@ -97,6 +98,7 @@ function getTargetSystemPrompt(
name: abapDeployConfigInternalPromptNames.targetSystem,
message: t('prompts.target.targetSystem.message'),
guiOptions: {
mandatory: true,
breadcrumb: t('prompts.target.targetSystem.breadcrumb')
},
choices: (): AbapSystemChoice[] => choices,
Expand Down Expand Up @@ -199,7 +201,7 @@ function getClientChoicePrompt(

if (!PromptState.isYUI) {
prompts.push({
when: async (answers: AbapDeployConfigAnswersInternal): Promise<boolean> => {
when: (answers: AbapDeployConfigAnswersInternal): boolean => {
const clientChoice = answers[abapDeployConfigInternalPromptNames.clientChoice];
if (clientChoice) {
validateClientChoiceQuestion(clientChoice as ClientChoiceValue, backendTarget?.abapTarget?.client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getPackagePrompts(options: AbapDeployConfigPromptOptions): Quest
let morePackageResultsMsg = '';
const isCli = !PromptState.isYUI;

const questions: Question[] = [
const questions: Question<AbapDeployConfigAnswersInternal>[] = [
{
when: (): boolean => showPackageInputChoiceQuestion(options.useAutocomplete),
type: 'list',
Expand Down Expand Up @@ -71,7 +71,7 @@ export function getPackagePrompts(options: AbapDeployConfigPromptOptions): Quest
},
type: 'input',
name: abapDeployConfigInternalPromptNames.packageCliExecution
},
} as InputQuestion<AbapDeployConfigAnswersInternal>,
{
when: (previousAnswers: AbapDeployConfigAnswersInternal): boolean =>
defaultOrShowManualPackageQuestion(isCli, previousAnswers.packageInputChoice, options.useAutocomplete),
Expand Down
14 changes: 9 additions & 5 deletions packages/abap-deploy-config-inquirer/src/prompts/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,26 @@ export function validateDestinationQuestion(destination: string, destinations?:
* @param props.client - client
* @param props.isS4HC - is S/4HANA Cloud
* @param props.scp - is SCP
* @param props.target - target system
*/
function updatePromptState({
url,
client,
isS4HC,
scp
scp,
target
}: {
url: string;
client?: string;
isS4HC?: boolean;
scp?: boolean;
target?: string;
}): void {
PromptState.abapDeployConfig.url = url;
PromptState.abapDeployConfig.client = client;
PromptState.abapDeployConfig.isS4HC = isS4HC;
PromptState.abapDeployConfig.scp = scp;
PromptState.abapDeployConfig.targetSystem = target;
}

/**
Expand Down Expand Up @@ -104,7 +108,8 @@ export function validateTargetSystem(target?: string, choices?: AbapSystemChoice
url: choice.value,
client: choice.client ?? '',
scp: choice.scp,
isS4HC: choice.isS4HC
isS4HC: choice.isS4HC,
target: target
});
}
}
Expand Down Expand Up @@ -419,7 +424,7 @@ async function handleCreateNewTransportChoice(
const description = `For ABAP repository ${previousAnswers?.ui5AbapRepo?.toUpperCase()}, created by SAP Fiori Tools`;
PromptState.transportAnswers.newTransportNumber = await createTransportNumber(
{
packageName: getPackageAnswer(previousAnswers),
packageName: getPackageAnswer(previousAnswers, PromptState.abapDeployConfig.package),
ui5AppName: previousAnswers?.ui5AbapRepo ?? '',
description: description.length > 60 ? description.slice(0, 57) + '...' : description
},
Expand Down Expand Up @@ -486,7 +491,7 @@ export async function validateTransportChoiceInput(
prevTransportInputChoice?: TransportChoices,
backendTarget?: BackendTarget
): Promise<boolean | string> {
const packageAnswer = getPackageAnswer(previousAnswers);
const packageAnswer = getPackageAnswer(previousAnswers, PromptState.abapDeployConfig.package);
const systemConfig: SystemConfig = {
url: PromptState.abapDeployConfig.url,
client: PromptState.abapDeployConfig.client,
Expand All @@ -500,7 +505,6 @@ export async function validateTransportChoiceInput(
case TransportChoices.CreateNewChoice: {
return handleCreateNewTransportChoice(
packageAnswer,

systemConfig,
input,
previousAnswers,
Expand Down
4 changes: 2 additions & 2 deletions packages/abap-deploy-config-inquirer/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ export interface TransportAnswers {
}

export interface AbapDeployConfigAnswers {
url: string;
destination?: string;
targetSystem?: string;
url?: string;
client?: string;
scp?: boolean;
ui5AbapRepo?: string;
description?: string;
package?: string;
package: string;
transport?: string;
index?: boolean;
overwrite?: boolean;
Expand Down
Loading

0 comments on commit 98e46c5

Please sign in to comment.