Commit Graph

94 Commits

Author SHA1 Message Date
Zuul a80ffceac4 Merge "Fix deprecated use of 'jQuery.fn.change()' shorthand event" 2023-05-09 19:09:48 +00:00
manchandavishal ba47352a73 Fix deprecated use of 'jQuery.fn.change()' shorthand event
This patch changed the code to use the recommended .trigger("change")
method instead of the deprecated .change(). For more information
about this deprecation, please refer [1].

[1] https://api.jquery.com/change-shorthand/

Change-Id: I762485c979cc5032db9a080d97d74f4be6efbcaf
2023-05-09 16:23:55 +05:30
manchandavishal 24047b5056 Fix "jQuery.fn.click() event shorthand is deprecated" warning
This patch changed the code to use the recommended 'on()' method
instead of the deprecated shorthand event. For more information
about this deprecation, please refer [1].

[1] https://api.jquery.com/click/

Change-Id: I4118a241a9e588ddac8cd1863979a7c83d6f98ff
2023-05-09 15:40:29 +05:30
Zuul da7173515d Merge "Fix deprecation warning for .removeAttr()" 2023-04-26 23:58:29 +00:00
Zuul 49d8d0ce75 Merge "Fix "jQuery.fn.mousedown() event shorthand is deprecated" warning" 2023-04-24 22:32:04 +00:00
manchandavishal 2d6cdae146 Fix deprecation warning for .removeAttr()
This patch updates the code to use the .prop() function instead of
.removeAttr() which was causing a deprecation warning.
For more info. please refer[1].

[1] https://api.jquery.com/removeAttr/

Change-Id: If9e104530d8ac48ead1d29eecabc6831046bc048
2023-04-20 01:52:53 +05:30
manchandavishal c397560d0d Fix "jQuery.fn.mousedown() event shorthand is deprecated" warning
This patch replaced the deprecated mousedown() event shorthand
with on('mousedown', ...) as suggested by the jQuery documentation[1].
This change ensures compatibility with the latest version of jQuery
and resolves the deprecation warning.

[1] https://api.jquery.com/mousedown/#mousedown-handler.

Change-Id: I2ccba8236d5831f4c81b3f963b7dc54fb98d95b8
2023-04-19 21:56:16 +05:30
manchandavishal cf158a213a Fix "jQuery.fn.submit() event shorthand is deprecated" warning
In horizon.forms.handle_submit(), replaced the shorthand .submit()
eventbinding with .on('submit', function ()) to avoid the deprecated
shorthand usage as suggested by the jQuery documentation[1].

[1] https://api.jquery.com/submit/

Change-Id: I1ddd89bd99510a981f2f3b6e198786890be22280
2023-04-11 00:12:52 +05:30
Tatiana Ovchinnikova 807a33e1c8 Update ESLint devDependencies in package.json
This patch updates outdated JavaScript dev dependencies.

The latest ESLint version adds rules changes. Some rules are disabled
to prevent checks failures, some minor issues are fixed.

Change-Id: I01c5ccb5c8f7ceb827a3978157b4d76805d259c1
2020-12-16 12:20:10 -06:00
白子玉 f6f858f721 Trigger size's oninput event manually after choosing source
When creating volume, after choosing a source such as Image,
Volume, Snapshot, the size is changed but oninput event cannot
be triggerred so that charts won't update automatically.

Change-Id: Ib1850739513af2cf13bcd4b468e809e9f0642c8a
closes-bug: #1428687
2020-01-20 11:11:25 +08:00
pengyuesheng d611572428 Add asterisk mark for the required field on create volume form
Change-Id: Ifb22a59523ab1cb96caebaddd5ea53f08faa197c
Closes-Bug: #1822524
2019-04-01 14:20:23 +08:00
pengyuesheng a81098b1d3 fix the bug of checkSpinnerValue
The user setting page sets the "Items Per Page" minimum or maximum value,
which affects the display of "Log Lines Per Instance"

