Skip to content

Commit

Permalink
Merge branch 'main' into 2821/add-cap-mta-prompting
Browse files Browse the repository at this point in the history
  • Loading branch information
longieirl authored Feb 7, 2025
2 parents f697d27 + 1baff46 commit 5ac258b
Show file tree
Hide file tree
Showing 184 changed files with 4,600 additions and 637 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-carrots-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sap-ux/fiori-elements-writer': patch
---

Add error handling to fiori elements writer while generating annotations
54 changes: 52 additions & 2 deletions docs/version-overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,29 @@ This document lists the version overrides for vulnerable (nested) dependencies a
## @ui5/cli -> @ui5/server -> router

- waiting on UI5 fixes to be released
- may be necessary to upgrade to version 4 of the UI5 cli
- may be necessary to upgrade to version 4 of the UI5 cli when switching up to node 20

```
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high │ Unpatched `path-to-regexp` ReDoS in 0.1.x │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package │ path-to-regexp │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ <0.1.12 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions │ >=0.1.12 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths │ packages\jest-environment-ui5 > @ui5/cli@3.8.0 > │
│ │ @ui5/server@3.1.5 > router@1.3.8 > │
│ │ path-to-regexp@0.1.7 │
│ │ │
│ │ packages\preview-middleware-client > @ui5/cli@3.8.0 > │
│ │ @ui5/server@3.1.5 > router@1.3.8 > │
│ │ path-to-regexp@0.1.7 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info │ https://github.com/advisories/GHSA-rhx6-c78j-4q9w │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high │ path-to-regexp outputs backtracking regular │
│ │ expressions │
├─────────────────────┼────────────────────────────────────────────────────────┤
Expand All @@ -18,10 +37,41 @@ This document lists the version overrides for vulnerable (nested) dependencies a
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions │ >=0.1.10 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths │ packages\preview-middleware-client > @ui5/cli@3.8.0 > │
│ Paths │ packages\jest-environment-ui5 > @ui5/cli@3.8.0 > │
│ │ @ui5/server@3.1.5 > router@1.3.8 > │
│ │ path-to-regexp@0.1.7 │
│ │ │
│ │ packages\preview-middleware-client > @ui5/cli@3.8.0 > │
│ │ @ui5/server@3.1.5 > router@1.3.8 > │
│ │ path-to-regexp@0.1.7 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info │ https://github.com/advisories/GHSA-9wv6-86v2-598j │
└─────────────────────┴────────────────────────────────────────────────────────┘
```

## @storybook/addons@7.6.20 -> @storybook/manager-api@7.6.20 -> store2

- need to wait for storybook modules updates
- major storybook version upgrade may be required

```
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ moderate │ Cross Site Scripting vulnerability in store2 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package │ store2 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ <2.14.4 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions │ >=2.14.4 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths │ examples\ui-prompting-examples > │
│ │ @storybook/addons@7.6.20 > │
│ │ @storybook/manager-api@7.6.20 > store2@2.14.2 │
│ │ │
│ │ packages\ui-prompting > @storybook/addons@7.6.20 > │
│ │ @storybook/manager-api@7.6.20 > store2@2.14.2 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info │ https://github.com/advisories/GHSA-w5hq-hm5m-4548 │
└─────────────────────┴────────────────────────────────────────────────────────┘
```
13 changes: 13 additions & 0 deletions examples/fe-fpm-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @sap-ux/fe-fpm-cli

## 0.0.60

### Patch Changes

- Updated dependencies [aaaf046]
- @sap-ux/fe-fpm-writer@0.33.0

## 0.0.59

### Patch Changes

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

## 0.0.58

### 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.58",
"version": "0.0.60",
"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
8 changes: 8 additions & 0 deletions examples/odata-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @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
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.4",
"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
33 changes: 33 additions & 0 deletions examples/simple-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# @sap-ux/generator-simple-fe

## 1.0.125

### Patch Changes

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

## 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
Expand Down
4 changes: 2 additions & 2 deletions 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.121",
"version": "1.0.125",
"description": "Simple example of a yeoman generator for Fiori elements.",
"license": "Apache-2.0",
"private": true,
Expand Down Expand Up @@ -29,7 +29,7 @@
"@types/yeoman-generator": "5.2.11",
"@sap-ux/ui5-application-writer": "workspace:*",
"@sap-ux/odata-service-writer": "workspace:*",
"axios": "1.7.4"
"axios": "1.7.9"
},
"files": [
"generators",
Expand Down
8 changes: 8 additions & 0 deletions examples/ui-prompting-examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @sap-ux-private/ui-prompting-examples

## 0.2.29

### Patch Changes

- 59453ba: fix(security): security findings from github
- Updated dependencies [59453ba]
- @sap-ux/ui-prompting@0.3.15

## 0.2.28

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions examples/ui-prompting-examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux-private/ui-prompting-examples",
"version": "0.2.28",
"version": "0.2.29",
"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 Expand Up @@ -38,7 +38,7 @@
"@sap-ux/fe-fpm-writer": "workspace:*",
"@sap-ux/i18n": "workspace:*",
"@sap-ux/project-access": "workspace:*",
"@storybook/addons": "7.6.17",
"@storybook/addons": "7.6.20",
"@storybook/components": "8.4.2",
"@storybook/react": "8.4.2",
"@storybook/react-webpack5": "8.4.2",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"packageManager": "pnpm@8.14.0",
"pnpm": {
"overrides": {
"router>path-to-regexp": "0.1.10",
"cross-spawn": "7.0.5"
"router>path-to-regexp": "0.1.12",
"@storybook/manager-api>store2": "2.14.4"
}
}
}
26 changes: 26 additions & 0 deletions packages/abap-deploy-config-inquirer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @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
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.9",
"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 5ac258b

Please sign in to comment.