sw2at-ui 0.0.11 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3612cda6f489c48a3170bd5bb707fe0ca831f8b
4
- data.tar.gz: c6d5a8639b2c725d93fbe8f0978755f770587ca8
3
+ metadata.gz: 1cffde9d161f0600912286898a90e66714af2b7c
4
+ data.tar.gz: 3949594b3e4c1ca123f016d2592009fd1f5aae18
5
5
  SHA512:
6
- metadata.gz: bab12debf2d4514d6bc6a4637c23bfc34574c4626c43ea8dd9f50b15fe2beed7ce1fdc5deed111d724564ca3ee5e0a94816994fcc036beecd0588ffff94577c9
7
- data.tar.gz: 2a5b81b6a3c0c541a4211bbef0ba6ef76cd74fc7bbe828837227722ace098219f0bb7ab836c60e44bae954bedfda50055a48fc503e3f16d184ae3f21ca48a68c
6
+ metadata.gz: 300ea82224d56e73969ab919a5f1434fe7c5fc19eb5225c752465cad44cffc74afe0a52c15fe1af6568d079afce3c015cc41b1f9f5266e292f87a9fd7286b6c0
7
+ data.tar.gz: 80d5b68a71caacf1b5b9cd8f83bdda7ab9ba330dc28aec54481506f8da3978bdff9ef78228930c4edf8573478575d88c9cf717e23ce852519f8dbe5f895254e1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
@@ -18,6 +18,7 @@ App = angular.module 'SWAT', [
18
18
  'ui.bootstrap'
19
19
  'ngClipboard'
20
20
  'highcharts-ng'
21
+ 'ngtimeago'
21
22
  ]
22
23
 
23
24
  App.config ($urlRouterProvider, $stateProvider) ->
@@ -8,6 +8,14 @@ angular.module("SWAT").controller "RevisionsCtrl", ($rootScope, $scope, $state,
8
8
  $scope.revisions = RevisionService.query()
9
9
 
10
10
  $scope.testsProgress = (revision)->
11
- _.sum(revision.threads, (t)->t )
11
+
12
+ startedThreads = revision.data.threads.length
13
+ totalThreads = revision.data.threads_count
14
+
15
+ completedThreads = _.select(revision.data.threads, (t)->t.status && t.status.completed)
16
+ completedTests = _.sum( completedThreads, (t)-> t.total_examples)
17
+ totalTests = _.sum( revision.data.threads, (t)-> t.total_examples)
18
+
19
+ completedThreads.length + " threads completed of " + totalThreads + ". (" + totalTests + " tests in total)"
12
20
 
13
21
  $scope.init()
@@ -1,6 +1,7 @@
1
- angular.module("SWAT").controller "RootCtrl", ($rootScope, $scope, $state) ->
1
+ angular.module("SWAT").controller "RootCtrl", ($rootScope, $scope, $state, SwatHelpers) ->
2
2
 
3
3
  $scope.init = ->
4
+ $scope.helpers = SwatHelpers
4
5
  window.Swat.log 'Swat Root initialized.'
5
6
 
6
7
  $scope.init()
@@ -65,9 +65,6 @@ angular.module("SWAT").controller "SummaryCtrl", ($rootScope, $scope, $state, $s
65
65
 
66
66
  $scope.summary.metrics = result
67
67
 
68
- $scope.isSpecTraceLine = (line)->
69
- _.include(line, 'spec')
70
-
71
68
  $scope.init()
72
69
 
73
70
 
@@ -10,13 +10,9 @@ angular.module("SWAT").directive "revisionName", ($document, RevisionService)->
10
10
  $scope.id = ('revision-name-'+$scope.revision.data.time+Math.floor(Math.random()*1000))
11
11
  $scope.name = ($scope.revision.data.name || $scope.revision.data.time)
12
12
 
13
- $scope.delayedSave = ->
14
- $timeout($scope.save, 0)
15
-
16
13
  $scope.save = ->
17
14
  value = angular.element('#'+$scope.id).text()
18
15
  window.Swat.log(value)
19
-
20
16
  return if value == $scope.name
21
17
  params = { branch: $scope.revision.data.branch, user: $scope.revision.data.user, time: $scope.revision.data.time, name: value }
22
18
  RevisionService.setName(params).$promise.then((resp)->
@@ -5,3 +5,7 @@ angular.module("SWAT").factory "SwatHelpers", ->
5
5
  mm = Math.floor(seconds / 60) % 60
6
6
  ss = Math.floor(seconds) % 60
7
7
  (if hh then (if hh < 10 then '0' else '') + hh + ':' else '') + (if mm < 10 and hh then '0' else '') + mm + ':' + (if ss < 10 then '0' else '') + ss
8
+
9
+ isSpecTraceLine: (line)->
10
+ _.include(line, 'spec')
11
+
@@ -16,3 +16,4 @@
16
16
 
17
17
  #= require swat/lib/highcharts.src.js
18
18
  #= require swat/lib/highcharts-ng.js
19
+ #= require swat/lib/ngtimeago.js
@@ -0,0 +1,75 @@
1
+ 'use strict';
2
+
3
+ var catalyst = angular.module('ngtimeago', []);
4
+
5
+
6
+ catalyst.filter('timeago', function() {
7
+ return function(input, p_allowFuture) {
8
+
9
+ var substitute = function (stringOrFunction, number, strings) {
10
+ var string = angular.isFunction(stringOrFunction) ? stringOrFunction(number, dateDifference) : stringOrFunction;
11
+ var value = (strings.numbers && strings.numbers[number]) || number;
12
+ return string.replace(/%d/i, value);
13
+ },
14
+ nowTime = (new Date()).getTime(),
15
+ date = (new Date(input)).getTime(),
16
+ //refreshMillis= 6e4, //A minute
17
+ allowFuture = p_allowFuture || false,
18
+ strings= {
19
+ prefixAgo: '',
20
+ prefixFromNow: '',
21
+ suffixAgo: "ago",
22
+ suffixFromNow: "from now",
23
+ seconds: "less than a minute",
24
+ minute: "about a minute",
25
+ minutes: "%d minutes",
26
+ hour: "about an hour",
27
+ hours: "about %d hours",
28
+ day: "a day",
29
+ days: "%d days",
30
+ month: "about a month",
31
+ months: "%d months",
32
+ year: "about a year",
33
+ years: "%d years"
34
+ },
35
+ dateDifference = nowTime - date,
36
+ words,
37
+ seconds = Math.abs(dateDifference) / 1000,
38
+ minutes = seconds / 60,
39
+ hours = minutes / 60,
40
+ days = hours / 24,
41
+ years = days / 365,
42
+ separator = strings.wordSeparator === undefined ? " " : strings.wordSeparator,
43
+
44
+
45
+ prefix = strings.prefixAgo,
46
+ suffix = strings.suffixAgo;
47
+
48
+ if (allowFuture) {
49
+ if (dateDifference < 0) {
50
+ prefix = strings.prefixFromNow;
51
+ suffix = strings.suffixFromNow;
52
+ }
53
+ }
54
+
55
+ words = seconds < 45 && substitute(strings.seconds, Math.round(seconds), strings) ||
56
+ seconds < 90 && substitute(strings.minute, 1, strings) ||
57
+ minutes < 45 && substitute(strings.minutes, Math.round(minutes), strings) ||
58
+ minutes < 90 && substitute(strings.hour, 1, strings) ||
59
+ hours < 24 && substitute(strings.hours, Math.round(hours), strings) ||
60
+ hours < 42 && substitute(strings.day, 1, strings) ||
61
+ days < 30 && substitute(strings.days, Math.round(days), strings) ||
62
+ days < 45 && substitute(strings.month, 1, strings) ||
63
+ days < 365 && substitute(strings.months, Math.round(days / 30), strings) ||
64
+ years < 1.5 && substitute(strings.year, 1, strings) ||
65
+ substitute(strings.years, Math.round(years), strings);
66
+ console.log(prefix+words+suffix+separator);
67
+ prefix.replace(/ /g, '')
68
+ words.replace(/ /g, '')
69
+ suffix.replace(/ /g, '')
70
+ return (prefix+' '+words+' '+suffix+' '+separator);
71
+
72
+ };
73
+ });
74
+
75
+
@@ -45,6 +45,19 @@ html, body {
45
45
 
46
46
  }
47
47
 
48
+ .backtrace {
49
+ background-color: #400e30;
50
+ padding: 10px;
51
+ margin-bottom: 5px;
52
+ color: #f8f8f8;
53
+ border-radius: 3px;
54
+ p {
55
+ margin-bottom: 0;
56
+ &.spec {
57
+ color: #ff5860;
58
+ }
59
+ }
60
+ }
48
61
 
49
62
  min-height: 100%;
50
63
  .invisible {
@@ -140,11 +153,12 @@ html, body {
140
153
  }
141
154
 
142
155
  #revisions-container {
156
+ min-height: 50px;
157
+
143
158
  .revisions-header {
144
159
  margin: 0;
145
160
  padding-right: 50px;
146
161
  padding-top: 8px;
147
- min-height: 45px;
148
162
  }
149
163
  .list {
150
164
  padding: 13px;
@@ -194,20 +208,6 @@ html, body {
194
208
  }
195
209
  .detailed-info {
196
210
  padding: 0 8px;
197
- .backtrace {
198
- background-color: #400e30;
199
- padding: 10px;
200
- margin-bottom: 5px;
201
- color: #f8f8f8;
202
- border-radius: 3px;
203
- p {
204
- margin-bottom: 0;
205
- &.spec {
206
- color: #ff5860;
207
- }
208
- }
209
-
210
- }
211
211
  }
212
212
  }
213
213
  td.status {
@@ -79,13 +79,13 @@ class RevisionStatusCalulator
79
79
  STATUSES = {
80
80
  in_progress_success: {
81
81
  name: 'in_progress_success',
82
- label: 'In Progress',
82
+ label: 'Started',
83
83
  completed: false,
84
84
  failed: false,
85
85
  },
86
86
  in_progress_failed: {
87
87
  name: 'in_progress_failed',
88
- label: 'In Progress',
88
+ label: 'Started',
89
89
  completed: false,
90
90
  failed: true,
91
91
  },
@@ -9,6 +9,7 @@
9
9
  th Branch
10
10
  th User
11
11
  th Time
12
+ th Progress
12
13
  th Status
13
14
  tr.has-status ng-class="revision.data.status.name" ng-repeat="revision in revisions | orderBy: '-data.time'" ui-sref="revision(revision.data)"
14
15
  td
@@ -20,6 +21,10 @@
20
21
  | {{ revision.data.user }}
21
22
  td
22
23
  | {{ revision.data.time * 1000 | date: "yyyy/MM/dd h:mm:ss a" }}
24
+ strong style="float:right;"
25
+ | {{ revision.data.time * 1000 | date: "yyyy/MM/dd h:mm:ss a" | timeago }}
26
+ td
27
+ | {{ testsProgress(revision) }}
23
28
  td.revision-status ng-class="revision.data.status.name" title="{{ revision.data.status.name }}"
24
29
  | {{ revision.data.status.label }}
25
30
 
@@ -29,7 +29,7 @@
29
29
  strong
30
30
  | {{ test.exception.message }}
31
31
  .backtrace
32
- p.trace-line class="{{ isSpecTraceLine(line) ? 'spec' : '' }}" ng-repeat="line in test.exception.backtrace track by $index"
32
+ p.trace-line class="{{ helpers.isSpecTraceLine(line) ? 'spec' : '' }}" ng-repeat="line in test.exception.backtrace track by $index"
33
33
  | {{ line }}
34
34
 
35
35
  th.count
@@ -10,7 +10,7 @@ table#test-cases.table.table-bordered.table-hover
10
10
  tr ng-if="(#{object} && #{object}.length == 0)"
11
11
  td colspan="#{ thread ? 5 : 4 }"
12
12
  .cell
13
- | No Failed Examples
13
+ | No Examples
14
14
  tr ng-class="test.status" ng-repeat="test in #{ object }"
15
15
  td title="{{ test.full_description }}"
16
16
  .main-info.cell data-toggle="collapse" data-target="##{test_id}"
@@ -22,7 +22,7 @@ table#test-cases.table.table-bordered.table-hover
22
22
  strong
23
23
  | {{ test.exception.message }}
24
24
  .backtrace
25
- p.trace-line ng-repeat="line in test.exception.backtrace track by $index"
25
+ p.trace-line class="{{ helpers.isSpecTraceLine(line) ? 'spec' : '' }}" ng-repeat="line in test.exception.backtrace track by $index"
26
26
  | {{ line }}
27
27
  - if thread
28
28
  td.thread title="{{ test.thread_name }}"
@@ -33,7 +33,7 @@ describe FullRevision do
33
33
  :completed=>true,
34
34
  :failed=>true},
35
35
  {:name=>"in_progress_success",
36
- :label=>"In Progress",
36
+ :label=>"Started",
37
37
  :completed=>false,
38
38
  :failed=>false}]
39
39
  )
@@ -125,12 +125,12 @@ describe FullRevision do
125
125
  :completed=>true,
126
126
  :failed=>true},
127
127
  {:name=>"in_progress_success",
128
- :label=>"In Progress",
128
+ :label=>"Started",
129
129
  :completed=>false,
130
130
  :failed=>false}]
131
131
  )
132
132
  status = RevisionStatusCalulator.new(rev).set_status
133
- expect(status).to include({name: "in_progress_failed", label: "In Progress", completed: false, failed: true})
133
+ expect(status).to include({name: "in_progress_failed", label: "Started", completed: false, failed: true})
134
134
  end
135
135
 
136
136
 
@@ -153,13 +153,13 @@ describe FullRevision do
153
153
  :completed=>true,
154
154
  :failed=>false},
155
155
  {:name=>"in_progress_success",
156
- :label=>"In Progress",
156
+ :label=>"Started",
157
157
  :completed=>false,
158
158
  :failed=>false}
159
159
  ]
160
160
  )
161
161
  status = RevisionStatusCalulator.new(rev).set_status
162
- expect(status).to include({name: "in_progress_success", label: "In Progress", completed: false, failed: false})
162
+ expect(status).to include({name: "in_progress_success", label: "Started", completed: false, failed: false})
163
163
  end
164
164
 
165
165
  end
data/sw2at-ui.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: sw2at-ui 0.0.11 ruby lib
5
+ # stub: sw2at-ui 0.0.12 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "sw2at-ui"
9
- s.version = "0.0.11"
9
+ s.version = "0.0.12"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Vitaly Tarasenko"]
14
- s.date = "2015-07-01"
14
+ s.date = "2015-07-03"
15
15
  s.description = " Control your tests, run them parallel. Check statuses of your revisions online. Share results to all team members. "
16
16
  s.email = "vetal.tarasenko@gmail.com"
17
17
  s.executables = ["rails"]
@@ -361,6 +361,7 @@ Gem::Specification.new do |s|
361
361
  "app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.swf",
362
362
  "app/assets/javascripts/swat/lib/highcharts-ng.js",
363
363
  "app/assets/javascripts/swat/lib/highcharts.src.js",
364
+ "app/assets/javascripts/swat/lib/ngtimeago.js",
364
365
  "app/assets/stylesheets/swat/application.scss",
365
366
  "app/assets/stylesheets/swat/default-theme.css",
366
367
  "app/assets/stylesheets/swat/font-awesome.css",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sw2at-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Tarasenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -571,6 +571,7 @@ files:
571
571
  - app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.swf
572
572
  - app/assets/javascripts/swat/lib/highcharts-ng.js
573
573
  - app/assets/javascripts/swat/lib/highcharts.src.js
574
+ - app/assets/javascripts/swat/lib/ngtimeago.js
574
575
  - app/assets/stylesheets/swat/application.scss
575
576
  - app/assets/stylesheets/swat/default-theme.css
576
577
  - app/assets/stylesheets/swat/font-awesome.css