Change-Id: I087412272257b665b6ac1de6ba5eabd06f011e74
Closes-Bug: #1803014
2018-11-13 10:24:29 +08:00
wangliangyu 0efbb377a5 Show an asterisk mark for 'switched' conditional filed(required=Flase)
Change-Id: I80dbd4b6aa9f3adeaf508b05f878b9f11cacf80a
Partial-Bug: #1755131
2018-03-16 14:58:26 +08:00
jiangpch 678bb64324 Fix bug for the switchable fields
Currently when a field switch to hidden, its required verification
doesn't get purged, this prevents form to be submitted.

Closes-bug: #1708601

Change-Id: I515ff048635f60610260ddfc076030e58724bf29
2017-08-20 20:54:00 -04:00
Diana Whitten 19e62b3cc5 Datepicker should inherit from theme
The datepicker plugin that we use provides its own css file, which we
were including and using, however, it was not inheriting any theme
variables.  Because the CSS was built with the default Bootstrap
skin in mind, it looked fine until you tried it on a different theme
and it inherited nothing.

A very minimal SCSS has been provided that actually pulls in theme
variables. The datepicker markup has been broken into templates that
will allow more granular overrides.

Change-Id: I3b6c92a205b2bfff908cb720974821db517a6a3f
Partially-implements: blueprint horizon-dynamic-theme
Partially-Implements: blueprint bootstrap-html-standards
2017-07-06 18:57:02 +00:00
Diana Whitten 1f11a79279 Horizon Forms should allow themable number spinners
Much like the themable selects and checkboxes, number spinners
should also be themable.

Standard number spinners are not very customizable.  We should use
existing buttons and fonts to add their functionality to allow a
richer experience if desired downstream.

An example of how to customize the spinner was placed in Material.
The example shows how to use flexbox to change layout type from
column to row, change icon order, and how to override the icons.

'autocomplete' needs to be false on this new element, otherwise
the browser will retain and load the last value without actually
triggering any JavaScript events by which we can key on and update
the state of the spinner buttons.

Change-Id: Ifd266cd515a903841e2d28e2f4731879116e3513
Closes-bug: #1598311
2017-06-28 15:50:27 -07:00
Jenkins 1dc560a9fd Merge "The minimum volume size should be pre-populated" 2016-12-12 23:38:37 +00:00
Ying Zuo cd2a7907be The minimum volume size should be pre-populated
On the create volume modal, the minimum volume size should be
pre-populated when user selects a different image.

Closes-bug: #1615114

Change-Id: I6a0feb376250aacb00270aa5db879dd4a98d6977
2016-12-12 14:16:57 -08:00
Jenkins 5974b0bab8 Merge "Add Apache 2.0 license to source file" 2016-12-08 12:29:29 +00:00
Cao Xuan Hoang b01c028673 Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.

[1] http://docs.openstack.org/developer/hacking/#openstack-licensing

Change-Id: If9ae2195d23ee8ed4bfe3da136e647f4e291a415
2016-12-02 17:40:28 +07:00
Maxime Guyot 016724d4ed Set the placeholder attribute in forms.py
Closes-Bug: #1640059
Change-Id: I4428d4c6ef7c198b480595bda8e12d8794b25e8d
2016-11-10 08:26:44 +01:00
Diana Whitten 238d273caa Project Creation from within Create User should work
Fix error in Themable Select Mutation Code

$options[jj] is just an HTML element, not a jQuery object, therefore
it didn't have an .attr function on it.

Change-Id: If763204737adcdb9bd0e4ae1ba0626a71770352a
Closes-bug: 1616660
2016-08-24 15:36:12 -07:00
Diana Whitten 00b842e989 Horizon selects are now themable: Table Actions
Horizon was using a standard select input.  Unfortunately,
this type of input is only customizable to a small extent.

Also, a bug was noted.  Things were being marked as btn-groups
that were not button groups.  This was fixed.

Co-Authored-By: Ryan Peters <rjpeter2@gmail.com>
Co-Authored-By: Matthew Wood <woodm1979@gmail.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>

