marty 2.5.1 → 2.5.2

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.
data/Dockerfile.dummy CHANGED
@@ -24,6 +24,8 @@ RUN curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrom
24
24
  && sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome \
25
25
  && rm google-chrome.deb
26
26
 
27
+ RUN gem install bundler
28
+
27
29
  ENV BUNDLE_PATH /bundle_box/bundle
28
30
  ENV GEM_HOME /bundle_box/bundle
29
31
  ENV PATH /bundle_box/bundle/bin:$PATH
data/Gemfile CHANGED
@@ -15,6 +15,7 @@ group :development, :test do
15
15
  gem 'pry-rails'
16
16
  gem 'rspec-rails'
17
17
  gem 'rspec-instafail', require: false
18
+ gem 'rubocop', require: false
18
19
  gem 'capybara'
19
20
  gem 'selenium-webdriver'
20
21
  gem 'chromedriver-helper'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- marty (2.5.1)
4
+ marty (2.5.2)
5
5
  aws-sigv4 (~> 1.0, >= 1.0.2)
6
6
  axlsx (= 3.0.0pre)
7
7
  coderay
@@ -61,6 +61,7 @@ GEM
61
61
  archive-zip (0.7.0)
62
62
  io-like (~> 0.3.0)
63
63
  arel (8.0.0)
64
+ ast (2.4.0)
64
65
  aws-sigv4 (1.0.3)
65
66
  axlsx (3.0.0.pre)
66
67
  htmlentities (~> 4.3, >= 4.3.4)
@@ -108,6 +109,7 @@ GEM
108
109
  i18n (0.9.5)
109
110
  concurrent-ruby (~> 1.0)
110
111
  io-like (0.3.0)
112
+ jaro_winkler (1.5.2)
111
113
  json-schema (2.8.1)
112
114
  addressable (>= 2.4)
113
115
  loofah (2.2.2)
@@ -141,8 +143,12 @@ GEM
141
143
  nio4r (2.3.0)
142
144
  nokogiri (1.8.2)
143
145
  mini_portile2 (~> 2.3.0)
146
+ parallel (1.13.0)
147
+ parser (2.6.0.0)
148
+ ast (~> 2.4.0)
144
149
  pg (0.21.0)
145
150
  polyglot (0.3.5)
151
+ powerpack (0.1.2)
146
152
  pry (0.11.3)
147
153
  coderay (~> 1.1.0)
148
154
  method_source (~> 0.9.0)
@@ -179,6 +185,7 @@ GEM
179
185
  method_source
180
186
  rake (>= 0.8.7)
181
187
  thor (>= 0.18.1, < 2.0)
188
+ rainbow (3.0.0)
182
189
  rake (12.3.1)
183
190
  rspec (3.7.0)
184
191
  rspec-core (~> 3.7.0)
@@ -205,6 +212,15 @@ GEM
205
212
  rspec-mocks (~> 3.7.0)
206
213
  rspec-support (~> 3.7.0)
207
214
  rspec-support (3.7.1)
215
+ rubocop (0.63.1)
216
+ jaro_winkler (~> 1.5.1)
217
+ parallel (~> 1.10)
218
+ parser (>= 2.5, != 2.5.1.1)
219
+ powerpack (~> 0.1)
220
+ rainbow (>= 2.2.2, < 4.0)
221
+ ruby-progressbar (~> 1.7)
222
+ unicode-display_width (~> 1.4.0)
223
+ ruby-progressbar (1.10.0)
208
224
  rubyzip (1.2.1)
209
225
  selenium-webdriver (3.8.0)
210
226
  childprocess (~> 0.5)
@@ -226,6 +242,7 @@ GEM
226
242
  thread_safe (~> 0.1)
227
243
  uglifier (4.1.6)
228
244
  execjs (>= 0.3.0, < 3)
245
+ unicode-display_width (1.4.1)
229
246
  websocket-driver (0.6.5)
230
247
  websocket-extensions (>= 0.1.0)
231
248
  websocket-extensions (0.1.3)
@@ -252,6 +269,7 @@ DEPENDENCIES
252
269
  rails-controller-testing
253
270
  rspec-instafail
254
271
  rspec-rails
272
+ rubocop
255
273
  selenium-webdriver
256
274
  sqlite3
257
275
  timecop
@@ -777,3 +777,123 @@ Ext.define('Ext.ux.form.field.CodeMirror', {
777
777
  me.callParent();
778
778
  },
779
779
  });
