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
Use the angular.isUndefined function as noted by the eslint rules.
Change-Id: I0a48a8520f6cd0f1cdbbddb6b1395f82ad696f91
Partially-Implements: blueprint jscs-cleanup
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
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
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
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
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
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
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
This patch breaks up launc-instance.js into small pieces according to
Horizon code style.
Change-Id: I852943a5223289391b1b8a315be80a48dcd39fb6
Partially-Implements: blueprint jscs-cleanup
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
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
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
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
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
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