8005 Commits

Author SHA1 Message Date
Tyr Johanson
f82e407547 Dashboard ReOrg - Create 'project' module
Starting re-organization of the Launch Instance angular code
to move it into the correct place for plugins, namely
openstack_dashboard/dashboards/project/

This patch creates a static directory for the angular files in
the 'project' dashboard and will be the future home for launch
instance.

This patch attempts to divide https://review.openstack.org/#/c/191592
into smaller, more easily reviewable pieces.

Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>

Change-Id: I3804a55a339a876d14cf3739dc9f0278db03acf5
Partially-Implements: blueprint angularize-instances-table
2015-07-07 15:23:25 -07:00
Jenkins
653f85444f Merge "Use angular.isUndefined in place of !angular.isDefined" 2015-07-07 07:39:35 +00:00
Jenkins
c80b3c15ef Merge "JSCS - making app.module.js following JP" 2015-07-07 06:40:07 +00:00
Shaoquan Chen
402aba6b39 JSCS - making app.module.js following JP
This patch applies JP's style guide to
openstack_dashboard/../app.module.js.

Change-Id: I03101b1f5e93959905a31d810d10ddac1aa6c336
Partially-Implements: blueprint jscs-cleanup
2015-07-06 14:12:38 -07:00
Yakira Dixon
bc7c4e8dd7 Use angular.isUndefined in place of !angular.isDefined
Use the angular.isUndefined function as noted by the eslint rules.

Change-Id: I0a48a8520f6cd0f1cdbbddb6b1395f82ad696f91
Partially-Implements: blueprint jscs-cleanup
2015-07-06 11:31:12 -07:00
Shaoquan Chen
02ce088fd3 Fixing hard-coded path
There are two places in angular launch-instance where it should have
used bathBase to build up a path rather than using hard-coded absolute
path (url). This bad practice keeps causing issues during refactoring.
This patch fixes the issue.

Change-Id: I02e945c4f4793fe435a2f0942787928285c458b0
2015-07-06 17:06:23 +00:00
OpenStack Proposal Bot
d8ce4041fb Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: If12314cd130f12e3ce6706f94ae74262283c76fe
2015-07-05 06:05:33 +00:00
Jenkins
a21329d98a Merge "Corrections to WEBROOT docs." 2015-07-03 10:17:34 +00:00
Jenkins
d4bb936c38 Merge "Imported Translations from Transifex" 2015-07-03 09:40:40 +00:00
Jenkins
9156d5c179 Merge "JSCS Cleanup - style guide cleanup for Util > Bind Scope" 2015-07-03 09:11:46 +00:00
OpenStack Proposal Bot
b38883d60d Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I9f818a25d0339294625617a44cd096ee109c7e93
2015-07-03 06:05:59 +00:00
Shaoquan Chen
cb8077db69 Extending Karma config
This patch extends karma's config to cover code in
/openstack_dashboard/dashboards/
where plugins should reside.

Co-Authored-By: Tyr Johanson <tyr@hp.com>

Change-Id: I82d7463f64b26bb36c2182488e20d41f1b2d87dd
Partially-Implements: blueprint angularize-instances-table
2015-07-02 20:13:42 -07:00
Jenkins
24f85b850a Merge "Add anti-ClickJack XFS hardening for old browsers" 2015-07-03 02:53:10 +00:00
Jenkins
cd6a883a9f Merge "Fix _get_tenant_volume_usages" 2015-07-03 01:12:28 +00:00
Jenkins
17342c2d42 Merge "Angular translation via babel (singular only)" 2015-07-02 22:44:34 +00:00
Jenkins
76ace698ac Merge "JSCS Cleanup - rename *.factory.js to *.service.js" 2015-07-02 22:44:23 +00:00
Jenkins
ab28be583e Merge "JSCS cleanup - launch-instance.js" 2015-07-02 22:05:08 +00:00
Jenkins
766d5a7cea Merge "JSCS Cleanup - style cleanup for modal factory" 2015-07-02 20:58:17 +00:00
Matt Borland
e6a5186842 Corrections to WEBROOT docs.
1) Misspelling of 'dashboard'
2) Exclusion of WSGIScriptAlias instruction for Apache
3) Inclusion of reminder to use collectstatic/compress after
   changing _variables.css
