blackberry / webworks-gui

GUI Tool for WebWorks 2.0
https://developer.blackberry.com/html5/
Apache License 2.0
3 stars 5 forks source link

UI Validator shall be able check values for the access list #51

Closed jengee closed 10 years ago

jengee commented 10 years ago

Currently the UI accepts nothing as a value for the access list. The validator shall prevent users from adding values. building an app that contains no value as part of the access list will cause WebWorks to choke.

novalue

kwallis commented 10 years ago

Does this cause an issue at package/runtime?

jengee commented 10 years ago

yes and no. For the most part it'll still build except in the scenarios where you have additional valid subdomains after it. In that scenario, the UI will return the following message in the builder log:

[INFO] Populating application source [INFO] Parsing config.xml

And return nothing else so the user is left wondering what just happened.

Node returns this message: stdout: [INFO] Populating application source [INFO] Parsing config.xml

stderr: /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/lib/logger.js:28 console.error("[ERROR] " + msg.replace(/error: /i, "")); ^ TypeError: Object Error: Invalid URI attribute in the access element - protocol required(rim.net) has no method 'replace' at Object.module.exports.error (/Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/lib/logger.js:28:42) at Object.module.exports.start (/Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/lib/packager.js:69:24) at build (/Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/lib/build.js:121:39) at /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/node_modules/async/lib/async.js:548:21 at /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/node_modules/async/lib/async.js:224:13 at iterate (/Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/node_modules/async/lib/async.js:131:13) at /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/node_modules/async/lib/async.js:142:25 at /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/node_modules/async/lib/async.js:226:17 at /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/node_modules/async/lib/async.js:553:34 at /Users/jgee/WebWorks Projects/Project1/platforms/blackberry10/cordova/lib/build.js:103:64

And even more so, once you get into this state, you can't remove the empty tags in the config.xml file in the GUI. The delete buttons don't work at this point those the empty access. Other access items on the list can be removed. I was able to fix this state is by deleting the project from the UI and rebuilding it from scratch. Reimporting the same project that is in this state does not fix the problem of the access "delete" buttons not working

So to truley fix the problem would be that the user physically goes into the config.xml and reload it into the UI (save everything elsewhere, delete it from the UI and reload it back into the UI)

jengee commented 10 years ago

For my previous comment, here are the steps to reproduce the scenario:

  1. Create a project.
  2. Click on the Config tab and add an access origin of ""
  3. Click Save. Then click on to the Build Tab don't click anything there.
  4. Click on the Config tab and add another access origin of ""
  5. Click Save. Then click on to the Build Tab. Don't build or do anything there.
  6. Click back on the config tab and add access origin of "google.com" and click save.
  7. Staying on the config tab, add another access origin of "" and click save.
  8. Then Click on the build tab and Build. You will see the scenario described in my previous comment.

You should get a config.xml similar to this:

<content src="index.html"/>
<access origin="*"/>
<access subdomains="false"/>
<access subdomains="true"/>
<access subdomains="false"/>
<access subdomains="false"/>
<access origin="google.com" subdomains="false"/>
<access origin="" subdomains="false"/>

bryanhiggins commented 10 years ago

Duplicate of #39