marty 2.9.3 → 3.0.0
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/.gitlab-ci.yml +6 -5
- data/Gemfile.lock +1 -1
- data/app/components/marty/data_grid_view.rb +64 -1
- data/app/components/marty/data_grid_view/client/data_grid_edit.js +550 -0
- data/app/components/marty/import_type_view.rb +11 -2
- data/app/components/marty/main_auth_app.rb +23 -23
- data/app/components/marty/promise_view.rb +1 -1
- data/app/components/marty/report_select.rb +1 -0
- data/app/components/marty/script_form.rb +1 -1
- data/app/components/marty/user_view.rb +30 -18
- data/app/models/marty/data_grid.rb +34 -8
- data/app/models/marty/import_type.rb +2 -4
- data/app/models/marty/role_type.rb +10 -0
- data/app/models/marty/user.rb +9 -4
- data/app/models/marty/user_role.rb +2 -3
- data/app/models/marty/vw_promise.rb +2 -2
- data/app/services/marty/data_grid/constraint.rb +73 -0
- data/app/services/marty/data_grid_view/save_grid.rb +63 -0
- data/config/locales/en.yml +1 -0
- data/db/migrate/107_add_data_grid_constraint.rb +8 -0
- data/db/migrate/507_migrate_marty_roles_to_enum.rb +72 -0
- data/db/seeds.rb +1 -6
- data/lib/marty/permissions.rb +6 -16
- data/lib/marty/version.rb +1 -1
- data/spec/dummy/config/locales/en.yml +1 -0
- data/spec/features/data_grid_spec.rb +499 -0
- data/spec/features/data_import_spec.rb +11 -8
- data/spec/features/user_view_spec.rb +1 -1
- data/spec/fixtures/json/data_grid.json +210 -0
- data/spec/fixtures/misc/data_grid_1.txt +15 -0
- data/spec/fixtures/misc/data_grid_2.txt +17 -0
- data/spec/fixtures/misc/data_grid_3.txt +9 -0
- data/spec/fixtures/misc/data_grid_4.txt +5 -0
- data/spec/fixtures/misc/data_grid_5.txt +19 -0
- data/spec/fixtures/misc/grid1_final_data.json +23 -0
- data/spec/fixtures/misc/grid1_final_meta.json +182 -0
- data/spec/fixtures/misc/grid2_final_data.json +11 -0
- data/spec/fixtures/misc/grid2_final_meta.json +181 -0
- data/spec/fixtures/misc/grid5_final_data.json +142 -0
- data/spec/fixtures/misc/grid5_final_meta.json +152 -0
- data/spec/fixtures/misc/grid_log_errs.json +418 -0
- data/spec/models/data_grid_spec.rb +689 -626
- data/spec/models/import_type_spec.rb +5 -5
- data/spec/spec_helper.rb +9 -7
- data/spec/support/users.rb +1 -1
- metadata +22 -3
- data/app/models/marty/role.rb +0 -6
@@ -13,13 +13,13 @@ module Marty
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe ImportType do
|
16
|
-
let(:
|
16
|
+
let(:role) { Marty::RoleType.get_all.first }
|
17
17
|
|
18
18
|
before(:each) do
|
19
19
|
@import = ImportType.new
|
20
20
|
@import.name = 'Test1'
|
21
21
|
@import.db_model_name = 'Marty::ARTestModel'
|
22
|
-
@import.
|
22
|
+
@import.role = role
|
23
23
|
@import.save!
|
24
24
|
end
|
25
25
|
|
@@ -29,14 +29,14 @@ module Marty
|
|
29
29
|
expect(it).to_not be_valid
|
30
30
|
expect(it.errors[:name].any?).to be true
|
31
31
|
expect(it.errors[:db_model_name].any?).to be true
|
32
|
-
expect(it.errors[:
|
32
|
+
expect(it.errors[:role].any?).to be true
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'require a unique name' do
|
36
36
|
it = ImportType.new
|
37
37
|
it.name = 'Test1'
|
38
38
|
it.db_model_name = 'Marty::ARTestModel'
|
39
|
-
it.
|
39
|
+
it.role = role
|
40
40
|
expect(it).to_not be_valid
|
41
41
|
expect(it.errors[:name].any?).to be true
|
42
42
|
end
|
@@ -45,7 +45,7 @@ module Marty
|
|
45
45
|
it = ImportType.new
|
46
46
|
it.name = 'Test1'
|
47
47
|
it.db_model_name = 'Marty::TestModel'
|
48
|
-
it.
|
48
|
+
it.role = role
|
49
49
|
expect(it).to_not be_valid
|
50
50
|
expect(it.errors[:base][0]).to eq 'bad model name'
|
51
51
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -64,12 +64,14 @@ RSpec.configure do |config|
|
|
64
64
|
config.verbose_retry = true
|
65
65
|
config.display_try_failure_messages = true
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
67
|
+
if ENV['RSPEC_AUTO_RETRY_JS'] == 'true'
|
68
|
+
config.around :each, :js do |ex|
|
69
|
+
ex.run_with_retry retry: 3
|
70
|
+
end
|
71
|
+
|
72
|
+
config.retry_callback = proc do |ex|
|
73
|
+
# run some additional clean up task - can be filtered by example metadata
|
74
|
+
Capybara.reset! if ex.metadata[:js]
|
75
|
+
end
|
74
76
|
end
|
75
77
|
end
|
data/spec/support/users.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2019-06-
|
17
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: pg
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- app/components/marty/base_rule_view.rb
|
258
258
|
- app/components/marty/config_view.rb
|
259
259
|
- app/components/marty/data_grid_view.rb
|
260
|
+
- app/components/marty/data_grid_view/client/data_grid_edit.js
|
260
261
|
- app/components/marty/delorean_rule_view.rb
|
261
262
|
- app/components/marty/event_view.rb
|
262
263
|
- app/components/marty/extras/layout.rb
|
@@ -344,7 +345,7 @@ files:
|
|
344
345
|
- app/models/marty/posting.rb
|
345
346
|
- app/models/marty/posting_type.rb
|
346
347
|
- app/models/marty/promise.rb
|
347
|
-
- app/models/marty/
|
348
|
+
- app/models/marty/role_type.rb
|
348
349
|
- app/models/marty/script.rb
|
349
350
|
- app/models/marty/tag.rb
|
350
351
|
- app/models/marty/token.rb
|
@@ -352,6 +353,8 @@ files:
|
|
352
353
|
- app/models/marty/user_role.rb
|
353
354
|
- app/models/marty/vw_promise.rb
|
354
355
|
- app/services/marty/background_job/update_schedule.rb
|
356
|
+
- app/services/marty/data_grid/constraint.rb
|
357
|
+
- app/services/marty/data_grid_view/save_grid.rb
|
355
358
|
- app/services/marty/jobs/schedule.rb
|
356
359
|
- app/services/marty/promises/delorean.rb
|
357
360
|
- app/services/marty/promises/delorean/create.rb
|
@@ -390,6 +393,7 @@ files:
|
|
390
393
|
- db/migrate/104_create_marty_grid_index_strings.rb
|
391
394
|
- db/migrate/105_create_marty_grid_index_booleans.rb
|
392
395
|
- db/migrate/106_make_grid_indexes_nullable.rb
|
396
|
+
- db/migrate/107_add_data_grid_constraint.rb
|
393
397
|
- db/migrate/200_create_marty_event_operation_enum.rb
|
394
398
|
- db/migrate/201_create_marty_events.rb
|
395
399
|
- db/migrate/202_add_completion_status_to_event.rb
|
@@ -407,6 +411,7 @@ files:
|
|
407
411
|
- db/migrate/504_remove_plv8_extension.rb
|
408
412
|
- db/migrate/505_add_cron_to_delayed_jobs.rb
|
409
413
|
- db/migrate/506_create_marty_delayed_job_schedules.rb
|
414
|
+
- db/migrate/507_migrate_marty_roles_to_enum.rb
|
410
415
|
- db/seeds.rb
|
411
416
|
- db/sql/lookup_grid_distinct_v1.sql
|
412
417
|
- db/sql/query_grid_dir_v1.sql
|
@@ -1582,6 +1587,7 @@ files:
|
|
1582
1587
|
- spec/dummy/spec/features/javascripts
|
1583
1588
|
- spec/dummy/tmp/.gitkeep
|
1584
1589
|
- spec/features/auth_app_spec.rb
|
1590
|
+
- spec/features/data_grid_spec.rb
|
1585
1591
|
- spec/features/data_import_spec.rb
|
1586
1592
|
- spec/features/endpoint_access.rb
|
1587
1593
|
- spec/features/enum_spec.rb
|
@@ -1598,7 +1604,20 @@ files:
|
|
1598
1604
|
- spec/fixtures/csv/rule/DataGrid.csv
|
1599
1605
|
- spec/fixtures/csv/rule/MyRule.csv
|
1600
1606
|
- spec/fixtures/csv/rule/XyzRule.csv
|
1607
|
+
- spec/fixtures/json/data_grid.json
|
1601
1608
|
- spec/fixtures/json/rpc_controller.json
|
1609
|
+
- spec/fixtures/misc/data_grid_1.txt
|
1610
|
+
- spec/fixtures/misc/data_grid_2.txt
|
1611
|
+
- spec/fixtures/misc/data_grid_3.txt
|
1612
|
+
- spec/fixtures/misc/data_grid_4.txt
|
1613
|
+
- spec/fixtures/misc/data_grid_5.txt
|
1614
|
+
- spec/fixtures/misc/grid1_final_data.json
|
1615
|
+
- spec/fixtures/misc/grid1_final_meta.json
|
1616
|
+
- spec/fixtures/misc/grid2_final_data.json
|
1617
|
+
- spec/fixtures/misc/grid2_final_meta.json
|
1618
|
+
- spec/fixtures/misc/grid5_final_data.json
|
1619
|
+
- spec/fixtures/misc/grid5_final_meta.json
|
1620
|
+
- spec/fixtures/misc/grid_log_errs.json
|
1602
1621
|
- spec/fixtures/misc/struct_compare_tests.txt
|
1603
1622
|
- spec/fixtures/scripts/load_tests/namespace/nested_namespace/script3.dl
|
1604
1623
|
- spec/fixtures/scripts/load_tests/script1.dl
|