@openui5/sap.ui.core 1.116.0 → 1.117.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -22
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/Event.js +4 -4
- package/src/sap/base/Eventing.js +5 -6
- package/src/sap/base/config/MemoryConfigurationProvider.js +10 -1
- package/src/sap/base/config.js +3 -2
- package/src/sap/base/i18n/Formatting.js +30 -32
- package/src/sap/base/i18n/LanguageTag.js +2 -2
- package/src/sap/base/i18n/Localization.js +19 -20
- package/src/sap/base/i18n/date/CalendarType.js +1 -1
- package/src/sap/base/i18n/date/CalendarWeekNumbering.js +1 -1
- package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
- package/src/sap/base/util/JSTokenizer.js +1 -1
- package/src/sap/base/util/fetch.js +4 -4
- package/src/sap/base/util/mixedFetch.js +2 -2
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/base/util/syncFetch.js +2 -2
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +6 -4
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +2 -4
- package/src/sap/ui/base/ManagedObjectMetadata.js +4 -6
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +2 -2
- package/src/sap/ui/core/AnimationMode.js +1 -1
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/Component.js +1 -1
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/ConfigTest.js +17 -0
- package/src/sap/ui/core/Configuration.js +2 -14
- package/src/sap/ui/core/Control.js +4 -1
- package/src/sap/ui/core/ControlBehavior.js +2 -2
- package/src/sap/ui/core/Core.js +3 -1
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +1 -1
- package/src/sap/ui/core/ElementMetadata.js +2 -4
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/Fragment.js +1 -1
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IconPool.js +1 -2
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/Lib.js +17 -16
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +5 -2
- package/src/sap/ui/core/LocaleData.js +12 -4
- package/src/sap/ui/core/Manifest.js +5 -5
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +37 -50
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/Rendering.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/Shortcut.js +11 -9
- package/src/sap/ui/core/StaticArea.js +1 -1
- package/src/sap/ui/core/Theming.js +16 -9
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +27 -5
- package/src/sap/ui/core/_IconRegistry.js +82 -11
- package/src/sap/ui/core/boot/_bootConfig.js +137 -0
- package/src/sap/ui/core/boot/_runBoot.js +16 -0
- package/src/sap/ui/core/boot/initDOM.js +96 -0
- package/src/sap/ui/core/boot/loadCalendar.js +50 -0
- package/src/sap/ui/core/boot/loadManifest.js +55 -0
- package/src/sap/ui/core/boot/loadModules.js +80 -0
- package/src/sap/ui/core/boot/manifest.json +11 -0
- package/src/sap/ui/core/boot/onInit.js +44 -0
- package/src/sap/ui/core/boot.js +107 -0
- package/src/sap/ui/core/date/UI5Date.js +9 -3
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +13 -12
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +32 -6
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageMixin.js +6 -5
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle_ar.properties +57 -55
- package/src/sap/ui/core/messagebundle_bg.properties +57 -55
- package/src/sap/ui/core/messagebundle_ca.properties +30 -28
- package/src/sap/ui/core/messagebundle_cs.properties +43 -41
- package/src/sap/ui/core/messagebundle_cy.properties +58 -56
- package/src/sap/ui/core/messagebundle_da.properties +56 -54
- package/src/sap/ui/core/messagebundle_de.properties +58 -56
- package/src/sap/ui/core/messagebundle_el.properties +47 -45
- package/src/sap/ui/core/messagebundle_en.properties +58 -56
- package/src/sap/ui/core/messagebundle_en_GB.properties +58 -56
- package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +3 -0
- package/src/sap/ui/core/messagebundle_es.properties +47 -45
- package/src/sap/ui/core/messagebundle_es_MX.properties +57 -55
- package/src/sap/ui/core/messagebundle_et.properties +54 -52
- package/src/sap/ui/core/messagebundle_fi.properties +51 -49
- package/src/sap/ui/core/messagebundle_fr.properties +36 -34
- package/src/sap/ui/core/messagebundle_fr_CA.properties +21 -19
- package/src/sap/ui/core/messagebundle_hi.properties +42 -40
- package/src/sap/ui/core/messagebundle_hr.properties +57 -55
- package/src/sap/ui/core/messagebundle_hu.properties +58 -56
- package/src/sap/ui/core/messagebundle_id.properties +58 -56
- package/src/sap/ui/core/messagebundle_it.properties +59 -57
- package/src/sap/ui/core/messagebundle_iw.properties +58 -56
- package/src/sap/ui/core/messagebundle_ja.properties +50 -48
- package/src/sap/ui/core/messagebundle_kk.properties +43 -41
- package/src/sap/ui/core/messagebundle_ko.properties +19 -17
- package/src/sap/ui/core/messagebundle_lt.properties +58 -56
- package/src/sap/ui/core/messagebundle_lv.properties +58 -56
- package/src/sap/ui/core/messagebundle_ms.properties +58 -56
- package/src/sap/ui/core/messagebundle_nl.properties +57 -55
- package/src/sap/ui/core/messagebundle_no.properties +55 -53
- package/src/sap/ui/core/messagebundle_pl.properties +55 -53
- package/src/sap/ui/core/messagebundle_pt.properties +57 -55
- package/src/sap/ui/core/messagebundle_pt_PT.properties +57 -55
- package/src/sap/ui/core/messagebundle_ro.properties +58 -56
- package/src/sap/ui/core/messagebundle_ru.properties +57 -55
- package/src/sap/ui/core/messagebundle_sh.properties +58 -56
- package/src/sap/ui/core/messagebundle_sk.properties +57 -55
- package/src/sap/ui/core/messagebundle_sl.properties +58 -56
- package/src/sap/ui/core/messagebundle_sv.properties +54 -52
- package/src/sap/ui/core/messagebundle_th.properties +17 -15
- package/src/sap/ui/core/messagebundle_tr.properties +58 -56
- package/src/sap/ui/core/messagebundle_uk.properties +58 -56
- package/src/sap/ui/core/messagebundle_vi.properties +58 -56
- package/src/sap/ui/core/messagebundle_zh_CN.properties +58 -56
- package/src/sap/ui/core/messagebundle_zh_TW.properties +58 -56
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +14 -2
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/rules/Misc.support.js +1 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +7 -4
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/Icon.less +2 -2
- package/src/sap/ui/core/theming/Parameters.js +0 -5
- package/src/sap/ui/core/theming/ThemeManager.js +3 -4
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +4 -5
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +166 -79
- package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +4 -3
- package/src/sap/ui/model/analytics/BatchResponseCollector.js +2 -2
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +14 -27
- package/src/sap/ui/model/analytics/odata4analytics.js +6 -12
- package/src/sap/ui/model/base/ManagedObjectModel.js +2 -1
- package/src/sap/ui/model/json/JSONModel.js +6 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +191 -5
- package/src/sap/ui/model/odata/ODataMetadata.js +38 -4
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataModel.js +2 -2
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/AnnotationHelper.js +4 -4
- package/src/sap/ui/model/odata/v4/Context.js +33 -30
- package/src/sap/ui/model/odata/v4/ODataBinding.js +18 -14
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +12 -12
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +110 -43
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +20 -28
- package/src/sap/ui/model/odata/v4/ODataModel.js +40 -31
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +8 -6
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +14 -14
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +93 -9
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +25 -27
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +58 -195
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +157 -0
- package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +14 -5
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +27 -15
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/TestUtils.js +1 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +1 -3
- package/src/sap/ui/test/matchers/_Visitor.js +6 -1
- package/src/sap/ui/test/starter/_setupAndStart.js +2 -5
- package/src/sap/ui/thirdparty/qunit-2.js +9 -3
- package/src/sap/ui/util/Mobile.js +10 -6
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap-ui-boot.js +23 -6
- package/src/ui5-boot.js +50 -0
- package/src/ui5loader-autoconfig.js +147 -75
- package/src/ui5loader.js +322 -362
- package/test/sap/ui/core/Device.js +1 -1
- package/test/sap/ui/core/demokit/sample/OpaAction/applicationUnderTest/view/Main.view.xml +1 -0
- package/test/sap/ui/core/demokit/sample/ViewTemplate/types/Template.controller.js +2 -2
- package/test/sap/ui/core/demokit/sample/odata/v2/AutoExpand/AutoExpand.view.xml +24 -5
- package/test/sap/ui/core/demokit/sample/odata/v4/Ancestry/Main.view.xml +24 -6
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/DataAggregation.view.xml +20 -5
- package/test/sap/ui/core/demokit/sample/odata/v4/DataAggregation/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/DeepCreate/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/Draft/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/FieldGroups/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/FlatDataAggregation/FlatDataAggregation.view.xml +4 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/FlexibleColumnLayout/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/GridTable/GridTable.view.xml +12 -3
- package/test/sap/ui/core/demokit/sample/odata/v4/LateProperties/Main.controller.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/LateProperties/Opa.OptimisticBatch.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/LateProperties/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ListBinding/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ListBindingTemplate/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/MultipleInlineCreationRowsGrid/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/Products/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/RecursiveHierarchy/RecursiveHierarchy.view.xml +26 -8
- package/test/sap/ui/core/demokit/sample/odata/v4/RecursiveHierarchy/data/metadata.xml +4 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V2/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrderTP100_V4/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/pages/Main.js +18 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrders/tests/Create.js +10 -6
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrdersRTATest/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrdersRTATest/manifest.json +18 -0
- package/test/sap/ui/core/demokit/sample/odata/v4/SalesOrdersTemplate/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/ServerDrivenPaging/pages/Main.js +4 -1
- package/test/sap/ui/core/demokit/sample/odata/v4/Sticky/Opa.qunit.js +2 -1
- package/test/sap/ui/core/demokit/tutorial/odatav4/06/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/06/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/07/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/07/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/08/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/09/webapp/controller/App.controller.js +1 -6
- package/test/sap/ui/core/demokit/tutorial/odatav4/09/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/10/webapp/controller/App.controller.js +3 -8
- package/test/sap/ui/core/demokit/tutorial/odatav4/10/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/controller/App.controller.js +3 -8
- package/test/sap/ui/core/demokit/tutorial/odatav4/11/webapp/localService/mockserver.js +1 -0
- package/test/sap/ui/core/qunit/IconPool.qunit.js +53 -4
- package/test/sap/ui/core/qunit/ManagedObjectModel.qunit.js +43 -5
- package/test/sap/ui/core/qunit/Theming.qunit.js +19 -1
- package/test/sap/ui/core/qunit/analytics/AnalyticalBinding.qunit.js +510 -185
- package/test/sap/ui/core/qunit/analytics/ODataModelAdapter.qunit.js +80 -10
- package/test/sap/ui/core/qunit/analytics/odata4analytics.qunit.js +20 -29
- package/test/sap/ui/core/qunit/base/Config_cascade.qunit.js +18 -1
- package/test/sap/ui/core/qunit/base/i18n/Formatting.qunit.js +15 -13
- package/test/sap/ui/core/qunit/base/i18n/Localization.qunit.js +35 -12
- package/test/sap/ui/core/qunit/bootstrap/Configuration.main.qunit.js +11 -0
- package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.html +4 -3
- package/test/sap/ui/core/qunit/bootstrap/Configuration.qunit.js +71 -35
- package/test/sap/ui/core/qunit/component/Models.qunit.js +5 -2
- package/test/sap/ui/core/qunit/generic/EnforceSemanticRendering.qunit.js +2 -2
- package/test/sap/ui/core/qunit/generic/SettersContextReturn.qunit.js +2 -2
- package/test/sap/ui/core/qunit/generic/legacy/SettersContextReturn.qunit.js +2 -2
- package/test/sap/ui/core/qunit/i18n/LocaleData.qunit.js +48 -13
- package/test/sap/ui/core/qunit/i18n/UI5Date.qunit.js +16 -4
- package/test/sap/ui/core/qunit/i18n/UniversalDate.qunit.js +73 -103
- package/test/sap/ui/core/qunit/i18n/UniversalDateUtils.qunit.js +34 -39
- package/test/sap/ui/core/qunit/internal/BeforePush.ODataV4.js +28 -0
- package/test/sap/ui/core/qunit/internal/BeforePush.html +1 -0
- package/test/sap/ui/core/qunit/internal/BeforePush.js +15 -0
- package/test/sap/ui/core/qunit/internal/performance/ExpressionParser.performance.qunit.js +1 -0
- package/test/sap/ui/core/qunit/loader/asyncMode.qunit.js +2 -2
- package/test/sap/ui/core/qunit/loader/asyncMode_unavoidablySync.qunit.js +1 -1
- package/test/sap/ui/core/qunit/loader/testsuite.loader.qunit.js +0 -3
- package/test/sap/ui/core/qunit/model/FAR_CUSTOMER_LINE_ITEMS.metadata.xml +2 -0
- package/test/sap/ui/core/qunit/mvc/XMLTemplateProcessorRequireXML.qunit.js +51 -0
- package/test/sap/ui/core/qunit/mvc/testdata/Async.view.xml +1 -1
- package/test/sap/ui/core/qunit/mvc/testdata/AsyncTypedView.js +5 -1
- package/test/sap/ui/core/qunit/odata/ODataMetadataNoFakeService.qunit.js +68 -4
- package/test/sap/ui/core/qunit/odata/v2/ODataModel.integration.qunit.js +232 -37
- package/test/sap/ui/core/qunit/odata/v2/V2ODataModel.qunit.js +1 -1
- package/test/sap/ui/core/qunit/odata/v4/Context.qunit.js +10 -5
- package/test/sap/ui/core/qunit/odata/v4/ODataBinding.qunit.js +33 -1
- package/test/sap/ui/core/qunit/odata/v4/ODataContextBinding.qunit.js +5 -3
- package/test/sap/ui/core/qunit/odata/v4/ODataListBinding.qunit.js +186 -65
- package/test/sap/ui/core/qunit/odata/v4/ODataMetaModel.qunit.js +17 -66
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.integration.qunit.js +528 -60
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.qunit.js +48 -8
- package/test/sap/ui/core/qunit/odata/v4/ODataModel.realOData.qunit.js +0 -3
- package/test/sap/ui/core/qunit/odata/v4/data/metadata.json +2 -1
- package/test/sap/ui/core/qunit/odata/v4/data/metadata.xml +4 -0
- package/test/sap/ui/core/qunit/odata/v4/data/metadata_special_cases.xml +2 -0
- package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationCache.qunit.js +148 -1
- package/test/sap/ui/core/qunit/odata/v4/lib/_AggregationHelper.qunit.js +24 -11
- package/test/sap/ui/core/qunit/odata/v4/lib/_Cache.qunit.js +196 -404
- package/test/sap/ui/core/qunit/odata/v4/lib/_Helper.qunit.js +201 -2
- package/test/sap/ui/core/qunit/odata/v4/lib/_MetadataRequestor.qunit.js +7 -3
- package/test/sap/ui/core/qunit/odata/v4/lib/_Requestor.qunit.js +21 -4
- package/test/sap/ui/core/qunit/opa/matchers/LabelFor.qunit.js +4 -2
- package/test/sap/ui/core/qunit/opa/matchers/_Busy.qunit.js +129 -2
- package/test/sap/ui/core/qunit/opa/matchers/_Editable.qunit.js +5 -1
- package/test/sap/ui/core/qunit/routing/fixture/Async1.view.xml +1 -1
- package/test/sap/ui/core/qunit/testdata/xml-require/helper/Formatter.js +7 -4
- package/test/sap/ui/core/qunit/testdata/xml-require/view/XMLTemplateProcessorAsync_require_in_html.view.xml +36 -0
- package/test/sap/ui/core/qunit/testsuites/testsuite.theming.qunit.js +2 -2
- package/test/sap/ui/core/qunit/types/DateFormatTimezones.qunit.js +1222 -1201
- package/test/sap/ui/core/qunit/util/Popup.qunit.js +7 -11
- package/test/sap/ui/core/qunit/util/XMLPreprocessor.qunit.js +3 -1
- package/test/sap/ui/core/qunit/util/jQuery.sap.Version.qunit.js +3 -0
- package/test/sap/ui/core/qunit/util/reflection/BaseTreeModifier.qunit.js +1 -1
- package/test/sap/ui/core/relnotes/changes-1.116.json +1 -12
- package/test/sap/ui/core/relnotes/changes-1.117.json +127 -0
- package/test/sap/ui/core/visual/images/HyphenationPlayground/windows/1600x1200/chrome/horizon/ltr/cozy/19_thirdParty_language_sl.ref.lnk +1 -1
- package/ui5.yaml +165 -0
- package/src/sap/ui/core/util/MockServerAnnotationsHandler.js +0 -45
- /package/test/sap/ui/core/qunit/bootstrap/{GlobalConfigurationSettings.js → Configuration.beforeBootstrap.qunit.js} +0 -0
|
@@ -8,7 +8,6 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/model/analytics/odata4analytics",
|
|
9
9
|
"sap/ui/model/analytics/AnalyticalBinding",
|
|
10
10
|
"sap/ui/model/analytics/AnalyticalTreeBindingAdapter",
|
|
11
|
-
"sap/ui/model/analytics/AnalyticalVersionInfo",
|
|
12
11
|
"sap/ui/model/analytics/BatchResponseCollector",
|
|
13
12
|
"sap/ui/model/analytics/ODataModelAdapter",
|
|
14
13
|
"sap/ui/model/ChangeReason",
|
|
@@ -18,7 +17,6 @@ sap.ui.define([
|
|
|
18
17
|
"sap/ui/model/Sorter",
|
|
19
18
|
"sap/ui/model/TreeAutoExpandMode",
|
|
20
19
|
"sap/ui/model/odata/CountMode",
|
|
21
|
-
"sap/ui/model/odata/ODataModel",
|
|
22
20
|
"sap/ui/model/odata/ODataUtils",
|
|
23
21
|
"sap/ui/model/odata/v2/ODataModel",
|
|
24
22
|
"sap/ui/core/qunit/analytics/o4aMetadata",
|
|
@@ -30,10 +28,9 @@ sap.ui.define([
|
|
|
30
28
|
"sap/ui/core/qunit/analytics/TBA_Batch_ExpandCollapseToggle",
|
|
31
29
|
"sap/ui/core/qunit/analytics/TBA_Batch_Filter",
|
|
32
30
|
"sap/ui/core/qunit/analytics/TBA_Batch_Sort"
|
|
33
|
-
], function (Log, deepExtend, extend, odata4analytics, AnalyticalBinding,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
TreeAutoExpandMode, CountMode, ODataModelV1, ODataUtils, ODataModelV2, o4aFakeService) {
|
|
31
|
+
], function (Log, deepExtend, extend, odata4analytics, AnalyticalBinding, AnalyticalTreeBindingAdapter,
|
|
32
|
+
BatchResponseCollector, ODataModelAdapter, ChangeReason, Filter, FilterOperator, FilterProcessor, Sorter,
|
|
33
|
+
TreeAutoExpandMode, CountMode, ODataUtils, ODataModelV2, o4aFakeService) {
|
|
37
34
|
/*global QUnit, sinon */
|
|
38
35
|
/*eslint camelcase: 0, max-nested-callbacks: 0, no-warning-comments: 0*/
|
|
39
36
|
"use strict";
|
|
@@ -298,36 +295,33 @@ sap.ui.define([
|
|
|
298
295
|
+ "P_CostCenterTo='999-9999')/Results",
|
|
299
296
|
sPathHierarchy = "/TypeWithHierarchiesResults";
|
|
300
297
|
|
|
301
|
-
|
|
302
|
-
*
|
|
303
|
-
*
|
|
298
|
+
/**
|
|
299
|
+
* Applies the ODataModelAdapter to the given OData model and creates a new AnalyticalBinding
|
|
300
|
+
* with the given parameters, analytical info, binding path, sorters and filters.
|
|
301
|
+
*
|
|
302
|
+
* @param {sap.ui.model.Model} oModel
|
|
303
|
+
* The OData model
|
|
304
|
+
* @param {object} [mParameters={}]
|
|
305
|
+
* The Analytical binding parameters
|
|
306
|
+
* @param {object[]} [aAnalyticalInfo]
|
|
307
|
+
* The array of the analytical columns to be used; by default CostCenter (grouped), CostElement (grouped),
|
|
308
|
+
* Currency (grouped) and ActualCosts (with total)
|
|
309
|
+
* @param {string} [sBindingPath="/ActualPlannedCosts(P_ControllingArea='US01',P_CostCenter='100-1000',P_CostCenterTo='999-9999')/Results"]
|
|
310
|
+
* The binding path
|
|
311
|
+
* @param {sap.ui.model.Sorter[]} [aSorters=[]]
|
|
312
|
+
* The array of sorters
|
|
313
|
+
* @param {sap.ui.model.Filter[]} [aFilters=[]]
|
|
314
|
+
* The array of filters
|
|
315
|
+
* @returns {sap.ui.model.analytics.AnalyticalBinding}
|
|
316
|
+
* The analytical binding
|
|
304
317
|
*/
|
|
305
|
-
function
|
|
306
|
-
sBindingPath, bSkipInitialize, aSorters, aFilters) {
|
|
307
|
-
var oBinding,
|
|
308
|
-
oModel;
|
|
309
|
-
|
|
318
|
+
function applyAdapterAndCreateBinding(oModel, mParameters, aAnalyticalInfo, sBindingPath, aSorters, aFilters) {
|
|
310
319
|
mParameters = mParameters || {};
|
|
311
320
|
aAnalyticalInfo = aAnalyticalInfo
|
|
312
321
|
|| [oCostCenterGrouped, oCostElementGrouped, oCurrencyGrouped, oActualCostsTotal];
|
|
313
322
|
|
|
314
|
-
if (iVersion === 1) {
|
|
315
|
-
oModel = new ODataModelV1(sServiceURL, {
|
|
316
|
-
defaultCountMode : CountMode.Inline,
|
|
317
|
-
json: true,
|
|
318
|
-
tokenHandling: false
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
} else {
|
|
322
|
-
oModel = new ODataModelV2(sServiceURL, {
|
|
323
|
-
defaultCountMode : CountMode.Inline,
|
|
324
|
-
tokenHandling: false,
|
|
325
|
-
json: true
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
|
|
329
323
|
ODataModelAdapter.apply(oModel);
|
|
330
|
-
oBinding = new AnalyticalBinding(oModel, sBindingPath || sPath, null, aSorters || [],
|
|
324
|
+
const oBinding = new AnalyticalBinding(oModel, sBindingPath || sPath, null, aSorters || [],
|
|
331
325
|
aFilters || [], /*mParameters*/ {
|
|
332
326
|
analyticalInfo : aAnalyticalInfo,
|
|
333
327
|
autoExpandMode : mParameters.autoExpandMode,
|
|
@@ -345,21 +339,51 @@ sap.ui.define([
|
|
|
345
339
|
);
|
|
346
340
|
AnalyticalTreeBindingAdapter.apply(oBinding);
|
|
347
341
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
342
|
+
return oBinding;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Creates an OData V2 model and an analytical binding instance.
|
|
347
|
+
* If a callback function is given, it is called when the metadata are loaded and the binding is
|
|
348
|
+
* initialized. If no callback function is given, a Promise is returned that resolves with the
|
|
349
|
+
* new binding as soon as metadata has been loaded.
|
|
350
|
+
*
|
|
351
|
+
* @param {object} [mParameters={}]
|
|
352
|
+
* The Analytical binding parameters
|
|
353
|
+
* @param {function} [fnODataV2Callback]
|
|
354
|
+
* The function which is called when the metadata is loaded and the binding is initialized
|
|
355
|
+
* @param {object[]} [aAnalyticalInfo]
|
|
356
|
+
* The array of the analytical columns to be used; by default CostCenter (grouped), CostElement (grouped),
|
|
357
|
+
* Currency (grouped) and ActualCosts (with total)
|
|
358
|
+
* @param {string} [sBindingPath="/ActualPlannedCosts(P_ControllingArea='US01',P_CostCenter='100-1000',P_CostCenterTo='999-9999')/Results"]
|
|
359
|
+
* The binding path
|
|
360
|
+
* @param {boolean} [bSkipInitialize=false]
|
|
361
|
+
* Whether to skip the binding intialization
|
|
362
|
+
* @param {sap.ui.model.Sorter[]} [aSorters=[]]
|
|
363
|
+
* The array of sorters
|
|
364
|
+
* @param {sap.ui.model.Filter[]} [aFilters=[]]
|
|
365
|
+
* The array of filters
|
|
366
|
+
* @returns {undefined|Promise}
|
|
367
|
+
* <code>undefined</code> if a callback function is given; otherwise a Promise which resolves
|
|
368
|
+
* with the new analytial binding instance
|
|
369
|
+
*/
|
|
370
|
+
function setupAnalyticalBinding(mParameters, fnODataV2Callback, aAnalyticalInfo,
|
|
371
|
+
sBindingPath, bSkipInitialize, aSorters, aFilters) {
|
|
372
|
+
const oModel = new ODataModelV2(sServiceURL, {
|
|
373
|
+
defaultCountMode : CountMode.Inline,
|
|
374
|
+
tokenHandling: false,
|
|
375
|
+
json: true
|
|
376
|
+
});
|
|
377
|
+
const oBinding = applyAdapterAndCreateBinding(oModel, mParameters, aAnalyticalInfo, sBindingPath,
|
|
378
|
+
aSorters, aFilters);
|
|
379
|
+
if (fnODataV2Callback) {
|
|
357
380
|
oModel.attachMetadataLoaded(function () {
|
|
358
381
|
if (!bSkipInitialize) {
|
|
359
382
|
oBinding.initialize();
|
|
360
383
|
}
|
|
361
384
|
fnODataV2Callback(oBinding, oModel);
|
|
362
385
|
});
|
|
386
|
+
return undefined;
|
|
363
387
|
} else {
|
|
364
388
|
return oModel.metadataLoaded().then(function () {
|
|
365
389
|
if (!bSkipInitialize) {
|
|
@@ -370,6 +394,31 @@ sap.ui.define([
|
|
|
370
394
|
}
|
|
371
395
|
}
|
|
372
396
|
|
|
397
|
+
/**
|
|
398
|
+
* Creates an OData V1 model and an analytical binding instance.
|
|
399
|
+
*
|
|
400
|
+
* @returns {object}
|
|
401
|
+
* An object with the properties <code>binding</code> containing the analytical binding instance
|
|
402
|
+
* and <code>model</code> containing the OData V1 model.
|
|
403
|
+
* @deprecated As of version 1.48.0
|
|
404
|
+
*/
|
|
405
|
+
function setupAnalyticalBindingV1() {
|
|
406
|
+
const ODataModelV1Class = sap.ui.require("sap/ui/model/odata/ODataModel") ||
|
|
407
|
+
sap.ui.requireSync("sap/ui/model/odata/ODataModel"); // legacy-relevant: fallback for missing dependency
|
|
408
|
+
const oModel = new ODataModelV1Class(sServiceURL, {
|
|
409
|
+
defaultCountMode : CountMode.Inline,
|
|
410
|
+
json: true,
|
|
411
|
+
tokenHandling: false
|
|
412
|
+
});
|
|
413
|
+
const oBinding = applyAdapterAndCreateBinding(oModel);
|
|
414
|
+
// V1 => synchronous metadata, initialize the binding directly
|
|
415
|
+
oBinding.initialize();
|
|
416
|
+
return {
|
|
417
|
+
binding : oBinding,
|
|
418
|
+
model : oModel
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
373
422
|
//*********************************************************************************************
|
|
374
423
|
QUnit.module("sap.ui.model.analytics.AnalyticalBinding", {
|
|
375
424
|
afterEach : function (assert) {
|
|
@@ -393,7 +442,7 @@ sap.ui.define([
|
|
|
393
442
|
}
|
|
394
443
|
});
|
|
395
444
|
|
|
396
|
-
/** @deprecated As of version 1.
|
|
445
|
+
/** @deprecated As of version 1.48.0 */
|
|
397
446
|
QUnit.test("Eventing - ODataModel V1 - DataRequested and DataReceived", function (assert) {
|
|
398
447
|
var done = assert.async(),
|
|
399
448
|
oBinding,
|
|
@@ -408,8 +457,7 @@ sap.ui.define([
|
|
|
408
457
|
// .withExactArgs("EventProvider sap.ui.model.odata.ODataModel "
|
|
409
458
|
// + "path /$metadata should be absolute if no Context is set");
|
|
410
459
|
|
|
411
|
-
|
|
412
|
-
oSetupBinding = setupAnalyticalBinding(1, {});
|
|
460
|
+
oSetupBinding = setupAnalyticalBindingV1();
|
|
413
461
|
oBinding = oSetupBinding.binding;
|
|
414
462
|
oModel = oSetupBinding.model;
|
|
415
463
|
|
|
@@ -477,7 +525,7 @@ sap.ui.define([
|
|
|
477
525
|
QUnit.test("Eventing - ODataModel V2 - DataRequested and DataReceived", function (assert) {
|
|
478
526
|
var done = assert.async();
|
|
479
527
|
|
|
480
|
-
setupAnalyticalBinding(
|
|
528
|
+
setupAnalyticalBinding({}, function (oBinding, oModel) {
|
|
481
529
|
var oRequestedSpy = sinon.spy(oBinding, 'fireDataRequested'),
|
|
482
530
|
oReceivedSpy = sinon.spy(oBinding, 'fireDataReceived'),
|
|
483
531
|
oRequestSentSpy = sinon.spy(oModel, 'fireRequestSent'),
|
|
@@ -572,7 +620,7 @@ sap.ui.define([
|
|
|
572
620
|
done = assert.async(),
|
|
573
621
|
that = this;
|
|
574
622
|
|
|
575
|
-
setupAnalyticalBinding(
|
|
623
|
+
setupAnalyticalBinding({}, function (oBinding, oModel) {
|
|
576
624
|
oModel.attachBatchRequestCompleted(function () {
|
|
577
625
|
iCount += 1;
|
|
578
626
|
if (iCount === 1) {
|
|
@@ -603,7 +651,7 @@ sap.ui.define([
|
|
|
603
651
|
],
|
|
604
652
|
done = assert.async();
|
|
605
653
|
|
|
606
|
-
setupAnalyticalBinding(
|
|
654
|
+
setupAnalyticalBinding({noPaging: true, numberOfExpandedLevels: 2},
|
|
607
655
|
function (oBinding, oModel) {
|
|
608
656
|
oModel.attachBatchRequestCompleted(function () {
|
|
609
657
|
done();
|
|
@@ -622,7 +670,7 @@ sap.ui.define([
|
|
|
622
670
|
+ ",P_CostCenter='100-1000',P_CostCenterTo='999-9999')/Results",
|
|
623
671
|
done = assert.async();
|
|
624
672
|
|
|
625
|
-
setupAnalyticalBinding(
|
|
673
|
+
setupAnalyticalBinding({useBatchRequests: false}, function (oBinding, oModel) {
|
|
626
674
|
sinon.stub(oModel, "read", function (sPath) {
|
|
627
675
|
assert.strictEqual(sPath, sExpectedPath, "percent encoding of space done");
|
|
628
676
|
|
|
@@ -638,7 +686,7 @@ sap.ui.define([
|
|
|
638
686
|
QUnit.test("No Paging Option - Normal Use Case", function (assert) {
|
|
639
687
|
var done = assert.async();
|
|
640
688
|
|
|
641
|
-
setupAnalyticalBinding(
|
|
689
|
+
setupAnalyticalBinding({noPaging: true}, function (oBinding, oModel) {
|
|
642
690
|
|
|
643
691
|
oBinding.attachChange(fnChangeHandler1);
|
|
644
692
|
oBinding.getContexts(0, 20, 10);
|
|
@@ -674,7 +722,7 @@ sap.ui.define([
|
|
|
674
722
|
QUnit.test("No Paging Option - Auto Expand (NO multi-unit)", function (assert) {
|
|
675
723
|
var done = assert.async();
|
|
676
724
|
|
|
677
|
-
setupAnalyticalBinding(
|
|
725
|
+
setupAnalyticalBinding({noPaging: true, numberOfExpandedLevels: 2}, function (oBinding) {
|
|
678
726
|
|
|
679
727
|
oBinding.attachChange(fnChangeHandler1);
|
|
680
728
|
oBinding.getContexts(0, 20, 10);
|
|
@@ -713,7 +761,7 @@ sap.ui.define([
|
|
|
713
761
|
QUnit.test("selectionChanged event with selectAll and collapse", function (assert) {
|
|
714
762
|
var done = assert.async();
|
|
715
763
|
|
|
716
|
-
setupAnalyticalBinding(
|
|
764
|
+
setupAnalyticalBinding({noPaging: true, numberOfExpandedLevels: 2}, function (oBinding) {
|
|
717
765
|
|
|
718
766
|
oBinding.attachChange(fnChangeHandler1);
|
|
719
767
|
oBinding.getContexts(0, 20, 10);
|
|
@@ -761,7 +809,7 @@ sap.ui.define([
|
|
|
761
809
|
QUnit.test("selectionChanged event with collapse: deselect lead selection", function (assert) {
|
|
762
810
|
var done = assert.async();
|
|
763
811
|
|
|
764
|
-
setupAnalyticalBinding(
|
|
812
|
+
setupAnalyticalBinding({noPaging: true, numberOfExpandedLevels: 2}, function (oBinding) {
|
|
765
813
|
|
|
766
814
|
oBinding.attachChange(fnChangeHandler1);
|
|
767
815
|
oBinding.getContexts(0, 20, 10);
|
|
@@ -806,7 +854,7 @@ sap.ui.define([
|
|
|
806
854
|
QUnit.test("Check if custom URL parameters are attached", function (assert) {
|
|
807
855
|
var done = assert.async();
|
|
808
856
|
|
|
809
|
-
setupAnalyticalBinding(
|
|
857
|
+
setupAnalyticalBinding({
|
|
810
858
|
custom: {
|
|
811
859
|
"search": "ABTestString"
|
|
812
860
|
}
|
|
@@ -846,7 +894,7 @@ sap.ui.define([
|
|
|
846
894
|
QUnit.test("getDownloadURL: Check if custom URL parameters are attached", function (assert) {
|
|
847
895
|
var done = assert.async();
|
|
848
896
|
|
|
849
|
-
setupAnalyticalBinding(
|
|
897
|
+
setupAnalyticalBinding({
|
|
850
898
|
custom: {
|
|
851
899
|
"search": "ABTestString"
|
|
852
900
|
}
|
|
@@ -866,7 +914,7 @@ sap.ui.define([
|
|
|
866
914
|
QUnit.test("getDownloadURL: replace spaces with %20", function (assert) {
|
|
867
915
|
var done = assert.async();
|
|
868
916
|
|
|
869
|
-
setupAnalyticalBinding(
|
|
917
|
+
setupAnalyticalBinding({
|
|
870
918
|
custom: {
|
|
871
919
|
"search": "AB Test String"
|
|
872
920
|
}
|
|
@@ -936,7 +984,7 @@ sap.ui.define([
|
|
|
936
984
|
QUnit.test("filter operators: " + oFixture.filters[0].sOperator, function (assert) {
|
|
937
985
|
var done = assert.async();
|
|
938
986
|
|
|
939
|
-
setupAnalyticalBinding(
|
|
987
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
940
988
|
var sURL = oBinding.getDownloadUrl(),
|
|
941
989
|
sFilterPart = sURL.slice(sURL.lastIndexOf("=") + 1);
|
|
942
990
|
|
|
@@ -954,7 +1002,7 @@ sap.ui.define([
|
|
|
954
1002
|
QUnit.test("filter operators: combine all", function (assert) {
|
|
955
1003
|
var done = assert.async();
|
|
956
1004
|
|
|
957
|
-
setupAnalyticalBinding(
|
|
1005
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
958
1006
|
var sExpectedFilterPart = "("
|
|
959
1007
|
+ "endswith(CostCenter,%271%27)%20"
|
|
960
1008
|
+ "or%20not%20endswith(CostCenter,%271%27)%20"
|
|
@@ -1024,12 +1072,12 @@ sap.ui.define([
|
|
|
1024
1072
|
select : "ActualCosts,CostCenter,CostCenterText,CostElement,CostElementText,Currency,"
|
|
1025
1073
|
+ "PlannedCosts",
|
|
1026
1074
|
expectedSelect : "CostElement,CostCenter,ActualCosts,Currency,PlannedCosts,Currency,"
|
|
1027
|
-
+ "CostCenterText
|
|
1075
|
+
+ "CostElementText,CostCenterText"
|
|
1028
1076
|
}, { // with additional selects: with dimensions text and measures without a unit
|
|
1029
1077
|
analyticalInfo : [oCostCenterGrouped, oCostElementText, oActualCostsTotal],
|
|
1030
1078
|
select : "ActualCosts,CostCenter,CostCenterText,CostElement,CostElementText,Currency",
|
|
1031
|
-
expectedSelect : "CostCenter,CostElementText,ActualCosts,Currency,
|
|
1032
|
-
+ "
|
|
1079
|
+
expectedSelect : "CostCenter,CostElementText,ActualCosts,Currency,CostCenterText,"
|
|
1080
|
+
+ "CostElement"
|
|
1033
1081
|
}].forEach(function (oFixture, i) {
|
|
1034
1082
|
QUnit.test("getDownloadURL: no duplicate units / select parameter: " + i,
|
|
1035
1083
|
function (assert) {
|
|
@@ -1037,7 +1085,7 @@ sap.ui.define([
|
|
|
1037
1085
|
// $select of excel download urls
|
|
1038
1086
|
var done = assert.async();
|
|
1039
1087
|
|
|
1040
|
-
setupAnalyticalBinding(
|
|
1088
|
+
setupAnalyticalBinding({select : oFixture.select}, function (oBinding, oModel) {
|
|
1041
1089
|
var sURL = oBinding.getDownloadUrl();
|
|
1042
1090
|
|
|
1043
1091
|
assert.strictEqual(sURL,
|
|
@@ -1053,7 +1101,7 @@ sap.ui.define([
|
|
|
1053
1101
|
QUnit.test("getGroupName: group by a dimension that is not in UI", function (assert) {
|
|
1054
1102
|
var done = assert.async();
|
|
1055
1103
|
|
|
1056
|
-
setupAnalyticalBinding(
|
|
1104
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
1057
1105
|
|
|
1058
1106
|
var oContext = {
|
|
1059
1107
|
getProperty : function () {}
|
|
@@ -1082,7 +1130,7 @@ sap.ui.define([
|
|
|
1082
1130
|
QUnit.test("getGroupName: dimension with text and empty label", function (assert) {
|
|
1083
1131
|
var done = assert.async();
|
|
1084
1132
|
|
|
1085
|
-
setupAnalyticalBinding(
|
|
1133
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
1086
1134
|
|
|
1087
1135
|
var oContext = {
|
|
1088
1136
|
getProperty : function () {}
|
|
@@ -1120,7 +1168,7 @@ sap.ui.define([
|
|
|
1120
1168
|
QUnit.test(sTitle, function (assert) {
|
|
1121
1169
|
var done = assert.async();
|
|
1122
1170
|
|
|
1123
|
-
setupAnalyticalBinding(
|
|
1171
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
1124
1172
|
|
|
1125
1173
|
var oContext = {
|
|
1126
1174
|
getProperty : function () {}
|
|
@@ -1325,29 +1373,42 @@ sap.ui.define([
|
|
|
1325
1373
|
|
|
1326
1374
|
//*********************************************************************************************
|
|
1327
1375
|
[{
|
|
1328
|
-
additionalSelects : [
|
|
1376
|
+
additionalSelects : [],
|
|
1329
1377
|
analyticalInfo : [oCostCenterGrouped, oCostElementGrouped, oCurrencyGrouped,
|
|
1330
1378
|
oActualCostsTotal],
|
|
1379
|
+
dimensionToTextProperty : {
|
|
1380
|
+
"CostElement" : "CostElementText",
|
|
1381
|
+
"CostCenter" : "CostCenterText"
|
|
1382
|
+
},
|
|
1331
1383
|
select : "CostCenter,CostElement,Currency,ActualCosts,CostElementText,CostCenterText"
|
|
1332
1384
|
},
|
|
1333
|
-
// CostElementText is contained in
|
|
1385
|
+
// CostElementText is contained in additionalSelects, and it will be part of $select
|
|
1334
1386
|
// calculated by the analytical binding; we don't want to reimplement the $select computation;
|
|
1335
1387
|
// we ensured that no additional dimension or measure is contained; redundant entries need to
|
|
1336
1388
|
// removed in _getQueryODataRequestOptions
|
|
1337
1389
|
{
|
|
1338
|
-
additionalSelects : [
|
|
1390
|
+
additionalSelects : [],
|
|
1339
1391
|
analyticalInfo : [oCostCenterGrouped, oCostElementText, oCurrencyGrouped,
|
|
1340
1392
|
oActualCostsTotal],
|
|
1393
|
+
dimensionToTextProperty : {
|
|
1394
|
+
"CostElement" : "CostElementText",
|
|
1395
|
+
"CostCenter" : "CostCenterText"
|
|
1396
|
+
},
|
|
1341
1397
|
select : "CostCenter,CostElement,CostElementText,Currency,ActualCosts,CostCenterText"
|
|
1342
1398
|
}, { // selects with whitespace characters
|
|
1343
|
-
additionalSelects : [
|
|
1344
|
-
|
|
1399
|
+
additionalSelects : [],
|
|
1400
|
+
analyticalInfo : [oCostCenterGrouped, oCostElementText, oCurrencyGrouped,
|
|
1345
1401
|
oActualCostsTotal],
|
|
1402
|
+
dimensionToTextProperty : {
|
|
1403
|
+
"CostElement" : "CostElementText",
|
|
1404
|
+
"CostCenter" : "CostCenterText"
|
|
1405
|
+
},
|
|
1346
1406
|
select : "CostCenter ,\tCostElement, CostElementText ,Currency,ActualCosts \
|
|
1347
1407
|
,CostCenterText"
|
|
1348
1408
|
}, { // trim only whitespace at the beginning and at the end of a property name
|
|
1349
1409
|
additionalSelects : ["CostCenter Text"], // whitespace is not removed -> server error
|
|
1350
1410
|
analyticalInfo : [oCostCenterGrouped, oCurrencyGrouped, oActualCostsTotal],
|
|
1411
|
+
dimensionToTextProperty : {},
|
|
1351
1412
|
select : "CostCenter,Currency,ActualCosts,CostCenter Text"
|
|
1352
1413
|
}, {
|
|
1353
1414
|
additionalSelects : [],
|
|
@@ -1355,12 +1416,18 @@ sap.ui.define([
|
|
|
1355
1416
|
// the binding; CostElement does not need to be part of the select parameter
|
|
1356
1417
|
analyticalInfo : [oCostCenterGrouped, oCurrencyGrouped, oActualCostsTotal,
|
|
1357
1418
|
oCostElementText],
|
|
1419
|
+
dimensionToTextProperty : {
|
|
1420
|
+
"CostElement" : "CostElementText"
|
|
1421
|
+
},
|
|
1358
1422
|
select : "CostCenter,Currency,ActualCosts,CostElementText"
|
|
1359
1423
|
}, {
|
|
1360
|
-
additionalSelects : [
|
|
1424
|
+
additionalSelects : [],
|
|
1361
1425
|
// the oActualCostsTotal has the associated unit Currency which gets automatically selected
|
|
1362
1426
|
// by the binding; Currency does not need to be part of the select parameter
|
|
1363
1427
|
analyticalInfo : [oCostCenterGrouped, oActualCostsTotal],
|
|
1428
|
+
dimensionToTextProperty : {
|
|
1429
|
+
"CostCenter" : "CostCenterText"
|
|
1430
|
+
},
|
|
1364
1431
|
select : "CostCenter,ActualCosts,CostCenterText"
|
|
1365
1432
|
}].forEach(function (oFixture, i) {
|
|
1366
1433
|
QUnit.test("updateAnalyticalInfo: additional selects - " + i, function (assert) {
|
|
@@ -1382,12 +1449,23 @@ sap.ui.define([
|
|
|
1382
1449
|
});
|
|
1383
1450
|
AnalyticalTreeBindingAdapter.apply(oBinding);
|
|
1384
1451
|
|
|
1385
|
-
oModel.attachMetadataLoaded(
|
|
1386
|
-
//
|
|
1452
|
+
oModel.attachMetadataLoaded(() => {
|
|
1453
|
+
// code under test
|
|
1387
1454
|
oBinding.initialize(); //calls oBinding.updateAnalyticalInfo
|
|
1388
1455
|
|
|
1389
1456
|
assert.deepEqual(oBinding.aAdditionalSelects, oFixture.additionalSelects);
|
|
1390
1457
|
|
|
1458
|
+
for (const [sName, oDetails] of Object.entries(oBinding.oDimensionDetailsSet)) {
|
|
1459
|
+
const sTextProperty = oDetails.textPropertyName;
|
|
1460
|
+
if (sName in oFixture.dimensionToTextProperty) {
|
|
1461
|
+
assert.strictEqual(sTextProperty, oFixture.dimensionToTextProperty[sName]);
|
|
1462
|
+
delete oFixture.dimensionToTextProperty[sName];
|
|
1463
|
+
} else {
|
|
1464
|
+
assert.strictEqual(sTextProperty, undefined);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
assert.strictEqual(Object.keys(oFixture.dimensionToTextProperty).length, 0,
|
|
1468
|
+
"all text properties found");
|
|
1391
1469
|
done();
|
|
1392
1470
|
});
|
|
1393
1471
|
});
|
|
@@ -1402,7 +1480,7 @@ sap.ui.define([
|
|
|
1402
1480
|
useBatchRequests : true,
|
|
1403
1481
|
expectedSelects : [
|
|
1404
1482
|
"ActualCosts,Currency", // sum request
|
|
1405
|
-
"CostCenter,CostElement,Currency,ActualCosts
|
|
1483
|
+
"CostCenter,CostElement,CostElementText,Currency,ActualCosts" // data request
|
|
1406
1484
|
]
|
|
1407
1485
|
}, {
|
|
1408
1486
|
analyticalInfo : [oCostCenterGrouped, oCostElementUngrouped, oCurrencyUngrouped,
|
|
@@ -1414,7 +1492,7 @@ sap.ui.define([
|
|
|
1414
1492
|
"ActualCosts,Currency", // sum request,
|
|
1415
1493
|
"CostCenter,CostElement,Currency", // count
|
|
1416
1494
|
"CostCenter,ActualCosts,Currency", // top level group request
|
|
1417
|
-
"CostCenter,CostElement,Currency,ActualCosts
|
|
1495
|
+
"CostCenter,CostElement,CostElementText,Currency,ActualCosts" // data request
|
|
1418
1496
|
]
|
|
1419
1497
|
}, {
|
|
1420
1498
|
analyticalInfo : [oCostCenterUngrouped, oCostElementUngrouped, oCurrencyUngrouped,
|
|
@@ -1425,7 +1503,7 @@ sap.ui.define([
|
|
|
1425
1503
|
expectedSelects : [
|
|
1426
1504
|
"ActualCosts,Currency", // sum request
|
|
1427
1505
|
"CostCenter,CostElement,Currency", // count
|
|
1428
|
-
"CostCenter,CostElement,Currency,ActualCosts
|
|
1506
|
+
"CostCenter,CostElement,CostElementText,Currency,ActualCosts" // data request
|
|
1429
1507
|
]
|
|
1430
1508
|
}, { // don't have the unit column in analytical info
|
|
1431
1509
|
analyticalInfo : [oCostElementUngrouped, oActualCostsTotal, oActualPlannedCostsPercentage],
|
|
@@ -1435,7 +1513,7 @@ sap.ui.define([
|
|
|
1435
1513
|
expectedSelects : [
|
|
1436
1514
|
"ActualCosts,Currency", // sum request
|
|
1437
1515
|
// data request
|
|
1438
|
-
"CostElement,ActualCosts,Currency,ActualPlannedCostsPercentage
|
|
1516
|
+
"CostElement,CostElementText,ActualCosts,Currency,ActualPlannedCostsPercentage"
|
|
1439
1517
|
]
|
|
1440
1518
|
}].forEach(function (oFixture, i) {
|
|
1441
1519
|
QUnit.test("_getQueryODataRequestOptions is called as expected - " + i, function (assert) {
|
|
@@ -1520,7 +1598,7 @@ sap.ui.define([
|
|
|
1520
1598
|
+ "ActualCosts,Currency",
|
|
1521
1599
|
sExpectedSelect = "$select=" + sSelects;
|
|
1522
1600
|
|
|
1523
|
-
setupAnalyticalBinding(
|
|
1601
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
1524
1602
|
var oAnalyticalQueryRequest = {
|
|
1525
1603
|
getFilterExpression : function () {
|
|
1526
1604
|
return {
|
|
@@ -1691,6 +1769,33 @@ sap.ui.define([
|
|
|
1691
1769
|
oFilterExpressionMock.verify();
|
|
1692
1770
|
});
|
|
1693
1771
|
|
|
1772
|
+
|
|
1773
|
+
//*********************************************************************************************
|
|
1774
|
+
[
|
|
1775
|
+
{sName: "sap.ui.model.odata.v2.ODataModel", iVersion: 2},
|
|
1776
|
+
{sName: "~other~", iVersion: null}
|
|
1777
|
+
].forEach((oFixture) => {
|
|
1778
|
+
QUnit.test(`_getModelVersion(${oFixture.sName}): ${oFixture.iVersion}`, function (assert) {
|
|
1779
|
+
const oModel = {getMetadata() {}};
|
|
1780
|
+
const oMetadata = {getName() {}};
|
|
1781
|
+
this.mock(oModel).expects("getMetadata").returns(oMetadata);
|
|
1782
|
+
this.mock(oMetadata).expects("getName").returns(oFixture.sName);
|
|
1783
|
+
|
|
1784
|
+
// code under test
|
|
1785
|
+
assert.strictEqual(AnalyticalBinding._getModelVersion(oModel), oFixture.iVersion);
|
|
1786
|
+
});
|
|
1787
|
+
});
|
|
1788
|
+
/** @deprecated As of version 1.48.0 */
|
|
1789
|
+
QUnit.test("_getModelVersion(sap.ui.model.odata.ODataModel): 1", function (assert) {
|
|
1790
|
+
const oModel = {getMetadata() {}};
|
|
1791
|
+
const oMetadata = {getName() {}};
|
|
1792
|
+
this.mock(oModel).expects("getMetadata").returns(oMetadata);
|
|
1793
|
+
this.mock(oMetadata).expects("getName").returns("sap.ui.model.odata.ODataModel");
|
|
1794
|
+
|
|
1795
|
+
// code under test
|
|
1796
|
+
assert.strictEqual(AnalyticalBinding._getModelVersion(oModel), 1);
|
|
1797
|
+
});
|
|
1798
|
+
|
|
1694
1799
|
//*********************************************************************************************
|
|
1695
1800
|
QUnit.test("_prepareGroupMembersAutoExpansionQueryRequest-prepareLevelMembersQueryRequest:"
|
|
1696
1801
|
+ " calls _getHierarchyLevelFiltersAndAddRecursiveHierarchy and"
|
|
@@ -1698,7 +1803,7 @@ sap.ui.define([
|
|
|
1698
1803
|
function (assert) {
|
|
1699
1804
|
var done = assert.async();
|
|
1700
1805
|
|
|
1701
|
-
setupAnalyticalBinding(
|
|
1806
|
+
setupAnalyticalBinding({noPaging: true, numberOfExpandedLevels: 2},
|
|
1702
1807
|
function (oBinding) {
|
|
1703
1808
|
var oAnalyticalBindingMock = sinon.mock(AnalyticalBinding),
|
|
1704
1809
|
oBindingMock = sinon.mock(oBinding),
|
|
@@ -1735,11 +1840,45 @@ sap.ui.define([
|
|
|
1735
1840
|
);
|
|
1736
1841
|
});
|
|
1737
1842
|
|
|
1843
|
+
//*********************************************************************************************
|
|
1844
|
+
QUnit.test("prepareLevelMembersQueryRequest: calls _mergeAndAddSorters", (assert) => {
|
|
1845
|
+
const done = assert.async();
|
|
1846
|
+
setupAnalyticalBinding({noPaging: true, numberOfExpandedLevels: 2}, (oBinding) => {
|
|
1847
|
+
const oMergeAndAddSortersSpy = sinon.spy(oBinding, "_mergeAndAddSorters");
|
|
1848
|
+
function fnChangeHandler() {
|
|
1849
|
+
oBinding.detachChange(fnChangeHandler);
|
|
1850
|
+
// 3x, once for each level
|
|
1851
|
+
assert.strictEqual(oMergeAndAddSortersSpy.callCount, 3);
|
|
1852
|
+
const aCall1Args = oMergeAndAddSortersSpy.firstCall.args;
|
|
1853
|
+
const oCostCenterSorter = new Sorter("CostCenter");
|
|
1854
|
+
assert.deepEqual(aCall1Args[0], [oCostCenterSorter]);
|
|
1855
|
+
assert.ok(aCall1Args[1] instanceof odata4analytics.SortExpression);
|
|
1856
|
+
|
|
1857
|
+
const aCall2Args = oMergeAndAddSortersSpy.secondCall.args;
|
|
1858
|
+
const oCostElementSorter = new Sorter("CostElement");
|
|
1859
|
+
assert.deepEqual(aCall2Args[0], [oCostCenterSorter, oCostElementSorter]);
|
|
1860
|
+
assert.ok(aCall2Args[1] instanceof odata4analytics.SortExpression);
|
|
1861
|
+
|
|
1862
|
+
const aCall3Args = oMergeAndAddSortersSpy.thirdCall.args;
|
|
1863
|
+
const oCurrencySorter = new Sorter("Currency");
|
|
1864
|
+
assert.deepEqual(aCall3Args[0], [oCostCenterSorter, oCostElementSorter, oCurrencySorter]);
|
|
1865
|
+
assert.ok(aCall3Args[1] instanceof odata4analytics.SortExpression);
|
|
1866
|
+
|
|
1867
|
+
oMergeAndAddSortersSpy.restore();
|
|
1868
|
+
done();
|
|
1869
|
+
}
|
|
1870
|
+
oBinding.attachChange(fnChangeHandler);
|
|
1871
|
+
|
|
1872
|
+
// code under test
|
|
1873
|
+
oBinding.getContexts(0, 20, 10);
|
|
1874
|
+
});
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1738
1877
|
//*********************************************************************************************
|
|
1739
1878
|
QUnit.test("_prepareTotalSizeQueryRequest: hierarchy dimensions tests", function (assert) {
|
|
1740
1879
|
var done = assert.async();
|
|
1741
1880
|
|
|
1742
|
-
setupAnalyticalBinding(
|
|
1881
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
1743
1882
|
var oAnalyticalBindingMock = sinon.mock(AnalyticalBinding),
|
|
1744
1883
|
oBindingMock = sinon.mock(oBinding),
|
|
1745
1884
|
oQueryResultRequestMock = sinon.mock(odata4analytics.QueryResultRequest.prototype),
|
|
@@ -1775,7 +1914,7 @@ sap.ui.define([
|
|
|
1775
1914
|
QUnit.test("_prepareGroupMembersQueryRequest: hierarchy dimensions tests", function (assert) {
|
|
1776
1915
|
var done = assert.async();
|
|
1777
1916
|
|
|
1778
|
-
setupAnalyticalBinding(
|
|
1917
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
1779
1918
|
var oAnalyticalBindingMock = sinon.mock(AnalyticalBinding),
|
|
1780
1919
|
oBindingMock = sinon.mock(oBinding),
|
|
1781
1920
|
aHierarchyLevelFilters = [];
|
|
@@ -2062,7 +2201,7 @@ sap.ui.define([
|
|
|
2062
2201
|
var done = assert.async(),
|
|
2063
2202
|
that = this;
|
|
2064
2203
|
|
|
2065
|
-
setupAnalyticalBinding(
|
|
2204
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2066
2205
|
if (oFixture.message) {
|
|
2067
2206
|
that.oLogMock.expects("isLoggable")
|
|
2068
2207
|
.withExactArgs(Log.Level.INFO)
|
|
@@ -2103,7 +2242,7 @@ sap.ui.define([
|
|
|
2103
2242
|
QUnit.test("updateAnalyticalInfo: hierarchy dimensions - errors - " + i, function (assert) {
|
|
2104
2243
|
var done = assert.async();
|
|
2105
2244
|
|
|
2106
|
-
setupAnalyticalBinding(
|
|
2245
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2107
2246
|
assert.throws(function () {
|
|
2108
2247
|
// code under test
|
|
2109
2248
|
oBinding.updateAnalyticalInfo(oFixture.analyticalInfo);
|
|
@@ -2118,7 +2257,7 @@ sap.ui.define([
|
|
|
2118
2257
|
var done = assert.async(),
|
|
2119
2258
|
aInitialColumns = [];
|
|
2120
2259
|
|
|
2121
|
-
setupAnalyticalBinding(
|
|
2260
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2122
2261
|
var aInitialColumnsAfterUpdate = [];
|
|
2123
2262
|
|
|
2124
2263
|
assert.strictEqual(oBinding.isInitial(), true);
|
|
@@ -2159,7 +2298,7 @@ sap.ui.define([
|
|
|
2159
2298
|
}],
|
|
2160
2299
|
that = this;
|
|
2161
2300
|
|
|
2162
|
-
return setupAnalyticalBinding(
|
|
2301
|
+
return setupAnalyticalBinding({}, /*fnODataV2Callback*/null, aInitialColumns)
|
|
2163
2302
|
.then(function (oBinding) {
|
|
2164
2303
|
var mAnalyticalInfoByProperty = deepExtend({}, oBinding.mAnalyticalInfoByProperty),
|
|
2165
2304
|
iAnalyticalInfoVersionNumber = oBinding.iAnalyticalInfoVersionNumber,
|
|
@@ -2226,11 +2365,12 @@ sap.ui.define([
|
|
|
2226
2365
|
QUnit.test("bApplySortersToGroups: Constructor and initialization", function (assert) {
|
|
2227
2366
|
var done = assert.async();
|
|
2228
2367
|
|
|
2229
|
-
setupAnalyticalBinding(
|
|
2368
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2230
2369
|
var bApplySortersToGroups = {/* true or false */};
|
|
2231
2370
|
|
|
2232
2371
|
assert.ok(oBinding.bApplySortersToGroups, "constructor sets bApplySortersToGroups");
|
|
2233
2372
|
assert.ok("sLastAutoExpandMode" in oBinding, "sLastAutoExpandMode defined");
|
|
2373
|
+
assert.deepEqual(oBinding.aSorter, []);
|
|
2234
2374
|
assert.strictEqual(oBinding.sLastAutoExpandMode, undefined);
|
|
2235
2375
|
|
|
2236
2376
|
oBinding.bApplySortersToGroups = bApplySortersToGroups;
|
|
@@ -2257,9 +2397,9 @@ sap.ui.define([
|
|
|
2257
2397
|
var done = assert.async();
|
|
2258
2398
|
|
|
2259
2399
|
// code under test
|
|
2260
|
-
setupAnalyticalBinding(
|
|
2400
|
+
setupAnalyticalBinding({}, function (oBinding0) {
|
|
2261
2401
|
// code under test
|
|
2262
|
-
setupAnalyticalBinding(
|
|
2402
|
+
setupAnalyticalBinding({}, function (oBinding1) {
|
|
2263
2403
|
assert.notStrictEqual(oBinding0._iId, oBinding1._iId, "Different IDs");
|
|
2264
2404
|
assert.ok(oBinding0._iId < oBinding1._iId, "ID increases with new instances");
|
|
2265
2405
|
|
|
@@ -2268,13 +2408,72 @@ sap.ui.define([
|
|
|
2268
2408
|
}, [], undefined, true);
|
|
2269
2409
|
});
|
|
2270
2410
|
|
|
2411
|
+
//*********************************************************************************************
|
|
2412
|
+
QUnit.test("constructor: calls AnalyticalBinding._getModelVersion", function (assert) {
|
|
2413
|
+
const done = assert.async();
|
|
2414
|
+
const oGetModelVersionSpy = this.spy(AnalyticalBinding, "_getModelVersion");
|
|
2415
|
+
|
|
2416
|
+
// code under test
|
|
2417
|
+
setupAnalyticalBinding({}, (_oBinding, oModel) => {
|
|
2418
|
+
// once applying the adapter and once in constructor
|
|
2419
|
+
assert.strictEqual(oGetModelVersionSpy.callCount, 2);
|
|
2420
|
+
assert.ok(oGetModelVersionSpy.firstCall.calledWithExactly(sinon.match.same(oModel)));
|
|
2421
|
+
assert.ok(oGetModelVersionSpy.secondCall.calledWithExactly(sinon.match.same(oModel)));
|
|
2422
|
+
done();
|
|
2423
|
+
}, [], undefined, true);
|
|
2424
|
+
});
|
|
2425
|
+
|
|
2426
|
+
//*********************************************************************************************
|
|
2427
|
+
QUnit.test("constructor: unsupported model", function (assert) {
|
|
2428
|
+
this.mock(AnalyticalBinding.prototype).expects("_convertDeprecatedFilterObjects").withExactArgs(undefined);
|
|
2429
|
+
const oModel = {createCustomParams() {}};
|
|
2430
|
+
this.mock(oModel).expects("createCustomParams").withExactArgs({custom: undefined});
|
|
2431
|
+
this.mock(AnalyticalBinding).expects("_getModelVersion").withExactArgs(sinon.match.same(oModel)).returns(null);
|
|
2432
|
+
this.oLogMock.expects("error").withExactArgs("The AnalyticalBinding does not support the given model");
|
|
2433
|
+
|
|
2434
|
+
// code under test
|
|
2435
|
+
const oBinding = new AnalyticalBinding(oModel, "path",/*oContext*/undefined, /*aSorter*/undefined,
|
|
2436
|
+
/*aFilters*/undefined, /*mParameters*/{});
|
|
2437
|
+
|
|
2438
|
+
assert.strictEqual(oBinding.aAllDimensionSortedByName, undefined);
|
|
2439
|
+
assert.strictEqual(oBinding.aInitialAnalyticalInfo, undefined);
|
|
2440
|
+
assert.strictEqual(oBinding.aAllDimensionSortedByName, undefined);
|
|
2441
|
+
});
|
|
2442
|
+
|
|
2443
|
+
//*********************************************************************************************
|
|
2444
|
+
QUnit.test("constructor, this.aSorter: sorter parameter is no array", function (assert) {
|
|
2445
|
+
var done = assert.async(),
|
|
2446
|
+
oSorter = {};
|
|
2447
|
+
|
|
2448
|
+
// code under test
|
|
2449
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2450
|
+
assert.strictEqual(oBinding.aSorter.length, 1);
|
|
2451
|
+
assert.strictEqual(oBinding.aSorter[0], oSorter);
|
|
2452
|
+
|
|
2453
|
+
done();
|
|
2454
|
+
}, [], undefined, true, oSorter);
|
|
2455
|
+
});
|
|
2456
|
+
|
|
2457
|
+
//*********************************************************************************************
|
|
2458
|
+
QUnit.test("constructor, this.aSorter: sorter parameter is array", function (assert) {
|
|
2459
|
+
var done = assert.async(),
|
|
2460
|
+
aSorter = [];
|
|
2461
|
+
|
|
2462
|
+
// code under test
|
|
2463
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2464
|
+
assert.strictEqual(oBinding.aSorter, aSorter);
|
|
2465
|
+
|
|
2466
|
+
done();
|
|
2467
|
+
}, [], undefined, true, aSorter);
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2271
2470
|
//*********************************************************************************************
|
|
2272
2471
|
QUnit.test("updateAnalyticalInfo: bApplySortersToGroups", function (assert) {
|
|
2273
2472
|
var done = assert.async();
|
|
2274
2473
|
|
|
2275
2474
|
// with default columns:
|
|
2276
2475
|
// [oCostCenterGrouped, oCostElementGrouped, oCurrencyGrouped, oActualCostsTotal]
|
|
2277
|
-
setupAnalyticalBinding(
|
|
2476
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2278
2477
|
var bApplySortersToGroups = {/* true or false */},
|
|
2279
2478
|
oColumn;
|
|
2280
2479
|
|
|
@@ -2311,11 +2510,30 @@ sap.ui.define([
|
|
|
2311
2510
|
});
|
|
2312
2511
|
});
|
|
2313
2512
|
|
|
2513
|
+
//*********************************************************************************************
|
|
2514
|
+
QUnit.test("updateAnalyticalInfo: calls _updateDimensionDetailsTextProperty", function (assert) {
|
|
2515
|
+
const oAnalyticalBindingMock = this.mock(AnalyticalBinding);
|
|
2516
|
+
oAnalyticalBindingMock.expects("_updateDimensionDetailsTextProperty")
|
|
2517
|
+
.withExactArgs(
|
|
2518
|
+
sinon.match((oDimension) => (oDimension.getName() === "CostElement")),
|
|
2519
|
+
"CostElement",
|
|
2520
|
+
sinon.match((oDimensionDetails) => (oDimensionDetails.name === "CostElement"))
|
|
2521
|
+
);
|
|
2522
|
+
oAnalyticalBindingMock.expects("_updateDimensionDetailsTextProperty")
|
|
2523
|
+
.withExactArgs(
|
|
2524
|
+
sinon.match((oDimension) => (oDimension.getName() === "CostElement")),
|
|
2525
|
+
"CostElementText",
|
|
2526
|
+
sinon.match((oDimensionDetails) => (oDimensionDetails.name === "CostElement"))
|
|
2527
|
+
);
|
|
2528
|
+
|
|
2529
|
+
return setupAnalyticalBinding({}, undefined, [oCostElementGrouped, oCostElementText]);
|
|
2530
|
+
});
|
|
2531
|
+
|
|
2314
2532
|
//*********************************************************************************************
|
|
2315
2533
|
QUnit.test("filter: resets bApplySortersToGroups", function (assert) {
|
|
2316
2534
|
var done = assert.async();
|
|
2317
2535
|
|
|
2318
|
-
setupAnalyticalBinding(
|
|
2536
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2319
2537
|
var oBindingMock = sinon.mock(oBinding);
|
|
2320
2538
|
|
|
2321
2539
|
oBindingMock.expects("_fireRefresh").withExactArgs(sinon.match(function (mParameters) {
|
|
@@ -2346,7 +2564,7 @@ sap.ui.define([
|
|
|
2346
2564
|
done = assert.async(),
|
|
2347
2565
|
bIncludeOrigin = {/*true or false*/};
|
|
2348
2566
|
|
|
2349
|
-
setupAnalyticalBinding(
|
|
2567
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2350
2568
|
var oCombinedFilterMock = sinon.mock(oCombinedFilter),
|
|
2351
2569
|
oFilterProcessorMock = sinon.mock(FilterProcessor);
|
|
2352
2570
|
|
|
@@ -2437,7 +2655,7 @@ sap.ui.define([
|
|
|
2437
2655
|
function (assert) {
|
|
2438
2656
|
var done = assert.async();
|
|
2439
2657
|
|
|
2440
|
-
setupAnalyticalBinding(
|
|
2658
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2441
2659
|
|
|
2442
2660
|
if (oFixture.controlFilter) {
|
|
2443
2661
|
oBinding.filter(oFixture.controlFilter);
|
|
@@ -2512,7 +2730,7 @@ sap.ui.define([
|
|
|
2512
2730
|
var done = assert.async(),
|
|
2513
2731
|
that = this;
|
|
2514
2732
|
|
|
2515
|
-
setupAnalyticalBinding(
|
|
2733
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2516
2734
|
var sOldLastAutoExpandMode = {/* any string different to the current mode */},
|
|
2517
2735
|
sExpectedLastAutoExpandMode = "sLastAutoExpandMode" in oFixture
|
|
2518
2736
|
? oFixture.sLastAutoExpandMode
|
|
@@ -2546,78 +2764,11 @@ sap.ui.define([
|
|
|
2546
2764
|
});
|
|
2547
2765
|
});
|
|
2548
2766
|
|
|
2549
|
-
//*********************************************************************************************
|
|
2550
|
-
[true, false].forEach(function (bApplySortersToGroups) {
|
|
2551
|
-
QUnit.test("_addSorters: " + bApplySortersToGroups, function (assert) {
|
|
2552
|
-
var done = assert.async();
|
|
2553
|
-
|
|
2554
|
-
setupAnalyticalBinding(2, {}, function (oBinding) {
|
|
2555
|
-
var oBindingMock = sinon.mock(oBinding),
|
|
2556
|
-
aGroupingSorters = [{
|
|
2557
|
-
sPath : "fooGrouping", bDescending : false
|
|
2558
|
-
}, {
|
|
2559
|
-
sPath : "barGrouping", bDescending : false
|
|
2560
|
-
}],
|
|
2561
|
-
oSortExpression = { addSorter : function () {} },
|
|
2562
|
-
oSortExpressionMock = sinon.mock(oSortExpression),
|
|
2563
|
-
// from aSorter - bIgnoreIfAlreadySorted has to be false always
|
|
2564
|
-
oExpectation0 = oSortExpressionMock.expects("addSorter")
|
|
2565
|
-
.withExactArgs("fooExternal", odata4analytics.SortOrder.Descending,
|
|
2566
|
-
false),
|
|
2567
|
-
oExpectation1 = oSortExpressionMock.expects("addSorter")
|
|
2568
|
-
.withExactArgs("barExternal", odata4analytics.SortOrder.Ascending,
|
|
2569
|
-
false),
|
|
2570
|
-
oExpectation2 = oSortExpressionMock.expects("addSorter")
|
|
2571
|
-
.withExactArgs("fooGrouping", odata4analytics.SortOrder.Descending,
|
|
2572
|
-
false),
|
|
2573
|
-
// from aGroupingSorters - must not overwrite sort order of aSorter properties
|
|
2574
|
-
oExpectation3 = oSortExpressionMock.expects("addSorter")
|
|
2575
|
-
.withExactArgs("fooGrouping", odata4analytics.SortOrder.Ascending,
|
|
2576
|
-
bApplySortersToGroups),
|
|
2577
|
-
oExpectation4 = oSortExpressionMock.expects("addSorter")
|
|
2578
|
-
.withExactArgs("barGrouping", odata4analytics.SortOrder.Ascending,
|
|
2579
|
-
bApplySortersToGroups);
|
|
2580
|
-
|
|
2581
|
-
oBinding.aSorter = [{
|
|
2582
|
-
sPath : "fooExternal", bDescending : true
|
|
2583
|
-
}, {
|
|
2584
|
-
sPath : "barExternal", bDescending : false
|
|
2585
|
-
}, {
|
|
2586
|
-
sPath : "fooGrouping", bDescending : true
|
|
2587
|
-
}];
|
|
2588
|
-
oBindingMock.expects("_canApplySortersToGroups")
|
|
2589
|
-
.withExactArgs()
|
|
2590
|
-
.returns(bApplySortersToGroups);
|
|
2591
|
-
|
|
2592
|
-
// code under test
|
|
2593
|
-
oBinding._addSorters(oSortExpression, aGroupingSorters);
|
|
2594
|
-
|
|
2595
|
-
assert.ok(oExpectation0.calledBefore(oExpectation1),
|
|
2596
|
-
"aSorter: fooExternal before barExternal");
|
|
2597
|
-
assert.ok(oExpectation1.calledBefore(oExpectation2),
|
|
2598
|
-
"aSorter: barExternal before barExternal");
|
|
2599
|
-
assert.ok(oExpectation3.calledBefore(oExpectation4),
|
|
2600
|
-
"fooGrouping before barGrouping");
|
|
2601
|
-
if (bApplySortersToGroups) {
|
|
2602
|
-
assert.ok(oExpectation2.calledBefore(oExpectation3),
|
|
2603
|
-
"aSorters before aGroupingSorters");
|
|
2604
|
-
} else {
|
|
2605
|
-
assert.ok(oExpectation4.calledBefore(oExpectation0),
|
|
2606
|
-
"aGroupingSorters before aSorters");
|
|
2607
|
-
}
|
|
2608
|
-
|
|
2609
|
-
oBindingMock.verify();
|
|
2610
|
-
oSortExpressionMock.verify();
|
|
2611
|
-
done();
|
|
2612
|
-
}, [], undefined, true);
|
|
2613
|
-
});
|
|
2614
|
-
});
|
|
2615
|
-
|
|
2616
2767
|
//*********************************************************************************************
|
|
2617
2768
|
QUnit.test("_prepareGroupMembersQueryRequest: calls _addSorters", function (assert) {
|
|
2618
2769
|
var done = assert.async();
|
|
2619
2770
|
|
|
2620
|
-
setupAnalyticalBinding(
|
|
2771
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2621
2772
|
var oBindingMock = sinon.mock(oBinding),
|
|
2622
2773
|
oSortExpressionMock = sinon.mock(odata4analytics.SortExpression.prototype);
|
|
2623
2774
|
|
|
@@ -2660,7 +2811,7 @@ sap.ui.define([
|
|
|
2660
2811
|
QUnit.test(sTitle, function (assert) {
|
|
2661
2812
|
var done = assert.async();
|
|
2662
2813
|
|
|
2663
|
-
setupAnalyticalBinding(
|
|
2814
|
+
setupAnalyticalBinding({provideGrandTotals : false}, function (oBinding) {
|
|
2664
2815
|
var oBindingMock = sinon.mock(oBinding),
|
|
2665
2816
|
oQueryResultRequestSpy = sinon.spy(odata4analytics.QueryResultRequest.prototype,
|
|
2666
2817
|
"setMeasures");
|
|
@@ -2691,7 +2842,7 @@ sap.ui.define([
|
|
|
2691
2842
|
+ " have been applyed to groups", function (assert) {
|
|
2692
2843
|
var done = assert.async();
|
|
2693
2844
|
|
|
2694
|
-
setupAnalyticalBinding(
|
|
2845
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2695
2846
|
var bApplySortersToGroups = {/* true or false*/},
|
|
2696
2847
|
oBindingMock = sinon.mock(oBinding),
|
|
2697
2848
|
oData = {
|
|
@@ -2735,7 +2886,7 @@ sap.ui.define([
|
|
|
2735
2886
|
+ " have *not* been applyed to groups", function (assert) {
|
|
2736
2887
|
var done = assert.async();
|
|
2737
2888
|
|
|
2738
|
-
setupAnalyticalBinding(
|
|
2889
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2739
2890
|
var oBindingMock = sinon.mock(oBinding),
|
|
2740
2891
|
oData = {
|
|
2741
2892
|
"__count" : "2",
|
|
@@ -2787,7 +2938,7 @@ sap.ui.define([
|
|
|
2787
2938
|
+ " have been applyed to groups", function (assert) {
|
|
2788
2939
|
var done = assert.async();
|
|
2789
2940
|
|
|
2790
|
-
setupAnalyticalBinding(
|
|
2941
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2791
2942
|
var bApplySortersToGroups = {/* true or false*/},
|
|
2792
2943
|
oBindingMock = sinon.mock(oBinding),
|
|
2793
2944
|
oData = {
|
|
@@ -2832,7 +2983,7 @@ sap.ui.define([
|
|
|
2832
2983
|
+ " group different to null", function (assert) {
|
|
2833
2984
|
var done = assert.async();
|
|
2834
2985
|
|
|
2835
|
-
setupAnalyticalBinding(
|
|
2986
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2836
2987
|
var bApplySortersToGroups = {/* true or false*/},
|
|
2837
2988
|
oBindingMock = sinon.mock(oBinding),
|
|
2838
2989
|
oData = {
|
|
@@ -2887,7 +3038,7 @@ sap.ui.define([
|
|
|
2887
3038
|
function (assert) {
|
|
2888
3039
|
var done = assert.async();
|
|
2889
3040
|
|
|
2890
|
-
setupAnalyticalBinding(
|
|
3041
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
2891
3042
|
var oExpectedMultiUnitEntry = {
|
|
2892
3043
|
oEntry: {
|
|
2893
3044
|
"ActualCosts" : null,
|
|
@@ -2943,7 +3094,7 @@ sap.ui.define([
|
|
|
2943
3094
|
QUnit.test("setContext: " + JSON.stringify(oFixture), function (assert) {
|
|
2944
3095
|
var done = assert.async();
|
|
2945
3096
|
|
|
2946
|
-
setupAnalyticalBinding(
|
|
3097
|
+
setupAnalyticalBinding({}, function (oBinding, oModel) {
|
|
2947
3098
|
var bApplySortersToGroups = {/* true or false*/},
|
|
2948
3099
|
oBindingMock = sinon.mock(oBinding),
|
|
2949
3100
|
oDataState = {},
|
|
@@ -3020,7 +3171,7 @@ sap.ui.define([
|
|
|
3020
3171
|
var done = assert.async(),
|
|
3021
3172
|
that = this;
|
|
3022
3173
|
|
|
3023
|
-
setupAnalyticalBinding(
|
|
3174
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
3024
3175
|
oBinding.bApplySortersToGroups = oFixture.bApplySortersToGroups;
|
|
3025
3176
|
that.oLogMock.expects("warning")
|
|
3026
3177
|
.withExactArgs(oFixture.sWarning, sPath)
|
|
@@ -3257,7 +3408,7 @@ sap.ui.define([
|
|
|
3257
3408
|
QUnit.test("_prepareGroupMembersAutoExpansionQueryRequest/prepareLevelMembersQueryRequest:"
|
|
3258
3409
|
+ " Allow expansion of all dimensions", function (assert) {
|
|
3259
3410
|
|
|
3260
|
-
return setupAnalyticalBinding(
|
|
3411
|
+
return setupAnalyticalBinding({
|
|
3261
3412
|
autoExpandMode : "Bundled",
|
|
3262
3413
|
numberOfExpandedLevels : 2,
|
|
3263
3414
|
useBatchRequests : true,
|
|
@@ -3396,7 +3547,7 @@ sap.ui.define([
|
|
|
3396
3547
|
var done = assert.async(),
|
|
3397
3548
|
that = this;
|
|
3398
3549
|
|
|
3399
|
-
setupAnalyticalBinding(
|
|
3550
|
+
setupAnalyticalBinding({}, function (oBinding) {
|
|
3400
3551
|
// that.oLogMock cannot be used as it mocks AnalyticalBinding.Logger which is not used
|
|
3401
3552
|
// in sap.ui.model.analytics.AnalyticalTreeBindingAdapter
|
|
3402
3553
|
that.mock(Log).expects("warning")
|
|
@@ -3803,18 +3954,21 @@ sap.ui.define([
|
|
|
3803
3954
|
|
|
3804
3955
|
//*********************************************************************************************
|
|
3805
3956
|
// BCP: 2380036006 fire data received also in error case and updated analytical info
|
|
3806
|
-
QUnit.test("_executeBatchRequest:
|
|
3807
|
-
|
|
3808
|
-
oAnalyticalQueryRequest = {
|
|
3957
|
+
QUnit.test("_executeBatchRequest: error cases", function (assert) {
|
|
3958
|
+
const oAnalyticalQueryRequest = {
|
|
3809
3959
|
getURIQueryOptionValue: function () {},
|
|
3810
3960
|
getURIToQueryResultEntries: function () {}
|
|
3811
3961
|
},
|
|
3812
3962
|
oError = {statusText: "abort"},
|
|
3813
|
-
oModel = {
|
|
3963
|
+
oModel = {
|
|
3964
|
+
fireRequestCompleted() {},
|
|
3965
|
+
read: function () {}
|
|
3966
|
+
},
|
|
3967
|
+
oModelMock = this.mock(oModel),
|
|
3814
3968
|
oBinding = {
|
|
3815
3969
|
iAnalyticalInfoVersionNumber: 1,
|
|
3816
3970
|
oModel: oModel,
|
|
3817
|
-
iModelVersion:
|
|
3971
|
+
iModelVersion: 2,
|
|
3818
3972
|
_getIdForNewRequestHandle: function () {},
|
|
3819
3973
|
_getQueryODataRequestOptions: function () {},
|
|
3820
3974
|
_isRequestPending: function () {},
|
|
@@ -3823,6 +3977,7 @@ sap.ui.define([
|
|
|
3823
3977
|
fireDataReceived: function () {},
|
|
3824
3978
|
fireDataRequested: function () {}
|
|
3825
3979
|
},
|
|
3980
|
+
oBindingMock = this.mock(oBinding),
|
|
3826
3981
|
aRequestDetails = [{
|
|
3827
3982
|
oAnalyticalQueryRequest: oAnalyticalQueryRequest,
|
|
3828
3983
|
bIsLeafGroupsRequest: "~isLeafGroupsRequest",
|
|
@@ -3835,21 +3990,21 @@ sap.ui.define([
|
|
|
3835
3990
|
this.mock(oAnalyticalQueryRequest).expects("getURIToQueryResultEntries")
|
|
3836
3991
|
.withExactArgs()
|
|
3837
3992
|
.returns("~path");
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3993
|
+
oBindingMock.expects("_isRequestPending").withExactArgs("~requestId").returns(false);
|
|
3994
|
+
oBindingMock.expects("_registerNewRequest").withExactArgs("~requestId");
|
|
3995
|
+
oBindingMock.expects("_getQueryODataRequestOptions")
|
|
3841
3996
|
.withExactArgs(sinon.match.same(oAnalyticalQueryRequest), "~isLeafGroupsRequest", {encode: true})
|
|
3842
3997
|
.returns("~urlParameters");
|
|
3843
3998
|
this.mock(oModel).expects("read").withExactArgs("/~path", {
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3999
|
+
success: sinon.match.func,
|
|
4000
|
+
error: sinon.match.func,
|
|
4001
|
+
context: undefined,
|
|
4002
|
+
urlParameters: "~urlParameters"
|
|
3848
4003
|
})
|
|
3849
4004
|
.returns("~requestHandle");
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
oSetupExpectation = this.mock(BatchResponseCollector.prototype).expects("setup")
|
|
4005
|
+
oBindingMock.expects("_getIdForNewRequestHandle").withExactArgs().returns("~newHandle");
|
|
4006
|
+
oBindingMock.expects("fireDataRequested").withExactArgs();
|
|
4007
|
+
const oSetupExpectation = this.mock(BatchResponseCollector.prototype).expects("setup")
|
|
3853
4008
|
.withExactArgs({
|
|
3854
4009
|
executedRequests: [sinon.match.same(aRequestDetails[0])],
|
|
3855
4010
|
binding: sinon.match.same(oBinding),
|
|
@@ -3862,9 +4017,179 @@ sap.ui.define([
|
|
|
3862
4017
|
AnalyticalBinding.prototype._executeBatchRequest.call(oBinding, aRequestDetails);
|
|
3863
4018
|
|
|
3864
4019
|
oBinding.iAnalyticalInfoVersionNumber = 2; // new analytical info causes abort of pending requests
|
|
3865
|
-
|
|
4020
|
+
oBindingMock.expects("fireDataReceived").withExactArgs();
|
|
4021
|
+
|
|
4022
|
+
// code under test - simulate abort; different iAnalyticalInfoVersionNumber
|
|
4023
|
+
oSetupExpectation.args[0][0].error(oError);
|
|
4024
|
+
|
|
4025
|
+
oBinding.iAnalyticalInfoVersionNumber = 1; // same iAnalyticalInfoVersionNumber
|
|
4026
|
+
oModelMock.expects("fireRequestCompleted").withExactArgs({
|
|
4027
|
+
async : true,
|
|
4028
|
+
errorobject: sinon.match.same(oError),
|
|
4029
|
+
info: "",
|
|
4030
|
+
infoObject : {},
|
|
4031
|
+
success: false,
|
|
4032
|
+
type : "POST",
|
|
4033
|
+
url : ""
|
|
4034
|
+
});
|
|
4035
|
+
oBindingMock.expects("fireDataReceived").withExactArgs();
|
|
3866
4036
|
|
|
3867
|
-
// code under test - simulate abort
|
|
4037
|
+
// code under test - simulate abort error in V2 case; same iAnalyticalInfoVersionNumber
|
|
3868
4038
|
oSetupExpectation.args[0][0].error(oError);
|
|
4039
|
+
/** @deprecated As of version 1.48.0 */
|
|
4040
|
+
((() => {
|
|
4041
|
+
oModelMock.restore();
|
|
4042
|
+
oModel._handleError = () => {};
|
|
4043
|
+
oModel.fireRequestFailed = () => {};
|
|
4044
|
+
oBinding.iModelVersion = 1;
|
|
4045
|
+
const oV1ModelMock = this.mock(oModel);
|
|
4046
|
+
oV1ModelMock.expects("_handleError").withExactArgs(sinon.match.same(oError)).returns("~oError0");
|
|
4047
|
+
oV1ModelMock.expects("fireRequestCompleted").withExactArgs({
|
|
4048
|
+
async : true,
|
|
4049
|
+
errorobject: "~oError0",
|
|
4050
|
+
info: "",
|
|
4051
|
+
infoObject : {},
|
|
4052
|
+
success: false,
|
|
4053
|
+
type : "POST",
|
|
4054
|
+
url : ""
|
|
4055
|
+
});
|
|
4056
|
+
oV1ModelMock.expects("fireRequestFailed").withExactArgs("~oError0");
|
|
4057
|
+
oBindingMock.expects("fireDataReceived").withExactArgs();
|
|
4058
|
+
|
|
4059
|
+
// code under test - simulate abort error in V1 case; same iAnalyticalInfoVersionNumber
|
|
4060
|
+
oSetupExpectation.args[0][0].error(oError);
|
|
4061
|
+
})());
|
|
4062
|
+
});
|
|
4063
|
+
|
|
4064
|
+
//*********************************************************************************************
|
|
4065
|
+
[undefined, {name : "~differentPropertyName"}].forEach(function (oTextProperty, i) {
|
|
4066
|
+
QUnit.test("_updateDimensionDetailsTextProperty: property is not the text property, " + i, function (assert) {
|
|
4067
|
+
const oDimension = {getTextProperty() {}};
|
|
4068
|
+
this.mock(oDimension).expects("getTextProperty").withExactArgs().returns(oTextProperty);
|
|
4069
|
+
const oDimensionDetails = {textPropertyName : "unchanged"};
|
|
4070
|
+
|
|
4071
|
+
// code under test
|
|
4072
|
+
AnalyticalBinding._updateDimensionDetailsTextProperty(oDimension, "~propertyName", oDimensionDetails);
|
|
4073
|
+
|
|
4074
|
+
assert.strictEqual(oDimensionDetails.textPropertyName, "unchanged");
|
|
4075
|
+
});
|
|
4076
|
+
});
|
|
4077
|
+
|
|
4078
|
+
//*********************************************************************************************
|
|
4079
|
+
QUnit.test("_updateDimensionDetailsTextProperty: property is the text property", function (assert) {
|
|
4080
|
+
const oDimension = {getTextProperty() {}};
|
|
4081
|
+
this.mock(oDimension).expects("getTextProperty").withExactArgs().returns({name : "~propertyName"});
|
|
4082
|
+
const oDimensionDetails = {};
|
|
4083
|
+
|
|
4084
|
+
// code under test
|
|
4085
|
+
AnalyticalBinding._updateDimensionDetailsTextProperty(oDimension, "~propertyName", oDimensionDetails);
|
|
4086
|
+
|
|
4087
|
+
assert.strictEqual(oDimensionDetails.textPropertyName, "~propertyName");
|
|
4088
|
+
});
|
|
4089
|
+
|
|
4090
|
+
//*********************************************************************************************
|
|
4091
|
+
[
|
|
4092
|
+
{descending : true, sortOrder : odata4analytics.SortOrder.Descending},
|
|
4093
|
+
{descending : false, sortOrder : odata4analytics.SortOrder.Ascending}
|
|
4094
|
+
].forEach((oFixture) => {
|
|
4095
|
+
QUnit.test("_addSorter", function (assert) {
|
|
4096
|
+
const oSortExpression = {addSorter() {}};
|
|
4097
|
+
this.mock(oSortExpression).expects("addSorter")
|
|
4098
|
+
.withExactArgs("~path", sinon.match.same(oFixture.sortOrder), "~bIgnoreIfAlreadySorted");
|
|
4099
|
+
const oSorter = {bDescending : oFixture.descending, sPath : "~path"};
|
|
4100
|
+
|
|
4101
|
+
// code under test
|
|
4102
|
+
AnalyticalBinding._addSorter(oSorter, oSortExpression, "~bIgnoreIfAlreadySorted");
|
|
4103
|
+
});
|
|
4104
|
+
});
|
|
4105
|
+
|
|
4106
|
+
//*********************************************************************************************
|
|
4107
|
+
QUnit.test("_mergeAndAddSorters", function (assert) {
|
|
4108
|
+
const oAnalyticalBindingMock = this.mock(AnalyticalBinding);
|
|
4109
|
+
// add oApplicationSorter0 and oGroupingSorter0 due to same path
|
|
4110
|
+
const oApplicationSorter0 = {sPath : "~path0"};
|
|
4111
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4112
|
+
.withExactArgs(sinon.match.same(oApplicationSorter0), "~oSortExpression");
|
|
4113
|
+
const oGroupingSorter0 = {sPath : "~path0"};
|
|
4114
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4115
|
+
.withExactArgs(sinon.match.same(oGroupingSorter0), "~oSortExpression", true);
|
|
4116
|
+
|
|
4117
|
+
// add oApplicationSorter1 and oGroupingSorter1 due to textPropertyName
|
|
4118
|
+
const oApplicationSorter1 = {sPath : "~path1"};
|
|
4119
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4120
|
+
.withExactArgs(sinon.match.same(oApplicationSorter1), "~oSortExpression");
|
|
4121
|
+
const oGroupingSorter1 = {sPath : "~dimensionPath1"};
|
|
4122
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4123
|
+
.withExactArgs(sinon.match.same(oGroupingSorter1), "~oSortExpression", true);
|
|
4124
|
+
|
|
4125
|
+
// only add oGroupingSorter2
|
|
4126
|
+
const oGroupingSorter2 = {sPath : "~dimensionPath2"};
|
|
4127
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4128
|
+
.withExactArgs(sinon.match.same(oGroupingSorter2), "~oSortExpression", true);
|
|
4129
|
+
|
|
4130
|
+
// add the rest of application sorters at the end
|
|
4131
|
+
const oApplicationSorter2 = {sPath : "~path2"};
|
|
4132
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4133
|
+
.withExactArgs(sinon.match.same(oApplicationSorter2), "~oSortExpression", true);
|
|
4134
|
+
const oApplicationSorter3 = {sPath : "~path3"};
|
|
4135
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4136
|
+
.withExactArgs(sinon.match.same(oApplicationSorter3), "~oSortExpression", true);
|
|
4137
|
+
const oBinding = {
|
|
4138
|
+
oDimensionDetailsSet : {
|
|
4139
|
+
"~dimensionPath1" : {textPropertyName : "~path1"},
|
|
4140
|
+
"~dimensionPath2" : {textPropertyName : "~foo"}
|
|
4141
|
+
},
|
|
4142
|
+
aSorter : [oApplicationSorter0, oApplicationSorter1, oApplicationSorter2, oApplicationSorter3]
|
|
4143
|
+
};
|
|
4144
|
+
|
|
4145
|
+
// code under test
|
|
4146
|
+
AnalyticalBinding.prototype._mergeAndAddSorters.call(oBinding,
|
|
4147
|
+
[oGroupingSorter0, oGroupingSorter1, oGroupingSorter2], "~oSortExpression");
|
|
4148
|
+
|
|
4149
|
+
assert.deepEqual(oBinding.aSorter,
|
|
4150
|
+
[oApplicationSorter0, oApplicationSorter1, oApplicationSorter2, oApplicationSorter3]);
|
|
4151
|
+
});
|
|
4152
|
+
|
|
4153
|
+
//*********************************************************************************************
|
|
4154
|
+
QUnit.test("_addSorters: cannot apply sorters to groups", function (assert) {
|
|
4155
|
+
const oBinding = {
|
|
4156
|
+
_canApplySortersToGroups() {},
|
|
4157
|
+
_mergeAndAddSorters() {}
|
|
4158
|
+
};
|
|
4159
|
+
const oBindingMock = this.mock(oBinding);
|
|
4160
|
+
oBindingMock.expects("_canApplySortersToGroups").withExactArgs().returns(false);
|
|
4161
|
+
oBindingMock.expects("_mergeAndAddSorters").withExactArgs("~aGroupingSorters", "~oSortExpression");
|
|
4162
|
+
|
|
4163
|
+
// code under test
|
|
4164
|
+
AnalyticalBinding.prototype._addSorters.call(oBinding, "~oSortExpression", "~aGroupingSorters");
|
|
4165
|
+
});
|
|
4166
|
+
|
|
4167
|
+
//*********************************************************************************************
|
|
4168
|
+
QUnit.test("_addSorters: can apply sorters to groups", function (assert) {
|
|
4169
|
+
const oApplicationSorter0 = {sPath : "~path0"};
|
|
4170
|
+
const oApplicationSorter1 = {sPath : "~path1"};
|
|
4171
|
+
const oBinding = {
|
|
4172
|
+
aSorter : [oApplicationSorter0, oApplicationSorter1],
|
|
4173
|
+
_canApplySortersToGroups() {},
|
|
4174
|
+
_mergeAndAddSorters() {}
|
|
4175
|
+
};
|
|
4176
|
+
const oBindingMock = this.mock(oBinding);
|
|
4177
|
+
oBindingMock.expects("_canApplySortersToGroups").withExactArgs().returns(true);
|
|
4178
|
+
const oAnalyticalBindingMock = this.mock(AnalyticalBinding);
|
|
4179
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4180
|
+
.withExactArgs(sinon.match.same(oApplicationSorter0), "~oSortExpression");
|
|
4181
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4182
|
+
.withExactArgs(sinon.match.same(oApplicationSorter1), "~oSortExpression");
|
|
4183
|
+
const oGroupingSorter0 = {sPath : "~path0"};
|
|
4184
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4185
|
+
.withExactArgs(sinon.match.same(oGroupingSorter0), "~oSortExpression", true);
|
|
4186
|
+
const oGroupingSorter1 = {sPath : "~path1"};
|
|
4187
|
+
oAnalyticalBindingMock.expects("_addSorter")
|
|
4188
|
+
.withExactArgs(sinon.match.same(oGroupingSorter1), "~oSortExpression", true);
|
|
4189
|
+
oBindingMock.expects("_mergeAndAddSorters").never();
|
|
4190
|
+
|
|
4191
|
+
// code under test
|
|
4192
|
+
AnalyticalBinding.prototype._addSorters.call(oBinding, "~oSortExpression",
|
|
4193
|
+
[oGroupingSorter0, oGroupingSorter1]);
|
|
3869
4194
|
});
|
|
3870
4195
|
});
|