Skip to content

Commit

Permalink
Merge 743a6ec into 586ee55
Browse files Browse the repository at this point in the history
  • Loading branch information
ethn committed May 2, 2024
2 parents 586ee55 + 743a6ec commit a17ee38
Show file tree
Hide file tree
Showing 21 changed files with 96 additions and 43 deletions.
27 changes: 27 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Dockerfile
docker-compose.yml
.semaphore
.gitignore
.gitmodules
/.git
/.bundle
/.byebug_history
/.ruby-version
/node_modules
/cypress/screenshots
/log/*
/files/*
/tmp/*
/public/*
/coverage/*
/backups
/script/metric/data/*
/.idea*
spec/examples.txt
/**/.DS_Store
!/**/.gitkeep
/**/*.iml
aws-secret.yml
cypress/videos
/.vscode
.env
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ruby:3

WORKDIR /wikirate

RUN apt-get update && \
apt-get install -y imagemagick

RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs

COPY . .

ENV RAILS_ENV=production

RUN cp -R config/sample/* config && \
rm -R config/sample

RUN bundle config without test cucumber cypress development profile
RUN bundle install
RUN bundle exec rake card:mod:symlink

CMD bundle exec decko server -b 0.0.0.0
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ gem "wkhtmltopdf-binary" # converting HTML to PDF

# MISCELLANEOUS
gem "company-mapping" # Vasso's gem, written for WikiRate
gem "puma", "~>5.6" # local webserver (6.x broke semaphore )
gem "rack-attack" # protection from bad clients
gem "rack-cors" # support for Cross-Origin Resource Sharing (CORS)

Expand All @@ -96,7 +97,6 @@ gem "timecop", group: %i[test cucumber] # date/time manipulation in tests
group :test, :development do
# gem "debase"
gem "decko-spring", path: "./vendor/decko/support"
gem "puma", "~>5.6" # local webserver (6.x broke semaphore )
# gem "ruby-debug-ide"
end

Expand Down
34 changes: 17 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.5.1)
airbrussh (1.5.2)
sshkit (>= 1.6.1, != 1.7.0)
ansi (1.5.0)
ast (2.4.2)
Expand Down Expand Up @@ -573,7 +573,7 @@ GEM
image_size (2.1.2)
interception (0.5)
iso8601 (0.13.0)
json (2.7.1)
json (2.7.2)
jwt (2.8.1)
base64
kaminari (1.2.2)
Expand Down Expand Up @@ -617,7 +617,7 @@ GEM
net-smtp
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
Expand Down Expand Up @@ -650,25 +650,25 @@ GEM
net-ssh (7.2.3)
net_http_timeout_errors (1.0.0)
netrc (0.11.0)
newrelic_rpm (9.8.0)
newrelic_rpm (9.9.0)
nio4r (2.7.1)
nokogiri (1.16.3-arm64-darwin)
nokogiri (1.16.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-darwin)
nokogiri (1.16.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
nokogiri-happymapper (0.10.0)
nokogiri (~> 1.5)
oga (3.4)
ast
ruby-ll (~> 2.1)
open_uri_redirections (0.2.1)
opensearch-ruby (3.1.0)
opensearch-ruby (3.3.0)
faraday (>= 1.0, < 3)
multi_json (>= 1.0)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pdfkit (0.8.7.3)
Expand Down Expand Up @@ -744,7 +744,7 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.2.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down Expand Up @@ -788,7 +788,7 @@ GEM
rspec-support (3.13.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.62.1)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -799,18 +799,18 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rspec (2.28.0)
rubocop-rspec (2.29.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.2)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
ruby-jmeter (3.1.08)
nokogiri
Expand Down Expand Up @@ -851,7 +851,7 @@ GEM
rack-protection (= 3.2.0)
tilt (~> 2.0)
spork (0.9.2)
spring (4.1.3)
spring (4.2.1)
spring-commands-cucumber (1.0.1)
spring (>= 0.9.1)
spring-commands-rspec (1.0.4)
Expand All @@ -864,7 +864,7 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.22.1)
sshkit (1.22.2)
base64
mutex_m
net-scp (>= 1.1.2)
Expand Down
5 changes: 0 additions & 5 deletions mod/deckorate_core/assets/script/deckorate.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ window.deckorate = {}


$(window).ready ->
$("body").on "click", "a.card-paging-link", ->
id = $(this).slot().attr("id")
#unless history.state?
# history.replaceState(slot_id: id, "")
history.pushState(slot_id: id, url: this.href, "", location.href);

# TODO: consider moving above to decko

Expand Down
4 changes: 2 additions & 2 deletions mod/deckorate_core/set/abstract/3_common_filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def self.define_filter_types hash
year: :check,
wikirate_topic: :multiselect,
company_category: :check,
company_group: :check,
company_group: :multiselect,
company_name: :text,
country: :check,
country: :multiselect,
published: :radio

def filter_company_category_options
Expand Down
2 changes: 1 addition & 1 deletion mod/deckorate_core/set/abstract/5_metric_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def default_sort_option
end

def shared_metric_filter_map
%i[bookmark topic designer metric_type value_type research_policy]
%i[wikirate_topic designer metric_type value_type research_policy bookmark]
end

def filter_map
Expand Down
6 changes: 5 additions & 1 deletion mod/deckorate_core/set/abstract/answer_filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
status: :radio,
updated: :radio,
# outliers: :radio,
source: :autocomplete
source: :multiselect

def filter_status_default
"exists"
Expand Down Expand Up @@ -53,6 +53,10 @@ def filter_calculated_options
{ "Yes" => :calculated, "No" => :not_calculated }
end

def filter_source_options
:remote_type
end

def filter_status_label
"Status"
end
Expand Down
5 changes: 0 additions & 5 deletions mod/deckorate_core/set/self/metric_answer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ def default_sort_option
:year
end

before :header do
voo.title = "Answer Dashboard #{icon_tag :dashboard}"
voo.variant = nil
end

view :titled_content do
[field_nest(:description), render_filtered_content]
end
Expand Down
2 changes: 1 addition & 1 deletion mod/deckorate_datasets/set/abstract/dataset_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def default_sort_option
end

def filter_map
%i[name bookmark topic]
%i[name bookmark wikirate_topic]
end

def default_filter_hash
Expand Down
2 changes: 1 addition & 1 deletion mod/deckorate_datasets/set/type/dataset/structure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

def tab_list
%i[metric_answer wikirate_company metric data_subset details]
%i[details metric_answer wikirate_company metric data_subset]
end

def tab_options
Expand Down
2 changes: 1 addition & 1 deletion mod/deckorate_datasets/set/type/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def default_unpublished
end

def tab_list
%i[wikirate_company metric details]
%i[details wikirate_company metric]
end

view :wikirate_company_tab do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def default_sort_option
end

def filter_map
%i[name topic bookmark]
%i[name wikirate_topic bookmark]
end

def default_filter_hash
Expand Down
2 changes: 1 addition & 1 deletion mod/deckorate_profiles/set/type/research_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def thumbnail_subtitle
end

def tab_list
%i[researcher project metric details]
%i[details researcher project metric]
end

view :metric_tab do
Expand Down
1 change: 1 addition & 0 deletions mod/deckorate_research/cypress/project_journey.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ describe "research page", ->
specify "project journey", ->
cy.login "sample@user.com", "sample_pass"
cy.visit "Evil Project"
cy.get(".tab-li-wikirate_company").click()
cy.get(".tab-pane-wikirate_company").within ->
cy.bar("Death Star").within ->
cy.get(".research-answer-button").click()
Expand Down
2 changes: 0 additions & 2 deletions mod/wikirate/assets/script/wikirate_common.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ decko.slot.ready (slot) ->

slot.find("[data-slick]").each -> loadSlick($(this))



# ~~~~~~~~~~~~~~ slick carousel config

# data-slick should contain json slick config object
Expand Down
11 changes: 11 additions & 0 deletions mod/wikirate_companies/data/real.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@
- :name: Jurisdiction
:type: :cardtype
:codename: jurisdiction

- :name: Corporate Identifier
:codename: corporate_identifier
:type: cardtype

- :name: OAR id
:codename: oar_id
:type: corporate_identifier

- :name: SEC CIK
:codename: sec_cik
:type: corporate_identifier



- :name: OpenCorporates
:type: :research_group
:codename: open_corporates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def filter_cql_class
end

def filter_map
%i[name topic bookmark]
%i[name wikirate_topic bookmark]
end

def default_filter_hash
Expand Down
2 changes: 1 addition & 1 deletion vendor/decko-cap

0 comments on commit a17ee38

Please sign in to comment.