Skip to content

Commit f3d09fd

Browse files
authored
Merge branch 'main' into fix/manifest_generation
2 parents 5f7aae9 + 4859d13 commit f3d09fd

File tree

12 files changed

+90
-5
lines changed

12 files changed

+90
-5
lines changed

examples/fe-fpm-cli/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @sap-ux/fe-fpm-cli
22

3+
## 0.0.66
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0c37c3d]
8+
- @sap-ux/fe-fpm-writer@0.33.6
9+
310
## 0.0.65
411

512
### Patch Changes

examples/fe-fpm-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sap-ux/fe-fpm-cli",
3-
"version": "0.0.65",
3+
"version": "0.0.66",
44
"description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.",
55
"license": "Apache-2.0",
66
"private": true,

examples/simple-generator/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @sap-ux/generator-simple-fe
22

3+
## 1.0.138
4+
5+
### Patch Changes
6+
7+
- @sap-ux/fiori-elements-writer@2.1.17
8+
39
## 1.0.137
410

511
### Patch Changes

examples/simple-generator/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sap-ux/generator-simple-fe",
3-
"version": "1.0.137",
3+
"version": "1.0.138",
44
"description": "Simple example of a yeoman generator for Fiori elements.",
55
"license": "Apache-2.0",
66
"private": true,

packages/fe-fpm-writer/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @sap-ux/fe-fpm-writer
22

3+
## 0.33.6
4+
5+
### Patch Changes
6+
7+
- 0c37c3d: Added support for 'showClearButton', 'showMessages', and 'liveMode' properties in FilterBar building block generation.
8+
39
## 0.33.5
410

511
### Patch Changes

packages/fe-fpm-writer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sap-ux/fe-fpm-writer",
33
"description": "SAP Fiori elements flexible programming model writer",
4-
"version": "0.33.5",
4+
"version": "0.33.6",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/SAP/open-ux-tools.git",

packages/fe-fpm-writer/src/building-block/types.ts

+18
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,24 @@ export interface FilterBar extends BuildingBlock {
137137
* This event is fired when the Go button is pressed or after a condition change.
138138
*/
139139
search?: string;
140+
/**
141+
* If true, the search is triggered automatically when a filter value is changed.
142+
*
143+
* @default false
144+
*/
145+
liveMode?: boolean;
146+
/**
147+
* Handles the visibility of the 'Clear' button on the FilterBar.
148+
*
149+
* @default false
150+
*/
151+
showClearButton?: boolean;
152+
/**
153+
* Displays possible errors during the search in a message box.
154+
*
155+
* @default true
156+
*/
157+
showMessages?: boolean;
140158
}
141159

142160
/**

packages/fe-fpm-writer/templates/building-block/filter-bar/View.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
metaPath="<%- data.metaPath %>"<% } %><% if (data.contextPath) { %>
44
contextPath="<%- data.contextPath %>"<% } %><% if (data.search) { %>
55
search="<%- data.search %>"<% } %><% if (data.filterChanged) { %>
6-
filterChanged="<%- data.filterChanged %>"<% } %>
6+
filterChanged="<%- data.filterChanged %>"<% } %><% if (data.liveMode !== undefined) { %>
7+
liveMode="<%- data.liveMode %>"<% } %><% if (data.showClearButton !== undefined) { %>
8+
showClearButton="<%- data.showClearButton %>"<% } %><% if (data.showMessages !== undefined) { %>
9+
showMessages="<%- data.showMessages %>"<% } %>
710
/>

packages/fe-fpm-writer/test/unit/__snapshots__/building-block.test.ts.snap

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ Object {
2828
}
2929
`;
3030

31+
exports[`Building Blocks FilterBar properties: filterbar-properties 1`] = `
32+
"<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\\">
33+
<Page title=\\"Main\\">
34+
<content>
35+
<macros:FilterBar id=\\"testFilterBar\\" search=\\"onSearch\\" filterChanged=\\"onFilterChanged\\" liveMode=\\"true\\" showClearButton=\\"false\\" showMessages=\\"true\\"/>
36+
</content>
37+
</Page>
38+
</mvc:View>"
39+
`;
40+
3141
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`] = `
3242
Object {
3343
"generate-chart-with-id-no-macros-ns/webapp/ext/main/Main.view.xml": Object {

packages/fe-fpm-writer/test/unit/building-block.test.ts

+28
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,34 @@ describe('Building Blocks', () => {
262262
expect(testFS.read(join(basePath, xmlViewFilePath))).toMatchSnapshot();
263263
});
264264

265+
test('FilterBar properties', async () => {
266+
const aggregationPath = `/mvc:View/*[local-name()='Page']/*[local-name()='content']`;
267+
const basePath = join(__dirname, 'sample/building-block/filterbar-properties');
268+
const testXmlViewFilePath = join(basePath, xmlViewFilePath);
269+
fs.write(join(basePath, manifestFilePath), JSON.stringify(testManifestContent));
270+
fs.write(testXmlViewFilePath, testXmlViewContent);
271+
272+
await generateBuildingBlock<FilterBar>(
273+
basePath,
274+
{
275+
viewOrFragmentPath: xmlViewFilePath,
276+
aggregationPath: aggregationPath,
277+
buildingBlockData: {
278+
id: 'testFilterBar',
279+
buildingBlockType: BuildingBlockType.FilterBar,
280+
filterChanged: 'onFilterChanged',
281+
search: 'onSearch',
282+
liveMode: true,
283+
showClearButton: false,
284+
showMessages: true
285+
}
286+
},
287+
fs
288+
);
289+
expect(fs.read(testXmlViewFilePath)).toMatchSnapshot('filterbar-properties');
290+
await writeFilesForDebugging(fs);
291+
});
292+
265293
describe('Generate with just ID and xml view without macros namespace', () => {
266294
const testInput = [
267295
{

packages/fiori-elements-writer/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @sap-ux/fiori-elements-writer
22

3+
## 2.1.17
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0c37c3d]
8+
- @sap-ux/fe-fpm-writer@0.33.6
9+
310
## 2.1.16
411

512
### Patch Changes

packages/fiori-elements-writer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sap-ux/fiori-elements-writer",
33
"description": "SAP Fiori elements application writer",
4-
"version": "2.1.16",
4+
"version": "2.1.17",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/SAP/open-ux-tools.git",

0 commit comments

Comments
 (0)