actual_db_schema 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61f315a9519f1dce13b43a53c781bf5755ab85ad9ebf38e87aa3c6e1d63060ed
4
- data.tar.gz: 0ef1c4c6e2fd50622f961a7d65ca846694f97e474fd6026bdea3c2d257f9da24
3
+ metadata.gz: 1d2364e9f753a0515b61cfc7598a8479af8e6819a54ce9c103b44572bd09f7a2
4
+ data.tar.gz: 9d0e8b6a73e4f94b9beeb73d799053be6745b17804f93acbf3f0e09c6a7142f0
5
5
  SHA512:
6
- metadata.gz: fbdf2a0da21f4e63c522363fbf3608094d67d4d5ae59ce198f58c66992c9c4577bff405df660202ae6d1b0443ad3b42b971116984c3a6700b66b038214b3ffd7
7
- data.tar.gz: 1f5c57b02e07fafab98210a1c9a93c31e8de5d2d7bb8eafa9a3bfd5b2734b86f4a2edba51ef2bfc3e04af2755aa8d6a5141ed6dac724f5196956e6c9dea4b82a
6
+ metadata.gz: 32b066503c2e9aa938552be473b4f8959022d022de6c743791f885781f6a1e585c83d1a1e635d78ffa378fdd0de828c5496c7f55c43638e16319aac74b2d39ac
7
+ data.tar.gz: 329e032b35b735a1b5fc0a3ffd4c7be8ebb9d98aca4469012321faa562cb6f46455996ad9bcc47d271ab2dd276ca5d5abad15af9b3da77b08c2612cc9936ebb1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [0.7.8] - 2024-08-07
2
+ - Make UI working without assets pipeline
3
+
1
4
  ## [0.7.7] - 2024-07-22
2
5
  - Unlock compatibility with Rails versions earlier than 6.0
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- actual_db_schema (0.7.7)
4
+ actual_db_schema (0.7.8)
5
5
  activerecord
6
6
  activesupport
7
7
  csv
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Migrations</title>
5
- <%= stylesheet_link_tag 'styles', media: 'all' %>
6
- <%= javascript_include_tag 'application' %>
5
+ <%= render partial: 'actual_db_schema/shared/js' %>
6
+ <%= render partial: 'actual_db_schema/shared/style' %>
7
7
  </head>
8
8
  <body>
9
9
  <div>
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Migration Details</title>
5
- <%= stylesheet_link_tag 'styles', media: 'all' %>
6
- <%= javascript_include_tag 'application' %>
5
+ <%= render partial: 'actual_db_schema/shared/js' %>
6
+ <%= render partial: 'actual_db_schema/shared/style' %>
7
7
  </head>
8
8
  <body>
9
9
  <div>
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Phantom Migrations</title>
5
- <%= stylesheet_link_tag 'styles', media: 'all' %>
6
- <%= javascript_include_tag 'application' %>
5
+ <%= render partial: 'actual_db_schema/shared/js' %>
6
+ <%= render partial: 'actual_db_schema/shared/style' %>
7
7
  </head>
8
8
  <body>
9
9
  <div>
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Phantom Migration Details</title>
5
- <%= stylesheet_link_tag 'styles', media: 'all' %>
6
- <%= javascript_include_tag 'application' %>
5
+ <%= render partial: 'actual_db_schema/shared/js' %>
6
+ <%= render partial: 'actual_db_schema/shared/style' %>
7
7
  </head>
8
8
  <body>
9
9
  <div>
