Skip to content

Commit fd5bdcd

Browse files
jserafmattbaumann1
andauthored
Release/1.18 (#1008)
* update readme about Shibboleth. #517 * PR comments changes. #517 * Update README.md updated typo. #517 * Refactor GrantPermissions front-end and Add contact attribute to grant admins (#982) * Add contact to grant_permission, grant * Add :contact trait to grant permission factory * Add contact info to Grant show page * Include contacts in Grant find * Move role descriptions to select options * Add :contact to permitted params * Tweaks to grant permission form display * Include contact info on submission page * Update to latest version of turbo-rails * Move On/Off boolean string translations to I18n, add Yes/No translation * Make grant permission editing inline via turbo * continue Make grant permission editing inline via turbo * Tweak css on contact card * Add tom-select for type to select * Import, override tom-select css * Add tom-select stimulus controller * Switch to tom-select in new permission form * Use turbo for all grant permission actions * Task/fix permission turbo actions (#991) * Use turbo update to clear the new_permission frame * Add new permission alphabetically based on last name * CSS fixes for proper row striping on turbo updates * Task/remove decorators (#993) * Remove empty, auto-generated decorators and specs * Remove all decorators and related specs * Add helper to get a CSS class based on grant name length * Remove all things decorator from index * Put all mailers in their own app/views directory (#997) * Task/searchable homepage (#995) * Use stimulus for filtering open grants on homepage * Add basic filtering specs * Quick fix for datepicker error in Firefox (#996) * Task/add submission award tracking (#1002) * Fix typo in partial name * Make a generic stylesheet for tables containing turbo_streams * Update permission table to use turbo-table stylesheet * User turbo-table stylesheet and minimize role-related calls in Submissions index * Update Submissions index spec to account for turbo-table styles * WIP: add awarded to submission, use in submissions index page * WIP: Add optional awarded column to excel view * WIP: update turbo-rails, hotwire * Add system specs for awarding submission, clean up or clarify other specs * Move submission row to partial, fix css striping * Use shared tests for roles that can un-/award * WIP: include RecordIdentifier in rails_helper to use dom_id method in system specs * Use turbo-table style, include award checkbox/form for appropriate admins * Add specs to confirm who can view awarded form * Misc partial cleanup, add notice to grant admins about who can view award form/column * Move export to dedicated controller, limit exported file name length * Add sorts on Award columns (#1004) * Update version number and release notes --------- Co-authored-by: mattbaumann1 <mattbaumann1@users.noreply.github.com> Co-authored-by: Matthew Baumann <matthew.baumann@northwestern.edu>
1 parent 2dab5f2 commit fd5bdcd

File tree

127 files changed

+1539
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1539
-1003
lines changed

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ gem 'redis', '~> 4.0'
2222

2323
gem 'hotwire-rails'
2424
gem 'jsbundling-rails'
25-
gem 'turbo-rails', '~> 1.1'
25+
gem 'requestjs-rails'
26+
gem 'turbo-rails', '~> 1.4.0'
2627

2728
# Reduces boot times through caching; required in config/boot.rb
2829
gem 'bootsnap', '>= 1.1.0', require: false

Gemfile.lock

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ GEM
164164
childprocess (4.1.0)
165165
cocoon (1.2.15)
166166
coderay (1.1.3)
167-
concurrent-ruby (1.1.10)
167+
concurrent-ruby (1.2.2)
168168
crass (1.0.6)
169169
debug_inspector (1.1.0)
170170
devise (4.8.1)
@@ -187,7 +187,7 @@ GEM
187187
activesupport (>= 5.0)
188188
request_store (>= 1.0)
189189
ruby2_keywords
190-
erubi (1.11.0)
190+
erubi (1.12.0)
191191
erubis (2.7.0)
192192
exception_notification (4.5.0)
193193
actionmailer (>= 5.2, < 8)
@@ -208,7 +208,7 @@ GEM
208208
sprockets-es6 (>= 0.9.0)
209209
friendly_id (5.4.2)
210210
activerecord (>= 4.0.0)
211-
globalid (1.0.0)
211+
globalid (1.1.0)
212212
activesupport (>= 5.0)
213213
haml (5.2.2)
214214
temple (>= 0.8.0)
@@ -248,7 +248,7 @@ GEM
248248
listen (3.5.1)
249249
rb-fsevent (~> 0.10, >= 0.10.3)
250250
rb-inotify (~> 0.9, >= 0.9.10)
251-
loofah (2.18.0)
251+
loofah (2.19.1)
252252
crass (~> 1.0.2)
253253
nokogiri (>= 1.5.9)
254254
mail (2.7.1)
@@ -257,16 +257,16 @@ GEM
257257
matrix (0.4.2)
258258
method_source (1.0.0)
259259
mini_mime (1.1.2)
260-
minitest (5.16.2)
260+
minitest (5.18.0)
261261
msgpack (1.5.1)
262262
nested_form (0.3.2)
263263
net-scp (3.0.0)
264264
net-ssh (>= 2.6.5, < 7.0.0)
265265
net-ssh (6.1.0)
266266
nio4r (2.5.8)
267-
nokogiri (1.13.8-x86_64-darwin)
267+
nokogiri (1.14.2-x86_64-darwin)
268268
racc (~> 1.4)
269-
nokogiri (1.13.8-x86_64-linux)
269+
nokogiri (1.14.2-x86_64-linux)
270270
racc (~> 1.4)
271271
orm_adapter (0.5.0)
272272
pagy (4.10.2)
@@ -284,9 +284,9 @@ GEM
284284
activesupport (>= 3.0.0)
285285
pundit-matchers (1.6.0)
286286
rspec-rails (>= 3.0.0)
287-
racc (1.6.0)
288-
rack (2.2.4)
289-
rack-test (2.0.2)
287+
racc (1.6.2)
288+
rack (2.2.6.4)
289+
rack-test (2.1.0)
290290
rack (>= 1.3)
291291
rails (6.1.5)
292292
actioncable (= 6.1.5)
@@ -310,8 +310,8 @@ GEM
310310
rails-dom-testing (2.0.3)
311311
activesupport (>= 4.2.0)
312312
nokogiri (>= 1.6)
313-
rails-html-sanitizer (1.4.3)
314-
loofah (~> 2.3)
313+
rails-html-sanitizer (1.5.0)
314+
loofah (~> 2.19, >= 2.19.1)
315315
railties (6.1.5)
316316
actionpack (= 6.1.5)
317317
activesupport (= 6.1.5)
@@ -327,6 +327,8 @@ GEM
327327
regexp_parser (2.3.0)
328328
request_store (1.5.1)
329329
rack (>= 1.4)
330+
requestjs-rails (0.0.10)
331+
rails (>= 6.0.0)
330332
responders (3.0.1)
331333
actionpack (>= 5.0)
332334
railties (>= 5.0)
@@ -425,11 +427,11 @@ GEM
425427
timeliness (0.4.4)
426428
trix (0.10.1)
427429
rails
428-
turbo-rails (1.1.1)
430+
turbo-rails (1.4.0)
429431
actionpack (>= 6.0.0)
430432
activejob (>= 6.0.0)
431433
railties (>= 6.0.0)
432-
tzinfo (2.0.5)
434+
tzinfo (2.0.6)
433435
concurrent-ruby (~> 1.0)
434436
unicode-display_width (2.1.0)
435437
uniform_notifier (1.16.0)
@@ -451,7 +453,7 @@ GEM
451453
wkhtmltopdf-binary (0.12.6.5)
452454
xpath (3.2.0)
453455
nokogiri (~> 1.8)
454-
zeitwerk (2.6.0)
456+
zeitwerk (2.6.7)
455457

456458
PLATFORMS
457459
x86_64-darwin-18
@@ -508,6 +510,7 @@ DEPENDENCIES
508510
rails-controller-testing
509511
ransack!
510512
redis (~> 4.0)
513+
requestjs-rails
511514
rspec
512515
rspec-rails (~> 5.0.0)
513516
rubocop
@@ -520,7 +523,7 @@ DEPENDENCIES
520523
sprockets-es6
521524
terser (~> 1.1)
522525
trix
523-
turbo-rails (~> 1.1)
526+
turbo-rails (~> 1.4.0)
524527
tzinfo-data
525528
validates_timeliness (= 6.0.0.alpha1)
526529
web-console (>= 3.3.0)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ The following are required to install competitions:
2626

2727
# Shibboleth IDP
2828

29-
You will need an IDP for your staging and production instances which may be coordinated with your university or the NIH.
29+
The [Devise SAML Authenticatable gem](https://github.com/apokalipto/devise_saml_authenticatable) has been used for authentication. Please see their documentation for more information on configuration.
3030

31-
[One Login](https://www.onelogin.com/developer-signup) can be used to set up an IDP for development.
31+
You will need an IDP for your staging and production instances which may be coordinated with your university, the NIH, or another IDP.
32+
33+
We have used a docker container for development. Instructions on setting up a local IDP for development can be found in our [WIKI](https://github.com/NUARIG/competitions/wiki/Installation-and-configuration-of-test-saml-idp). Third party venders like [One Login](https://www.onelogin.com/developer-signup) can also be used for a development IDP.
3234

3335

3436
# Installation

app/assets/stylesheets/app.scss

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ th,
182182
font-size: .85em;
183183
font-weight: bold;
184184
text-align: left;
185+
padding: .25em 0;
185186
vertical-align: bottom;
186187
}
187188

@@ -254,7 +255,8 @@ h2#section {
254255
}
255256

256257
// grant dates
257-
#grant-dates {
258+
#grant-dates,
259+
#grant-contacts {
258260
.card-divider {
259261
padding: .5rem 1rem;
260262
}
@@ -277,15 +279,51 @@ h2#section {
277279
}
278280

279281
#turbo-table {
280-
margin: 2rem 0;
281282
border: $table-border;
283+
.header {
284+
.cell {
285+
font-size: .85em;
286+
margin-bottom: 0em;
287+
}
288+
}
282289

283290
.columns {
284291
border-bottom: $table-border;
285292
padding: $table-padding;
286293
}
287294

288295
.turbo-row:nth-of-type(even) {
289-
background-color: #f1f1f1;
296+
background-color: #F1F1F1;
297+
}
298+
}
299+
300+
.ts-wrapper {
301+
height: 2.4375rem;
302+
background-color: #FEFEFE;
303+
::placeholder {
304+
color: #000;
305+
}
306+
&.single {
307+
.ts-control {
308+
box-shadow: none;
309+
background-color: #FEFEFE;
310+
background-image: none;
311+
border-radius: 0;
312+
font-size: 1em;
313+
}
314+
}
315+
316+
.ts-dropdown {
317+
color: #0A0A0A;
318+
font-size: 1em;
319+
.ts-dropdown-content {
320+
font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
321+
}
322+
.active {
323+
border: none;
324+
background: #F9F9F9;
325+
border-radius: 0;
326+
color: #0A0A0A;
327+
}
290328
}
291-
}
329+
}

