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]: Not able to reuse same spreadsheet importer component in multiple apps #490

Closed mainakaich closed 5 months ago

mainakaich commented 8 months ago

OData Version

OData V2

Draft

Yes

Scenario

Fiori Elements

Environment

BTP ABAP

UI5 Spreadsheet Component

cc.spreadsheetimporter.v0_31_5

What happened?

Not able to reuse spreadsheet importer in multiple apps.docx I want to use the same spreadsheet importer component in 2 apps. In first app, it is deployed properly. But in the 2nd app, deployment is failed.

Relevant log output

Will be shared upon request

Spreadsheet Component Init

"actions": {
                                        "SpreadSheetController": {
                                            "press": "zsschoice.ext.spreadSheetController.SpreadSheetController.uploadExcel",
                                            "visible": true,
                                            "enabled": true,
                                            "requiresSelection": false,
                                            "text": "Upload"
                                        }
                                    }

Manifest

"componentUsages": {
            "spreadsheetImporter": {
                "name": "cc.spreadsheetimporter.v0_31_5"
            }
        },
        "resourceRoots": {
            "cc.spreadsheetimporter.v0_31_5": "./thirdparty/customControl/spreadsheetImporter/v0_31_5"
        },
marianfoo commented 8 months ago

Hi @mainakaich Thank you for your report. Can you check if the app was actually deployed even with the error message?

mainakaich commented 8 months ago

Hi @marianfoo

Is there a way to validate if 0.31.5 was deployed successfully? But in general this app had version 0.31.4 and you fixed the date issue in 0.31.5. And when I test this app, this date issue is still there. So I am thinking the deployment was not successful.

Thanks, Mainak

marianfoo commented 8 months ago

Either it was not deployed or I did not fix ther error for you.
Can you check the BSP Application in ADT and check the manifest for the current version?

mainakaich commented 8 months ago

Hi @marianfoo

It is not deployed successfully. As you can see from attached screenshot, I am opening the fiori app zss_choice where the version is showing 0.29.1 whereas I have maintained 0.31.5 in the zss_choice fiori project manifest.json and package.json and deployed( and it failed during deployment as mentioned in the defect earlier). image

marianfoo commented 8 months ago

Ok, I'll try to reproduce it. You deployed them to the BTP ABAB Stack right?

mainakaich commented 8 months ago

@marianfoo yes, I deployed to BTP ABAP Environment

mainakaich commented 8 months ago

@marianfoo the interesting thing here is if you release a new dummy version e.g. 0.31.6, then system will not complain during deployment since it is treated as a different component.

marianfoo commented 7 months ago

Hi @mainakaich i was able to reproduce the error, but i have no solution. I´d recommend that you create a ticket with SAP because that error has nothing to do with my component but the deployment of nested components.

What has worked for me, however, is the central deployment. Now the namespace really only exists once and the deployment and use in the app has worked. https://docs.spreadsheet-importer.com/pages/CentralDeployment/ Please try that and report back. Also if SAP Support was able to help you, i would be very interested in the solution.

marianfoo commented 7 months ago

Currently opened a SAP Case, might take a while

marianfoo commented 6 months ago

Still working with SAP on the case but I already have an explanation why it doesn't work and a possible solution. By the way, this has nothing to do with my component but only reuse components in general and namespaces in the ABAP system.

In a normal deployment of UI5 apps, libraries and reuse components all have a unique namespace and this cannot be deployed twice. These are then also present in the app index and are there to be loaded in the launchpad.

If you now deploy the component in the app itself, the namespace of the Spreadsheet Importer component is still globally available in the app index. Therefore, no second app can be deployed with the Spreadsheet Importer, as this namespace is already assigned, hence the error message. You can easily check this by deploying a component in an app and then calling this URL. <//ABAPURL//>/sap/bc/ui2/app_index/ui5_app_info?id=cc.spreadsheetimporter.v0_33_0

This means that if you deploy the spreadsheet importer within an app, it is basically the same as a standalone deployment. So for your second and all other apps that still use the Spreadsheet Importer, you can simply use the instructions for the central deployment, but only if the same version is always used. https://docs.spreadsheet-importer.com/pages/GettingStarted/#setup-central-deployment

This is the special feature of the ABAP Cloud environment. But it also means that the same problem will land on the on-premise environment, even if it is not there yet.

So far I have recommended in-app deployment, but due to this development I am leaning more towards standalone or central deployment, which was my workaround for this problem anyway.

Why did i say possible solution? Because it seems like there is a bug which prevents this solution to work :/ I´ll keep this issue updated but would recommend to use standalone deployment in the cloud.

mainakaich commented 6 months ago

@marianfoo, Thanks so much for your guidance and providing the detailed update. It really helped. As you suggested, I will try out the central deployment now. I will let you know if I face any issue there.

marianfoo commented 6 months ago

No worries, i will leave the issue open as of now

marianfoo commented 6 months ago

Why did i say possible solution? Because it seems like there is a bug which prevents this solution to work :/

SAP has recognized an error, after SAP fixed it I will improve the documentation for it

marianfoo commented 5 months ago

Why did i say possible solution? Because it seems like there is a bug which prevents this solution to work :/

SAP has recognized an error, after SAP fixed it I will improve the documentation for it

SAP has fixed the error, i updated the documentation for it: https://docs.spreadsheet-importer.com/pages/GettingStarted/#component-deployment