Change-Id: I048f001bf71c5d9a8d13451b7e5a892122f481c8
Partially-implements: blueprint horizon-theme-css-reorg
2016-05-05 15:42:08 +00:00
Bo Wang fb804ac4ad Fix workflow bug in "Create Network" dialog
In "Subnet Info" tab, the button "Next" will hide and
button "Create" will show if checked Disable Gateway.
Because value of hide_tab is undefined but transformed to
hide_tab = ['undefined'] in js code.

Remove unused ',' which will introduce empty element in list:
String(['a', 'b',]).split(,) --> ['a', 'b', '']

Switching field "address_source" should not trigger
field "gateway_ip" show/disappear.

Closes-Bug: #1487005
Closes-Bug: #1530729
Closes-Bug: #1569942
Change-Id: If9e417e151e11c8ee46ded50ee3ee8108ed777a4
2016-04-18 16:34:12 +08:00
Luis Daniel Castellanos ac78a486d9 Image create "Copy Data" checkbox wrong label
"Copy Data" checkbox on Image create has the wrong label
How to reproduce:
  - Go to project -> Images
  - Click on "Create Image"

Expected result:
  - There is a "Copy Data" checkbox

Current result:
  - There is an "Image Location" checkbox with bad aligment

Change-Id: I7e6c7acb4ddcfc0a36c7e9f7651f269e375a5a14
Closes-Bug:#1560145
2016-03-24 20:26:24 +00:00
Diana Whitten 54b9506ed5 Branding: Create Network should inherit from theme
Create network is different than all other workflows, and it has a
lot of unnecessary style associated with it. This inhibits
themability. It should just use standard nav-pills.

partial-bug: #1551492
Closes-bug: #1553781

Change-Id: I6896df03b86ae0c4388ac15246739aeea5365a95
2016-03-16 13:00:43 +00:00
woodm1979 6a1c665ad1 Remove table search placeholder overwrite
Currently, the table-header-template sets the placeholder for filter
inputs.  This value is also being set (overwritten really) by
horizon.forms.js .  That doesn't make any sense.  Gabriel had previously
added a FIXME for this issue, but when it was fixed, nobody removed the
js overwrite.

The template placeholder is here (currently)
https://github.com/openstack/horizon/blob/master/horizon/templates/horizon/common/_data_table_table_actions.html#L21

Change-Id: Ib9ee07ef9db546aa48c8d235c2eecc82364dd4d4
Partially-implements: blueprint horizon-theme-css-reorg
2016-01-21 10:56:12 -07:00
Jenkins 3c5811b2a5 Merge "Remove disabled attribute from select fields on submit" 2015-12-09 09:48:34 +00:00
Michael Krotscheck 2aa78ad0b7 Enable no-unused-vars
This enables the no-unused-vars rule from the upstream
eslint-config-openstack, and corrects all linting errors found.

Change-Id: I9f5fb29cd9b2429698819ecf556ced933378b081
2015-11-18 10:14:28 -08:00
Frode Nordahl 1ce1bd4d4e Remove disabled attribute from select fields on submit
Subsqeuently we get the value included in the POST-request.

Replaces custom logic implemented for subnetpools that has weaknesses and
does not work any more.

Change-Id: I5ce5ff0dcd7ba812a92e1aaa82c770064f0302c0
Closes-Bug: 1498926
2015-10-13 09:07:35 +02:00
Frode Nordahl ef20a53f93 Support create subnet w/Neutron subnet allocation
The user is enabled to choose between entering a network address
manually or to allocate a network address from a pool. With the
advent of address scopes in Neutron this feature will be used for
enabling routing of globally unique addresses (GUA) all the way in
to the VM. This is a prerequisite for IPv6 to be routable, and will
also at some point allow GUA-IPv4 without NAT.

Workflow:
If subnet allocation is not supported in backend, there are no
subnet pools available, or the user chooses to enter network address
manually the form will behave like before.

If subnet allocation is supported in backend and there either are
subnet pools available or the label for the default subnet pool(s) is
configured, the user may choose to allocate a network address from a
pool. The user will be presented with two new drop-down menus. The
first drop-down menu will, in addition to the default pool (if
configured), present the names and prefixes of available pools. The
next drop-down menu will display available choices for prefix lengths
(it will not be displayed if the "default pool" is selected). The
available choices are defined by the subnet pool. Default prefix length
defined by the pool will be selected. The correct IP version is used
based on what IP version is defined by the selected subnet pool.