4) Capitalization of 'Apache'

Change-Id: I33c2121529ec45f8500b102e0d5979157e3e56b6
Closes-Bug: 1470982
2015-07-02 14:11:05 -06:00
Jenkins
2d14edce5b Merge "Added .eslintignore" 2015-07-02 20:08:52 +00:00
Cindy Lu
107b3fcb1a JSCS Cleanup - rename *.factory.js to *.service.js
Per the style guide (brought up by TravT):
https://github.com/johnpapa/angular-styleguide#style-y121

Factory and service should both just be .service.js

Change-Id: I2b1b57f0dbaa859a1d30a6d9e463108eb32d3263
Partially-Implements: blueprint jscs-cleanup
2015-07-02 12:08:54 -07:00
Jenkins
aa2db769c0 Merge "Remove serial console hardcode url" 2015-07-02 19:06:36 +00:00
Travis Tripp
21445e391a JSCS Cleanup - style cleanup for modal factory
Per the style guide:

Factory and service should both just be .service.js

https://github.com/johnpapa/angular-styleguide#style-y121

Notice the comment:
/**
 * recommended
 */
// services/factories
logger.service.js
logger.service.spec.js

And discussion here:

https://review.openstack.org/#/c/182243
https://review.openstack.org/#/c/195660

Change-Id: I361f38f0fb1989190fe1b3e75f224d4c46aafbf4
Partially-Implements: blueprint jscs-cleanup
2015-07-02 19:52:59 +01:00
Jenkins
fa50d79721 Merge "Remove 'shared' from Neutron Firewall table" 2015-07-02 18:46:18 +00:00
Jenkins
095fe40527 Merge "Add integration tests for Identity->Projects page" 2015-07-02 18:46:04 +00:00
Jenkins
959ee8d59b Merge "JSCS Cleanup - style cleanup for Launch Instance Security Groups Step" 2015-07-02 18:40:30 +00:00
Brian Tully
056151cc70 Add anti-ClickJack XFS hardening for old browsers
A Cross-Frame Scripting (XFS) vulnerability can allow an attacker to
load the vulnerable application inside an HTML iframe tag on a
malicious page. An attacker could use XFS to devise a Clickjacking
attack to conduct phishing, frame sniffing, social engineering or
Cross-Site Request Forgery attacks. Although many pages within Horizon
leverage the X-Frame-Options header with the recommended SAMEORIGIN
policy, some (still popular) older browsers don’t support this setting.
Namely, browsers older than IE 8 and Firefox 3.6.9 don’t recognize the
header and are thus vulnerable to an attack known as ClickJacking
unless an additional mitigating control is present.

To support legacy browsers, a suggested best practice is to add a
frame breaking script to the base/global template file.

Reference: http://tinyurl.com/anticlickjack

Change-Id: Ibd7acd0d7b4c4d58afcd59f025735bfc9e4c2957
Closes-Bug: 1461154
2015-07-02 12:57:35 -04:00
Jenkins
bbefb309d8 Merge "Wrong url in document of horizon tutorial" 2015-07-02 15:33:15 +00:00
Michael Krotscheck
81a256821a Added .eslintignore
This file adds the ignore pattern previously contained in
.jshintignore.

