spreadsheetimporter / ui5-cc-spreadsheetimporter

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

[Bug]: #614

Closed buesguen closed 2 months ago

buesguen commented 2 months ago

OData Version

OData V4

Draft

Yes

Scenario

Object Page/List Report

Environment

BAS

UI5 Spreadsheet Component

No response

What happened?

Hello,

I'm a new CAP learner and it is my first app. I created a CAP app by using this link : https://developers.sap.com/tutorials/build-cap-app.html then added a button to my Fiori elements table for Excel Upload.

and followed these steps :

  1. Install the component from npm
  2. Add resourceRoots to your manifest.json under sap.ui5
  3. Update your build script in package.json by adding --all
  4. Add componentUsages to your manifest.json under sap.ui5
  5. Handle the "component does not exist" error

But I'm getting this error : image

Can you explain what is missing? packagejson.txt ui5yaml.txt Press.txt Manifest.txt

Relevant log output

Device-dbg.js:85 2024-08-15 22:32:10 Device API logging initialized - DEVICE
Component-preload.js:1 

        Failed to load resource: the server responded with a status of 404 ()
Component-preload.js:1 

        Failed to load resource: the server responded with a status of 404 ()
Log-dbg.js:497  2024-08-15 22:32:10.276699 failed to load JavaScript resource: ns/incidents/Component-preload.js -  sap.ui.ModuleSystem
u @ Log-dbg.js:497
Log-dbg.js:497  2024-08-15 22:32:10.278000 The fallback locale 'en' is not contained in the list of supported locales [''] of the bundle 'i18n/i18n.properties' and will be ignored. -  
u @ Log-dbg.js:497
Log-dbg.js:497  2024-08-15 22:32:10.339000 The fallback locale 'en' is not contained in the list of supported locales [''] of the bundle './i18n/i18n.properties' and will be ignored. -  
u @ Log-dbg.js:497
Log-dbg.js:497  2024-08-15 22:32:10.339300 The fallback locale 'en' is not contained in the list of supported locales [''] of the bundle 'i18n/i18n.properties' and will be ignored. -  
u @ Log-dbg.js:497
Log-dbg.js:497  2024-08-15 22:32:10.867800 The fallback locale 'en' is not contained in the list of supported locales [''] of the bundle 'i18n/i18n.properties' and will be ignored. -  
u @ Log-dbg.js:497
Log-dbg.js:497  2024-08-15 22:32:10.898000 S/CUBE is not yet supported -  
u @ Log-dbg.js:497
/sap/bc/lrep/flex/data/ns.incidents?sap-language=6N:1 

        Failed to load resource: the server responded with a status of 404 ()
Log-dbg.js:497  2024-08-15 22:32:10.980099 Connector (LrepConnector) failed call 'loadFlexData': Error
                Application startup continues without data from this storage. -  
u @ Log-dbg.js:497
/sap/bc/lrep/flex/settings:1 

        Failed to load resource: the server responded with a status of 404 ()
Log-dbg.js:497  2024-08-15 22:32:11.039000 Connector (LrepConnector) failed call 'loadFeatures': Error
                Application startup continues without data from this storage. -  
u @ Log-dbg.js:497
Log-dbg.js:497  2024-08-15 22:32:11.177399 [FUTURE FATAL] The registered Event Listener 'onInit' must not have a return value. - sap.fe.templates.ListReport.ListReportController 
u @ Log-dbg.js:497
assert-dbg.js:33  Assertion failed: EventProvider.detachEvent: sEventId must be a non-empty string
n @ assert-dbg.js:33
assert-dbg.js:33  Assertion failed: EventProvider.detachEvent: sEventId must be a non-empty string
n @ assert-dbg.js:33
Log-dbg.js:497  2024-08-15 22:32:11.616800 TypeError: i.storeInnerAppStateAsync is not a function -  
u @ Log-dbg.js:497
FPMHelper.ts:33  Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bind')
    at FPMHelper.ts:33:35
    at ui5loader-dbg.js:2163:18
FPMHelper.ts:33  Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bind')
    at FPMHelper.ts:33:35
    at ui5loader-dbg.js:2163:18
assert-dbg.js:33  Assertion failed: EventProvider.detachEvent: sEventId must be a non-empty string
n @ assert-dbg.js:33
[NEW] Explain Console errors by using Copilot in Edge: click

         to explain an error. 
        Learn more

          Don't show again

Spreadsheet Component Init

Manifest.json : 

