Skip to content

Commit

Permalink
Remove leaderboards (Issue ossboard-org#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
likeath committed Sep 28, 2017
1 parent 18bceea commit bab2e8c
Show file tree
Hide file tree
Showing 21 changed files with 1 addition and 531 deletions.
137 changes: 0 additions & 137 deletions apps/web/assets/stylesheets/_leaderboard.scss

This file was deleted.

1 change: 0 additions & 1 deletion apps/web/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'leaderboard';
@import 'settings';
@import 'buttons';
@import 'labels';
Expand Down
2 changes: 0 additions & 2 deletions apps/web/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
root to: 'main#index'

get '/leaderboards', to: 'leaderboards#index'

get '/about', to: 'static#about', as: 'about'
get '/how-to-help', to: 'static#help', as: 'help'

Expand Down
19 changes: 0 additions & 19 deletions apps/web/controllers/leaderboards/index.rb

This file was deleted.

30 changes: 0 additions & 30 deletions apps/web/templates/leaderboards/index.html.slim

This file was deleted.

14 changes: 0 additions & 14 deletions apps/web/views/leaderboards/index.rb

This file was deleted.

2 changes: 0 additions & 2 deletions config/sidekiq.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
:schedule:
RefreshUserReposWorker:
every: 12h
CalculatePointsWorker:
every: 12h
3 changes: 1 addition & 2 deletions lib/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%w[markdown http_request].each { |file| require_relative "ossboard/core/#{file}" }

%w[
analytic_reporter url_shortener points_calculator task_tweeter
analytic_reporter url_shortener task_tweeter
].each { |file| require_relative "ossboard/services/#{file}" }

require_relative 'tasks/matchers/git_host'
Expand All @@ -19,7 +19,6 @@ class Container

namespace('services') do
register('analytic_reporter', Services::AnalyticReporter.new)
register('points_calculator', Services::PointsCalculator.new)
register('task_twitter', Services::TaskTwitter.new)
register('url_shortener', Services::UrlShortener.new)
end
Expand Down
2 changes: 0 additions & 2 deletions lib/ossboard/entities/point.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/ossboard/entities/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class User < Hanami::Entity
attribute :created_at_day, Types::Date

attribute :tasks, Types::Collection(Task)
attribute :points, Types::Collection(Point)
attribute :repos, Types::Collection(Repo)
attribute :accounts, Types::Collection(Account)
end
Expand Down
2 changes: 0 additions & 2 deletions lib/ossboard/repositories/point_repository.rb

This file was deleted.

5 changes: 0 additions & 5 deletions lib/ossboard/repositories/user_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class UserRepository < Hanami::Repository
has_many :tasks
has_many :accounts
has_many :repos
has_many :points
end

def admins
Expand Down Expand Up @@ -35,10 +34,6 @@ def find_with_tasks(id)
aggregate(:tasks).where(id: id).map_to(User).one
end

def all_with_points_and_tasks
aggregate(:points, :tasks).map_to(User).to_a
end

private

def all_from_date_request(from)
Expand Down
32 changes: 0 additions & 32 deletions lib/ossboard/services/points_calculator.rb

This file was deleted.

9 changes: 0 additions & 9 deletions lib/ossboard/workers/calculate_points_worker.rb

This file was deleted.

3 changes: 0 additions & 3 deletions spec/ossboard/entities/point_spec.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/ossboard/repositories/point_repository_spec.rb

This file was deleted.

19 changes: 0 additions & 19 deletions spec/ossboard/repositories/user_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,4 @@
it { expect(subject.tasks).to be_a Array }
it { expect(subject.tasks.count).to eq 1 }
end

describe '#all_with_points_and_tasks' do
let(:task_repo) { TaskRepository.new }

let(:user) { Fabricate.create(:user, uuid: 'test') }

before do
Fabricate.create(:task, title: 'bad', user_id: user.id )
Fabricate.create(:task, title: 'good', approved: true)
end

subject { repo.all_with_points_and_tasks }

it { expect(subject).to be_a Array }

it { expect(subject[0]).to be_a User }
it { expect(subject[0].points).to be_a Array }
it { expect(subject[0].tasks).to be_a Array }
end
end
Loading

0 comments on commit bab2e8c

Please sign in to comment.