780
+
781
+ // There is an error with code tester. Sometimes the Ext app craches when you click test again after some time passed
782
+ // The bug is present in Ext 6.5.3.57
783
+ // HACK FIX. This error happens when OuterCt/InnerCt dom was removed, but components thinks that it's still there
784
+ // Uncaught TypeError: Cannot read property 'style' of null
785
+ // at constructor.setStyle (ext-all-debug.js:42950)
786
+ // at constructor.beginLayoutCycle (ext-all-debug.js:150619)
787
+ //
788
+ // check for outerCt.destroyed value. If it's destroyed then it's dom is gone and
789
+ // and it's style and dimentions are not available
790
+ // If it's not destroyed go with regular way
791
+ Ext.define('Marty.layout.container.Auto', {
792
+ override: 'Ext.layout.container.Auto',
793
+
794
+ // Sometimes outerCt is already destroyed. in that case it's DOM is null and all methods
795
+ // that call DOM should not be called
796
+ beginLayoutCycle: function(ownerContext) {
797
+ var me = this,
798
+ outerCt = me.outerCt,
799
+ lastOuterCtWidth = me.lastOuterCtWidth || '',
800
+ lastOuterCtHeight = me.lastOuterCtHeight || '',
801
+ lastOuterCtTableLayout = me.lastOuterCtTableLayout || '',
802
+ state = ownerContext.state,
803
+ overflowXStyle, outerCtWidth, outerCtHeight, outerCtTableLayout, inheritedStateInner;
804
+
805
+ // FIX
806
+ //- me.callParent(arguments);
807
+ // If callParent would call overriden method, which leads to and exception
808
+ // when outerCt is destroyed. In that case we use callSuper, which ignores overriden method.
809
+ // If outerCt is not destroyed, then we call overriden method and exit the function. Fixes bellow are not needed
810
+ if (outerCt.destroyed) {
811
+ me.callSuper(arguments);
812
+ } else {
813
+ return me.callParent(arguments);
814
+ }
815
+
816
+ // Default to "shrink wrap styles".
817
+ outerCtWidth = outerCtHeight = outerCtTableLayout = '';
818
+ if (!ownerContext.widthModel.shrinkWrap) {
819
+ // if we're not shrink wrapping width, we need to get the innerCt out of the
820
+ // way to avoid any shrink wrapping effect on child items
821
+ // fill the available width within the container
822
+ outerCtWidth = '100%';
823
+ inheritedStateInner = me.owner.inheritedStateInner;
824
+ // expand no further than the available width, even if contents are wider
825
+ // unless there is a potential for horizontal overflow, then allow
826
+ // the outerCt to expand to the width of the contents
827
+ overflowXStyle = me.getOverflowXStyle(ownerContext);
828
+ outerCtTableLayout = (inheritedStateInner.inShrinkWrapTable || overflowXStyle === 'auto' || overflowXStyle === 'scroll') ? '' : 'fixed';
829
+ }
830
+ if (!ownerContext.heightModel.shrinkWrap && !Ext.supports.PercentageHeightOverflowBug) {
831
+ // if we're not shrink wrapping height, we need to get the outerCt out of the
832
+ // way so that percentage height children will be sized correctly. We do this
833
+ // by giving the outerCt a height of '100%' unless the browser is affected by
834
+ // the "percentage height overflow bug", in which case the outerCt will get a
835
+ // pixel height set during the calculate phase after we know the targetEl size.
836
+ outerCtHeight = '100%';
837
+ }
838
+ // if the outerCt width changed since last time (becuase of a widthModel change)
839
+ // or if we set a pixel width on the outerCt last time to work around a browser-
840
+ // specific bug, we need to set the width of the outerCt
841
+ if ((outerCtWidth !== lastOuterCtWidth) || me.hasOuterCtPxWidth) {
842
+ // FIX: Added check for !outerCt.destroyed
843
+ if (!outerCt.destroyed) {
844
+ outerCt.setStyle('width', outerCtWidth);
845
+ }
846
+ me.lastOuterCtWidth = outerCtWidth;
847
+ me.hasOuterCtPxWidth = false;
848
+ }
849
+ // Set the outerCt table-layout property if different from last time.
850
+ if (outerCtTableLayout !== lastOuterCtTableLayout) {
851
+ outerCt.setStyle('table-layout', outerCtTableLayout);
852
+ me.lastOuterCtTableLayout = outerCtTableLayout;
853
+ }
854
+ // if the outerCt height changed since last time (becuase of a heightModel change)
855
+ // or if we set a pixel height on the outerCt last time to work around a browser-
856
+ // specific bug, we need to set the height of the outerCt
857
+ if ((outerCtHeight !== lastOuterCtHeight) || me.hasOuterCtPxHeight) {
858
+ // FIX: Added check for !outerCt.destroyed
859
+ if (!outerCt.destroyed) {
860
+ outerCt.setStyle('height', outerCtHeight);
861
+ }
862
+ me.lastOuterCtHeight = outerCtHeight;
863
+ me.hasOuterCtPxHeight = false;
864
+ }
865
+ if (me.hasInnerCtPxHeight) {
866
+ // FIX: Added check for !innerCt.destroyed
867
+ if (!me.innerCt.destroyed) {
868
+ me.innerCt.setStyle('height', '');
869
+ }
870
+ me.hasInnerCtPxHeight = false;
871
+ }
872
+ // Begin with the scrollbar adjustment that we used last time - this is more likely
873
+ // to be correct than beginning with no adjustment at all, but only if it is not
874
+ // already defined - it may have already been set by invalidate()
875
+ state.overflowAdjust = state.overflowAdjust || me.lastOverflowAdjust;
876
+ },
877
+
878
+ // The fix checks whether outerCt is destroyed or not
879
+ // If it's destroyed, then the dom is gone and calling getHeight() would lead to exception
880
+ // set contentHeight to 0 if outerCt is destroyed
881
+ measureContentHeight: function(ownerContext) {
882
+ // contentHeight includes padding, but not border, framing or margins
883
+ // FIX
884
+ // var contentHeight = this.outerCt.getHeight();
885
+ var contentHeight = this.outerCt.destroyed ? 0 : this.outerCt.getHeight();
886
+ // END FIX
887
+ var target = ownerContext.target;
888
+
889
+ if (this.managePadding && (target[target.contentPaddingProperty] === undefined)) {
890
+ // if padding was not configured using the appropriate contentPaddingProperty
891
+ // then the padding will not be on the paddingContext, and therfore not included
892
+ // in the outerCt measurement, so we need to read the padding from the
893
+ // targetContext
894
+ contentHeight += ownerContext.targetContext.getPaddingInfo().height;
895
+ }
896
+ return contentHeight;
897
+ },
898
+
899
+ });
@@ -6,8 +6,65 @@ module Marty; class DataGridView < McflyGridPanel
6
6
 
