Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#Feature/sort by modified for #307 #333

Closed
wants to merge 237 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
8622cb1
Broken dependencies
worleydl Oct 17, 2020
8e1942c
OMG this is partly working!
Nov 21, 2020
33d9c1a
checkpoint
Nov 22, 2020
a197d97
checkopint, fighjting with the any_of stuff
Nov 22, 2020
3605665
yeomans work on progress towards eliminating any_of, had to use raw S…
Nov 22, 2020
f6455c7
fixing up more tests!
Nov 22, 2020
ea40690
clean up gems
Nov 23, 2020
a45a4be
lets run api tests first
Nov 23, 2020
405be30
try and run rails before js
Nov 23, 2020
6f4c41b
one more try
Nov 23, 2020
63c4eac
one more try
Nov 23, 2020
b8d3aad
fixing more tests
Nov 23, 2020
edb10b6
frustrated with circleci
Nov 23, 2020
9984e1a
so many fixes
Nov 23, 2020
c1e00dc
more fixes
Nov 23, 2020
59289fb
Welcome back jquery
worleydl Nov 24, 2020
6008531
fixes!
Nov 24, 2020
2f99639
one more
Nov 24, 2020
bfa3039
more fixes
Nov 25, 2020
32f0e5a
more datamodeling fun, especially caused by a force param that we don…
Nov 26, 2020
f88a71f
upgrade for the cop
Nov 26, 2020
d6ceb54
rubo
Nov 26, 2020
2f9cefc
more fixes
Nov 26, 2020
8acac58
more fixes
Nov 26, 2020
7dc223e
rubocopy you are so needy, upgrade you
Nov 27, 2020
bf1a6c9
started doing more rubocop
Nov 27, 2020
ed0074f
onemore
Nov 27, 2020
407240d
fixin
Nov 27, 2020
aa89451
fixed
Nov 27, 2020
523cd92
magic fix
Nov 28, 2020
76000d2
for some reason after_create is now working
Nov 28, 2020
adf431d
fix up
Nov 28, 2020
18dca3e
turns out we have better vlidation now in rails 5 then in 4
Nov 28, 2020
9c33b2b
getting closer
Nov 28, 2020
24fceea
update doc
Nov 29, 2020
4393153
fixes
Nov 29, 2020
6479253
bumping to updated Ruby that Heroku uses, and removing 12factor since…
Nov 30, 2020
8653551
one more
Nov 30, 2020
36d5806
get tests to run again
Nov 30, 2020
7220f0f
get all tests to run
Nov 30, 2020
8e31100
we got rid of using any_of, so now remove gem
Nov 30, 2020
eaec96e
doh
Dec 7, 2020
b4cbe80
rubocop
Dec 7, 2020
c1b0746
update
Dec 7, 2020
afb1337
need to fix this (#223)
epugh Oct 21, 2020
61f7c64
Move "docid" from the URL to a JSON payload (#233)
epugh Oct 29, 2020
09a0e13
Add import ltr format (#204)
epugh Nov 2, 2020
830f6e8
hotfix: k=5 despite scores being changed to @10, i.e k should be 10
epugh Nov 2, 2020
fbd992c
the errant comma at the end of the line loading the scorer code was c…
epugh Nov 2, 2020
8dd30ad
Turns out we were updating a non communal ndcg scorer, hence not seei…
epugh Nov 2, 2020
5c18b6f
document fixes
epugh Nov 2, 2020
308061f
fixes #178 with some messaging (#235)
epugh Nov 2, 2020
cfa75d7
document fix
epugh Nov 2, 2020
196f7fc
turns out we need to work around the default DELETE in angular
epugh Nov 2, 2020
d05f04b
document the bug
epugh Nov 2, 2020
f865c91
use fancier defaults to demo capablity (#236)
epugh Nov 3, 2020
b76b2f5
found two tickets fixed by same pr
epugh Nov 3, 2020
51a0d13
add teams owner controller tests and add check for ownership before a…
jacobgraves Nov 11, 2020
0c37cbb
control signup enablement via config (#238)
tonomonic Nov 11, 2020
54107f9
uncovered a old debugging statement that leaves a undefined message i…
epugh Nov 12, 2020
4722d91
Renaming a Case on the Teams Listing Page doesn't work (#240)
epugh Nov 13, 2020
1b13694
easy in place case name editing (#242)
epugh Nov 16, 2020
ee8baab
Issue 231: Fixing CSV Injection (#245)
nicholaskwan Nov 18, 2020
7507be0
document vulnerability fix
epugh Nov 18, 2020
236415f
often we add improvemnts, so make it an option
epugh Nov 18, 2020
98076ff
232 stored xss - add new env flag to forbid user scorers and only all…
jacobgraves Nov 19, 2020
7637131
document fixes
epugh Nov 19, 2020
0327955
Harden export import cycle for queries no docs (#252)
epugh Nov 21, 2020
8f94a74
Remove sharing from communal scorers (#251)
epugh Nov 21, 2020
db6575d
doc fix
Nov 21, 2020
9e512fd
doc fix
Nov 21, 2020
498926f
Initialize scorer.scaleWithLabels (#254)
worleydl Nov 24, 2020
3206c5c
Issue 225 (#253)
nathancday Dec 3, 2020
bd7b3d6
mergin
Dec 7, 2020
f86b82f
fixes
Dec 7, 2020
f1f579e
roll
Dec 7, 2020
973ac0e
testing fix
Dec 7, 2020
937966c
harden test
Dec 7, 2020
a108de2
rubocop
Dec 7, 2020
dc8d402
rubocop
Dec 7, 2020
bc5bfd1
fix up for now
Dec 7, 2020
6283d5f
rubocop
Dec 7, 2020
8cdad13
rubocop
Dec 7, 2020
f4b8942
rubocop
Dec 7, 2020
cf2169b
rubcop
Dec 7, 2020
f8fb6c1
rubocop
Dec 7, 2020
b90d599
so much rubocop
Dec 7, 2020
76da7bd
more rubocop
Dec 7, 2020
f709112
fixin
Dec 7, 2020
08904d0
backing out message cause this is still used
Dec 7, 2020
7978b3b
tweaks
Dec 7, 2020
d430470
ignore a rule
Dec 7, 2020
be7cf95
more rubo
Dec 7, 2020
0f19834
rubocop
Dec 7, 2020
7cfacff
Merge branch 'master' into eric_branch
epugh Dec 7, 2020
79edced
rubo
Dec 7, 2020
5d3ac83
bug fix
Dec 7, 2020
832a560
update
Dec 7, 2020
2fa041b
Deal with cases not auto being created, so we need to create explictl…
Dec 8, 2020
a1f9fdc
remove the CurrentUserDecorator, we don't actually need it..
Dec 8, 2020
c363c8e
while I like firstTime better, I'd rather have consistency on both si…
Dec 8, 2020
82e4330
rubocop
Dec 8, 2020
3eb1f4a
optimization of sprockets for files that only matter in test
Dec 8, 2020
5796b1e
Trying to resolve the gzip issue in running test:js led me down a path
Dec 8, 2020
d9160b7
small optimization
Dec 8, 2020
2238a8a
explicit bundler version install
Dec 8, 2020
f538ee5
tweak name!
Dec 8, 2020
8ea30ec
rubocop
Dec 8, 2020
4685f27
fixes
Dec 8, 2020
00cf4f3
Much better name than user.case for method.
Dec 8, 2020
fb9fc9b
docs
Dec 8, 2020
d62ff08
clean up!
Dec 8, 2020
b8ca767
rubocop!
Dec 8, 2020
ca68462
fix ups
Dec 8, 2020
99fdebc
more fix up
Dec 8, 2020
a5c3e11
one more fix
Dec 8, 2020
cc02413
deal with bigint being default in rails 5, and we don't want that.
Dec 9, 2020
db2c28e
update docs
Dec 9, 2020
b050e65
Strip out Spring since we are in a container world and don't get the …
Dec 9, 2020
5279efb
rubo
Dec 9, 2020
3a3c38e
rails 5 is stricter on params!
Dec 9, 2020
21ccc23
dan agrees we should simplify
Dec 9, 2020
a3d18a2
solve the try_id versus try_number issue
Dec 10, 2020
4eb3134
small fix to prevent messages showing up till page has loaded all ang…
Dec 10, 2020
24756a0
kill a constant we don't use
Dec 10, 2020
c80fec3
old debuggin
Dec 10, 2020
059d588
change up default, add some debuggin
Dec 10, 2020
889dfcd
rubo
Dec 10, 2020
b3649fb
Quit creating dummy Try Number 0, and instead start with 1, and at th…
Dec 10, 2020
46fd225
Update UPGRADING_RAILS_NOTES.md
Dec 10, 2020
d842f92
Merge branch 'master' into eric_branch
epugh Dec 10, 2020
85c22ee
use our new put method!
Dec 10, 2020
714767b
jshint
Dec 10, 2020
d10fc91
Some code from the dawn of Quepid that isn't used!
Dec 10, 2020
87fb540
suspected this change would happen!
Dec 10, 2020
d450c7d
some per fixes
Dec 10, 2020
380beaa
doc fixe
Dec 10, 2020
bf2d485
rubo
Dec 10, 2020
6ab5680
looks like we have some upgrades that elminiate this issue!
Dec 10, 2020
42f9e10
had to upgrade to Rails 5, but now we can try inviting users!
Dec 10, 2020
40be487
make matching on names case insentsive
Dec 11, 2020
56f76f5
first cut of adding invitations.
Dec 12, 2020
340a954
looking up by user name and email was too slow!
Dec 12, 2020
41c7f00
have the invite accept screen working!
Dec 12, 2020
71c61e5
lifecycle test is working!
Dec 13, 2020
f175152
rubocop!
Dec 13, 2020
0080bdf
rubocop
Dec 13, 2020
894b6ec
not sure why current_team_finder.rb was different than current_case_f…
Dec 13, 2020
489c8af
making same as others, and making it not happen unless called!
Dec 13, 2020
bf92e7a
this appears to matter on circle ci, and we don't need it to be a var…
Dec 14, 2020
e792eec
Update test.rb
Dec 14, 2020
a6fb347
rubo
Dec 14, 2020
15c9f16
deal with the signup flag
Dec 14, 2020
b0d9968
now dealing with t and c and agreed time.
Dec 14, 2020
34875f1
no longer need the true on callsbacks in rails 5..
Dec 14, 2020
1135672
finally get arms around the boolean beting string or bool!
Dec 14, 2020
0d4d2a9
polish up emails
Dec 14, 2020
fc46fbe
Properly track who has a pending invite!
Dec 14, 2020
12630cc
track links
Dec 17, 2020
9434a21
notes
Dec 18, 2020
faf3689
figured out we were attempting to diff snapshot with deleted query docs
Dec 18, 2020
b091f38
small fix
Dec 19, 2020
a1a02b8
First cut of adding user_id at the query/doc level! Ie to ratings.
Dec 21, 2020
630901d
ready to go on introducing multiple ratings!
Dec 21, 2020
6744456
Going hard average with a round(0) on all the individual ratings!!!
Dec 22, 2020
eadbb89
not sure about creating a Struct....
Dec 22, 2020
b136997
byebug is cool
Dec 22, 2020
c3347df
I hate doing this..
Dec 22, 2020
2a53e8d
back out the idea of average ratings coming from ratings_contoller, b…
Dec 23, 2020
adb66c5
store chagnes for later if needed
Dec 23, 2020
1a398f5
debug on circle ci
Dec 23, 2020
629673f
back out the averaging
Dec 23, 2020
5d41b17
oops
Dec 23, 2020
3899825
use better regex to pluck out the raw invite token. Thanks Nate!
Dec 23, 2020
f81e79b
silence bullet notification that I don't grok for now.
Dec 23, 2020
c6b3562
harden test
Dec 23, 2020
ed0f0dd
rubocop!
Dec 23, 2020
61d5477
lets keep sql on by default
Dec 23, 2020
95ed08e
always track who is rating a doc
Dec 23, 2020
4a96dda
now need a currentUser to get the id for rating docs.
Dec 23, 2020
22f802e
add to each users view of a case the individual or averaged view!
Dec 25, 2020
d64df95
rubocop
Dec 26, 2020
2cc93b7
Reworked bulk ratings sending data back and forth, found a bug in boo…
Dec 26, 2020
b2eae6a
now have modal for ratings, but how to trigger a reload?
Dec 26, 2020
29dc50c
fixup
Dec 26, 2020
454f3b0
jshint
Dec 26, 2020
b254926
Call a custom scroer a custom scorer!
Dec 26, 2020
852186b
front end ui now behaves differently based on if rating is enabled or…
Dec 29, 2020
5a1e033
Update caseSvc.js
Dec 29, 2020
0118ae9
Looking at why query is timing out in staging.
Dec 29, 2020
8727d03
not loving this fix, but here it is.
Dec 29, 2020
e3ba8c3
rubocop
Dec 29, 2020
492f2cf
mention need to check in!
Dec 29, 2020
28c5ac5
tiny bump of puma version
Jan 4, 2021
eca8f9f
checkpoint
Jan 12, 2021
3a9eb8a
lets use kirk and spock as two members of team with differenign appro…
Jan 18, 2021
40e3f5e
left over syntax from our old Trial user days
Jan 18, 2021
44fcb7a
I chased down why the teams Member count is often off by one, owner
Jan 18, 2021
7cb4810
rubocop and fixes
Jan 20, 2021
e9a7983
Update _query.json.jbuilder
Jan 20, 2021
a3c4a5f
first cut of case analytics
Jan 21, 2021
d1e9370
lets be smarter about the dot
Jan 21, 2021
daa0f18
deal with truncation
Jan 21, 2021
1544e45
fixes
Jan 21, 2021
f4c99d9
tweak the meaning
Jan 21, 2021
68a5f87
add basic rating variance per query
Jan 21, 2021
1162d8b
placheolder
Jan 21, 2021
5be1d65
fixes
Jan 21, 2021
a845483
rubocop
Jan 21, 2021
b6d003a
fix name
Jan 21, 2021
1100d6f
back this out...
Jan 21, 2021
a9ad7b9
flip color scale
nathancday Jan 22, 2021
a62110f
Update MULTIPLE_RATINGS_NOTES.md
Jan 22, 2021
f28ea0a
got math backwards...
Jan 22, 2021
ceb6dfb
less erorro prone
Jan 22, 2021
0af3654
match names
Feb 19, 2021
3000575
Merge branch 'master' into spike_adding_multiple_raters
Mar 7, 2021
ad69adf
Merge branch 'master' into spike_adding_multiple_raters
Apr 16, 2021
ba6b9d3
lost this in the merge
Apr 16, 2021
c8161ac
fixing merges
Apr 16, 2021
f1754bf
Merge branch 'master' into spike_adding_multiple_raters
Apr 23, 2021
ae4a2eb
Rolling in some update tech: dataframes and vega visualization!
Apr 25, 2021
cb896cc
we don't have a tip, and besides, we have a different anular 1 method
Apr 25, 2021
712d527
start putting in a more realistic test case.
Apr 25, 2021
9b365e7
Tests are all passing.
Apr 25, 2021
135d20b
if you delete a user, you delete their ratings!
Apr 25, 2021
299b9d5
why is uglifier blowing up?
Apr 25, 2021
9065356
maybe?
Apr 25, 2021
66a8831
checkpoint while I deal with uglifier issues
Apr 25, 2021
96119c2
bring in a fix from master
epugh Apr 25, 2021
b95069a
forgot the gemfile.lock
Apr 25, 2021
ac41029
lint
Apr 25, 2021
c263766
okay, be more dynamic on field name
Apr 25, 2021
ea7ef73
Merge branch 'master' into spike_adding_multiple_raters
epugh Apr 25, 2021
7202a65
checkpoint
Apr 30, 2021
af695bd
#307 added modified column for sorting queries -- incomplete
May 2, 2021
df4886e
#307 added modified column for sorting queries -- incomplete
May 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ COOKIES_URL=
EMAIL_MARKETING_MODE=false

# Default scorer for new user accounts
QUEPID_DEFAULT_SCORER=AP@10
QUEPID_DEFAULT_SCORER=nDCG@10

# Whether or not signing up via the UI is enabled.
SIGNUP_ENABLED=true
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ public/srv

# Test Reports
test/reports

.byebug_history
10 changes: 9 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ AllCops:
Naming/VariableNumber:
Enabled: false # we have a lot of legacy code to update

Naming/MethodParameterName:
Enabled: false

Bundler/OrderedGems:
Enabled: false # legacy gem file, someday.

Expand All @@ -30,7 +33,12 @@ Style/RedundantAssignment:
Enabled: false # legacy stuff

Style/EmptyMethod:
Enabled: false
Enabled: false

# scale.join(',') unless scale.nil? may not be good style compared to
# scale&.join(','), but the & is very opaque to me!
Style/SafeNavigation:
Enabled: false

Lint/MissingSuper:
Enabled: false # legacy stuff
Expand Down
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gem 'jquery-rails'
gem 'jquery-ui-rails' # Can we narrow the widgets to load faster?
gem 'mysql2'
gem 'postmark-rails', '~> 0.10.0'
gem 'puma', '~> 3.11'
gem 'puma', '~> 3.12'
gem 'puma_worker_killer'
gem 'pundit'
gem 'rails', '~> 5.2.4', '>= 5.2.4.4'
Expand All @@ -35,6 +35,9 @@ gem 'd3-rails', '~> 3.5.5' # we have a very old version of D3. This provides D3
gem 'cal-heatmap-rails', '~> 3.6' # provides assets for cal heatmap, that requires old d3
gem 'font-awesome-sass'

gem 'rover-df'
gem 'vega'

group :development, :test do
gem 'annotate'
gem 'bullet'
Expand Down
8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ GEM
nokogiri (1.11.2)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
numo-narray (0.9.1.9)
orm_adapter (0.5.0)
parallel (1.20.1)
parser (2.7.2.0)
Expand Down Expand Up @@ -228,6 +229,8 @@ GEM
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rover-df (0.2.3)
numo-narray (>= 0.9.1.9)
rubocop (1.6.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
Expand Down Expand Up @@ -284,6 +287,7 @@ GEM
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
uniform_notifier (1.13.0)
vega (0.1.3)
warden (1.2.9)
rack (>= 2.0.9)
webmock (3.10.0)
Expand Down Expand Up @@ -327,7 +331,7 @@ DEPENDENCIES
mocha (~> 1.11)
mysql2
postmark-rails (~> 0.10.0)
puma (~> 3.11)
puma (~> 3.12)
puma_worker_killer
pundit
rack-mini-profiler
Expand All @@ -336,13 +340,15 @@ DEPENDENCIES
rails-erd (~> 1.6)
redis (~> 4.0)
responders
rover-df
rubocop
rubocop-rails
sassc-rails (~> 2.1)
sidekiq
simplecov
terser
turbolinks (~> 5)
vega
webmock

RUBY VERSION
Expand Down
88 changes: 88 additions & 0 deletions MULTIPLE_RATINGS_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
* The custom Struct for ratings is weird.
* DONE: Need a migration to assign ALL ratings to whoever owns the case.
* DONE: Need a migration to add the `case_view` column to cases.metadata.
* back out the average stuff on the rating view on updating it.
* When swapping between invidicual and consolidated, the front end UI doesn't refresh.
* When you share a case with a team, we need to refresh the component for "changes ratings view" in the front end
* Still a bug where sometimes tryNo in JS is 0, not 1!!!
* Think about moving the variances to something like /cases/case_id/analytics/variances end point, and introduce a case_analytics_controller.rb to deal with all of that!




# Saving for later

### view
json.ratings do
query.ratings_averaged.each { |rating| json.set! rating.doc_id, rating.rating }
Query.ratings_averaged(query.ratings).each { |rating| json.set! rating.doc_id, rating.rating }
end

### Test

describe "Lets check out the rating_views" do
rating = {
doc_id: 'x123z',
rating: 14,
user_id: nil
}


test "individual view returns individual rating" do
put :update, params: { case_id: acase.id, query_id: query.id, rating: rating, ratings_view: 'individual' }
assert_response :ok

data = JSON.parse(response.body)
assert_equal data['rating'], 14
end

test "average view returns averaged rating" do
doc_id = 'x123z'
query.ratings.create(doc_id: doc_id, rating: 1, user_id: doug.id)
query.ratings.create(doc_id: doc_id, rating: 1, user_id: user.id)

put :update, params: { case_id: acase.id, query_id: query.id, rating: rating, ratings_view: 'average' }
assert_response :ok
#byebug

data = JSON.parse(response.body)
assert_equal data['rating'], 5
end

end

### controller

def update
- # user_id sometimes is nil and sometimes is populated
+ ratings_view = params[:ratings_view] || :individual
+
+ # user_id sometimes is nil and sometimes is populated, and thats okay
@rating = @query.ratings.find_or_create_by doc_id: @doc_id, user_id: rating_params[:user_id]

if @rating.update rating_params
Analytics::Tracker.track_rating_created_event current_user, @rating
- respond_with @rating
+ if ratings_view == :individual
+ respond_with @rating
+ else
+ ratings_averaged = Query.ratings_averaged(@query.ratings.where(doc_id: @doc_id))
+ require 'pp'
+ pp ratings_averaged
+ @rating = ratings_averaged.first
+ respond_with @rating
+ end
else
render json: @rating.errors, status: :bad_request
end



## Discussion w/ Nate .


Do we show the case variance stop light in INDIVIDUAL mode?

If, when you change from CONSOLIDATED to INDIVIDUAL and back, maybe we just redirect you to the case and reload everything, versus trying to update in place???? I don't expect it to be super common changing, unlike say the show rated toggle.

Maybe if you start rating, we single the case variance stop light to become a hollow circle to indicate the data is out of date?
41 changes: 19 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,16 @@ To check the Ruby syntax:
bin/docker r bundle exec rubocop
```

Rubocop can often autocorrect many of the lint issues it runs into via `--auto-correct-all`:
If you get `Error: `Rails` cops have been extracted to the `rubocop-rails` gem.`, it means you forgot the `bundle exec` part!

Rubocop has some magic "auto correction" features for simple/common issues, so you can just run it with autocorrect enabled:

```
bin/docker r bundle exec rubocop --auto-correct-all
```

Now check in your fixes to GitHub!

If there is a new "Cop" as they call their rules that we don't like, you can add it to the `./rubocop.yml` file.

### All Tests
Expand Down Expand Up @@ -489,27 +493,20 @@ heroku restart -a quepid-staging

## Seed Data

The following accounts are created through the seeds. They all follow the following format:

```
email: quepid+[type]@o19s.com
password: password
```

where type is one of the following:

* `admin`: An admin account
* `1case`: A trial user with 1 case
* `2case`: A trial user with 2 cases
* `solr`: A trial user with a Solr case
* `es`: A trial user with a ES case
* `10sOfQueries`: A trial user with a Solr case that has 10s of queries
* `100sOfQueries`: A trial user with a Solr case that has 100s of queries (usually disabled)
* `1000sOfQueries`: A trial user with a Solr case that has 1000s of queries (usually disabled)
* `oscOwner`: A trial user who owns the team 'OSC'
* `oscMember`: A trial user who is a member of the team 'OSC'
* `CustomScorer`: A trial user who has a custom scorer
* `CustomScorerDefault`: A trial user who has a custom scorer that is set as their default
The following accounts are created through the seeds. They all have the same password value of _password_ ;-)

* `[email protected]`: An administrator account
* `[email protected]`: A user with 1 case
* `[email protected]`: A user with 2 cases
* `[email protected]`: A user with a Solr case
* `[email protected]`: A user with a ES case
* `[email protected]`: A user with a Solr case that has 10s of queries
* `[email protected]`: A user with a Solr case that has 100s of queries (usually disabled)
* `[email protected]`: A user with a Solr case that has 1000s of queries (usually disabled)
* `[email protected]`: Kirk is the owner of the team 'NCC-1701 Enterprise', and has rated documents
* `[email protected]`: A member of the team 'NCC-1701 Enterprise', shares cases with Kirk
* `[email protected]`: A user who has a custom scorer
* `[email protected]`: A user who has a custom scorer that is set as their default

# Data Map

Expand Down
4 changes: 4 additions & 0 deletions app/assets/javascripts/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
//= require cookies_eu
//= require bootstrap/dist/js/bootstrap.bundle
//= require turbolinks

//= require vega
//= require vega-lite
//= require vega-embed
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
<div>
Case Rating Variance is <strong>{{thisCase.ratingVariance}}</strong>.
</div>

<div class="actions">

</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<a class="action-icon">
<span
ng-if="ctrl.thisCase.sharedWithTeam"
class="matches-popper"
uib-popover-template="'case_analytics/analytics.html'"
popover-title="Case Analytics"
popover-trigger="outsideClick"
popover-placement="auto top-right"
>
<i
class="fa fa-circle"
aria-hidden="true"
style="vertical-align: middle; font-size: 0.3em; color:{{ctrl.varianceColour()}} !important"
title="Case analytics"
alt="Case analytics"
></i>
</span>
<span
ng-if="!ctrl.thisCase.sharedWithTeam"
>
<i
class="far fa-circle"
aria-hidden="true"
style="vertical-align: middle; font-size: 0.3em;"
title="Share with a team to gather case analytics"
alt="Share with a team to gather case analytics"
></i>
</span>
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';

/*jshint latedef:false*/

angular.module('QuepidApp')
.controller('CaseAnalyticsCtrl', [
'$scope',
function (
$scope
) {
var ctrl = this;

ctrl.thisCase = $scope.thisCase;
ctrl.varianceColour = varianceColour;

function varianceColour() {
var colour = '';
var val = ctrl.thisCase.ratingVariance;
switch(true)
{
case ((val >= 0) && (val < 0.25)):
colour = 'SeaGreen';
break;
case ((val >= 0.25) && (val < 0.5)):
colour = '#dbab09';
break;
case ((val >= 0.5) && (val <= 1)):
colour = 'Tomato';
break;
}
return colour;
}
}
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

angular.module('QuepidApp')
.directive('caseAnalytics', [
function () {
return {
restrict: 'E',
controller: 'CaseAnalyticsCtrl',
controllerAs: 'ctrl',
templateUrl: 'case_analytics/case_analytics.html',
scope: {
thisCase: '=',
},
};
}
]);
22 changes: 22 additions & 0 deletions app/assets/javascripts/components/change_ratings_view/_modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="modal-header">
<button type="button" class="close" aria-label="Close" ng-click="ctrl.cancel()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">Change View of Ratings for Case: <span class="modal-case">{{ ctrl.acase.caseName }}</span></h3>
</div>
<div class="modal-body">
<p>You can look at the ratings in two ways, your individual ratings and then the ratings averaged across your team.</p>

<div class="form-group">
<div class="list-group">

<div class="list-group">
<a href="" class="list-group-item" ng-repeat="ratingView in ctrl.ratingViews" ng-class="{ active: ratingView === ctrl.acase.ratingsView }" ng-click="ctrl.selectRatingView(ratingView)">
{{ ratingView }}
</a>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default float-left" ng-click="ctrl.cancel()">Cancel</button>
<button class="btn btn-primary" ng-click="ctrl.ok()">Update</button>
</div>
Loading