The "Create Subnet" checkbox has been moved from the Subnet step to
the first step of the workflow. This is because of how switchable
fields work, and how you can not safely define more than one slug in a
fields "switch-on" attribute. For the sake of User Experience, we need
to reliably switch fields based on selected Address source on the
Subnet tab. IMHO it also makes more sense to have this checkbox on the
first step of the workflow, if you just want to create a network you can
now uncheck the "Create Subnet" checkbox and click directly on "Create".

Change-Id: Ie392ccd9feae4dc02c3f30e2475457e755700b6b
Implements: blueprint neutron-subnet-allocation
2015-08-31 07:39:00 +02:00
Cindy Lu 7ed405fe14 Jshint unused and undef cleanup for forms, heattop JS
Removing unused and undefined variables in forms, formset_table,
heattop javascript. This ensures that once we enable it globally,
the gate will not barf.

Change-Id: I3d0b21dd1813fe83f28c2488cd308eee680ed690
Partial-Bug: #1438620
2015-04-23 11:09:12 -07:00
Bradley Jones a792e5b319 Next/Create button loses state in create network
Ensure that if the Next button should be Create button due to a tab in workflow
being removed, it stays as the Create button even after going back through the
workflow.

Change-Id: I5bf3ff79726db9464b7c1179f0a646901d3152f8
Closes-bug: 1384305
2015-03-23 14:03:17 +00:00
Jenkins 942deb1502 Merge "Angular Form Password Validation" 2015-03-11 23:33:56 +00:00
Jenkins a9883aed17 Merge "Fix auto-fill on filename input." 2015-03-10 22:11:30 +00:00
Chris Johnson 2a8cad0674 Refactor multiple references to $(document)
According to the Horizon Contributing Guide, we are to:
"Avoid creating instances of the same object repeatedly
within the same scope. Instead, assign the object to a
variable and re-use the existing object."

The guide references the use of "$(document)", as an
example. And yet multiple examples can be found of that
sort of approach. This commit cleans up those references.

Partial-Bug: 1412971
Change-Id: Ica05700101ae9a453623d928f07b75fa7aaca186
2015-03-09 19:23:00 -04:00
Thai Tran ac70b94899 Angular Form Password Validation
A simple form validation to check that password matches.
Required for the angular identity users create and edit action.

Also prevents angular form button from triggering legacy JS events.

Partially Implemenents: blueprint angularize-identity-tables
Change-Id: Ia69f4743b181f051a8574a3e25e626b346ef81b3
2015-03-06 21:56:38 +00:00
Cindy Lu afbca3d431 Password reveal feature should be configurable
Horizon has a password reveal eye button which allows the
password field to be viewed in plain text.  This is a security risk
because a malicious user can check the OpenStack password at an
unattended computer.

Add new DISABLE_PASSWORD_REVEAL setting which is by default, False.

DocImpact

Change-Id: I21a2eaedbff4c1ee73d97c5674eca43c0258ca1a
Closes-Bug: #1400872
2015-01-08 11:43:53 -08:00
Radomir Dopieralski d7ad91e8a8 Replace the glyphicons with font awesome icons
There are still some scss mixins that use the old (from bootstrap 2)
image icons. Replacing them will have to be done in a separate patch.

I also link to the css file, instead of scss, because django-pyscss has
some problems finding the right file. This is reported and will have to
be fixed upstream to unbundle bootstrap.

Change-Id: I67e94a9283bcceef8fc89343f3f5b2d7e0d4449f
Partial-implement: blueprint font-icons-replace
2014-12-01 14:36:38 -07:00
Timur Sufiev 6ffebb6d20 Return eye-icon to its place when validation message is shown
Making eye-icon properly positioned relies on its parent having
'has-feedback' class - which makes the parent to obey 'position:
relative' and thus eye-icon with its 'position: absolute' is properly
positioned within it.

