data_migration_for_rails 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/controllers/data_migration/migration_plans_controller.rb +1 -0
- data/app/controllers/{users → data_migration/users}/sessions_controller.rb +4 -2
- data/app/controllers/data_migration/users_controller.rb +5 -5
- data/app/views/data_migration/users/_form.html.erb +2 -2
- data/app/views/data_migration/users/index.html.erb +3 -3
- data/app/views/data_migration/users/show.html.erb +4 -4
- data/app/views/layouts/_navbar.html.erb +1 -1
- data/config/routes.rb +2 -2
- data/lib/data_migration/version.rb +1 -1
- metadata +6 -6
- /data/app/views/{users → data_migration/users}/registrations/edit.html.erb +0 -0
- /data/app/views/{users → data_migration/users}/sessions/new.html.erb +0 -0
- /data/app/views/{users → data_migration/users}/shared/_error_messages.html.erb +0 -0
- /data/app/views/{users → data_migration/users}/shared/_links.html.erb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e63b71c83e6d3ad8a7ce1303c1e420a2f5d18b52e3c9ae2c8699dffd7d360d03
|
|
4
|
+
data.tar.gz: 632b9805658b6889ceb6294cd674e9481d744a855467fd3d4530331a5992f725
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fbd6098d10948bc8c6bcde4b45657d6563b5e26a1ae6c4a0e84c6ea2f8e6e9798201af3a06bd14463ec56a65e0ede49545114fd28ee9dc78d70347ff14601d8
|
|
7
|
+
data.tar.gz: be5e7fc77968f04cf807fc870bbd3e27ae562f1b1306327b4e2465daf769885517e44438cc2c1bcd91a215d5519d46ba4f57545e4b9e5aa86ea5357c9374aa4b
|
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
4
|
-
|
|
3
|
+
module DataMigration
|
|
4
|
+
module Users
|
|
5
|
+
class SessionsController < Devise::SessionsController
|
|
5
6
|
# Skip CSRF verification for the new action to handle Devise FailureApp redirects
|
|
6
7
|
skip_before_action :verify_authenticity_token, only: [:new]
|
|
7
8
|
|
|
@@ -26,5 +27,6 @@ module Users
|
|
|
26
27
|
# def configure_sign_in_params
|
|
27
28
|
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
|
|
28
29
|
# end
|
|
30
|
+
end
|
|
29
31
|
end
|
|
30
32
|
end
|
|
@@ -21,7 +21,7 @@ module DataMigration
|
|
|
21
21
|
@user = DataMigrationUser.new(user_params)
|
|
22
22
|
|
|
23
23
|
if @user.save
|
|
24
|
-
redirect_to
|
|
24
|
+
redirect_to '/data_migration/users', notice: 'User created successfully.'
|
|
25
25
|
else
|
|
26
26
|
render :new, status: :unprocessable_entity
|
|
27
27
|
end
|
|
@@ -42,7 +42,7 @@ module DataMigration
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
if @user.update(params_to_update)
|
|
45
|
-
redirect_to
|
|
45
|
+
redirect_to '/data_migration/users', notice: 'User updated successfully.'
|
|
46
46
|
else
|
|
47
47
|
render :edit, status: :unprocessable_entity
|
|
48
48
|
end
|
|
@@ -52,9 +52,9 @@ module DataMigration
|
|
|
52
52
|
authorize @user
|
|
53
53
|
|
|
54
54
|
if @user.destroy
|
|
55
|
-
redirect_to
|
|
55
|
+
redirect_to '/data_migration/users', notice: 'User deleted successfully.'
|
|
56
56
|
else
|
|
57
|
-
redirect_to
|
|
57
|
+
redirect_to '/data_migration/users', alert: @user.errors.full_messages.join(', ')
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ module DataMigration
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def user_params
|
|
68
|
-
params.require(:
|
|
68
|
+
params.require(:data_migration_user).permit(:name, :email, :password, :password_confirmation, :role)
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%= form_with(model: user, url: user.new_record? ?
|
|
1
|
+
<%= form_with(model: user, url: user.new_record? ? '/data_migration/users' : '/data_migration/users/' + user.id.to_s, local: true) do |form| %>
|
|
2
2
|
<% if user.errors.any? %>
|
|
3
3
|
<div class="alert alert-danger">
|
|
4
4
|
<h4><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h4>
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
47
|
<%= form.submit user.new_record? ? "Create User" : "Update User", class: "btn btn-primary" %>
|
|
48
|
-
<%= link_to "Cancel",
|
|
48
|
+
<%= link_to "Cancel", '/data_migration/users', class: "btn btn-secondary" %>
|
|
49
49
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
2
2
|
<h1>Users</h1>
|
|
3
|
-
<%= link_to "New User",
|
|
3
|
+
<%= link_to "New User", '/data_migration/users/new', class: "btn btn-primary" %>
|
|
4
4
|
</div>
|
|
5
5
|
|
|
6
6
|
<div class="table-responsive">
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
</td>
|
|
27
27
|
<td><%= time_ago_in_words(user.created_at) %> ago</td>
|
|
28
28
|
<td>
|
|
29
|
-
<%= link_to "Edit",
|
|
29
|
+
<%= link_to "Edit", '/data_migration/users/' + user.id.to_s + '/edit', class: "btn btn-sm btn-outline-warning" %>
|
|
30
30
|
<% if user != current_user %>
|
|
31
|
-
<%= button_to "Delete",
|
|
31
|
+
<%= button_to "Delete", '/data_migration/users/' + user.id.to_s,
|
|
32
32
|
method: :delete,
|
|
33
33
|
class: "btn btn-sm btn-outline-danger",
|
|
34
34
|
data: { confirm: "Are you sure?" } %>
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
|
|
23
23
|
<% if policy(@user).change_role? && @user.id != current_user.id %>
|
|
24
24
|
<div class="btn-group btn-group-sm ms-3">
|
|
25
|
-
<%= button_to "Make Viewer",
|
|
25
|
+
<%= button_to "Make Viewer", '/data_migration/users/' + @user.id.to_s + '?role=viewer',
|
|
26
26
|
method: :patch,
|
|
27
27
|
class: "btn btn-sm btn-outline-secondary #{'active' if @user.viewer?}",
|
|
28
28
|
data: { confirm: "Change #{@user.email} to Viewer?" } %>
|
|
29
|
-
<%= button_to "Make Operator",
|
|
29
|
+
<%= button_to "Make Operator", '/data_migration/users/' + @user.id.to_s + '?role=operator',
|
|
30
30
|
method: :patch,
|
|
31
31
|
class: "btn btn-sm btn-outline-warning #{'active' if @user.operator?}",
|
|
32
32
|
data: { confirm: "Change #{@user.email} to Operator?" } %>
|
|
33
|
-
<%= button_to "Make Admin",
|
|
33
|
+
<%= button_to "Make Admin", '/data_migration/users/' + @user.id.to_s + '?role=admin',
|
|
34
34
|
method: :patch,
|
|
35
35
|
class: "btn btn-sm btn-outline-danger #{'active' if @user.admin?}",
|
|
36
36
|
data: { confirm: "Change #{@user.email} to Admin?" } %>
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
|
|
127
127
|
<div class="card mt-3">
|
|
128
128
|
<div class="card-body">
|
|
129
|
-
<%= link_to "← Back to Users",
|
|
129
|
+
<%= link_to "← Back to Users", '/data_migration/users', class: "btn btn-secondary w-100" %>
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
132
|
</div>
|
data/config/routes.rb
CHANGED
|
@@ -4,7 +4,7 @@ DataMigration::Engine.routes.draw do
|
|
|
4
4
|
# Devise routes for DataMigrationUser
|
|
5
5
|
devise_for :users, class_name: 'DataMigrationUser',
|
|
6
6
|
controllers: {
|
|
7
|
-
sessions: 'users/sessions'
|
|
7
|
+
sessions: 'data_migration/users/sessions'
|
|
8
8
|
},
|
|
9
9
|
path: '',
|
|
10
10
|
path_names: {
|
|
@@ -15,7 +15,7 @@ DataMigration::Engine.routes.draw do
|
|
|
15
15
|
|
|
16
16
|
# Define root path with devise_scope
|
|
17
17
|
devise_scope :user do
|
|
18
|
-
root to: 'users/sessions#new'
|
|
18
|
+
root to: 'data_migration/users/sessions#new'
|
|
19
19
|
|
|
20
20
|
# Registration routes for password changes only (edit/update)
|
|
21
21
|
resource :registration,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: data_migration_for_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vaibhav Rokkam
|
|
@@ -190,8 +190,8 @@ files:
|
|
|
190
190
|
- app/controllers/data_migration/migration_executions_controller.rb
|
|
191
191
|
- app/controllers/data_migration/migration_plans_controller.rb
|
|
192
192
|
- app/controllers/data_migration/migration_steps_controller.rb
|
|
193
|
+
- app/controllers/data_migration/users/sessions_controller.rb
|
|
193
194
|
- app/controllers/data_migration/users_controller.rb
|
|
194
|
-
- app/controllers/users/sessions_controller.rb
|
|
195
195
|
- app/helpers/data_migration/application_helper.rb
|
|
196
196
|
- app/jobs/application_job.rb
|
|
197
197
|
- app/jobs/export_job.rb
|
|
@@ -234,15 +234,15 @@ files:
|
|
|
234
234
|
- app/views/data_migration/users/edit.html.erb
|
|
235
235
|
- app/views/data_migration/users/index.html.erb
|
|
236
236
|
- app/views/data_migration/users/new.html.erb
|
|
237
|
+
- app/views/data_migration/users/registrations/edit.html.erb
|
|
238
|
+
- app/views/data_migration/users/sessions/new.html.erb
|
|
239
|
+
- app/views/data_migration/users/shared/_error_messages.html.erb
|
|
240
|
+
- app/views/data_migration/users/shared/_links.html.erb
|
|
237
241
|
- app/views/data_migration/users/show.html.erb
|
|
238
242
|
- app/views/layouts/_navbar.html.erb
|
|
239
243
|
- app/views/layouts/data_migration.html.erb
|
|
240
244
|
- app/views/layouts/mailer.html.erb
|
|
241
245
|
- app/views/layouts/mailer.text.erb
|
|
242
|
-
- app/views/users/registrations/edit.html.erb
|
|
243
|
-
- app/views/users/sessions/new.html.erb
|
|
244
|
-
- app/views/users/shared/_error_messages.html.erb
|
|
245
|
-
- app/views/users/shared/_links.html.erb
|
|
246
246
|
- config/initializers/devise.rb
|
|
247
247
|
- config/initializers/filter_parameter_logging.rb
|
|
248
248
|
- config/initializers/warden.rb
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|