From 21b46adc9851a7779df210c84bade67d49713e6c Mon Sep 17 00:00:00 2001 From: Janik Date: Tue, 5 Mar 2024 14:29:10 +0100 Subject: [PATCH] [INTERNAL] p13n JSDoc improvements Change-Id: I5d60ded5c7ec13c5e8e3a855b92868b76d60721a --- src/sap.m/src/sap/m/p13n/FilterController.js | 20 +++++++++---------- src/sap.m/src/sap/m/p13n/MetadataHelper.js | 4 ++-- .../src/sap/m/p13n/SelectionController.js | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/sap.m/src/sap/m/p13n/FilterController.js b/src/sap.m/src/sap/m/p13n/FilterController.js index 640e795a8b31..fc45b3e02b96 100644 --- a/src/sap.m/src/sap/m/p13n/FilterController.js +++ b/src/sap.m/src/sap/m/p13n/FilterController.js @@ -23,7 +23,7 @@ sap.ui.define([ * * @public * @typedef {object} sap.m.p13n.FilterStateItem - * @property {string} operator The operator of the condition + * @property {sap.ui.model.FilterOperator} operator The operator of the condition * @property {string[]} values The values of the condition * @property {boolean} [filtered] Defines whether the item is filtered (if a filter state is provided, it's filtered automatically) * @@ -53,14 +53,14 @@ sap.ui.define([ * @alias sap.m.p13n.FilterController */ const FilterController = BaseController.extend("sap.m.p13n.FilterController", { - constructor: function (mSettings) { + constructor: function(mSettings) { BaseController.apply(this, arguments); this._itemFactory = mSettings?.itemFactory; this._bResetEnabled = true; } }); - FilterController.prototype.getCurrentState = function () { + FilterController.prototype.getCurrentState = function() { const oXConfig = xConfigAPI.readConfig(this.getAdaptationControl()) || {}; const aConditions = oXConfig.hasOwnProperty("properties") ? oXConfig.properties.filterConditions : []; @@ -83,7 +83,7 @@ sap.ui.define([ return "active"; }; - FilterController.prototype.initAdaptationUI = function (oPropertyHelper, oWrapper) { + FilterController.prototype.initAdaptationUI = function(oPropertyHelper, oWrapper) { return new Promise((resolve, reject) => { sap.ui.require(["sap/m/p13n/FilterPanel", "sap/m/Input"], (FilterPanel, Input) => { @@ -131,7 +131,7 @@ sap.ui.define([ return aConditions.indexOf(oExistingCondition); }; - FilterController.prototype._createConditionChange = function (sChangeType, oControl, sFieldPath, oCondition) { + FilterController.prototype._createConditionChange = function(sChangeType, oControl, sFieldPath, oCondition) { delete oCondition.filtered; //Consider moving this to the delta calculation instead const oConditionChange = { @@ -163,7 +163,7 @@ sap.ui.define([ * * @returns {array} Array containing the delta based created changes */ - FilterController.prototype._diffConditionPath = function(sFieldPath, aConditions, aOrigShadowConditions, oControl, bAbsoluteAppliance){ + FilterController.prototype._diffConditionPath = function(sFieldPath, aConditions, aOrigShadowConditions, oControl, bAbsoluteAppliance) { let oChange; const aChanges = []; const aOrigConditions = merge([], aConditions); @@ -264,9 +264,9 @@ sap.ui.define([ return aConditionChanges; }; - FilterController.prototype.getDelta = function (mPropertyBag) { - const {existingState} = mPropertyBag; - let {changedState} = mPropertyBag; + FilterController.prototype.getDelta = function(mPropertyBag) { + const { existingState } = mPropertyBag; + let { changedState } = mPropertyBag; if (deepEqual(existingState, changedState)) { return []; @@ -304,7 +304,7 @@ sap.ui.define([ return oChangeContent; }; - FilterController.prototype.mixInfoAndState = function (oPropertyHelper) { + FilterController.prototype.mixInfoAndState = function(oPropertyHelper) { const mExistingFilters = this.getCurrentState() || {}; diff --git a/src/sap.m/src/sap/m/p13n/MetadataHelper.js b/src/sap.m/src/sap/m/p13n/MetadataHelper.js index 2b8feef49885..f9ff8d5c052c 100644 --- a/src/sap.m/src/sap/m/p13n/MetadataHelper.js +++ b/src/sap.m/src/sap/m/p13n/MetadataHelper.js @@ -61,10 +61,10 @@ sap.ui.define([ * * @public * @param {string} sKey The property key identifying a property entry - * @returns {object} A single property + * @returns {sap.m.p13n.MetadataObject | undefined} A single property */ MetadataHelper.prototype.getProperty = function(sKey) { - return this._aProperties.find(function(oProp){ + return this._aProperties.find((oProp) => { return oProp.key === sKey; }); }; diff --git a/src/sap.m/src/sap/m/p13n/SelectionController.js b/src/sap.m/src/sap/m/p13n/SelectionController.js index b49994e38164..680f8fb05394 100644 --- a/src/sap.m/src/sap/m/p13n/SelectionController.js +++ b/src/sap.m/src/sap/m/p13n/SelectionController.js @@ -43,7 +43,7 @@ sap.ui.define([ * * @param {object} mSettings Initial settings for the new controller * @param {sap.ui.core.Control} mSettings.control The control instance that is personalized by this controller - * @param {function} [mSettings.getKeyForItem] By default the SelectionController tries to identify the existing item through the + * @param {function(sap.ui.core.Element):string} [mSettings.getKeyForItem] By default the SelectionController tries to identify the existing item through the * key by checking if there is an existing item with this id. This behaviour can be overruled by implementing this method which will * provide the according item of the targetAggregation to return the according key associated to this item. * @param {string} mSettings.targetAggregation The name of the aggregation that is now managed by this controller