7
7
  include Extras::Layout
8
8
 
9
+ # show_grid_js and client_show_grid_js have specific
10
+ # handles so they can be used by various other components
11
+ # FIXME: add the ability to pull specific functions
12
+ # from other component javascripts or add a base to pull from
13
+ def self.show_grid_js(options={})
14
+ dg = options[:data_grid] || 'data_grid'
15
+ title_str = options[:title_str] || 'Data Grid'
16
+
17
+ javascript = l(<<-JS)
18
+ function() {
19
+ var sel = this.getSelectionModel().getSelection()[0];
20
+ var record_id = sel && sel.getId();
21
+ this.server.showGrid({record_id: record_id,
22
+ data_grid: "#{dg}",
23
+ title_str: "#{title_str}"});
24
+ }
25
+ JS
26
+ javascript
27
+ end
28
+
29
+ def self.client_show_grid_js
30
+ javascript = l(<<-JS)
31
+ function(count, data, title_str) {
32
+ var columns = [];
33
+ var fields = [];
34
+
35
+ for (var i=0; i<count; i++) {
36
+ fields.push("a" + i);
37
+ columns.push({dataIndex: "a" + i, text: i, flex: 1});
38
+ }
39
+
40
+ Ext.create('Ext.Window', {
41
+ height: "80%",
42
+ width: "80%",
43
+ x: 0,
44
+ y: 0,
45
+ autoWidth: true,
46
+ modal: true,
47
+ autoScroll: true,
48
+ title: title_str,
49
+ items: {
50
+ xtype: 'grid',
51
+ border: false,
52
+ hideHeaders: false,
53
+ columns: columns,
54
+ store: Ext.create('Ext.data.ArrayStore', {
55
+ fields: fields,
56
+ data: data,
57
+ })
58
+ },
59
+ }).show();
60
+ }
61
+ JS
62
+ javascript
63
+ end
64
+
9
65
  client_class do |c|
10
- c.include :data_grid_view
66
+ c.netzke_show_grid = DataGridView.show_grid_js
67
+ c.netzke_client_show_grid = DataGridView.client_show_grid_js
11
68
  end
12
69
 
13
70
  def configure(c)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  showDetail: function (details, title) {
3
- this.hideLoadmask();
3
+ this.hideLoadMask();
4
4
  Ext.create('Ext.Window', {
5
5
  height: 400,
6
6
  minWidth: 400,
@@ -15,6 +15,8 @@ services:
15
15
  - "TEST_DATABASE_URL=postgres://postgres@postgres/marty_test"
16
16
  - "HEADLESS_WINDOW_SIZE=1400,1400"
17
17
  - "HEADLESS=true"
18
+ - "PGTZ=America/Los_Angeles"
19
+ - "BUNDLER_VERSION=2.0.1"
18
20
  # env_file: ".rbenv-vars"
19
21
  depends_on:
20
22
  - "postgres"
@@ -1,6 +1,7 @@
1
1
  class Marty::Aws::Base
2
2
  # this base class is used for instance information/credential acquisition
3
3
 
4
+ # FIXME: should that be in public marty gem?
4
5
  # aws reserved host used to get instance meta-data
5
6
  META_DATA_HOST = '169.254.169.254'
6
7
 
@@ -19,6 +20,9 @@ class Marty::Aws::Base
19
20
  end
20
21
 
21
22
  def self.is_aws?
23
+ # FIXME: hack to pass tests on CI
24
+ return false if Rails.env.test?
25
+
22
26
  response = get("http://#{META_DATA_HOST}") rescue nil
23
27
  response.present?
24
28
  end
data/lib/marty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "2.5.1"
2
+ VERSION = "2.5.2"
3
3
  end
@@ -0,0 +1,13 @@
1
+ common: &common
2
+ adapter: postgresql
3
+ encoding: utf8
4
+ database: marty_dev
5
+ host: 127.0.0.1
6
+ pool: 5
7
+
8
+ test:
9
+ <<: *common
10
+ database: marty_test
11
+ host: 127.0.0.1
12
+ username: runner
13
+
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: 2.5.1
4
+ version: 2.5.2
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-01-24 00:00:00.000000000 Z
17
+ date: 2019-01-25 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg
@@ -212,7 +212,10 @@ extensions: []
212
212
  extra_rdoc_files: []
213
213
  files:
214
214
  - ".gitignore"
215
+ - ".gitlab-ci.yml"
215
216
  - ".rspec"
217
+ - ".rubocop.yml"
218
+ - ".rubocop_todo.yml"
216
219
  - ".travis.yml"
217
220
  - Dockerfile.dummy
218
221
  - Gemfile
@@ -240,7 +243,6 @@ files:
240
243
  - app/components/marty/base_rule_view.rb
241
244
  - app/components/marty/config_view.rb
242
245
  - app/components/marty/data_grid_view.rb
243
- - app/components/marty/data_grid_view/client/data_grid_view.js
244
246
  - app/components/marty/delorean_rule_view.rb
245
247
  - app/components/marty/event_view.rb
246
248
  - app/components/marty/extras/layout.rb
@@ -481,6 +483,7 @@ files:
481
483
  - spec/dummy/config.ru
482
484
  - spec/dummy/config/application.rb
483
485
  - spec/dummy/config/boot.rb
486
+ - spec/dummy/config/database.ci.yml
484
487
  - spec/dummy/config/database.yml.example
485
488
  - spec/dummy/config/environment.rb
486
489
  - spec/dummy/config/environments/development.rb
@@ -1,49 +0,0 @@
1
- {
2
- netzkeShowGrid: function (options = {}) {
3
- var dg = options.dataGrid || 'data_grid'
4
- var title_str = options.titleStr || 'Data Grid'
5
-
6
- var sel = this.getSelectionModel().getSelection()[0];
7
- var record_id = sel && sel.getId();
8
- this.server.showGrid({
9
- record_id: record_id,
10
- data_grid: dg,
11
- title_str: title_str
12
- });
13
- },
14
-
15
- netzkeClientShowGrid: function (count, data, title_str) {
16
- var columns = [];
17
- var fields = [];
18
-
19
- for (var i = 0; i < count; i++) {
20
- fields.push("a" + i);
21
- columns.push({
22
- dataIndex: "a" + i,
23
- text: i,
24
- flex: 1
25
- });
26
- }
27
-
28
- Ext.create('Ext.Window', {
29
- height: "80%",
30
- width: "80%",
31
- x: 0,
32
- y: 0,
33
- autoWidth: true,
34
- modal: true,
35
- autoScroll: true,
36
- title: title_str,
37
- items: {
38
- xtype: 'grid',
39
- border: false,
40
- hideHeaders: false,
41
- columns: columns,
42
- store: Ext.create('Ext.data.ArrayStore', {
43
- fields: fields,
44
- data: data,
45
- })
46
- },
47
- }).show();
48
- },
49
- }