forked from SAP-samples/teched2022-DT181
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"2.2 Table Building Block": { | ||
"scope": "cds", | ||
"prefix": "#teched", | ||
"body": [",\n UI.LineItem : [\n {\n $Type : 'UI.DataField',\n Value : TravelID,\n },\n {\n $Type : 'UI.DataField',\n Value : TravelStatus_code,\n Criticality : TravelStatus.criticality,\n },\n {\n $Type : 'UI.DataField',\n Value : BeginDate,\n },\n {\n $Type : 'UI.DataField',\n Value : EndDate,\n },\n {\n $Type : 'UI.DataField',\n Value : to_Agency_AgencyID,\n },\n {\n $Type : 'UI.DataField',\n Value : to_Customer_CustomerID,\n },\n {\n $Type : 'UI.DataField',\n Value : TotalPrice,\n },\n {\n $Type : 'UI.DataFieldForAction',\n Label : '{i18n>AcceptTravel}',\n Action : 'TravelService.acceptTravel',\n },\n {\n $Type : 'UI.DataFieldForAction',\n Label : '{i18n>RejectTravel}',\n Action : 'TravelService.rejectTravel',\n },\n ]"] | ||
}, | ||
"3.1 Dynamic Page Layout": { | ||
"scope": "xml", | ||
"prefix": "#teched", | ||
"body": [" <f:DynamicPage id=\"FilterBarDefault\" class=\"sapUiResponsiveContentPadding\">\n <f:title>\n <f:DynamicPageTitle id=\"_IDGenDynamicPageTitle1\">\n <f:heading>\n <Title id=\"_IDGenTitle1\" text=\"Travel\" level=\"H2\" />\n </f:heading>\n <f:snappedContent>\n <Panel headerText=\"{i18n>FilterStatus}\">\n <Text text=\"{fbConditions>/filtersTextInfo}\" class=\"sapUiTinyMargin\" />\n </Panel>\n </f:snappedContent>\n </f:DynamicPageTitle>\n </f:title>\n <f:header>\n <f:DynamicPageHeader id=\"_IDGenDynamicPageHeader1\" pinnable=\"true\">\n <VBox id=\"_IDGenVBox1\">\n <macros:FilterBar \n metaPath=\"@com.sap.vocabularies.UI.v1.SelectionFields\" \n id=\"FilterBar\" \n filterChanged=\".handlers.onFiltersChanged\" />\n </VBox>\n </f:DynamicPageHeader>\n </f:header>\n <f:content>\n <macros:Table \n id=\"myTable\" \n filterBar=\"FilterBar\" \n metaPath=\"@com.sap.vocabularies.UI.v1.LineItem\" />\n </f:content>\n </f:DynamicPage>"] | ||
}, | ||
"3.2.1 onAfterRendering": { | ||
"scope": "javascript,typescript", | ||
"prefix": "#teched", | ||
"body": [" onAfterRendering: function (oEvent) {\n var oView = this.getView();\n var mFBConditions = new JSONModel({\n filtersTextInfo: oView.byId(\"FilterBar\").getActiveFiltersText()\n });\n oView.setModel(mFBConditions, \"fbConditions\");\n },"] | ||
}, | ||
"3.2.2 onFiltersChanged": { | ||
"scope": "javascript,typescript", | ||
"prefix": "#teched", | ||
"body": [" handlers: {\n onFiltersChanged: function (oEvent) {\n var oSource = oEvent.getSource();\n var mFBConditions = oSource.getModel(\"fbConditions\");\n mFBConditions.setProperty(\"/filtersTextInfo\", oSource.getActiveFiltersText());\n } \n }"] | ||
}, | ||
"3.3.1 i18n.properties": { | ||
"scope": "properties", | ||
"prefix": "#teched", | ||
"body": ["HighestPrice=Open Travels Highest Total Price (Thousands)\nFilterStatus=Table Filter Status"] | ||
}, | ||
"3.3.2 f:snappedContent": { | ||
"scope": "xml", | ||
"prefix": "#teched", | ||
"body": ["<Panel id='pn1' headerText='{i18n>HighestPrice}'>\n <VBox id='vb1'>\n <HeaderContainer scrollStep=\"200\" showDividers=\"false\" id=\"container1\" content=\"{\n path:'/Travel', \n parameters : {\n $filter : 'TravelStatus_code eq 'O' and IsActiveEntity eq false or SiblingEntity/IsActiveEntity eq null',\n $orderby : 'TotalPrice desc'\n }\n }\">\n <GenericTile id='gt1' header=\"Travel {TravelID}\" subheader=\"{Description}\" press=\".handlers.onPressed\" class=\"sapUiTinyMarginTop tileLayout\">\n <TileContent id='tc1' unit=\"{CurrencyCode_code}\" footer=\"{to_Customer/LastName}\">\n <NumericContent id='nc1' withMargin=\"false\" value=\"{TotalPrice}\" valueColor=\"Good\" scale=\"k\" />\n </TileContent>\n </GenericTile>\n </HeaderContainer>\n </VBox>\n</Panel>\n<Panel id='pn2' headerText=\"{i18n>FilterStatus}\">\n <Text id='filterInfo1' text=\"{fbConditions>/filtersTextInfo}\" class=\"sapUiTinyMargin\" />\n</Panel>"] | ||
}, | ||
"3.3.3 onPressed": { | ||
"scope": "javascript,typescript", | ||
"prefix": "#teched", | ||
"body": [",\nonPressed: function (oEvent) {\n var oContext = oEvent.getSource().getBindingContext();\n this.routing.navigate(oContext);\n}"] | ||
}, | ||
"6.3 CustomSection.fragment.xml": { | ||
"scope": "xml", | ||
"prefix": "#teched", | ||
"body": ["<core:FragmentDefinition\n xmlns:core='sap.ui.core'\n xmlns='sap.m'\n xmlns:l='sap.ui.layout'\n xmlns:macros='sap.fe.macros'\n>\n<VBox core:require=\"{handler: 'sap/fe/cap/managetravels/ext/fragment/CustomSection'}\"> \n <MessageStrip\n text='All bookings for travel {TravelID} got confirmed by the agency.'\n showIcon='true'\n class='sapUiSmallMarginBottom'>\n </MessageStrip> \n <l:Grid hSpacing='1' containerQuery='true'\n defaultSpan='L12 M12 S12'>\n <l:content>\n <macros:Table metaPath='to_Booking/@com.sap.vocabularies.UI.v1.LineItem'\n id='bookingTable'/>\n </l:content>\n </l:Grid>\n</VBox>\n</core:FragmentDefinition>"] | ||
}, | ||
"7.3.1 l:dependents": { | ||
"scope": "xml", | ||
"prefix": "#teched", | ||
"body": [" <l:dependents>\n <core:Fragment fragmentName=\"sap.fe.cap.managetravels.ext.fragment.Popover\" type=\"XML\"/> \n </l:dependents> "] | ||
}, | ||
"7.3.2 CustomSection.js": { | ||
"scope": "javascript,typescript", | ||
"prefix": "#teched", | ||
"body": ["sap.ui.define([\"sap/ui/model/json/JSONModel\"], function (JSONModel) {\n \"use strict\";\n return {\n onChartSelectionChanged: function (oEvent) {\n var oView = this.editFlow.getView();\n var oPopupModel = oView.getModel(\"popup\");\n var oPopover = oEvent.getSource().getParent().getDependents()[0]; \n if (oEvent.getParameter(\"selected\")) {\n if (!oPopupModel) {\n oPopupModel = new JSONModel();\n oView.setModel(oPopupModel, \"popup\");\n }\n oPopupModel.setData(oEvent.getParameter(\"data\")[0].data, true);\n // open popover at selected chart segment\n oPopover.openBy(\n oEvent.getParameter(\"data\")[0].target\n );\n }\n }\n };\n});"] | ||
}, | ||
"8.1 editFlow onBeforeSave": { | ||
"scope": "javascript,typescript", | ||
"prefix": "#teched", | ||
"body": [",\neditFlow: {\n onBeforeSave: function() {\n //Check on green flights\n if (!this.getView().getBindingContext().getProperty('GoGreen')){ \n return new Promise(async function(fnResolve, fnReject) {\n var mSettings = {\n id: "myFragment",\n name: "sap.fe.cap.managetravels.ext.fragment.Trees4Tickets",\n controller: this.base.getView().getController(),\n contextPath: "/Travel",\n initialBindingContext: this.getView().getBindingContext()\n }\n var oApproveDialog = await this.base.getExtensionAPI().loadFragment(mSettings);\n oApproveDialog.setBindingContext(this.getView().getBindingContext());\n let buttons = oApproveDialog.getButtons();\n let saveButton = buttons.find(obj => obj.sId === "myFragment--Save");\n saveButton.attachPress(function() {\n oApproveDialog.close();\n oApproveDialog.destroy(); \n fnResolve(); }.bind(this));\n\n let cancelButton = buttons.find(obj => obj.sId === "myFragment--Cancel");\n cancelButton.attachPress(function() {\n oApproveDialog.close(); \n oApproveDialog.destroy(); \n fnReject(); }.bind(this));\n oApproveDialog.open();\n }.bind(this));\n } \n }\n}"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters