@sapui5/sap.suite.ui.generic.template 1.141.3 → 1.142.1
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 +3 -4
- package/src/sap/suite/ui/generic/template/.library +3 -2
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_kk.properties +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/Component.js +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +61 -12
- package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +2 -2
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n.properties +5 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ar.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_bg.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ca.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cnr.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cs.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cy.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_da.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_de.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_el.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_GB.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es_MX.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_et.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fi.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr_CA.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hi.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hr.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hu.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_id.properties +5 -2
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_it.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_iw.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ja.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_kk.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ko.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_lt.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_lv.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_mk.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ms.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_nl.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_no.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pl.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt.properties +4 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt_PT.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ro.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ru.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sh.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sk.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sl.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sr.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sv.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_th.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_tr.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_uk.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_vi.properties +5 -2
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_CN.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_TW.properties +3 -0
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartTable.fragment.xml +29 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/annotationHelpers/AnnotationHelperActionButtons.js +8 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +85 -21
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +8 -7
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ar.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pt.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_vi.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/templateSpecificPreparationHelper.js +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Actions.fragment.xml +2 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +0 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/fragments/MessagePopover.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +0 -5
- package/src/sap/suite/ui/generic/template/js/AnnotationHelperStreamSupport.js +2 -1
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +20 -2
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +47 -1
- package/src/sap/suite/ui/generic/template/lib/TableNoDataHandler.js +107 -0
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +58 -6
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +6 -4
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +44 -199
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterDataFetcherHelper.js +334 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +49 -13
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +34 -10
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +32 -8
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +32 -8
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +33 -9
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +33 -9
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +14 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +33 -9
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +33 -9
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +32 -8
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +28 -4
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +26 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +38 -14
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +33 -9
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +28 -4
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +31 -7
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +29 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +33 -9
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +32 -8
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +30 -6
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +10 -0
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +6 -1
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartChartHandler.js +10 -5
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartListHandler.js +6 -1
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartTableHandler.js +36 -31
- package/src/sap/suite/ui/generic/template/library.js +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/fragments/DetailSmartTable.fragment.xml +29 -28
|
@@ -133,7 +133,8 @@ sap.ui.define([
|
|
|
133
133
|
sPath = '${' + (sAnnotationUpdatablePath || sMetadataUpdatable) + '} !== false';
|
|
134
134
|
}
|
|
135
135
|
if (oFieldControl) {
|
|
136
|
-
|
|
136
|
+
var sFCPath = oFieldControl && oFieldControl.Path;
|
|
137
|
+
sPath += ' && ${' + sFCPath + '} > "1"';
|
|
137
138
|
}
|
|
138
139
|
return sPath;
|
|
139
140
|
},
|
|
@@ -368,6 +368,20 @@ sap.ui.define([
|
|
|
368
368
|
oComponentData.feEnvironment.getShareControlVisibility();
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
+
// If the FE app is embedded within the Inbox app, the Inbox injects a dummy object named "feEnvironment"
|
|
372
|
+
// into the "componentData". In this case, we obtain the (mocked) shell service from "feEnvironment"
|
|
373
|
+
// instead of the standard ShellUIService.
|
|
374
|
+
// The mocked shell service exposes few methods like "setTitle" and "setHierarchy".
|
|
375
|
+
// They are invoked by NavigationController.
|
|
376
|
+
//
|
|
377
|
+
// Otherwise, we return the actual "ShellUIService" from the app component.
|
|
378
|
+
function fnGetShellUIServicePromise () {
|
|
379
|
+
var oComponentData = oAppComponent.getComponentData();
|
|
380
|
+
return oComponentData?.feEnvironment?.getShellService ?
|
|
381
|
+
Promise.resolve( oComponentData.feEnvironment.getShellService() ) :
|
|
382
|
+
oAppComponent.getService("ShellUIService");
|
|
383
|
+
}
|
|
384
|
+
|
|
371
385
|
function attachToApplicationController() {
|
|
372
386
|
oTemplateContract.fnAddSideEffectPromise = function(oPromise){
|
|
373
387
|
var i = 0;
|
|
@@ -427,7 +441,7 @@ sap.ui.define([
|
|
|
427
441
|
oViewDependencyHelper: new ViewDependencyHelper(oTemplateContract)
|
|
428
442
|
};
|
|
429
443
|
oTemplateContract.oViewDependencyHelper = oAppRegistryEntry.oViewDependencyHelper;
|
|
430
|
-
oTemplateContract.oShellServicePromise =
|
|
444
|
+
oTemplateContract.oShellServicePromise = fnGetShellUIServicePromise();
|
|
431
445
|
oTemplateContract.oShellServicePromise.catch(function(){
|
|
432
446
|
oLogger.warning("No ShellService available");
|
|
433
447
|
});
|
|
@@ -945,7 +959,7 @@ sap.ui.define([
|
|
|
945
959
|
* @public
|
|
946
960
|
* @extends sap.ui.core.UIComponent
|
|
947
961
|
* @author SAP SE
|
|
948
|
-
* @version 1.
|
|
962
|
+
* @version 1.142.1
|
|
949
963
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
950
964
|
*/
|
|
951
965
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -1049,6 +1063,10 @@ sap.ui.define([
|
|
|
1049
1063
|
skipOPContextInfoInBrowserTitle: {
|
|
1050
1064
|
type: "boolean",
|
|
1051
1065
|
defaultValue: false
|
|
1066
|
+
},
|
|
1067
|
+
noDataRepresentation: {
|
|
1068
|
+
type: "string",
|
|
1069
|
+
defaultValue: "illustration" // Possible values: 'illustration', 'illustrationWithFallback' and 'textOnly'
|
|
1052
1070
|
}
|
|
1053
1071
|
},
|
|
1054
1072
|
events: {
|
|
@@ -282,6 +282,51 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
282
282
|
return getSpecializedText(sKey, sSpecificI18nKey, sFrameworkKey, aParameters);
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
var aAppSpecificResourceBundles;
|
|
286
|
+
/**
|
|
287
|
+
* Returns i18n text from application's resource bundle.
|
|
288
|
+
*
|
|
289
|
+
* Background: On `lib.TemplateComponent#fnEnhanceI18nModel` method, FE's resource bundles are initialized.
|
|
290
|
+
* - The main resource bundle is `lib/i18n/i18n.properties`.
|
|
291
|
+
* - Additional bundles (floor-plan specific FE bundles + app bundles) are added as custom bundles (`ResourceBundle#aCustomBundles`).
|
|
292
|
+
*
|
|
293
|
+
* This method,
|
|
294
|
+
* 1. Creates an array of custom resource bundles ()`aAppSpecificResourceBundles`) which only contains the app's resource bundles.
|
|
295
|
+
* 2. Iterates through the app's bundles in reverse order to resolve the i18n key.
|
|
296
|
+
*
|
|
297
|
+
* Reason for reverse order:
|
|
298
|
+
* - The last bundle contains most specific text (floor-plan / entityset level).
|
|
299
|
+
* - The first bundle is more generic one.
|
|
300
|
+
* - This follows the same precedence logic as `sap.base.i18n.ResourceBundle#_getTextFromProperties`.
|
|
301
|
+
*
|
|
302
|
+
* @param {string} sKey i18n key
|
|
303
|
+
* @param {string[]} aArguments arguments for i18n text
|
|
304
|
+
* @returns {string|null} i18n text if found, otherwise null
|
|
305
|
+
*/
|
|
306
|
+
function getCustomizedTextFromApp(sKey, aArguments) {
|
|
307
|
+
var sText = null, i;
|
|
308
|
+
if (aAppSpecificResourceBundles == null) {
|
|
309
|
+
var oComponent = oController.getOwnerComponent();
|
|
310
|
+
var oResourceBundle = oComponent.getModel("i18n").getResourceBundle();
|
|
311
|
+
// FE's bundles are omitted.
|
|
312
|
+
aAppSpecificResourceBundles = oResourceBundle.aCustomBundles.filter(oBundle => {
|
|
313
|
+
return !oBundle.oUrlInfo.url.includes("sap/suite/ui/generic/template");
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
// "aArguments" normalized to array
|
|
317
|
+
if (aArguments && !Array.isArray(aArguments)) {
|
|
318
|
+
aArguments = [aArguments];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
for (i = aAppSpecificResourceBundles.length - 1; i >= 0; i--) {
|
|
322
|
+
sText = aAppSpecificResourceBundles[i].getText(sKey, aArguments, true);
|
|
323
|
+
if (sText != null) {
|
|
324
|
+
return sText;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
|
|
285
330
|
// This functions intends to give selection from different selection behavior
|
|
286
331
|
function getSelectionPoints(oInnerChart, sSelectionBehavior) {
|
|
287
332
|
var sSelectionBehavior = sSelectionBehavior || oInnerChart.getSelectionBehavior();
|
|
@@ -2044,7 +2089,8 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2044
2089
|
handleError: fnHandleError,
|
|
2045
2090
|
transformTechnicalPropsOnExportedFile: fnTransformTechnicalPropsOnExportedFile,
|
|
2046
2091
|
includeEntitySetParametersToExportedFile: fnIncludeEntitySetParametersToExportedFile,
|
|
2047
|
-
openContextInNewTabFromListItem: fnOpenContextInNewTabFromListItem
|
|
2092
|
+
openContextInNewTabFromListItem: fnOpenContextInNewTabFromListItem,
|
|
2093
|
+
getCustomizedTextFromApp: getCustomizedTextFromApp
|
|
2048
2094
|
};
|
|
2049
2095
|
}
|
|
2050
2096
|
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/base/util/extend",
|
|
3
|
+
"sap/ui/base/Object",
|
|
4
|
+
"sap/suite/ui/generic/template/genericUtilities/FeLogger"
|
|
5
|
+
], function (
|
|
6
|
+
extend,
|
|
7
|
+
BaseObject,
|
|
8
|
+
FeLogger
|
|
9
|
+
) {
|
|
10
|
+
"use strict";
|
|
11
|
+
var oLogger = new FeLogger("lib.TableNoDataHandler").getLogger();
|
|
12
|
+
|
|
13
|
+
function getMethods(oController, oTemplateUtils, oNoDataConfig) {
|
|
14
|
+
var sNoDataRepresentation = oController.getOwnerComponent().getAppComponent().getNoDataRepresentation();
|
|
15
|
+
|
|
16
|
+
function fnSetNoDataMessage (oSmartTable, sScenario) {
|
|
17
|
+
if (sNoDataRepresentation === "textOnly") {
|
|
18
|
+
fnSetTextMessage(oSmartTable, sScenario);
|
|
19
|
+
} else if (["illustration", "illustrationWithFallback"].includes(sNoDataRepresentation)) {
|
|
20
|
+
fnSetIllustratedMessage(oSmartTable, sScenario);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Sets "text" based no data message
|
|
25
|
+
function fnSetTextMessage (oSmartTable, sScenario) {
|
|
26
|
+
var sSmartTableId = oSmartTable.getId();
|
|
27
|
+
var sI18nKey = oNoDataConfig[sScenario].i18nKey;
|
|
28
|
+
var sNoDataText = oTemplateUtils.oCommonUtils.getContextText(sI18nKey, sSmartTableId);
|
|
29
|
+
oSmartTable.setNoData(sNoDataText);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Sets "illustration" based no data message
|
|
33
|
+
function fnSetIllustratedMessage (oSmartTable, sScenario) {
|
|
34
|
+
var sSmartTableId = oSmartTable.getId();
|
|
35
|
+
var sI18nPrefix = oNoDataConfig[sScenario].i18nKey;
|
|
36
|
+
// Derive title key from base key
|
|
37
|
+
var sTitleI18nKey = sI18nPrefix + "_ILLUSTRATION_TITLE";
|
|
38
|
+
// Get title from resource bundle.
|
|
39
|
+
var sTitle = oTemplateUtils.oCommonUtils.getContextText(sTitleI18nKey, sSmartTableId);
|
|
40
|
+
// Find description (this logic varies between "illustration" and "illustrationWithFallback")
|
|
41
|
+
var sDescription = fnDeriveIllustrationDescription(sI18nPrefix, sSmartTableId);
|
|
42
|
+
// Get illustration type from config
|
|
43
|
+
var sIllustrationType = oNoDataConfig[sScenario].illustrationType;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
var oNoDataIllustratedMessage = oSmartTable.getNoData();
|
|
47
|
+
// oSmartTable.getNoData should actually return an illustrated message.
|
|
48
|
+
//
|
|
49
|
+
// Sometimes, app changes the no data message into text message using custom coding.
|
|
50
|
+
// Hence, adding this type check as a safety measure.
|
|
51
|
+
if ( !(oNoDataIllustratedMessage?.isA?.("sap.m.IllustratedMessage")) ) {
|
|
52
|
+
oLogger.error(`Unable to update the no data message of smart table ${oSmartTable.getId()} as it's not an IllustratedMessage`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// Table already has illustrated no data message. Just update the attributes
|
|
56
|
+
oNoDataIllustratedMessage.setIllustrationType(sIllustrationType);
|
|
57
|
+
oNoDataIllustratedMessage.setTitle(sTitle);
|
|
58
|
+
oNoDataIllustratedMessage.setDescription(sDescription);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Calculates the illustrated message's description based on the manifest flag "noDataRepresentation" value
|
|
63
|
+
* 1. If manifest flag is "illustration"
|
|
64
|
+
* - Just returns text for the new i18n key (legacy key + "_ILLUSTRATION_DESCRIPTION")
|
|
65
|
+
* - The text can be found on either app or FE
|
|
66
|
+
* 2. If flag is "illustrationWithFallback"
|
|
67
|
+
* a. Checks the app if customized text available for (legacy i18n key | tableId) (for e.g. "NOITEMS_LR_SMARTTABLE|C_SalesOrder")
|
|
68
|
+
* - If found, returns it.
|
|
69
|
+
* b. Checks the app if customized text available just for legacy i18n key (for e.g. "NOITEMS_LR_SMARTTABLE")
|
|
70
|
+
* - If found, returns it.
|
|
71
|
+
* c. Returns the text for the new i18n key (Same as "Case 1" above).
|
|
72
|
+
*/
|
|
73
|
+
function fnDeriveIllustrationDescription (sI18nPrefix, sSmartTableId) {
|
|
74
|
+
var sLatestDescriptionI18nKey = sI18nPrefix + "_ILLUSTRATION_DESCRIPTION";
|
|
75
|
+
var sLatestDescription = oTemplateUtils.oCommonUtils.getContextText(sLatestDescriptionI18nKey, sSmartTableId);
|
|
76
|
+
if (sNoDataRepresentation === "illustration") {
|
|
77
|
+
return sLatestDescription;
|
|
78
|
+
}
|
|
79
|
+
// Below logic is for noDataRepresentation = "illustrationWithFallback"
|
|
80
|
+
var sLegacyDescription = null;
|
|
81
|
+
var sLegacyI18nKey = sI18nPrefix;
|
|
82
|
+
var sTableSpecificI18nSuffix = oTemplateUtils.oCommonUtils.getSpecificI18nKeyForSmartControl(sSmartTableId);
|
|
83
|
+
sTableSpecificI18nSuffix = (sTableSpecificI18nSuffix === "|") ? "" : sTableSpecificI18nSuffix; // Omit the suffix "|"
|
|
84
|
+
// If table specific i18n key is available, get the customized text for that.
|
|
85
|
+
if (sTableSpecificI18nSuffix) {
|
|
86
|
+
sLegacyDescription = oTemplateUtils.oCommonUtils.getCustomizedTextFromApp(sLegacyI18nKey + "|" + sTableSpecificI18nSuffix);
|
|
87
|
+
}
|
|
88
|
+
// If the description is not yet found, get the customized text just for the generic i18n key.
|
|
89
|
+
if (!sLegacyDescription) {
|
|
90
|
+
sLegacyDescription = oTemplateUtils.oCommonUtils.getCustomizedTextFromApp(sLegacyI18nKey);
|
|
91
|
+
}
|
|
92
|
+
// If legacy text is found, return it.
|
|
93
|
+
// Otherwise, return the latest one.
|
|
94
|
+
return sLegacyDescription || sLatestDescription;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
setNoDataMessage: fnSetNoDataMessage
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return BaseObject.extend("sap.suite.ui.generic.template.lib.TableNoDataHandler", {
|
|
103
|
+
constructor: function (oController, oTemplateUtils, oNoDataConfig) {
|
|
104
|
+
extend(this, getMethods(oController, oTemplateUtils, oNoDataConfig));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
@@ -15,8 +15,8 @@ sap.ui.define([
|
|
|
15
15
|
* It gets initialized when the Fiori AI EasyFill is enabled
|
|
16
16
|
* Below things are handled in this class:
|
|
17
17
|
* 1. Prepare Field metadata
|
|
18
|
-
* 2. Prepare EasyFill Dialog
|
|
19
|
-
*
|
|
18
|
+
* 2. Prepare EasyFill Dialog
|
|
19
|
+
*
|
|
20
20
|
*/
|
|
21
21
|
function getMethods(oState, oController, oTemplateUtils, oObjectPage) {
|
|
22
22
|
let oTransientContextForEasyFill;
|
|
@@ -25,13 +25,14 @@ sap.ui.define([
|
|
|
25
25
|
let mUpdatableLookupMap;
|
|
26
26
|
let oRb;
|
|
27
27
|
let oAIPopover;
|
|
28
|
+
let aEditableFields = [];
|
|
28
29
|
|
|
29
30
|
async function openEasyFillDialog(oEvent,oContext) {
|
|
30
31
|
let oEasyFillDialog;
|
|
31
32
|
oRb = oController.getView().getModel("i18n").getResourceBundle();
|
|
32
33
|
const bIsModelCreated = !!oController.getView().getModel("easyFillDialogModel");
|
|
34
|
+
oObjectPageModel = oObjectPage.getModel();
|
|
33
35
|
if (!bIsModelCreated) {
|
|
34
|
-
oObjectPageModel = oObjectPage.getModel();
|
|
35
36
|
const aDeferredGroups = oObjectPageModel.getDeferredGroups();
|
|
36
37
|
//Adding a defferred group will make sure that no batch call would get triggered to backend until submitChanges() is invoked
|
|
37
38
|
aDeferredGroups.push("EasyFillFETransientChanges");
|
|
@@ -107,8 +108,9 @@ sap.ui.define([
|
|
|
107
108
|
oObjectPageContext.setProperty(oProp, oTransientObject[oProp]);
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
activateSideEffects();
|
|
110
112
|
resetEasyFill(true);
|
|
111
|
-
oEasyFillDialog
|
|
113
|
+
oEasyFillDialog?.close();
|
|
112
114
|
},
|
|
113
115
|
onLiveChange: function(oEvent) {
|
|
114
116
|
const easyFillDialogModel = oController.getView().getModel("easyFillDialogModel");
|
|
@@ -124,6 +126,7 @@ sap.ui.define([
|
|
|
124
126
|
easyFillDialogModel.setProperty("/isBusy",true);
|
|
125
127
|
let mFieldMapping = getEntitySetMapForLLM();
|
|
126
128
|
let aiCallResult = await oTemplateUtils.oServices.oFioriAIHandler.fioriaiLib.EasyFill.extractFieldValuesFromText(oController.byId("EasyFillInputTextArea").getValue(), mFieldMapping);
|
|
129
|
+
aEditableFields = [];
|
|
127
130
|
easyFillDialogModel.setProperty("/isBusy",false);
|
|
128
131
|
formatDateValues(aiCallResult,mFieldMapping);
|
|
129
132
|
if (aiCallResult.success) {
|
|
@@ -170,10 +173,56 @@ sap.ui.define([
|
|
|
170
173
|
}
|
|
171
174
|
}, "easyFillPopup",undefined,true,true).then(function (oPopup) {
|
|
172
175
|
oEasyFillDialog = oPopup;
|
|
173
|
-
oPopup
|
|
176
|
+
oPopup?.open();
|
|
174
177
|
});
|
|
175
178
|
}
|
|
176
179
|
|
|
180
|
+
function activateSideEffects() {
|
|
181
|
+
//Making a set so that , duplicate field group ids are not passed
|
|
182
|
+
const aFieldGroupIdSet = new Set();
|
|
183
|
+
aEditableFields.forEach((oSmartField)=>{
|
|
184
|
+
//SideEffect would be invoked only for the editable controls inside the SmartField
|
|
185
|
+
const aEditableInnerFields = oSmartField.getInnerControls().filter((oControl)=>oControl.getEditable());
|
|
186
|
+
aEditableInnerFields.forEach((oControl)=>{
|
|
187
|
+
const aControlFieldGroupId = oControl.getFieldGroupIds();
|
|
188
|
+
if (aControlFieldGroupId.length > 0) {
|
|
189
|
+
aControlFieldGroupId.forEach((sFieldGroupId)=>{
|
|
190
|
+
aFieldGroupIdSet.add(sFieldGroupId);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const oView = oController.getView();
|
|
198
|
+
|
|
199
|
+
aFieldGroupIdSet.forEach((sFieldGroupId)=>{
|
|
200
|
+
const oID = oView.data(sFieldGroupId);
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Currently, the SmartFields are created using the TransientContext, which means both
|
|
204
|
+
* "context" and "contextObject" refer to the TransientContext instance.
|
|
205
|
+
*
|
|
206
|
+
* However, we need to use the original OP context so that side effects are triggered
|
|
207
|
+
* on the original OP context when the user saves data from the EasyFill dialog back to OP.
|
|
208
|
+
*
|
|
209
|
+
* Therefore, we update the "context" and "contextObject" to reference the original OP context.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
if (oID) {
|
|
213
|
+
oID["context"] = oObjectPageContext.getPath();
|
|
214
|
+
oID["contextObject"] = oObjectPageContext;
|
|
215
|
+
oView.data(sFieldGroupId,oID);
|
|
216
|
+
}
|
|
217
|
+
//To make sure that all the fields sideeffect would be triggered
|
|
218
|
+
const sSideEffectQualifier = oTemplateUtils.oServices.oApplicationController._getSideEffectsQualifier(oID.name);
|
|
219
|
+
oTemplateUtils.oServices.oApplicationController.registerGroupChange(sSideEffectQualifier);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
oView.triggerValidateFieldGroup([...aFieldGroupIdSet]);
|
|
224
|
+
}
|
|
225
|
+
|
|
177
226
|
function getAIPopover() {
|
|
178
227
|
return new Promise(async(resolve,reject) => {
|
|
179
228
|
const sFragmentname = "sap.suite.ui.generic.template.fragments.AINotice";
|
|
@@ -358,7 +407,7 @@ sap.ui.define([
|
|
|
358
407
|
var oGroup = new Group({
|
|
359
408
|
title: (isTransient) ? oRb.getText("EASY_FILL_PROPOSED_VALUES") : oRb.getText("EASY_FILL_PREVIOUS_VALUES")
|
|
360
409
|
});
|
|
361
|
-
|
|
410
|
+
|
|
362
411
|
for (const key of Object.keys(oDataFromLLM)) {
|
|
363
412
|
const oGroupElement = new GroupElement();
|
|
364
413
|
const oSmartField = new SmartField({
|
|
@@ -368,6 +417,9 @@ sap.ui.define([
|
|
|
368
417
|
contextEditable: isEditable,
|
|
369
418
|
change: onSmartFieldChange.bind(this)
|
|
370
419
|
});
|
|
420
|
+
if (isEditable) {
|
|
421
|
+
aEditableFields.push(oSmartField);
|
|
422
|
+
}
|
|
371
423
|
const oSmartLabel = new SmartLabel();
|
|
372
424
|
oSmartLabel.setLabelFor(oSmartField);
|
|
373
425
|
oGroupElement.addElement(oSmartField);
|
package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml
CHANGED
|
@@ -36,6 +36,7 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
|
|
|
36
36
|
text="Easy Fill"
|
|
37
37
|
type="Default"
|
|
38
38
|
icon="sap-icon://ai"
|
|
39
|
+
fesr:press="fe2:ef:analyzeText"
|
|
39
40
|
enabled="{easyFillDialogModel>/isEasyFillButtonEnabled}"
|
|
40
41
|
press="onEasyFillSubmitInputToAI">
|
|
41
42
|
</Button>
|
|
@@ -43,6 +44,7 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
|
|
|
43
44
|
id="EasyFillClearAll"
|
|
44
45
|
type = "Transparent"
|
|
45
46
|
press="onEasyFillClearAll"
|
|
47
|
+
fesr:press="fe2:ef:clearAll"
|
|
46
48
|
text="{i18n>EASYFILL_CLEAR_ALL}">
|
|
47
49
|
</Button>
|
|
48
50
|
</FlexBox>
|
|
@@ -58,8 +60,8 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
|
|
|
58
60
|
<HBox gap="0.5rem" justifyContent = "End" alignItems = "Center" renderType="Bare" class="sapSmartTemplatesObjectPageEasyFillReviewAreaBanner">
|
|
59
61
|
<Link text="{i18n>AI_LINK_NOTICE_TITLE}" press="onLinkPress"/>
|
|
60
62
|
<Label text="{i18n>AI_WARNING_TEXT}"/>
|
|
61
|
-
<Button icon = "sap-icon://thumb-up" type = "Transparent" fesr:press="
|
|
62
|
-
<Button icon = "sap-icon://thumb-down" type="Transparent" fesr:press="
|
|
63
|
+
<Button icon = "sap-icon://thumb-up" type = "Transparent" fesr:press="fe2:ef:thumbsup" enabled="{easyFillDialogModel>/feedbackEnabled}" press="onFeedbackPress"/>
|
|
64
|
+
<Button icon = "sap-icon://thumb-down" type="Transparent" fesr:press="fe2:ef:thumbsdown" enabled="{easyFillDialogModel>/feedbackEnabled}" press="onFeedbackPress"/>
|
|
63
65
|
</HBox>
|
|
64
66
|
<VBox class="sapSmartTemplatesObjectPageEasyFillReviewAreaSmartFormWrapper" renderType = "Bare" visible="{easyFillDialogModel>/isUpdatableVisible}">
|
|
65
67
|
<core:Fragment fragmentName="sap.suite.ui.generic.template.lib.ai.EasyFill.fragments.EasyFillUpdatebleSmartForm" type="XML"/>
|
|
@@ -73,10 +75,10 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
|
|
|
73
75
|
</FlexBox>
|
|
74
76
|
</content>
|
|
75
77
|
<beginButton>
|
|
76
|
-
<Button text="{i18n>
|
|
78
|
+
<Button text="{i18n>EASY_FILL_CONFIRM}" fesr:press="fe2:ef:confirm" enabled="{easyFillDialogModel>/isSaveEnabled}" press="onSaveFromEasyFillDialog" type="Emphasized"/>
|
|
77
79
|
</beginButton>
|
|
78
80
|
<endButton>
|
|
79
|
-
<Button text="{i18n>CANCEL}"
|
|
81
|
+
<Button text="{i18n>CANCEL}" press="onCancelEasyFillDialog" fesr:press="fe2:ef:cancel"/>
|
|
80
82
|
</endButton>
|
|
81
83
|
</Dialog>
|
|
82
84
|
</core:FragmentDefinition>
|