spreadsheetimporter / ui5-cc-spreadsheetimporter

A UI5 Component to integrate a Spreadsheet Upload for UI5 Apps.
https://spreadsheet-importer.com/
Apache License 2.0
82 stars 16 forks source link

[Bug]: Overwrite Button text not working #578

Closed TravelTechCode closed 3 months ago

TravelTechCode commented 3 months ago

OData Version

OData V2

Draft

No

Scenario

Flexible programming model

Environment

BAS

UI5 Spreadsheet Component

1.1.0

What happened?

  1. As per the documentation : https://docs.spreadsheet-importer.com/pages/Configuration/#i18nmodel , to overwritetexts i am following this approach, but it isn't working for me.
    this.editFlow.getView().setBusyIndicatorDelay(0);
            this.editFlow.getView().setBusy(true);
            this.spreadsheetUpload = await this.editFlow.getView()
                .getController()
                .getAppComponent()
                .createComponent({
                    usage: "spreadsheetimporter",
                    async: true,
                    componentData: {
                        context: this,
                        debug: true,
                        columns: ["SAP_MATNR", "EXT_MATNR", "Distributor_code"],
                        spreadsheetFileName: "External Material Mapping Template.xlsx",
                        mandatoryFields: ["SAP_MATNR", "EXT_MATNR", "Distributor_code"],
                        batchSize: 100,
                        //createActiveEntity: true,
                        i18nModel: this.getModel("i18n"),
                        //  useTableSelector: true
                    },
                });
            this.spreadsheetUpload.openSpreadsheetUploadDialog();
            this.editFlow.getView().setBusy(false);
  2. In the previous versions the Buttons on the spreadsheetupload fragment used to have icons as well. for the latest version the icons are removed. Is there any way to configure it ???

Relevant log output

' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.Understand this error
Log-dbg.js?eval:500 2024-06-18 14:52:54.546899 retry loading JavaScript resource: bsc/latam/project1/ext/ListReportExtController.js -  sap.ui.ModuleSystem
log @ Log-dbg.js?eval:500
Log.warning @ Log-dbg.js?eval:272
Logger.warning @ Log-dbg.js?eval:686
onerror @ ui5loader-dbg.js:1477
error (async)
loadScript @ ui5loader-dbg.js:1493
requireModule @ ui5loader-dbg.js:1714
requireAll @ ui5loader-dbg.js:1876
fnRequire @ ui5loader-dbg.js:2133
(anonymous) @ FPMHelper.ts:53
actionWrapper @ FPMHelper.ts:22
FUNCTION_CALL @ ExpressionParser-dbg.js?eval:412
eval @ ExpressionParser-dbg.js?eval:740
formatter @ ExpressionParser-dbg.js?eval:920
CompositeBinding.getExternalValue @ CompositeBinding-dbg.js?eval:316
getBindingValue @ EventHandlerResolver-dbg.js:347
(anonymous) @ EventHandlerResolver-dbg.js:171
EventProvider.fireEvent @ EventProvider-dbg.js?eval:241
Element.fireEvent @ Element-dbg.js?eval:681
eval @ ManagedObjectMetadata-dbg.js?eval:826
Button.ontap @ Button-dbg.js:599
Element._handleEvent @ Element-dbg.js?eval:350
UIArea._handleEvent @ UIArea-dbg.js?eval:1052
dispatch @ jquery-dbg.js?eval:5430
triggerCustomEvent @ jquery-mobile-custom-dbg.js?eval:1907
clickHandler @ jquery-mobile-custom-dbg.js?eval:2030
dispatch @ jquery-dbg.js?eval:5430
elemData.handle @ jquery-dbg.js?eval:5234
trigger @ jquery-dbg.js?eval:8823
eval @ jquery-dbg.js?eval:8901
each @ jquery-dbg.js?eval:385
each @ jquery-dbg.js?eval:207
trigger @ jquery-dbg.js?eval:8900
triggerVirtualEvent @ jquery-mobile-custom-dbg.js?eval:1455
mouseEventCallback @ jquery-mobile-custom-dbg.js?eval:1465
dispatch @ jquery-dbg.js?eval:5430
elemData.handle @ jquery-dbg.js?eval:5234Understand this warning
Log-dbg.js?eval:503 2024-06-18 14:53:01.320399 Loading manifest via URL: thirdparty/customcontrol/spreadsheetimporter/v1_1_0/manifest.json?sap-language=EN -  
Log-dbg.js?eval:503 2024-06-18 14:53:01.537100 Component "cc.spreadsheetimporter.v1_1_0" is loading libraries: "sap.ui.core, sap.m" -  
Log-dbg.js?eval:503 2024-06-18 14:53:01.537600 Can't apply manifest to ComponentMetadata as it has already been created. - cc.spreadsheetimporter.v1_1_0.Component sap.ui.core.ComponentMetadata
Log-dbg.js?eval:503 2024-06-18 14:53:01.538500 Component "cc.spreadsheetimporter.v1_1_0" is loading library: "sap.ui.core" -  
Log-dbg.js?eval:503 2024-06-18 14:53:01.538899 Component "cc.spreadsheetimporter.v1_1_0" is loading library: "sap.m" -  
Log-dbg.js?eval:503 2024-06-18 14:53:01.539500 Component "cc.spreadsheetimporter.v1_1_0" is loading CSS: "thirdparty/customcontrol/spreadsheetimporter/v1_1_0/css/style.css" -  
Log-dbg.js?eval:503 2024-06-18 14:53:01.541800 Changing log level to DEBUG -  sap.base.log
Log-dbg.js?eval:516 {debug: true, columns: Array(3), spreadsheetFileName: 'External Material Mapping Template.xlsx', mandatoryFields: Array(3), batchSize: 100, …}
Log-dbg.js?eval:499 2024-06-18 14:53:01.545000 [FUTURE FATAL] The registered Event Listener 'init' must not have a return value. - __component0 
log @ Log-dbg.js?eval:499
Log.fatal @ Log-dbg.js?eval:226
throws @ future-dbg.js?eval:29
fatalThrows @ future-dbg.js?eval:40
_enforceNoReturnValue @ _enforceNoReturnValue-dbg.js?eval:22
eval @ ManagedObject-dbg.js?eval:533
constructor @ ManagedObject-dbg.js?eval:552
constructor @ Component-dbg.js?eval:336
constructor @ UIComponent-dbg.js:87
_constructor @ Component-dbg.js:204
oClassProxy @ Component-dbg.js?eval:3229
createInstance @ Component-dbg.js?eval:2738
eval @ Component-dbg.js?eval:2848
ManagedObject.runWithOwner @ ManagedObject-dbg.js?eval:1216
eval @ Component-dbg.js?eval:2847
Promise.then (async)
eval @ Component-dbg.js?eval:2812
Promise.then (async)
componentFactory @ Component-dbg.js?eval:2797
Component.create @ Component-dbg.js?eval:2499
createComponent @ Component-dbg.js?eval:1532
ManagedObject.runWithOwner @ ManagedObject-dbg.js?eval:1216
Component.runAsOwner @ Component-dbg.js?eval:781
Component._createComponent @ Component-dbg.js?eval:1543
Component.createComponent @ Component-dbg.js?eval:1363
openSpreadsheetUploadDialog @ ListReportExtController.js:16
(anonymous) @ FPMHelper.ts:56
(anonymous) @ ui5loader-dbg.js:2137
Promise.then (async)
requireAll @ ui5loader-dbg.js:1886
fnRequire @ ui5loader-dbg.js:2133
(anonymous) @ FPMHelper.ts:53
actionWrapper @ FPMHelper.ts:22
FUNCTION_CALL @ ExpressionParser-dbg.js?eval:412
eval @ ExpressionParser-dbg.js?eval:740
formatter @ ExpressionParser-dbg.js?eval:920
CompositeBinding.getExternalValue @ CompositeBinding-dbg.js?eval:316
getBindingValue @ EventHandlerResolver-dbg.js:347
(anonymous) @ EventHandlerResolver-dbg.js:171
EventProvider.fireEvent @ EventProvider-dbg.js?eval:241
Element.fireEvent @ Element-dbg.js?eval:681
eval @ ManagedObjectMetadata-dbg.js?eval:826
Button.ontap @ Button-dbg.js:599
Element._handleEvent @ Element-dbg.js?eval:350
UIArea._handleEvent @ UIArea-dbg.js?eval:1052
dispatch @ jquery-dbg.js?eval:5430
triggerCustomEvent @ jquery-mobile-custom-dbg.js?eval:1907
clickHandler @ jquery-mobile-custom-dbg.js?eval:2030
dispatch @ jquery-dbg.js?eval:5430
elemData.handle @ jquery-dbg.js?eval:5234
trigger @ jquery-dbg.js?eval:8823
eval @ jquery-dbg.js?eval:8901
each @ jquery-dbg.js?eval:385
each @ jquery-dbg.js?eval:207
trigger @ jquery-dbg.js?eval:8900
triggerVirtualEvent @ jquery-mobile-custom-dbg.js?eval:1455
mouseEventCallback @ jquery-mobile-custom-dbg.js?eval:1465
dispatch @ jquery-dbg.js?eval:5430
elemData.handle @ jquery-dbg.js?eval:5234Understand this error
Log-dbg.js?eval:503 2024-06-18 14:53:01.545600 Component instance Id = __component0 -  
Log-dbg.js?eval:516 {ui5version: '1.122.0', isOpenUI5: false}
Log-dbg.js?eval:516 {view: fnClass}
Log-dbg.js?eval:516 {tableObject: fnClass}
Log-dbg.js?eval:516 {tableID: 'bsc.latam.project1::MaterialMappingList--fe::table::MaterialMapping::LineItem-innerTable'}
Log-dbg.js?eval:516 {odataType: 'CatalogService.MaterialMapping'}
Log-dbg.js?eval:516 {odataKeyList: Array(0)}
Log-dbg.js?eval:516 {$Version: '4.0', $Reference: {…}, CatalogService.: {…}, CatalogService.EntityContainer: {…}, $EntityContainer: 'CatalogService.EntityContainer', …}
Log-dbg.js?eval:516 {typeLabelList: Map(3)}
Log-dbg.js?eval:516 {model: constructor}
Log-dbg.js?eval:503 2024-06-18 14:53:07.994000 Including https://sapui5.hana.ondemand.com/1.122.0/resources/sap/ui/comp/themes/sap_horizon/library.css -  sap.ui.core.theming.ThemeManager.includeLibraryTheme() -  
Log-dbg.js?eval:503 2024-06-18 14:53:09.772500 It's not needed to call IconPool.insertFontFaceStyle to insert font-face for the predefined icon font SAP-icons because the font-face is included in the library.css of sap.ui.core -  
Log-dbg.js?eval:503 2024-06-18 14:53:11.198800 Including https://sapui5.hana.ondemand.com/1.122.0/resources/sap/ui/table/themes/sap_horizon/library.css -  sap.ui.core.theming.ThemeManager.includeLibraryTheme() -  
Log-dbg.js?eval:503 2024-06-18 14:53:11.766399 Rendering of popup content: __dialog3 -