@@ -0,0 +1,43 @@
1
+ <script>
2
+ document.addEventListener('DOMContentLoaded', function() {
3
+ const migrationActions = document.querySelectorAll('.migration-action');
4
+
5
+ migrationActions.forEach(button => {
6
+ button.addEventListener('click', function(event) {
7
+ const originalText = button.value;
8
+ button.value = 'Loading...';
9
+ disableButtons();
10
+
11
+ fetch(event.target.form.action, {
12
+ method: 'POST'
13
+ })
14
+ .then(response => {
15
+ if (response.ok) {
16
+ window.location.reload();
17
+ } else {
18
+ throw new Error('Network response was not ok.');
19
+ }
20
+ })
21
+ .catch(error => {
22
+ console.error('There has been a problem with your fetch operation:', error);
23
+ enableButtons();
24
+ button.value = originalText;
25
+ });
26
+
27
+ event.preventDefault();
28
+ });
29
+ });
30
+
31
+ function disableButtons() {
32
+ migrationActions.forEach(button => {
33
+ button.disabled = true;
34
+ });
35
+ }
36
+
37
+ function enableButtons() {
38
+ migrationActions.forEach(button => {
39
+ button.disabled = false;
40
+ });
41
+ }
42
+ });
43
+ </script>
@@ -0,0 +1,116 @@
1
+ <style>
2
+ body {
3
+ margin: 8px;
4
+ background-color: #fff;
5
+ color: #333;
6
+ }
7
+
8
+ body, p, td {
9
+ font-family: helvetica, verdana, arial, sans-serif;
10
+ font-size: 13px;
11
+ line-height: 18px;
12
+ }
13
+
14
+ h2 {
15
+ padding-left: 10px;
16
+ }
17
+
18
+ table {
19
+ margin: 0;
20
+ border-collapse: collapse;
21
+
22
+ thead tr {
23
+ border-bottom: 2px solid #ddd;
24
+ }
25
+
26
+ tbody {
27
+ .migration-row.phantom {
28
+ background-color: #fff3f3;
29
+ }
30
+
31
+ .migration-row.normal {
32
+ background-color: #ffffff;
33
+ }
34
+
35
+ .migration-row:nth-child(odd).phantom {
36
+ background-color: #ffe6e6;
37
+ }
38
+
39
+ .migration-row:nth-child(odd).normal {
40
+ background-color: #f9f9f9;
41
+ }
42
+ }
43
+
44
+ td {
45
+ padding: 14px 30px;
46
+ }
47
+ }
48
+
49
+ .top-buttons {
50
+ margin: 8px;
51
+ display: flex;
52
+ align-items: center;
53
+
54
+ .top-button {
55
+ background-color: #ddd;
56
+ }
57
+ }
58
+
59
+ .button, .top-button {
60
+ font-weight: bold;
61
+ color: #000;
62
+ border: none;
63
+ padding: 5px 10px;
64
+ text-align: center;
65
+ text-decoration: none;
66
+ display: inline-block;
67
+ margin: 0 2px;
68
+ cursor: pointer;
69
+ border-radius: 4px;
70
+ transition: background-color 0.3s;
71
+ background: none;
72
+ }
73
+
74
+ .button:hover, .top-button:hover {
75
+ color: #fff;
76
+ background-color: #000;
77
+ }
78
+
79
+ .button:disabled, .button:hover:disabled {
80
+ background-color: transparent;
81
+ color: #666;
82
+ cursor: not-allowed;
83
+ }
84
+
85
+ .button-container {
86
+ display: flex;
87
+ }
88
+
89
+ pre {
90
+ background-color: #f7f7f7;
91
+ padding: 10px;
92
+ border: 1px solid #ddd;
93
+ }
94
+
95
+ .truncate-text {
96
+ max-width: 200px;
97
+ overflow: hidden;
98
+ text-overflow: ellipsis;
99
+ }
100
+
101
+ .flash {
102
+ padding: 10px;
103
+ margin-bottom: 10px;
104
+ border-radius: 5px;
105
+ }
106
+
107
+ .flash.notice {
108
+ background-color: #d4edda;
109
+ color: #155724;
110
+ }
111
+
112
+ .flash.alert {
113
+ background-color: #f8d7da;
114
+ color: #721c24;
115
+ }
116
+ </style>
@@ -10,8 +10,6 @@ module ActualDbSchema
10
10
  app.routes.append do
11
11
  mount ActualDbSchema::Engine => "/rails"
12
12
  end
13
-
14
- app.config.assets.precompile += %w[styles.css application.js]
15
13
  end
16
14
  end
17
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActualDbSchema
4
- VERSION = "0.7.7"
4
+ VERSION = "0.7.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actual_db_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Kaleshka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-24 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -127,14 +127,14 @@ files:
127
127
  - README.md
128
128
  - Rakefile
129
129
  - actual_db_schema.gemspec
130
- - app/assets/javascripts/application.js
131
- - app/assets/stylesheets/styles.css
132
130
  - app/controllers/actual_db_schema/migrations_controller.rb
133
131
  - app/controllers/actual_db_schema/phantom_migrations_controller.rb
134
132
  - app/views/actual_db_schema/migrations/index.html.erb