{
  "_version": "1.59.0",

  "sap.app": {
    "embeds": [
      "thirdparty/customcontrol/spreadsheetimporter/v1_2_0"
    ],
    "id": "ns.incidents",
    "type": "application",
    "i18n": "i18n/i18n.properties",
    "applicationVersion": {
      "version": "0.0.1"
    },
    "title": "{{appTitle}}",
    "description": "{{appDescription}}",
    "resources": "resources.json",
    "sourceTemplate": {
      "id": "@sap/generator-fiori:lrop",
      "version": "1.14.3",
      "toolsId": "666f6e38-05d3-4c81-a73e-05817fcd90b0"
    },
    "dataSources": {
      "mainService": {
        "uri": "/odata/v4/processor/",
        "type": "OData",
        "settings": {
          "annotations": [],
          "odataVersion": "4.0"
        }
      }
    }
  },
  "sap.ui": {
    "technology": "UI5",
    "icons": {
      "icon": "",
      "favIcon": "",
      "phone": "",
      "phone@2": "",
      "tablet": "",
      "tablet@2": ""
    },
    "deviceTypes": {
      "desktop": true,
      "tablet": true,
      "phone": true
    }
  },
  "sap.ui5": {    
    "flexEnabled": true,
    "dependencies": {
      "minUI5Version": "1.127.0",
      "libs": {
        "sap.m": {},
        "sap.ui.core": {},
        "sap.ushell": {},
        "sap.fe.templates": {}
      }
    },
    "componentUsages": {
      "spreadsheetImporter": {
        "name": "cc.spreadsheetimporter.v1_2_0"
      }
    },
    "resourceRoots": {
      "cc.spreadsheetimporter.v1_2_0": "./thirdparty/customcontrol/spreadsheetimporter/v1_2_0"
    },
    "contentDensities": {
      "compact": true,
      "cozy": true
    },
    "handleValidation": true,
    "models": {
      "i18n": {
        "type": "sap.ui.model.resource.ResourceModel",
        "settings": {
          "bundleName": "ns.incidents.i18n.i18n"
        }
      },
      "": {
        "dataSource": "mainService",
        "preload": true,
        "settings": {
          "operationMode": "Server",
          "autoExpandSelect": true,
          "earlyRequests": true
        }
      },
      "@i18n": {
        "type": "sap.ui.model.resource.ResourceModel",
        "uri": "i18n/i18n.properties"
      }
    },
    "resources": {
      "css": []
    },
    "routing": {
      "config": {},
      "routes": [
        {
          "pattern": ":?query:",
          "name": "IncidentsList",
          "target": "IncidentsList"
        },
        {
          "pattern": "Incidents({key}):?query:",
          "name": "IncidentsObjectPage",
          "target": "IncidentsObjectPage"
        }
      ],
      "targets": {
        "IncidentsList": {
          "type": "Component",
          "id": "IncidentsList",
          "name": "sap.fe.templates.ListReport",
          "options": {
            "settings": {
              "contextPath": "/Incidents",
              "variantManagement": "Page",
              "navigation": {
                "Incidents": {
                  "detail": {
                    "route": "IncidentsObjectPage"
                  }
                }
              },
              "controlConfiguration": {
                "@com.sap.vocabularies.UI.v1.LineItem": {
                  "tableSettings": {
                    "type": "ResponsiveTable",
                    "selectionLimit": 0,
                    "enableExport": true
                  },
                  "actions": {
                    "ExcelUpload": {
                      "press": "ns.incidents.ext.controller.EUHandlerFile.EUHandlerMethod",
                      "visible": true,
                      "enabled": true,
                      "requiresSelection": false,
                      "text": "{i18n>excelUpload}"
                    }
                  }
                }
              },
              "initialLoad": "Enabled",
              "content": {
                "header": {
                  "actions": {
                    "asd": {
                      "press": "ns.incidents.ext.controller.Asd.asd",
                      "visible": true,
                      "enabled": true,
                      "text": "asd"
                    }
                  }
                }
              }
            }
          }
        },
        "IncidentsObjectPage": {
          "type": "Component",
          "id": "IncidentsObjectPage",
          "name": "sap.fe.templates.ObjectPage",
          "options": {
            "settings": {
              "editableHeaderContent": false,
              "contextPath": "/Incidents"
            }
          }
        }
      }
    }
  },
  "sap.fiori": {
    "registrationIds": [],
    "archeType": "transactional"
  }
}

Manifest

"resourceRoots": {
      "cc.spreadsheetimporter.v1_2_0": "./thirdparty/customcontrol/spreadsheetimporter/v1_2_0"
    },

"componentUsages": {
      "spreadsheetImporter": {
        "name": "cc.spreadsheetimporter.v1_2_0"
      }
    },
buesguen commented 2 months ago

I installed all packages to the both package.json files. and it is fixed in that way. thank you.