Spreadsheet Component Init

},
    "resourceRoots": {
      "cc.spreadsheetimporter.v1_1_0": "./thirdparty/customcontrol/spreadsheetimporter/v1_1_0"
    },
    "componentUsages": {
      "spreadsheetimporter": {
        "name": "cc.spreadsheetimporter.v1_1_0"
      }
    },

Manifest

No response

marianfoo commented 3 months ago

Please show make sure your i18n model is correctly in manifest and loaded in the component. Can you please show your i18n properties files

marianfoo commented 3 months ago

here is a example which still works https://github.com/spreadsheetimporter/ui5-cc-spreadsheetimporter/blob/bc7cecc2b23d49486890a9e1d3bead0e2c5b30c9/examples/packages/ordersv4fe/webapp/ext/ListReportExtController.js#L22

TravelTechCode commented 3 months ago

Hi Marian,

Initially I had maintined texts in i18n.properties file and now that i maintained in 18n_en.properties file, it is working, thanks Can you please help me with this query ?

In the previous versions the Buttons on the spreadsheetupload fragment used to have icons as well. for the latest version the icons are removed. Is there any way to configure it ???

marianfoo commented 3 months ago

Hi the icons were not according to Fiori Design Guidelines so they have been removed.
Currently they are no plans to add a config to add icons.