Skip to content

Commit

Permalink
[FIX] Component: class-based model check to support language parameters
Browse files Browse the repository at this point in the history
- Introduces a class based model check
- Instead of string based type checks, the Component now makes sure a models
class is loaded before compiling the model's constructor settings
- This allows to pass sap-language parameter to v2 and v4 $metadata

PS06: requireSync for ODataUtils removed
PS07: Update Jira and BCP references, rebase
PS08: Implement solution for BCP incident, adapt commit message
PS09: Fixed Models.qunit, added sap-language param
PS10: Adapt OD V4 tests with sap-language param
PS11: Add missing language param for annotation URIs
PS12: Rebase

Change-Id: I6048a5381e3a3ed4fbd460761d19d5d3b92b604f
BCP: 2170145239
BCP: 2180369275
JIRA: CPOUI5FRAMEWORK-252
JIRA: CPOUI5MODELS-700
  • Loading branch information
Thodd committed Sep 21, 2021
1 parent 6489920 commit 2183384
Show file tree
Hide file tree
Showing 16 changed files with 273 additions and 170 deletions.
329 changes: 209 additions & 120 deletions src/sap.ui.core/src/sap/ui/core/Component.js

Large diffs are not rendered by default.

Expand Up @@ -13,7 +13,7 @@ sap.ui.define([
// Note: DO NOT reuse the same source file with a different $top if that leads to a short read!
var oMockData = {
mFixture : {
"$metadata" : {
"$metadata?sap-language=EN" : {
source : "metadata.xml"
},
"BusinessPartners?$apply=concat(aggregate(SalesAmountLocalCurrency,LocalCurrency),groupby((Country_Code,Country),aggregate(SalesAmountLocalCurrency,LocalCurrency))/orderby(Country%20desc)/concat(aggregate($count%20as%20UI5__count),top(4)))" : {
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata" : {
"$metadata?sap-language=EN" : {
source : "metadata.xml"
},
"ContactList(42010aef-0de5-1eea-af8f-5bce865f0879)?$select=ContactGUID,EmailAddress,FirstName,LastName" : {
Expand Down
Expand Up @@ -13,7 +13,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata" : {
"$metadata?sap-language=EN" : {
source : "metadata.xml"
},
"SalesOrderList?$count=true&$filter=SalesOrderID%20ge%20'0500000000'%20and%20LifecycleStatus%20eq%20'N'&$select=CurrencyCode,GrossAmount,Note,SalesOrderID&$expand=SO_2_BP($select=BusinessPartnerID,CompanyName)&$skip=0&$top=5" : {
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata?custom-option=value" : {
"$metadata?custom-option=value&sap-language=EN" : {
source : "metadata.xml"
},
"SalesOrderList?custom-option=value&$select=BuyerID,SalesOrderID&$expand=SO_2_BP($select=BusinessPartnerID,CompanyName)&$skip=0&$top=5" : {
Expand Down
Expand Up @@ -21,9 +21,9 @@ sap.ui.define([
"GetEmployeeMaxAge()" : {
message : {"value" : 56}
},
"$metadata" : {source : "metadata.xml"},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_product/0001/$metadata" : {source : "metadata_product.xml"},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_supplier/0001/$metadata" : {source : "metadata_supplier.xml"},
"$metadata?sap-language=EN" : {source : "metadata.xml"},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_product/0001/$metadata?sap-language=EN" : {source : "metadata_product.xml"},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_supplier/0001/$metadata?sap-language=EN" : {source : "metadata_supplier.xml"},
"TEAMS?$expand=TEAM_2_EMPLOYEES($expand=EMPLOYEE_2_EQUIPMENTS($expand=EQUIPMENT_2_PRODUCT($expand=PRODUCT_2_CATEGORY,PRODUCT_2_SUPPLIER));$orderby=LOCATION/City/CITYNAME),TEAM_2_MANAGER&$skip=0&$top=100" : {
source : "TEAMS.json"
},
Expand Down
Expand Up @@ -13,11 +13,11 @@ sap.ui.define([
var oMockData = {
mFixture : {
"localAnnotations.xml" : {source : "localAnnotations.xml"},
"$metadata" : {source : "metadata.xml"},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_product/0001/$metadata" : {
"$metadata?sap-language=EN" : {source : "metadata.xml"},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_product/0001/$metadata?sap-language=EN" : {
source : "metadata_product.xml"
},
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_supplier/0001/$metadata" : {
"/sap/opu/odata4/IWBEP/TEA/default/iwbep/tea_busi_supplier/0001/$metadata?sap-language=EN" : {
source : "metadata_supplier.xml"
},
"Equipments?$select=Category,EmployeeId,ID,Name&$expand=EQUIPMENT_2_PRODUCT($select=ID,Name;$expand=PRODUCT_2_CATEGORY($select=CategoryIdentifier,CategoryName),PRODUCT_2_SUPPLIER($select=SUPPLIER_ID,Supplier_Name))&$skip=0&$top=5" : {
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata?custom-option=value" : {
"$metadata?custom-option=value&sap-language=EN" : {
source : "metadata.xml"
},
"/sap/opu/odata4/sap/zui5_testv4/default/iwbep/common/0001/$metadata" : {
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata" : {
"$metadata?sap-language=EN" : {
source : "metadataV2.xml"
},
"SEPM_C_SLSORDER_TP_100?$inlinecount=allpages&$expand=to_Item&$filter=SalesOrder%20ge%20'500000000'&$select=Customer,OverallStatus,SalesOrder,SalesOrderUUID,to_Item/GrossAmount,to_Item/Product,to_Item/SalesOrder,to_Item/SalesOrderItem,to_Item/SalesOrderItemUUID,to_Item/SalesOrderUUID&$skip=0&$top=5" : {
Expand Down
Expand Up @@ -12,10 +12,10 @@ sap.ui.define([

var oMockData = {
mFixture : {
"/sap/opu/odata4/sap/sepm_odata_ref/sadl/sap/sepm_c_slsorder_tp_100/0001/$metadata" : {
"/sap/opu/odata4/sap/sepm_odata_ref/sadl/sap/sepm_c_slsorder_tp_100/0001/$metadata?sap-language=EN" : {
source : "metadataV4.xml"
},
"/sap/opu/odata4/sap/sepm_odata_ref/sadl/sap/sepm_c_slsorderitem_tp_100/0001/$metadata" : {
"/sap/opu/odata4/sap/sepm_odata_ref/sadl/sap/sepm_c_slsorderitem_tp_100/0001/$metadata?sap-language=EN" : {
source : "metadataV4_item.xml"
},
"SEPM_C_SLSORDER_TP_100?$count=true&$expand=_Item($select=GrossAmount,Product,SalesOrder,SalesOrderItem,SalesOrderItemUUID,SalesOrderUUID)&$select=Customer,OverallStatus,SalesOrder,SalesOrderUUID&$skip=0&$top=5" : {
Expand Down
Expand Up @@ -14,7 +14,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata?custom-option=value" : {source : "metadata.xml"},
"$metadata?custom-option=value&sap-language=EN" : {source : "metadata.xml"},
"BusinessPartnerList?custom-option=value&$orderby=CompanyName&$filter=BusinessPartnerRole%20eq%20'01'&$select=BusinessPartnerID,CompanyName&$skip=0&$top=100" : {
source : "BusinessPartnerList.json"
},
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata" : {source : "metadata.xml"},
"$metadata?sap-language=EN" : {source : "metadata.xml"},
"BusinessPartnerList?$skip=0&$top=5" : {source : "BusinessPartnerList.json"},
"/sap/opu/odata4/sap/zui5_testv4/f4/sap/h_tcurc-sh/0001;ps=%27default-zui5_epm_sample-0002%27;va=%27com.sap.gateway.default.zui5_epm_sample.v0002.ET-BUSINESSPARTNER.CURRENCY_CODE%27/$metadata"
: {source : "metadata_tcurc.xml"},
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata?custom-option=value" : {
"$metadata?custom-option=value&sap-language=EN" : {
source : "metadata.xml"
},
"BusinessPartnerList?custom-option=value&$filter=BusinessPartnerID%20lt%20'0100000030'&$select=BusinessPartnerID,CompanyName&$skip=0&$top=21" : {
Expand Down
Expand Up @@ -12,7 +12,7 @@ sap.ui.define([

var oMockData = {
mFixture : {
"$metadata" : {
"$metadata?sap-language=EN" : {
source : "metadata.xml"
},
"GET Sticky?$count=true&$select=Content,Id&$skip=0&$top=5" : {
Expand Down

0 comments on commit 2183384

Please sign in to comment.