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 21, 2025
2 parents 6bce186 + 4859d13 commit 77fffb4
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 5 deletions.
7 changes: 7 additions & 0 deletions examples/fe-fpm-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sap-ux/fe-fpm-cli

## 0.0.66

### Patch Changes

- Updated dependencies [0c37c3d]
- @sap-ux/fe-fpm-writer@0.33.6

## 0.0.65

### 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.65",
"version": "0.0.66",
"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
6 changes: 6 additions & 0 deletions examples/simple-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sap-ux/generator-simple-fe

## 1.0.138

### Patch Changes

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

## 1.0.137

### 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.137",
"version": "1.0.138",
"description": "Simple example of a yeoman generator for Fiori elements.",
"license": "Apache-2.0",
"private": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/fe-fpm-writer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sap-ux/fe-fpm-writer

## 0.33.6

### Patch Changes

- 0c37c3d: Added support for 'showClearButton', 'showMessages', and 'liveMode' properties in FilterBar building block generation.

## 0.33.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/fe-fpm-writer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/fe-fpm-writer",
"description": "SAP Fiori elements flexible programming model writer",
"version": "0.33.5",
"version": "0.33.6",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
18 changes: 18 additions & 0 deletions packages/fe-fpm-writer/src/building-block/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,24 @@ export interface FilterBar extends BuildingBlock {
* This event is fired when the Go button is pressed or after a condition change.
*/
search?: string;
/**
* If true, the search is triggered automatically when a filter value is changed.
*
* @default false
*/
liveMode?: boolean;
/**
* Handles the visibility of the 'Clear' button on the FilterBar.
*
* @default false
*/
showClearButton?: boolean;
/**
* Displays possible errors during the search in a message box.
*
* @default true
*/
showMessages?: boolean;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
metaPath="<%- data.metaPath %>"<% } %><% if (data.contextPath) { %>
contextPath="<%- data.contextPath %>"<% } %><% if (data.search) { %>
search="<%- data.search %>"<% } %><% if (data.filterChanged) { %>
filterChanged="<%- data.filterChanged %>"<% } %>
filterChanged="<%- data.filterChanged %>"<% } %><% if (data.liveMode !== undefined) { %>
liveMode="<%- data.liveMode %>"<% } %><% if (data.showClearButton !== undefined) { %>
showClearButton="<%- data.showClearButton %>"<% } %><% if (data.showMessages !== undefined) { %>
showMessages="<%- data.showMessages %>"<% } %>
/>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ Object {
}
`;

exports[`Building Blocks FilterBar properties: filterbar-properties 1`] = `
"<mvc:View xmlns:core=\\"sap.ui.core\\" xmlns:mvc=\\"sap.ui.core.mvc\\" xmlns=\\"sap.m\\" xmlns:html=\\"http://www.w3.org/1999/xhtml\\" controllerName=\\"com.test.myApp.ext.main.Main\\" xmlns:macros=\\"sap.fe.macros\\">
<Page title=\\"Main\\">
<content>
<macros:FilterBar id=\\"testFilterBar\\" search=\\"onSearch\\" filterChanged=\\"onFilterChanged\\" liveMode=\\"true\\" showClearButton=\\"false\\" showMessages=\\"true\\"/>
</content>
</Page>
</mvc:View>"
`;
exports[`Building Blocks Generate with just ID and xml view without macros namespace generate chart building block: generate-chart-with-id-no-macros-ns 1`] = `
Object {
"generate-chart-with-id-no-macros-ns/webapp/ext/main/Main.view.xml": Object {
Expand Down
28 changes: 28 additions & 0 deletions packages/fe-fpm-writer/test/unit/building-block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,34 @@ describe('Building Blocks', () => {
expect(testFS.read(join(basePath, xmlViewFilePath))).toMatchSnapshot();
});

test('FilterBar properties', async () => {
const aggregationPath = `/mvc:View/*[local-name()='Page']/*[local-name()='content']`;
const basePath = join(__dirname, 'sample/building-block/filterbar-properties');
const testXmlViewFilePath = join(basePath, xmlViewFilePath);
fs.write(join(basePath, manifestFilePath), JSON.stringify(testManifestContent));
fs.write(testXmlViewFilePath, testXmlViewContent);

await generateBuildingBlock<FilterBar>(
basePath,
{
viewOrFragmentPath: xmlViewFilePath,
aggregationPath: aggregationPath,
buildingBlockData: {
id: 'testFilterBar',
buildingBlockType: BuildingBlockType.FilterBar,
filterChanged: 'onFilterChanged',
search: 'onSearch',
liveMode: true,
showClearButton: false,
showMessages: true
}
},
fs
);
expect(fs.read(testXmlViewFilePath)).toMatchSnapshot('filterbar-properties');
await writeFilesForDebugging(fs);
});

describe('Generate with just ID and xml view without macros namespace', () => {
const testInput = [
{
Expand Down
7 changes: 7 additions & 0 deletions packages/fiori-elements-writer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sap-ux/fiori-elements-writer

## 2.1.17

### Patch Changes

- Updated dependencies [0c37c3d]
- @sap-ux/fe-fpm-writer@0.33.6

## 2.1.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori-elements-writer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/fiori-elements-writer",
"description": "SAP Fiori elements application writer",
"version": "2.1.16",
"version": "2.1.17",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down

0 comments on commit 77fffb4

Please sign in to comment.