Change-Id: I69ce13e1e3fc9674c4f25e7d04d79a3f550014a6
Closes-Bug: #1386126
2014-10-28 17:20:21 +00:00
Jenkins f151ff4e42 Merge "Fix dynamic select layout when help block is displayed" 2014-10-24 17:55:28 +00:00
Thai Tran a7b06e3837 Add init methods to javascript
Currently, we have old javascripts that automatically  get initialized when
the document is ready. This patch provides a mechanism to access those
initialization code by assigning them a name.

Change-Id: I59aa4abf6c68675f7c5f2802682d73fb7beb7613
Closes-bug: #1347072
2014-10-21 20:44:33 +00:00
Justin Pomeroy 6a97012b2f Fix dynamic select layout when help block is displayed
This fixes the layout of the dynamic select widget when the help
block is displayed. To reproduce this error you must be using the
keystone v2 API so that the Primary Project field will be required
when creating a user. If you leave it blank when submitting the
form the help block will be displayed.

Closes-Bug: #1361725
Change-Id: Ied4bb5d22b7e8a1948330503516cba2aa016417f
2014-10-21 08:35:14 -05:00
Bradley Jones 335444ab7b Hide gateway ip input field if gateway ip disabled
If the checkbox for gateway ip is selected, meaning that a gateway ip should not
be set, then hide the gateway ip input field.

Change-Id: I8f3764aeb30225e2cfcdd97d661ab4bbb9b173f8
Closes-bug: 1372313
2014-10-03 11:54:16 +01:00
Bradley Jones 1763d0a7e9 Style network address for subnet as required field
It does this by adding the required class to the network address field when the
checkbox is enabled.

I have also made the checkbox behave like a switchable select so when the create
subnet checkbox is checked all fields are visible. They are hidden when create
subnet is unselected.

When the checkbox is disabled the 'subnet details' step in the workflow is
hidden and the workflow can finish there by clicking the create button as all
other information is to do with subnet creation.

Issue highlighted in bug #1371901 was caused by the select.switchable methods in
horizon.forms.js looking at everything with class switchable instead of only
looking at select objects with class switchable.

Change-Id: I92d7b5eee758f0433e3fb61704ddb82f52147ad5
Closes-bug: 1367858
Related-bug: 1371901
2014-10-03 11:49:26 +01:00
Randy Bertram 78c917570e Datepicker locale support
Also adds general language info to the
horizon JS object.

Change-Id: I8fbf20635ac0a2ae1f3b8f618ce5a37eb53e9cc0
Closes-Bug: 1274145
2014-09-23 14:24:48 +00:00
Akihiro Motoki 927a698610 Revert "Style network address for subnet as required field"
This reverts commit 9f9b197fa0.

The reverted commit completely breaks IPv6 network creation
workflow. In the network creation workflow, when IPv6 is selected
in "IP version", all subnet related fields will be hidden and
users cannot created a network with IPv6 subnet.

Change-Id: I6c974ac4c890543166117253400cb6c827aa0fb8
Closes-Bug: #1371901
Related-Bug: #1367858
2014-09-20 20:17:58 +09:00
Jenkins b25fb96796 Merge "Style network address for subnet as required field" 2014-09-19 01:59:15 +00:00
Bradley Jones 9f9b197fa0 Style network address for subnet as required field
It does this by adding the required class to the network address field when the
checkbox is enabled.

I have also made the checkbox behave like a switchable select so when the create
subnet checkbox is checked all fields are visible. There are hidden when create
subnet is unselected.

Change-Id: Id45d5ce2a1bb55e4bcaa33df065ca2b1ccee3c7e
Closes-bug: 1367858
2014-09-15 15:19:54 +01:00
Randy Bertram 6849481c42 Switch to xstatic-bootstrap-datepicker
This points to datepicker 1.3.1 in xstatic.
Also fixes a couple of minor bugs in forms with
the new datepicker. The datepicker patch is:
https://review.openstack.org/#/c/116866/

Change-Id: I0a8cb7a16e50addbbdb10df8bdd4be427937bd81
Closes-Bug: 1361666
2014-09-11 13:26:11 -04:00