Skip to content

Commit

Permalink
Update code for IT3. (aptos-labs#2412)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharydenton authored Aug 5, 2022
1 parent cd100bb commit 075f68e
Show file tree
Hide file tree
Showing 45 changed files with 753 additions and 417 deletions.
54 changes: 54 additions & 0 deletions ecosystem/platform/server/app/admin/it3_profiles.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true

# Copyright (c) Aptos
# SPDX-License-Identifier: Apache-2.0

ActiveAdmin.register It3Profile do
menu priority: 2
actions :all, except: %i[destroy edit new]

permit_params :consensus_key
includes :user

index do
selectable_column
id_column
column :user
column :owner_key
column :consensus_key
column :account_key
column :network_key
column :validator_ip
column :validator_address
column :validator_port
column :validator_metrics_port
column :validator_api_port
column :validator_verified
column :fullnode_address
column :fullnode_port
column :fullnode_network_key
column :created_at
column :updated_at
actions
end

filter :owner_key
filter :consensus_key
filter :account_key
filter :network_key
filter :validator_ip
filter :validator_address
filter :validator_port
filter :validator_metrics_port
filter :validator_api_port
filter :validator_verified
filter :created_at
filter :updated_at

show do
default_main_content do
row :location
row(:it3_survey) { |profile| profile.user.it3_survey }
end
end
end
41 changes: 41 additions & 0 deletions ecosystem/platform/server/app/admin/it3_surveys.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

# Copyright (c) Aptos
# SPDX-License-Identifier: Apache-2.0

ActiveAdmin.register It3Survey do
menu priority: 2
actions :all, except: %i[destroy edit new]

permit_params :consensus_key
includes :user

index do
selectable_column
id_column
column :user
column :persona
column :participate_reason
column :qualified_reason
column :website
column :interest_reason
column :created_at
column :updated_at
actions
end

filter :user_id
filter :persona
filter :participate_reason
filter :qualified_reason
filter :website
filter :interest_reason
filter :created_at
filter :updated_at

show do
default_main_content do
row(:it3_profile) { |survey| survey.user.it3_profile }
end
end
end
4 changes: 3 additions & 1 deletion ecosystem/platform/server/app/admin/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
actions :all, except: %i[destroy new]

permit_params :email, :is_root, :kyc_exempt
includes :authorizations, :it1_profile, :it2_profile
includes :authorizations, :it1_profile, :it2_profile, :it3_profile

index do
selectable_column
id_column
column :it1_profile
column :it2_profile
column :it3_profile
column :authorizations
column 'External ID', :external_id
column :email
Expand Down Expand Up @@ -42,6 +43,7 @@
row :authorizations
row :it1_profile
row :it2_profile
row :it3_profile
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HeaderComponent < ViewComponent::Base
[
NavItem.new('/community', 'Aptos Community', 'Aptos Community'),
NavItem.new('/it1', 'AIT1', 'Incentivized Testnet 1 Results'),
NavItem.new('/it2', 'AIT2', 'Incentivized Testnet 2'),
NavItem.new('/it2', 'AIT2', 'Incentivized Testnet 2 Results'),
NavItem.new('https://forum.aptoslabs.com/', 'Forum', 'Aptos Forum')
]
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def sso
sso.admin = current_user.is_root?

add_groups = []
add_groups.append('ait2_eligible') if current_user.ait2_registration_complete?
add_groups.append('ait3_eligible') if current_user.ait3_registration_complete?
sso.add_groups = add_groups if add_groups.present?

redirect_to sso.to_url(DiscourseHelper.discourse_url('/session/sso_login')), allow_other_host: true
Expand Down
174 changes: 0 additions & 174 deletions ecosystem/platform/server/app/controllers/it2_profiles_controller.rb

This file was deleted.

This file was deleted.

Loading

0 comments on commit 075f68e

Please sign in to comment.