app/assets/stylesheets/application.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
*= require_self
1616
*= require select2
1717
*/
18+
@import "tom-select/dist/scss/tom-select.default.scss";
1819
@import "app";
1920
@import "foundation_and_overrides";
2021
@import "foundation-datepicker";
2122
@import "trix/dist/trix";
2223
@import "./actiontext.scss";
2324
@import "font-awesome";
24-
@import "./jquery-ui.css"
25+
@import "./jquery-ui.css";
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1+
@import 'settings';
12
main.grant_permissions {
23
.notification-checkbox{
34
padding-top: .3rem;
45
}
5-
6-
.select2-selection {
7-
border-radius: 0 !important;
8-
border: 1px solid #cacaca !important;
9-
height: 2.4375rem !important;
10-
padding-top: .25rem !important;
11-
}
12-
13-
.select2-selection__arrow {
14-
top: 6px !important;
15-
}
16-
}
6+
}

app/assets/stylesheets/home.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@ main.home {
99
display: none;
1010
}
1111
}
12+
13+
input {
14+
text-align: center;
15+
}
16+
1217
#public-grants {
1318
padding-top: 1rem;
19+
.cell {
20+
&.filtered {
21+
display: none;
22+
}
23+
}
1424
.card {
1525
@include breakpoint(medium) {
1626
height: 20rem;

app/assets/stylesheets/tables.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import 'settings';
2+
3+
.turbo-table {
4+
border: 1px solid $light-gray;
5+
margin-bottom: 1em;
6+
7+
.header {
8+
background-color: $table-head-background;
9+
padding: .5em 0;
10+
.cell {
11+
align-items: baseline;
12+
display: table-cell;
13+
font-size: .85em;
14+
font-weight: bold;
15+
}
16+
}
17+
18+
.rows {
19+
border-top: 1px solid $light-gray;
20+
.item {
21+
border-bottom: 1px solid $light-gray;
22+
display: block;
23+
&:nth-of-type(odd) {
24+
background-color: $white;
25+
}
26+
&:nth-of-type(even) {
27+
background-color: $table-striped-background;
28+
}
29+
.row {
30+
&:hover {
31+
background: #FAFAFA;
32+
}
33+
}
34+
}
35+
}
36+
}

app/controllers/banners_controller.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ def new
2121
def create
2222
@banner = Banner.new(banner_params)
2323
authorize @banner
24-
if @banner.save
25-
redirect_to banners_path, notice: t(@banner.visible? ? '.visible_success' : '.not_visible_success')
26-
else
27-
flash.now[:alert] = @banner.errors.full_messages
28-
render :new, status: :unprocessable_entity
24+
25+
respond_to do |format|
26+
if @banner.save
27+
format.html { redirect_to banners_path, notice: t(@banner.visible? ? '.visible_success' : '.not_visible_success') }
28+
else
29+
flash.now[:alert] = @banner.errors.full_messages
30+
format.html { render :new, status: :unprocessable_entity }
31+
end
2932
end
3033
end
3134

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
module GrantPermissions
22
class UsersQueryController < GrantPermissionsController
3+
skip_before_action :set_paper_trail_whodunnit, :audit_action
4+
35
respond_to :json
46

57
def index
6-
@grant = Grant.find(params[:grant_id])
7-
@users = User.where.not(id: @grant.grant_permissions.map(&:user_id))
8-
.where("email LIKE ?", "%#{params[:q]}%")
9-
.distinct
10-
respond_with @users.to_json
8+
if params[:q].size >= 3
9+
grant = Grant.includes(:grant_permissions).find(params[:grant_id])
10+
users = User.where.not(id: grant.grant_permissions.map(&:user_id)).where("email ILIKE ?", "%#{params[:q]}%").distinct
11+
12+
render json: users.map{ |u| { text: u.email, value: u.id } }
13+
else
14+
render json: [{}]
15+
end
1116
end
1217
end
1318
end

0 commit comments

Comments
 (0)