Change-Id: I2b4b2cd94567e8c68f2f97a6757b8cacfb4de9a6
2015-07-02 08:29:08 -07:00
Jenkins
1405992717 Merge "Update project list in the header bar." 2015-07-02 14:40:29 +00:00
Jenkins
8f0ff6f139 Merge "Error message for invalid job details page" 2015-07-02 07:05:49 +00:00
Jenkins
bc0fecd97c Merge "Adding identity ng-users panel" 2015-07-02 06:47:42 +00:00
Jenkins
5312dbf1fc Merge "Remove first newline from generated OpenSTack RC file" 2015-07-02 02:16:45 +00:00
Jenkins
31ca133f59 Merge "Apply auto-file-discovery to plugins" 2015-07-02 01:52:05 +00:00
Neill Cox
9b36822fe2 Angular translation via babel (singular only)
An approach to i18n for Angular HTML templates using babel. This patch
allows only singular translation. Plurals and context will be
addressed in subsequent patches.

Based on Thai Tran's work at https://review.openstack.org/#/c/187321

This patch implements a custom extractor in
horizon/utils/babel_extract_angular.py. pybabel really wants this to be
a package installed into site-packages. I have not done this so as to
avoid introducing a dependency on another change to global requirements
just yet. I will upload a package to pypi in parallel so that we can
start using it in the future.

For now, I have had to modify tools/with_venv.sh to add horizon to the
PYTHONPATH. This is less than ideal but seemed to be the least worst
option.

Steps to verify that it works:
1. Create a new html file in horizon/static or openstack_dashboard/static
2. Add something like <div translate>hello world!</div> to the html
   To test interpolation add something like:
     <div translate>hello {$name$}!</div>
3. Run ./run_tests.sh --makemessages
4. Inspect your djangojs.po file, it should be there.

The following steps are optional:
5. Run ./run_tests.sh --pseudo de
6. Run ./run_tests.sh --compilemessages
7. Go to http://localhost:8000/settings
8. Change Language to Deutsch
9. Go to http://localhost:8000/i18n/js/horizon+openstack_dashboard
10. Your translated text should be there as well.

Note: There are now unit tests as well.

Partially-Implements: blueprint angular-translate-makemessages
Depends on: If4352aba01ce0ca6337f590c0689d8fe9f0867c8

Change-Id: I26d4fef8646d5f038918cd3376dbbdbef37eb603
2015-07-02 11:13:45 +10:00
Jenkins
3b4a428cfb Merge "Redirect URL for invalid data source details page" 2015-07-02 01:02:03 +00:00
Jenkins
86af08ddcf Merge "Error message for invalid job binary details page" 2015-07-02 01:01:50 +00:00
Jenkins
f8eba7d1cb Merge "Searchbar directive should be prefix with hz" 2015-07-02 00:58:28 +00:00
Thai Tran
24e57ef376 Adding identity ng-users panel
This sets up the python side of the users panel.
We need to do this since a panel still needs to inherit from base.html
and navigation is still tightly coupled with Dashboard.

This provides a cleaner way to phase out the old users panel.
This ensures that integration tests does not break until we are ready to
replace the old panel.

To test set DISABLED to False in _250_identity_users_panel.py

Change-Id: Ied6db285ccac0d70a7be4cb1e795b1a2c9058c19
Partially-Implemenents: blueprint angularize-identity-tables
2015-07-01 17:34:57 -07:00
Shaoquan Chen
c0f4ee6e07 JSCS cleanup - launch-instance.js
This patch breaks up launc-instance.js into small pieces according to
Horizon code style.

Change-Id: I852943a5223289391b1b8a315be80a48dcd39fb6
Partially-Implements: blueprint jscs-cleanup
2015-07-01 10:17:47 -07:00
Michael Krotscheck
eff59ac2dd Removed JSHint
JSHint is being deprecated by the Horizon project. This removes all
references, commands, and documentation related to this tool. The
patch depends on the deactivation patch for jshint in infra.

