Component generator adds invalid string to index.html #54

Closed
saschakiefer opened this Issue Feb 20, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@saschakiefer
Owner

saschakiefer commented Feb 20, 2014

When the component controller doesn't find the comment /* endOfResources */ in index.html, it adds sap.ui.localResources( "myDir" ); at the beginning of index.html.
if the hook isn't found, the generator should do nothing.

@saschakiefer saschakiefer added this to the 0.2.1 milestone Feb 20, 2014

@saschakiefer saschakiefer added the bug label Feb 20, 2014

@saschakiefer saschakiefer self-assigned this Feb 20, 2014

@js1972 js1972 assigned js1972 and unassigned saschakiefer Feb 21, 2014

@js1972

This comment has been minimized.

Show comment
Hide comment
@js1972

js1972 Feb 21, 2014

Collaborator

We only want to use sap.ui.localResources( "myDir" ); on a classic app. For the Fiori-like apps that use the component model we use the UI5 bootstrap tag to specify resource roots instead.

So we need to detect what sort of app the new component is being generated in. If its classical then use this.addLocalResource(this.componentName);; if its fiori-like then skip this and ....

a) Do we need to add a new resource root? We don't if we are going to prefix the component name with the apps namespace as it already has that resource root defined.

b) If we don't prefix the component name with the apps namespace then we would need to add the component name as a resource root.
(the above two options depend on issue #47.)

Collaborator

js1972 commented Feb 21, 2014

We only want to use sap.ui.localResources( "myDir" ); on a classic app. For the Fiori-like apps that use the component model we use the UI5 bootstrap tag to specify resource roots instead.

So we need to detect what sort of app the new component is being generated in. If its classical then use this.addLocalResource(this.componentName);; if its fiori-like then skip this and ....

a) Do we need to add a new resource root? We don't if we are going to prefix the component name with the apps namespace as it already has that resource root defined.

b) If we don't prefix the component name with the apps namespace then we would need to add the component name as a resource root.
(the above two options depend on issue #47.)

js1972 added a commit to js1972/generator-openui5 that referenced this issue Feb 21, 2014

feat(Components): Handle component namespaces
Handle component namespaces:
 - Prompt for application architecture in uiComponent generator (will be refactored to be automatic later)
 - If application.js style then use addLocalResource()
 - If Component style then use new function: addResourceRoot() (this is still a work in progress for formatting the index.html)
 - Fix issue that the rewrite function in utils.js doesn't handle files that use tabs instead of spaces

Fixes #47 #54 #55
@saschakiefer

This comment has been minimized.

Show comment
Hide comment
@saschakiefer

saschakiefer Feb 21, 2014

Owner

Even though the generator checks for Application.js or Component.js, I still want to add a check if the heystack is found.

Owner

saschakiefer commented Feb 21, 2014

Even though the generator checks for Application.js or Component.js, I still want to add a check if the heystack is found.

js1972 added a commit to js1972/generator-openui5 that referenced this issue Feb 23, 2014

fix(rewrite): Handle needle not found error in rewrite function.
Throw exception - handled by current default handler - when the needle is not found in the rewrite fucntion.

Fixes #54

js1972 added a commit to js1972/generator-openui5 that referenced this issue Feb 23, 2014

js1972 added a commit to js1972/generator-openui5 that referenced this issue Feb 24, 2014

@js1972 js1972 closed this Feb 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment