@sapui5/sap.suite.ui.generic.template 1.124.6 → 1.124.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.124.6",
3
+ "version": "1.124.8",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "keywords": [
6
6
  "sapui5",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.124.6</version>
10
+ <version>1.124.8</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -44,8 +44,7 @@ sap.ui.define(["sap/m/SegmentedButtonItem", "sap/m/Button", "sap/m/Text", "sap/m
44
44
  }
45
45
  //Enable "AdaptFilter" beside the "Go" button
46
46
  if (!bShowGoButtonOnFilter) {
47
- //TODO:Hiding "AdaptFilter" button using private API , public API to be used when available
48
- me.oState.oSmartFilterbar.getAggregation("_filtersButton").setVisible(false);
47
+ me.oState.oSmartFilterbar.setShowFilterConfiguration(false);
49
48
  }
50
49
 
51
50
  oState.oHeader = oState.oPage.getHeader();
@@ -433,7 +433,7 @@ sap.ui.define([
433
433
  oVisualFilterDialogModelClone.setProperty('/filterCompList/' + idx + '/searchVisible', bVisible);
434
434
  oVisualFilterDialogModel.setData(oVisualFilterDialogModelClone.getData());
435
435
  //update config object when VFConfig model is updated
436
- this.oConfig = oVisualFilterDialogModel.getProperty();
436
+ this.oConfig = oVisualFilterDialogModel.getData();
437
437
  //to enable Restore button on change of chart type, sort order, measure field and show in filter bar changes
438
438
  this.oState.oSmartFilterbar._oVariantManagement.currentVariantSetModified(true);
439
439
  },
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.124.6"
11
+ "version": "1.124.8"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.124.6"
11
+ "version": "1.124.8"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.124.6"
11
+ "version": "1.124.8"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.124.6"
9
+ "version": "1.124.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -331,62 +331,110 @@ sap.ui.define([
331
331
  fnSetTargetEntity(oEntitySet);
332
332
 
333
333
  var bToolbarButtonVisible = fnGetTableToolbarButtonVisibility(oSettings, oEntitySet, oResult.type);
334
- var oPathforRestriction = fnGetRestrictionForPasteButton(oEntitySet);
335
334
  /* Workaround fix for non draft apps with no section settings defined in the manifest. In UI5v1.93, the export to excel button is displayed by default because of a code gap in
336
335
  FE which later got fixed with a change related to paste button in UI5v1.96 wherein the export button is not displayed by default. This looks like a regression issue to customers
337
336
  for which we have provided this temporary solution which shall get removed soon. */
338
337
  oResult.bExportToExcel = (!oComponentUtils.isDraftEnabled() && !oSettings.sections) || bToolbarButtonVisible;
339
- if (oPathforRestriction) {
340
- var sPathforRestriction = "";
341
- if (oPathforRestriction.insertable) {
342
- sPathforRestriction = "${" + oPathforRestriction.insertable + "}";
343
- }
344
- if (oPathforRestriction.updatable) {
345
- sPathforRestriction = sPathforRestriction ? sPathforRestriction + " || ${" + oPathforRestriction.updatable + "}" : "${" + oPathforRestriction.updatable + "}";
346
- }
347
- sPathforRestriction = sPathforRestriction && "(" + sPathforRestriction + ")";
348
- oResult.vShowPasteButton = bToolbarButtonVisible ? "{= ${ui>/editable} && " + sPathforRestriction + "}" : false;
349
- } else {
350
- oResult.vShowPasteButton = bToolbarButtonVisible ? "{ui>/editable}" : false;
351
- }
352
-
338
+ oResult.vShowPasteButton = fnGetPasteButtonVisibility(oEntitySet);
353
339
  oResult.commandExecution = fnGetTableLevelStandardActions();
354
340
  oResult.persistencyKeyState = fnGetPersistencyKeyState(oSettings.tableSettings);
355
341
 
356
342
  return oResult;
357
343
  }
358
-
359
- // fnGetRestrictionForPasteButton return object contains updatable and insertable restriction for the given Entity Set.
360
- function fnGetRestrictionForPasteButton(oEntitySet) {
361
- var oLeadingEntitySet = oMetaModel.getODataEntitySet(sLeadingEntitySet);
362
- var oInsertableAnnotation, oUpdatableAnnotation;
363
-
364
- var oInsertRestrictionSetViaNavRestrictions = AnnotationHelper.handleNavigationRestrictions(oMetaModel, oLeadingEntitySet, oEntitySet, 'Insertable');
365
- if (oInsertRestrictionSetViaNavRestrictions) {
366
- oInsertableAnnotation = oInsertRestrictionSetViaNavRestrictions['Insertable'];
367
- } else {
368
- var oSectionInsertRestriction = oEntitySet['Org.OData.Capabilities.V1.InsertRestrictions'];
369
- oInsertableAnnotation = oSectionInsertRestriction && oSectionInsertRestriction['Insertable'];
370
- }
371
344
 
372
- var oUpdateRestrictionSetViaNavRestrictions = AnnotationHelper.handleNavigationRestrictions(oMetaModel, oLeadingEntitySet, oEntitySet, 'Updatable');
373
- if (oUpdateRestrictionSetViaNavRestrictions) {
374
- oUpdatableAnnotation = oUpdateRestrictionSetViaNavRestrictions['Updatable'];
375
- } else {
376
- var oSectionUpdatableRestriction = oEntitySet['Org.OData.Capabilities.V1.UpdateRestrictions'];
377
- oUpdatableAnnotation = oSectionUpdatableRestriction && oSectionUpdatableRestriction['Updatable'];
345
+ /**
346
+ * Finds out the paste button visibility. It can be visible when,
347
+ * 1. The object page is editable AND
348
+ * 2. Either the table should be insertable OR updatable
349
+ * @param {object} oEntitySet Table's entity set info
350
+ * @returns {boolean|string} Returns a boolean value for visibility or binding expression
351
+ */
352
+ function fnGetPasteButtonVisibility (oEntitySet) {
353
+ var vInsertRestriction = fnGetRestrictionForPaste(oEntitySet, "Insertable");
354
+ var vUpdateRestriction = fnGetRestrictionForPaste(oEntitySet, "Updatable");
355
+
356
+ // If both the restrictions are boolean and falsy, paste button should be hidden.
357
+ // Hence, immediately return false
358
+ if (!(vInsertRestriction || vUpdateRestriction)) {
359
+ return false;
378
360
  }
379
361
 
380
- var sInsertablePath = oInsertableAnnotation ? oInsertableAnnotation.Path : "";
381
- var sUpdatablePath = oUpdatableAnnotation ? oUpdatableAnnotation.Path : "";
362
+ // As we are going to combine insertable and updatable by OR condition, if there's any boolean value "true" found, it will be always evaluated to true
363
+ // Hence, no need to include them in the binding and just return the binding expression "ui>/editable"
364
+ var bAnyBooleanTrue = [vInsertRestriction, vUpdateRestriction].some(function (vRestriction) {
365
+ return vRestriction === true;
366
+ });
367
+ if (bAnyBooleanTrue) {
368
+ return "{ui>/editable}";
369
+ }
382
370
 
383
- if (sInsertablePath || sUpdatablePath) {
384
- return {
385
- insertable: sInsertablePath,
386
- updatable: sUpdatablePath
387
- };
371
+ // Now the remaining cases are either
372
+ // 1. Both are path expressions or
373
+ // 2. One path expression and one boolean value "false"
374
+ //
375
+ // While building OR expression, "${expression} || false" will always be evaluated to "${expression}"
376
+ // Hence, we can omit the "false" values and build binding expression with "Path" values
377
+ var sPathRestriction = [vInsertRestriction, vUpdateRestriction].filter(function (vRestriction) {
378
+ return (typeof vRestriction === "string");
379
+ }).map(function (sPath) {
380
+ return "${" + sPath + "}";
381
+ }).join(" || ");
382
+
383
+ // Add "editable" with "path" expression
384
+ return "{= ${ui>/editable} && ( " + sPathRestriction + " )}";
385
+ }
386
+
387
+ /**
388
+ * Checks the navigation restriction on the parent entity set or current entity set
389
+ * and returns the boolean value or path for the restriction
390
+ *
391
+ * 1. If NavigationRestriction is available on parent entity set
392
+ * a. Restricted by boolean value - returns the boolean value
393
+ * b. Restricted by path - Checks the data type of path and returns it
394
+ *
395
+ * 2. If Restriction is available on table's entity set
396
+ * a. Restricted by boolean value - returns the boolean value
397
+ * b. Restricted by path - ignores it
398
+ * Important: Reason for ignoring the path. As path value refers to the individual records on the table, it can't control the whole table's paste functionality
399
+ *
400
+ * 3. If no restriction available, returns true
401
+ *
402
+ * @param {object} oEntitySet Table's entity set info
403
+ * @param {string} sRestrictionType "Insertable" or "Updatable"
404
+ * @returns {boolean|string} Boolean value or path for the restriction
405
+ */
406
+ function fnGetRestrictionForPaste (oEntitySet, sRestrictionType) {
407
+ var mAnnotation = {
408
+ Insertable: "Org.OData.Capabilities.V1.InsertRestrictions",
409
+ Updatable: "Org.OData.Capabilities.V1.UpdateRestrictions"
410
+ };
411
+
412
+ // Navigation restriction on parent entity set
413
+ var oLeadingEntitySet = oMetaModel.getODataEntitySet(sLeadingEntitySet);
414
+ var oNavRestriction = AnnotationHelper.handleNavigationRestrictions(oMetaModel, oLeadingEntitySet, oEntitySet, sRestrictionType);
415
+ var oNavRestrictionAnnotation = oNavRestriction && oNavRestriction[sRestrictionType];
416
+
417
+ // Restriction on table entity set
418
+ var oSectionRestriction = oEntitySet[mAnnotation[sRestrictionType]];
419
+ var oSectionRestrictionAnnotation = oSectionRestriction && oSectionRestriction[sRestrictionType];
420
+
421
+ // Check for navigation restriction
422
+ if (oNavRestrictionAnnotation) {
423
+ if (oNavRestrictionAnnotation.Bool) {
424
+ return oNavRestrictionAnnotation.Bool !== "false";
425
+ } else if (oNavRestrictionAnnotation.Path) {
426
+ var bIsBooleanPath = AnnotationHelper._isPropertyPathBoolean(oMetaModel, oLeadingEntitySet.entityType, oNavRestrictionAnnotation.Path);
427
+ if (!bIsBooleanPath) {
428
+ oLogger.error("Service Broken: Restrictions annotations for entity type " + sLeadingEntitySet + " for section '" + sRestrictionType + "' are invalid.");
429
+ return false;
430
+ }
431
+ return oNavRestrictionAnnotation.Path;
432
+ }
433
+ } else if (oSectionRestrictionAnnotation && oSectionRestrictionAnnotation.Bool) {
434
+ return oSectionRestrictionAnnotation.Bool !== "false";
388
435
  }
389
- return null;
436
+ // If no annotation found, return true
437
+ return true;
390
438
  }
391
439
 
392
440
  // used in the process of determining the visibility of export to excel and paste button depending on certain restrictions/conditions.
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.124.6"
9
+ "version": "1.124.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.124.6"
9
+ "version": "1.124.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -920,7 +920,7 @@ sap.ui.define([
920
920
  * @extends sap.ui.core.UIComponent
921
921
  * @abstract
922
922
  * @author SAP SE
923
- * @version 1.124.6
923
+ * @version 1.124.8
924
924
  * @name sap.suite.ui.generic.template.lib.AppComponent
925
925
  */
926
926
  var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -25,9 +25,9 @@ ST_SUCCESS=Con \u00E9xito
25
25
 
26
26
  ST_CHANGES_APPLIED=Se han aplicado las modificaciones
27
27
 
28
- DATA_LOSS_MESSAGE=Si sale se per.entr.
28
+ DATA_LOSS_MESSAGE=Sus entradas se perder\u00E1n al abandonar esta p\u00E1gina.
29
29
 
30
- DATA_LOSS_GENERAL_MESSAGE=Si cont.se per.entr.
30
+ DATA_LOSS_GENERAL_MESSAGE=Si contin\u00FAa se perder\u00E1n sus entradas.
31
31
 
32
32
  PROCEED=Continuar
33
33
 
@@ -3149,7 +3149,7 @@ sap.ui.define(["sap/ui/base/Object",
3149
3149
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
3150
3150
  * @public
3151
3151
  * @extends sap.ui.base.Object
3152
- * @version 1.124.6
3152
+ * @version 1.124.8
3153
3153
  * @since 1.30.0
3154
3154
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3155
3155
  */
@@ -62,7 +62,7 @@ sap.ui.define([
62
62
  interfaces: [],
63
63
  controls: [],
64
64
  elements: [],
65
- version: "1.124.6",
65
+ version: "1.124.8",
66
66
  extensions: {
67
67
  //Configuration used for rule loading of Support Assistant
68
68
  "sap.ui.support": {