Skip to content

Commit

Permalink
Fixes #21170 - move password_strength.js to wepback
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfefer committed Dec 26, 2017
1 parent 476dbd2 commit e5ad452
Show file tree
Hide file tree
Showing 18 changed files with 813 additions and 98 deletions.
81 changes: 0 additions & 81 deletions app/assets/javascripts/password_strength.js

This file was deleted.

11 changes: 0 additions & 11 deletions app/assets/stylesheets/password_strength.scss

This file was deleted.

11 changes: 8 additions & 3 deletions app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<%= javascript 'password_strength' %>
<%= form_for @user do |f| %>
<%= base_errors_for @user %>
Expand Down Expand Up @@ -43,8 +42,14 @@
<% if User.current == @user %>
<%= password_f f, :current_password, :label => _('Current password'), :placeholder => '' %>
<% end %>
<%= password_f f, :password, :label => _('Password'), :error => @user.errors[:password_hash] %>
<%= password_f f, :password_confirmation, :label => _('Verify') %>
<div id="password_react"></div>
<%= mount_react_component('PasswordStrength', '#password_react',
{:className => 'form-control',
:id => 'user_password',
:userInputIds => ['user_login'],
:name => 'user[password]',
:verify => {name: 'user[password_confirmation]', :error => f.object.errors[:password_confirmation].present? ? f.object.errors[:password_confirmation].to_sentence : false},
:error => f.object.errors[:password_hash].present? ? f.object.errors[:password_hash].to_sentence : false}.to_json) %>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion app/views/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<%= javascript 'password_strength' %>
<% title _("Users") %>
<% title_actions new_link(_("Create User")) %>
Expand Down
1 change: 0 additions & 1 deletion bundler.d/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
gem 'uglifier', '>= 1.0.3'
gem 'sass-rails', '~> 5.0'
gem 'spice-html5-rails', '~> 0.1.5'
gem 'jquery_pwstrength_bootstrap_4', :require => 'jquery_pwstrength_bootstrap'
1 change: 0 additions & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
auth_source_ldap
subnets
hidden_values
password_strength
proxy_status
about
parameter_override)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"react-dom": "^16.0.0",
"react-numeric-input": "^2.0.7",
"react-onclickoutside": "^6.6.2",
"react-password-strength": "^2.1.0",
"react-redux": "^5.0.2",
"redux": "^3.6.0",
"redux-form": "^7.2.0",
Expand Down
6 changes: 6 additions & 0 deletions webpack/assets/javascripts/react_app/common/colors.scss
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
$pf-black-200: #ededed;
$pf-red-200: #a30000;
$pf-red-100: #c00;
$pf-orange-400: #ec7a08;
$pf-gold-400: #f0ab00;
$pf-green-400: #3f9c35;
$pf-green-600: #1e4f18;
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import NotificationContainer from './notifications/';
import ToastsList from './toastNotifications/';
import StorageContainer from './hosts/storage/vmware/';
import BookmarkContainer from './bookmarks';
import PasswordStrength from './user/passwordStrength/';

const componentRegistry = {
registry: {},
Expand Down Expand Up @@ -64,6 +65,7 @@ const coreComponets = [
{ name: 'NotificationContainer', type: NotificationContainer },
{ name: 'ToastNotifications', type: ToastsList, data: false },
{ name: 'StorageContainer', type: StorageContainer },
{ name: 'PasswordStrength', type: PasswordStrength },
];

componentRegistry.registerMultiple(coreComponets);
Expand Down
Loading

0 comments on commit e5ad452

Please sign in to comment.