135
133
  - app/views/actual_db_schema/migrations/show.html.erb
136
134
  - app/views/actual_db_schema/phantom_migrations/index.html.erb
137
135
  - app/views/actual_db_schema/phantom_migrations/show.html.erb
136
+ - app/views/actual_db_schema/shared/_js.html
137
+ - app/views/actual_db_schema/shared/_style.html
138
138
  - config/routes.rb
139
139
  - gemfiles/rails.6.0.gemfile
140
140
  - gemfiles/rails.6.1.gemfile
@@ -1,39 +0,0 @@
1
- document.addEventListener('DOMContentLoaded', function () {
2
- const migrationActions = document.querySelectorAll('.migration-action');
3
-
4
- migrationActions.forEach(button => {
5
- button.addEventListener('click', function (event) {
6
- const originalText = button.value;
7
- button.value = 'Loading...';
8
- disableButtons();
9
-
10
- fetch(event.target.form.action, { method: 'POST'})
11
- .then(response => {
12
- if (response.ok) {
13
- window.location.reload();
14
- } else {
15
- throw new Error('Network response was not ok.');
16
- }
17
- })
18
- .catch(error => {
19
- console.error('There has been a problem with your fetch operation:', error);
20
- enableButtons();
21
- button.value = originalText;
22
- });
23
-
24
- event.preventDefault();
25
- });
26
- });
27
-
28
- function disableButtons() {
29
- migrationActions.forEach(button => {
30
- button.disabled = true;
31
- });
32
- }
33
-
34
- function enableButtons() {
35
- migrationActions.forEach(button => {
36
- button.disabled = false;
37
- });
38
- }
39
- });
@@ -1,114 +0,0 @@
1
- body {
2
- margin: 8px;
3
- background-color: #fff;
4
- color: #333;
5
- }
6
-
7
- body, p, td {
8
- font-family: helvetica, verdana, arial, sans-serif;
9
- font-size: 13px;
10
- line-height: 18px;
11
- }
12
-
13
- h2 {
14
- padding-left: 10px;
15
- }
16
-
17
- table {
18
- margin: 0;
19
- border-collapse: collapse;
20
-
21
- thead tr {
22
- border-bottom: 2px solid #ddd;
23
- }
24
-
25
- tbody {
26
- .migration-row.phantom {
27
- background-color: #fff3f3;
28
- }
29
-
30
- .migration-row.normal {
31
- background-color: #ffffff;
32
- }
33
-
34
- .migration-row:nth-child(odd).phantom {
35
- background-color: #ffe6e6;
36
- }
37
-
38
- .migration-row:nth-child(odd).normal {
39
- background-color: #f9f9f9;
40
- }
41
- }
42
-
43
- td {
44
- padding: 14px 30px;
45
- }
46
- }
47
-
48
- .top-buttons {
49
- margin: 8px;
50
- display: flex;
51
- align-items: center;
52
-
53
- .top-button {
54
- background-color: #ddd;
55
- }
56
- }
57
-
58
- .button, .top-button {
59
- font-weight: bold;
60
- color: #000;
61
- border: none;
62
- padding: 5px 10px;
63
- text-align: center;
64
- text-decoration: none;
65
- display: inline-block;
66
- margin: 0 2px;
67
- cursor: pointer;
68
- border-radius: 4px;
69
- transition: background-color 0.3s;
70
- background: none;
71
- }
72
-
73
- .button:hover, .top-button:hover {
74
- color: #fff;
75
- background-color: #000;
76
- }
77
-
78
- .button:disabled, .button:hover:disabled {
79
- background-color: transparent;
80
- color: #666;
81
- cursor: not-allowed;
82
- }
83
-
84
- .button-container {
85
- display: flex;
86
- }
87
-
88
- pre {
89
- background-color: #f7f7f7;
90
- padding: 10px;
91
- border: 1px solid #ddd;
92
- }
93
-
94
- .truncate-text {
95
- max-width: 200px;
96
- overflow: hidden;
97
- text-overflow: ellipsis;
98
- }
99
-
100
- .flash {
101
- padding: 10px;
102
- margin-bottom: 10px;
103
- border-radius: 5px;
104
- }
105
-
106
- .flash.notice {
107
- background-color: #d4edda;
108
- color: #155724;
109
- }
110
-
111
- .flash.alert {
112
- background-color: #f8d7da;
113
- color: #721c24;
114
- }