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
@@ -25,14 +25,17 @@ feature 'under Applications menu, Reports using Data Import', js: true do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def populate_import_type
|
28
|
-
Marty::ImportType.create(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
Marty::ImportType.create(
|
29
|
+
name: 'BC',
|
30
|
+
db_model_name: 'Gemini::BudCategory',
|
31
|
+
role: 'admin'
|
32
|
+
)
|
33
|
+
|
34
|
+
Marty::ImportType.create(
|
35
|
+
name: 'FB',
|
36
|
+
db_model_name: 'Gemini::FannieBup',
|
37
|
+
role: 'admin'
|
38
|
+
)
|
36
39
|
end
|
37
40
|
|
38
41
|
def populate_bud_category_fannie_bup
|
@@ -0,0 +1,210 @@
|
|
1
|
+
[
|
2
|
+
{"id": "s1",
|
3
|
+
"type": "string",
|
4
|
+
"constraint": ">A<Z",
|
5
|
+
"values": ["A", "B", "C"],
|
6
|
+
"error": "range constraint not allowed for type string"
|
7
|
+
},
|
8
|
+
{"id": "s2",
|
9
|
+
"type": "string",
|
10
|
+
"constraint": "A|Z",
|
11
|
+
"values": ["A", "B", "C"],
|
12
|
+
"error": "cell 0, 1 fails constraint check, cell 0, 2 fails constraint check"
|
13
|
+
},
|
14
|
+
{"id": "s3",
|
15
|
+
"type": "string",
|
16
|
+
"constraint": "A|B|C",
|
17
|
+
"values": ["A", "B", "C"]
|
18
|
+
},
|
19
|
+
{"id": "s4",
|
20
|
+
"type": "string",
|
21
|
+
"constraint": "A|B|C|5",
|
22
|
+
"values": ["A", "B", "5"]
|
23
|
+
},
|
24
|
+
{"id": "s5",
|
25
|
+
"type": "string",
|
26
|
+
"constraint": "A|B|C|true",
|
27
|
+
"values": ["A", "B", "true"]
|
28
|
+
},
|
29
|
+
{"id": "s6",
|
30
|
+
"type": "string",
|
31
|
+
"constraint": "",
|
32
|
+
"values": ["A", "B", "5"]
|
33
|
+
},
|
34
|
+
{"id": "i1",
|
35
|
+
"type": "integer",
|
36
|
+
"constraint": ">0<5",
|
37
|
+
"values": ["1", "2", "3"]
|
38
|
+
},
|
39
|
+
{"id": "i2",
|
40
|
+
"type": "integer",
|
41
|
+
"constraint": ">0<5",
|
42
|
+
"values": ["1", "2", "8"],
|
43
|
+
"error": "cell 0, 2 fails constraint check"
|
44
|
+
},
|
45
|
+
{"id": "i3",
|
46
|
+
"type": "integer",
|
47
|
+
"constraint": "1|8",
|
48
|
+
"values": ["1", "2", "8"],
|
49
|
+
"error": "cell 0, 1 fails constraint check"
|
50
|
+
},
|
51
|
+
{"id": "i4",
|
52
|
+
"type": "integer",
|
53
|
+
"constraint": "1|2|8",
|
54
|
+
"values": ["1", "2", "8"]
|
55
|
+
},
|
56
|
+
{"id": "i5",
|
57
|
+
"type": "integer",
|
58
|
+
"constraint": "",
|
59
|
+
"values": ["1", "2", "8"]
|
60
|
+
},
|
61
|
+
{"id": "i6",
|
62
|
+
"type": "integer",
|
63
|
+
"constraint": "",
|
64
|
+
"values": ["1", "2", "hi"],
|
65
|
+
"error": "bad integer \"hi\""
|
66
|
+
},
|
67
|
+
{"id": "i7",
|
68
|
+
"type": "integer",
|
69
|
+
"constraint": "",
|
70
|
+
"values": ["1", "2", "8"]
|
71
|
+
},
|
72
|
+
{"id": "i8",
|
73
|
+
"type": "integer",
|
74
|
+
"constraint": "",
|
75
|
+
"values": ["1", "2", "2.2"],
|
76
|
+
"error": "bad integer \"2.2\""
|
77
|
+
},
|
78
|
+
{"id": "f1",
|
79
|
+
"type": "float",
|
80
|
+
"constraint": "",
|
81
|
+
"values": ["1", "2", "hi"],
|
82
|
+
"error": "bad float \"hi\""
|
83
|
+
},
|
84
|
+
{"id": "f2",
|
85
|
+
"type": "float",
|
86
|
+
"constraint": ">0<10",
|
87
|
+
"values": ["1", "2", "hi"],
|
88
|
+
"error": "bad float \"hi\""
|
89
|
+
},
|
90
|
+
{"id": "f3",
|
91
|
+
"type": "float",
|
92
|
+
"constraint": "1|2|3",
|
93
|
+
"values": ["1", "2", "3.3"],
|
94
|
+
"error": " list constraint not allowed for type Float"
|
95
|
+
},
|
96
|
+
{"id": "f4",
|
97
|
+
"type": "float",
|
98
|
+
"constraint": ">=1<4",
|
99
|
+
"values": ["1", "2", "3.3"]
|
100
|
+
},
|
101
|
+
{"id": "f7",
|
102
|
+
"type": "float",
|
103
|
+
"constraint": "",
|
104
|
+
"values": ["1", "2", "3.3"]
|
105
|
+
},
|
106
|
+
{"id": "b1",
|
107
|
+
"type": "boolean",
|
108
|
+
"constraint": ">true<false",
|
109
|
+
"values": ["A", "B", "C"],
|
110
|
+
"error": "unknown boolean: \"A\""
|
111
|
+
},
|
112
|
+
{"id": "b2",
|
113
|
+
"type": "boolean",
|
114
|
+
"constraint": "true",
|
115
|
+
"values": ["true", "true", "false"],
|
116
|
+
"error": "cell 0, 2 fails constraint check"
|
117
|
+
},
|
118
|
+
{"id": "b3",
|
119
|
+
"type": "boolean",
|
120
|
+
"constraint": "true|false",
|
121
|
+
"values": ["true", "true", "false"]
|
122
|
+
},
|
123
|
+
{"id": "b4",
|
124
|
+
"type": "boolean",
|
125
|
+
"constraint": "1|false",
|
126
|
+
"values": ["true", "true", "false"],
|
127
|
+
"error": "bad boolean 1"
|
128
|
+
},
|
129
|
+
{"id": "b5",
|
130
|
+
"type": "boolean",
|
131
|
+
"constraint": ">true<false",
|
132
|
+
"values": ["true", "true", "false"],
|
133
|
+
"error": "range constraint not allowed for type boolean"
|
134
|
+
},
|
135
|
+
{"id": "b6",
|
136
|
+
"type": "boolean",
|
137
|
+
"constraint": "",
|
138
|
+
"values": ["true", "true", "false"]
|
139
|
+
},
|
140
|
+
{"id": "b7",
|
141
|
+
"type": "boolean",
|
142
|
+
"constraint": "",
|
143
|
+
"values": ["true", "true", "x"],
|
144
|
+
"error": "unknown boolean: \"x\""
|
145
|
+
},
|
146
|
+
{"id": "e1",
|
147
|
+
"type": "Gemini::EnumState",
|
148
|
+
"constraint": "",
|
149
|
+
"values": ["CA", "TN", "xyz"],
|
150
|
+
"error": "no such Gemini::EnumState: 'xyz'"
|
151
|
+
},
|
152
|
+
{"id": "e2",
|
153
|
+
"type": "Gemini::EnumState",
|
154
|
+
"constraint": "",
|
155
|
+
"values": ["CA", "TN", "NY"]
|
156
|
+
},
|
157
|
+
{"id": "e3",
|
158
|
+
"type": "Gemini::EnumState",
|
159
|
+
"constraint": "CA|TN",
|
160
|
+
"values": ["CA", "TN", "NY"],
|
161
|
+
"error": "cell 0, 2 fails constraint check"
|
162
|
+
},
|
163
|
+
{"id": "e4",
|
164
|
+
"type": "Gemini::EnumState",
|
165
|
+
"constraint": "x|TN",
|
166
|
+
"values": ["CA", "TN", "NY"],
|
167
|
+
"error": "Error in constraint: no such Gemini::EnumState: 'x'"
|
168
|
+
},
|
169
|
+
{"id": "e5",
|
170
|
+
"type": "Gemini::EnumState",
|
171
|
+
"constraint": ">TN<=AK",
|
172
|
+
"values": ["CA", "TN", "NY"],
|
173
|
+
"error": "range constraint not allowed for type Gemini::EnumState"
|
174
|
+
},
|
175
|
+
{"id": "c1",
|
176
|
+
"type": "Gemini::BudCategory",
|
177
|
+
"constraint": "",
|
178
|
+
"values": ["cat1", "cat2", "xyz"],
|
179
|
+
"error": "can't find key 'xyz' for class Gemini::BudCategory"
|
180
|
+
},
|
181
|
+
{"id": "c2",
|
182
|
+
"type": "Gemini::BudCategory",
|
183
|
+
"constraint": "",
|
184
|
+
"values": ["cat1", "cat2", "cat2"]
|
185
|
+
},
|
186
|
+
{"id": "c3",
|
187
|
+
"type": "Gemini::BudCategory",
|
188
|
+
"constraint": "cat1|cat2",
|
189
|
+
"values": ["cat3", "cat2", "cat1"],
|
190
|
+
"error": "cell 0, 0 fails constraint check"
|
191
|
+
},
|
192
|
+
{"id": "c4",
|
193
|
+
"type": "Gemini::BudCategory",
|
194
|
+
"constraint": "x|cat1",
|
195
|
+
"values": ["cat1", "cat1", "cat1"],
|
196
|
+
"error": "Error in constraint: instance x of Gemini::BudCategory not found"
|
197
|
+
},
|
198
|
+
{"id": "c5",
|
199
|
+
"type": "Gemini::BudCategory",
|
200
|
+
"constraint": ">cat1<=cat3",
|
201
|
+
"values": ["cat1", "cat2", "cat3"],
|
202
|
+
"error": "range constraint not allowed for type Gemini::BudCategory"
|
203
|
+
},
|
204
|
+
{"id": "c6",
|
205
|
+
"type": "Gemini::BudCategory",
|
206
|
+
"constraint": "cat1",
|
207
|
+
"values": ["cat1", "cat1", "cat1"]
|
208
|
+
}
|
209
|
+
|
210
|
+
]
|
@@ -0,0 +1,15 @@
|
|
1
|
+
lenient
|
2
|
+
int_field integer v
|
3
|
+
string_field1 string v
|
4
|
+
string_field2 string v
|
5
|
+
string_field3 string v
|
6
|
+
string_field4 string v
|
7
|
+
string_field5 string v
|
8
|
+
numrange_field1 numrange v
|
9
|
+
|
10
|
+
1 Str1|Str2 Hi This Is Strings >10<=100 123
|
11
|
+
2 Str3 Some String Values Here >100<=200 456
|
12
|
+
3 String ABC DEF|ghij Klm nopq >200<=3000 99999
|
13
|
+
4 Foo Ventura CA USA xyzzy >3000<=4000 8888
|
14
|
+
5 Bar San Luis Obispo CA USA Antwerp >4000<=5000000 777
|
15
|
+
6|7 Baz|Plugh Primary Refi Address Strings >5000000<=5000010 6
|
@@ -0,0 +1,17 @@
|
|
1
|
+
lenient
|
2
|
+
int_field integer h
|
3
|
+
string_field1 string h
|
4
|
+
string_field2 string h
|
5
|
+
string_field3 string h
|
6
|
+
string_field4 string h
|
7
|
+
string_field5 string h
|
8
|
+
numrange_field1 numrange h
|
9
|
+
|
10
|
+
1 2 3 4 5 6|7
|
11
|
+
Str1|str2 Str3 String Foo Bar Baz|Plugh
|
12
|
+
Hi Some ABC Ventura San Luis Obispo Primary
|
13
|
+
This String DEF|ghij CA CA Refi
|
14
|
+
Is Values Klm USA USA Address
|
15
|
+
Strings Here nopq xyzzy Antwerp Strings
|
16
|
+
>10<=100 >100<=200 >200<=3000 >3000<=4000 >4000<=5000000 >5000000<=5000010
|
17
|
+
123 456 99999 8888 777 6
|
@@ -0,0 +1,19 @@
|
|
1
|
+
lenient
|
2
|
+
property_state Gemini::EnumState v
|
3
|
+
property_county_name string v
|
4
|
+
mortgage_type Gemini::MortgageType h
|
5
|
+
project_legal_structure_type string h
|
6
|
+
financed_unit_count int4range h
|
7
|
+
|
8
|
+
Conventional Conventional Conventional FHA FHA FHA VA VA VA VA VA
|
9
|
+
Condominium Condominium Condominium
|
10
|
+
>=1 <=1 >1 >=1 <=1 >1 >=1 <=1 >1<=2 >2<=3 >3<=4
|
11
|
+
AK 0.0 1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10.10
|
12
|
+
AL 11.11 12.12 13.13 14.14 15.15 16.16 17.17 18.18 19.19 20.20 21.21
|
13
|
+
AR Dallas 22.22 23.23 24.24 25.25 26.26 27.27 28.28 29.29 30.30 31.31 32.32
|
14
|
+
AR Montgomery 33.33 34.34 35.35 36.36 37.37 38.38 39.39 40.40 41.41 42.42 43.43
|
15
|
+
AR Nevada 44.44 45.45 46.46 47.47 48.48 49.49 50.50 51.51 52.52 53.53 54.54
|
16
|
+
AR Newton 55.55 56.56 57.57 58.58 59.59 60.60 61.61 62.62 63.63 64.64 65.65
|
17
|
+
AR Pike 66.66 67.67 68.68 69.69 70.70 71.71 72.72 73.73 74.74 75.75 76.76
|
18
|
+
AR 77.77 78.78 79.79 80.80 81.81 82.82 83.83 84.84 85.85 86.86 87.87
|
19
|
+
AZ Apache 88.88 89.89 90.90 91.91 92.92 93.93 94.94 95.95 96.96 97.97 98.98
|
@@ -0,0 +1,182 @@
|
|
1
|
+
[
|
2
|
+
[
|
3
|
+
"v",
|
4
|
+
"int_field",
|
5
|
+
[
|
6
|
+
[
|
7
|
+
1
|
8
|
+
],
|
9
|
+
[
|
10
|
+
2
|
11
|
+
],
|
12
|
+
[
|
13
|
+
3
|
14
|
+
],
|
15
|
+
[
|
16
|
+
4
|
17
|
+
],
|
18
|
+
[
|
19
|
+
5
|
20
|
+
],
|
21
|
+
[
|
22
|
+
4,
|
23
|
+
5
|
24
|
+
],
|
25
|
+
[
|
26
|
+
6,
|
27
|
+
7
|
28
|
+
]
|
29
|
+
]
|
30
|
+
],
|
31
|
+
[
|
32
|
+
"v",
|
33
|
+
"numrange_field1",
|
34
|
+
[
|
35
|
+
"(10,100]",
|
36
|
+
"(100,200]",
|
37
|
+
"(200,3000]",
|
38
|
+
"(3000,4000]",
|
39
|
+
"(4000,5000000]",
|
40
|
+
"(5000011,6000000)",
|
41
|
+
"(5000000,5000010]"
|
42
|
+
]
|
43
|
+
],
|
44
|
+
[
|
45
|
+
"v",
|
46
|
+
"string_field1",
|
47
|
+
[
|
48
|
+
[
|
49
|
+
"Str1",
|
50
|
+
"Str2"
|
51
|
+
],
|
52
|
+
[
|
53
|
+
"Str3"
|
54
|
+
],
|
55
|
+
[
|
56
|
+
"String"
|
57
|
+
],
|
58
|
+
[
|
59
|
+
"Foo"
|
60
|
+
],
|
61
|
+
[
|
62
|
+
"Bar"
|
63
|
+
],
|
64
|
+
[
|
65
|
+
"Abc"
|
66
|
+
],
|
67
|
+
[
|
68
|
+
"Baz",
|
69
|
+
"Plugh"
|
70
|
+
]
|
71
|
+
]
|
72
|
+
],
|
73
|
+
[
|
74
|
+
"v",
|
75
|
+
"string_field2",
|
76
|
+
[
|
77
|
+
[
|
78
|
+
"Hi"
|
79
|
+
],
|
80
|
+
[
|
81
|
+
"Some"
|
82
|
+
],
|
83
|
+
[
|
84
|
+
"ABC"
|
85
|
+
],
|
86
|
+
[
|
87
|
+
"Ventura"
|
88
|
+
],
|
89
|
+
[
|
90
|
+
"San Luis Obispo"
|
91
|
+
],
|
92
|
+
[
|
93
|
+
"Def"
|
94
|
+
],
|
95
|
+
[
|
96
|
+
"Primary"
|
97
|
+
]
|
98
|
+
]
|
99
|
+
],
|
100
|
+
[
|
101
|
+
"v",
|
102
|
+
"string_field3",
|
103
|
+
[
|
104
|
+
[
|
105
|
+
"This"
|
106
|
+
],
|
107
|
+
[
|
108
|
+
"String"
|
109
|
+
],
|
110
|
+
[
|
111
|
+
"DEF",
|
112
|
+
"ghij"
|
113
|
+
],
|
114
|
+
[
|
115
|
+
"CA"
|
116
|
+
],
|
117
|
+
[
|
118
|
+
"CA"
|
119
|
+
],
|
120
|
+
[
|
121
|
+
"QQQ"
|
122
|
+
],
|
123
|
+
[
|
124
|
+
"Refi"
|
125
|
+
]
|
126
|
+
]
|
127
|
+
],
|
128
|
+
[
|
129
|
+
"v",
|
130
|
+
"string_field4",
|
131
|
+
[
|
132
|
+
[
|
133
|
+
"Is"
|
134
|
+
],
|
135
|
+
[
|
136
|
+
"Values"
|
137
|
+
],
|
138
|
+
[
|
139
|
+
"Klm"
|
140
|
+
],
|
141
|
+
[
|
142
|
+
"USA"
|
143
|
+
],
|
144
|
+
[
|
145
|
+
"USA"
|
146
|
+
],
|
147
|
+
[
|
148
|
+
"ZZZ"
|
149
|
+
],
|
150
|
+
[
|
151
|
+
"Address"
|
152
|
+
]
|
153
|
+
]
|
154
|
+
],
|
155
|
+
[
|
156
|
+
"v",
|
157
|
+
"string_field5",
|
158
|
+
[
|
159
|
+
[
|
160
|
+
"Strings"
|
161
|
+
],
|
162
|
+
[
|
163
|
+
"Here"
|
164
|
+
],
|
165
|
+
[
|
166
|
+
"nopq"
|
167
|
+
],
|
168
|
+
[
|
169
|
+
"xyzzy"
|
170
|
+
],
|
171
|
+
[
|
172
|
+
"Antwerp"
|
173
|
+
],
|
174
|
+
[
|
175
|
+
"AAA"
|
176
|
+
],
|
177
|
+
[
|
178
|
+
"Strings"
|
179
|
+
]
|
180
|
+
]
|
181
|
+
]
|
182
|
+
]
|