Change-Id: I1a799f39023e0598a58d912a4288300ec8340dd9
Depends-on: Ifb59af36ae37926133769c655e54f4c2e1edf095
Partially-Implements: blueprint jscs-cleanup
2015-07-01 09:11:21 -07:00
Aaron Sahlin
68d4aeb867 JSCS Cleanup - style cleanup for Launch Instance Security Groups Step
Following John Papa's style guide
https://github.com/johnpapa/angular-styleguide,
this patch refactors the Angular code for 'Security Groups' step
in Launch Instance wizard.

Change-Id: If5c56df70e7232172fa8ddb4878d5517bf9413b1
Partially-Implements: blueprint jscs-cleanup
2015-07-01 10:58:29 -05:00
Jenkins
849c3cc5d7 Merge "[Launch instance Fix] Fixes booting issue when booting from volume" 2015-07-01 15:22:09 +00:00
Vlad Okhrimenko
3c5be5106b Add integration tests for Identity->Projects page
The projects page is based on tnovacik's regions patches.
Add tests for create, delete project.

Partially implements blueprint: selenium-integration-testing

Change-Id: I89ecc3960ec27259eb2e4666119e6a6f682e1511
2015-07-01 17:36:37 +03:00
Shaoquan Chen
41b1b42dc0 Apply auto-file-discovery to plugins
When AUTO_DISCOVER_STATIC_FILES enabled in a plugin dashboard,
static files including JavaScript files and static angular html
templates will be automatically discovered.

Change-Id: I7a88983f2604b71431b5b18c97a5c22c37961141
Partially-Implements: blueprint auto-js-file-finding
2015-07-01 14:14:03 +01:00
Cindy Lu
332e9dcc94 JSCS Cleanup - style guide cleanup for Util > Bind Scope
Following John Papa's style guide, this patch cleans up
the Angular code for the 'bind-scope' module

Change-Id: I587e779bf369d1f6093877598a1d2717e9cd4616
Partially-Implements: blueprint jscs-cleanup
2015-06-30 23:02:24 -07:00
Michael Krotscheck
c6c0352982 Switched from JSCS to ESLint
This patch switches horizon from using JSCS to using ESlint. It
adds the john papa style guides as an eslint plugin, and deactivates
additional linting rules so current cleanup efforts can focus on the
issues remaining from JSCS. Once that cleanup effort is complete,
we can switch our linting job to voting and move forward from there.

YAML for .eslintrc was chosen because the JSON specification does
not allow comments, and having comments (including rule links) will
make it easier to discuss linting changes.

Deactivated eslint rules have each been annotated with a # TODO
statement, so we can address them in the future. Links in the
documentation have been updated to new contributor guidelines, which
will be updated after this patch lands.

Linting may be executed by first installing npm dependencies using
`npm install`, and then executing `npm run lint` at any time in the
future. No python venv is required.

For clarification: We are switching to ESLint because JSCS explicitly
focuses on code-style, not on language use errors. For that purpose,
JSCS explicitly defers to JSHint, which due to the 'do no evil' license is
not usable. Since ESLint provides both the codestyle functionality, and
the language use checks, of both JSCS and JSHint, it was deemed the
only viable tool,

http://lists.openstack.org/pipermail/openstack-dev/2015-June/067030.html

Change-Id: Ib4c3f77f8cc3cdaa3c7558b7bc3a6d1299b6dcbe
Partially-Implements: blueprint jscs-cleanup
2015-06-30 23:00:29 -07:00
Kuo-tung Kao
6d6a44e190 Searchbar directive should be prefix with hz
Rename search-bar directive to hz-search-bar for consistency.

Change-Id: I98e91b8fa6b9d6f0aa55825efce1de3a56e72f01
Closes-Bug: #1467610
2015-07-01 12:11:09 +08:00
Jenkins
e217e041d4 Merge "Applying auto-file-discovery partially" 2015-07-01 03:29:09 +00:00
Jenkins
9f563c498d Merge "Useing 'yesno' filter to display Boolean value" 2015-07-01 02:24:56 +00:00