wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
846 stars 785 forks source link

[3.1.0] Issue when building Devportal component if there are newly added files for UI customization #9267

Closed vithu30 closed 3 years ago

vithu30 commented 4 years ago

Description:

New files can be introduced to override directory when doing advanced UI customization - [1]. New files should be imported in the following format:

import NewFile from 'AppOverride/src/app/components/Apis/Details/NewFile.jsx';

When building Devportal component with above mentioned changes in Windows environment, following error is thrown due to file path conflict:

ERROR in ./source/src/app/components/Apis/Apis.jsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\~\repository\deployment\server\jaggeryapps\devportal\source\src\app\components\Apis\Apis.jsx: Octal literal in strict mode (26:38)

  24 | import Details from './Details/index';
  25 | import { ResourceNotFound } from '../Base/Errors';
> 26 | import NewFile from 'C:\~\repository\deployment\server\jaggeryapps\devportal/override//src/app/components/Apis/Details/NewFile';

In order to fix this issue, the same logic used in master branch -[2], needs to be ported to 3.1.0.

[1] https://apim.docs.wso2.com/en/3.1.0/develop/customizations/customizing-the-developer-portal/advanced-customization/ [2] https://github.com/wso2/carbon-apimgt/blob/master/features/apimgt/org.wso2.carbon.apimgt.store.feature/src/main/resources/devportal/loader.js

Environment details (with versions):

vithu30 commented 4 years ago

Need to test the behavior in Publisher app as well.