Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ff_tests_writer
Browse files Browse the repository at this point in the history
* origin/main: (43 commits)
  chore: apply latest changesets
  feat(abap-deploy-config-inq): option for createDuringDeploy list item (#2864)
  chore: apply latest changesets
  feat(preview-middleware):add support for type component (#2872)
  chore: apply latest changesets
  feat: introduce ADP FLP config generator (#2730)
  fix(cf-gen): fix unstable windows test (#2876)
  chore: apply latest changesets
  fix: project access dependency (#2875)
  chore: apply latest changesets
  feat(odata-service-inquirer): #2866 - Adds cf bas prompts (#2867)
  chore: apply latest changesets
  feat: add context menu for outline in cpe (#2847)
  chore: apply latest changesets
  feat(cf-gen): adds new sub generator to `@sap-ux/cf-deploy-config-sub-generator` (#2844)
  chore: apply latest changesets
  fix: Default model naming (#2862)
  chore: apply latest changesets
  correct command type for add annotation file (#2839)
  chore: apply latest changesets
  ...
  • Loading branch information
devinea committed Feb 7, 2025
2 parents e432870 + f8e5538 commit bfc72ea
Show file tree
Hide file tree
Showing 265 changed files with 9,551 additions and 695 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
retention-days: 15
- name: Run SonarCloud scan
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18.x'
uses: sonarsource/sonarcloud-github-action@master
uses: sonarsource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img src="docs/images/sap-fiori-tools.svg" width=75px align="right" alt="SAP Fiori tools icon">

# Open UX Tools

[![Build status](https://github.com/SAP/open-ux-tools/actions/workflows/pipeline.yml/badge.svg?branch=main)](https://github.com/SAP/open-ux-tools/actions/workflows/pipeline.yml?query=branch%3Amain)
Expand Down
69 changes: 69 additions & 0 deletions docs/images/sap-fiori-tools.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions examples/fe-fpm-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @sap-ux/fe-fpm-cli

## 0.0.59

### Patch Changes

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

## 0.0.58

### Patch Changes

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

## 0.0.57

### 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.57",
"version": "0.0.59",
"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
16 changes: 16 additions & 0 deletions examples/odata-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @sap-ux/odata-cli

## 0.16.5

### Patch Changes

- Updated dependencies [65f15d9]
- @sap-ux/btp-utils@1.0.1
- @sap-ux/axios-extension@1.18.5

## 0.16.4

### Patch Changes

- Updated dependencies [9980073]
- @sap-ux/btp-utils@1.0.0
- @sap-ux/axios-extension@1.18.4

## 0.16.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/odata-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/odata-cli",
"version": "0.16.3",
"version": "0.16.5",
"description": "Simple example CLI uing the @sap-ux/axios-extension module to fetch metadata and annotations from an SAP system.",
"license": "Apache-2.0",
"private": true,
Expand Down
55 changes: 55 additions & 0 deletions examples/simple-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# @sap-ux/generator-simple-fe

## 1.0.124

### Patch Changes

- @sap-ux/axios-extension@1.18.5
- @sap-ux/system-access@0.5.30
- @sap-ux/fiori-elements-writer@2.1.4
- @sap-ux/fiori-freestyle-writer@2.0.12

## 1.0.123

### Patch Changes

- @sap-ux/fiori-elements-writer@2.1.3
- @sap-ux/fiori-freestyle-writer@2.0.11

## 1.0.122

### Patch Changes

- Updated dependencies [65f15d9]
- @sap-ux/btp-utils@1.0.1
- @sap-ux/axios-extension@1.18.5
- @sap-ux/system-access@0.5.30
- @sap-ux/fiori-elements-writer@2.1.2
- @sap-ux/fiori-freestyle-writer@2.0.10

## 1.0.121

### Patch Changes

- @sap-ux/fiori-elements-writer@2.1.1
- @sap-ux/fiori-freestyle-writer@2.0.9

## 1.0.120

### Patch Changes

- Updated dependencies [c4d9d0d]
- @sap-ux/fiori-elements-writer@2.1.0
- @sap-ux/axios-extension@1.18.4
- @sap-ux/system-access@0.5.29
- @sap-ux/fiori-freestyle-writer@2.0.8

## 1.0.119

### Patch Changes

- Updated dependencies [9980073]
- @sap-ux/btp-utils@1.0.0
- @sap-ux/axios-extension@1.18.4
- @sap-ux/system-access@0.5.29
- @sap-ux/fiori-elements-writer@2.0.9
- @sap-ux/fiori-freestyle-writer@2.0.7

## 1.0.118

### 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.118",
"version": "1.0.124",
"description": "Simple example of a yeoman generator for Fiori elements.",
"license": "Apache-2.0",
"private": true,
Expand Down
46 changes: 46 additions & 0 deletions packages/abap-deploy-config-inquirer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# @sap-ux/abap-deploy-config-inquirer

## 1.2.12

### Patch Changes

- c08e1e3: Add option to hide createDuringDeploy list item in getTransportChoices

## 1.2.11

### Patch Changes

- @sap-ux/axios-extension@1.18.5
- @sap-ux/fiori-generator-shared@0.7.27
- @sap-ux/system-access@0.5.30
- @sap-ux/inquirer-common@0.6.14

## 1.2.10

### Patch Changes

- Updated dependencies [65f15d9]
- @sap-ux/btp-utils@1.0.1
- @sap-ux/axios-extension@1.18.5
- @sap-ux/fiori-generator-shared@0.7.26
- @sap-ux/inquirer-common@0.6.13
- @sap-ux/system-access@0.5.30

## 1.2.9

### Patch Changes

- @sap-ux/axios-extension@1.18.4
- @sap-ux/fiori-generator-shared@0.7.25
- @sap-ux/system-access@0.5.29
- @sap-ux/inquirer-common@0.6.12

## 1.2.8

### Patch Changes

- Updated dependencies [9980073]
- @sap-ux/btp-utils@1.0.0
- @sap-ux/axios-extension@1.18.4
- @sap-ux/fiori-generator-shared@0.7.24
- @sap-ux/inquirer-common@0.6.11
- @sap-ux/system-access@0.5.29

## 1.2.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion 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": "1.2.7",
"version": "1.2.12",
"license": "Apache-2.0",
"main": "dist/index.js",
"scripts": {
Expand Down
10 changes: 8 additions & 2 deletions packages/abap-deploy-config-inquirer/src/prompts/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ export function getPackageInputChoices(): ListChoiceOptions[] {
/**
* Returns a list of transport choices.
*
* @param showCreateDuringDeploy - show createDuringDeploy choice, defaults to true
* @returns list of transport choices
*/
export function getTransportChoices(): ListChoiceOptions[] {
export function getTransportChoices(showCreateDuringDeploy = true): ListChoiceOptions[] {
const manualChoice = {
name: t('choices.transport.enterManually'),
value: TransportChoices.EnterManualChoice
Expand All @@ -216,7 +217,12 @@ export function getTransportChoices(): ListChoiceOptions[] {
};
const createNewChoice = { name: t('choices.transport.createNew'), value: TransportChoices.CreateNewChoice };

return [manualChoice, listExistingChoice, createDuringDeployChoice, createNewChoice];
return [
manualChoice,
listExistingChoice,
...(showCreateDuringDeploy ? [createDuringDeployChoice] : []),
createNewChoice
];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function getTransportRequestPrompts(
guiOptions: {
applyDefaultWhenDirty: true
},
choices: () => getTransportChoices(),
choices: () => getTransportChoices(options.transportInputChoice?.showCreateDuringDeploy),
default: (previousAnswers: AbapDeployConfigAnswersInternal): string =>
defaultTransportRequestChoice(
previousAnswers.transportInputChoice,
Expand Down
10 changes: 9 additions & 1 deletion packages/abap-deploy-config-inquirer/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,21 @@ export type PackageAutocompletePromptOptions = PackagePromptOptions & {
useAutocomplete?: boolean;
};

export type TransportInputChoicePromptOptions = {
/**
* This options determines if createDuringDeploy option should be shown in the list of transport choices.
*/
showCreateDuringDeploy?: boolean;
};

type abapDeployConfigPromptOptions = Record<promptNames.ui5AbapRepo, UI5AbapRepoPromptOptions> &
Record<promptNames.description, DescriptionPromptOptions> &
Record<promptNames.packageManual, PackageManualPromptOptions> &
Record<promptNames.transportManual, TransportManualPromptOptions> &
Record<promptNames.overwrite, OverwritePromptOptions> &
Record<promptNames.index, IndexPromptOptions> &
Record<promptNames.packageAutocomplete, PackageAutocompletePromptOptions>;
Record<promptNames.packageAutocomplete, PackageAutocompletePromptOptions> &
Record<promptNames.transportInputChoice, TransportInputChoicePromptOptions>;

/**
* The options which are common for the abap deploy config inquirer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,42 @@ describe('getTransportRequestPrompts', () => {
}
});

test('should return expected values from transportInputChoice prompt methods', async () => {
jest.spyOn(conditions, 'showTransportInputChoice').mockReturnValueOnce(true);
jest.spyOn(validators, 'validateTransportChoiceInput').mockResolvedValueOnce(true);

const transportPrompts = getTransportRequestPrompts({
transportInputChoice: { showCreateDuringDeploy: false }
});
const transportInputChoicePrompt = transportPrompts.find(
(prompt) => prompt.name === promptNames.transportInputChoice
);

if (transportInputChoicePrompt) {
expect((transportInputChoicePrompt.when as Function)()).toBe(true);
expect(transportInputChoicePrompt.message).toBe(t('prompts.config.transport.transportInputChoice.message'));
expect(((transportInputChoicePrompt as ListQuestion).choices as Function)()).toMatchInlineSnapshot(`
Array [
Object {
"name": "Enter manually",
"value": "EnterManualChoice",
},
Object {
"name": "Choose from existing",
"value": "ListExistingChoice",
},
Object {
"name": "Create new",
"value": "CreateNewChoice",
},
]
`);

expect((transportInputChoicePrompt.default as Function)({})).toBe(TransportChoices.EnterManualChoice);
expect(await (transportInputChoicePrompt.validate as Function)()).toBe(true);
}
});

test('should return expected values from transportCliExecution prompt methods', async () => {
const validateTransportChoiceInputSpy = jest.spyOn(validators, 'validateTransportChoiceInput');

Expand Down
Loading

0 comments on commit bfc72ea

Please sign in to comment.