mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Fixes per @Ducz0r's request
This commit is contained in:
parent
9bf8b5d864
commit
09c60d2468
5 changed files with 3 additions and 12 deletions
|
@ -1,3 +0,0 @@
|
|||
#reset-tutorial-btn {
|
||||
margin-top: 5px;
|
||||
}
|
|
@ -299,7 +299,7 @@ class ProjectsController < ApplicationController
|
|||
def generate_intro_demo
|
||||
return unless current_user.sign_in_count == 1
|
||||
team = current_user.teams.where(created_by: current_user).first
|
||||
seed_demo_data(current_user) if team && team.projects.blank?
|
||||
seed_demo_data(current_user, team) if team && team.projects.blank?
|
||||
end
|
||||
|
||||
def project_params
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
module FirstTimeDataGenerator
|
||||
# Create data for demo for new users
|
||||
def seed_demo_data(user)
|
||||
def seed_demo_data(user, team)
|
||||
@user = user
|
||||
|
||||
# First team that this user created
|
||||
# should contain the "intro" project
|
||||
team = user.teams.where(created_by: user).order(created_at: :asc).first
|
||||
|
||||
# If private private team does not exist,
|
||||
# there was something wrong with user creation.
|
||||
# Do nothing
|
||||
|
@ -64,7 +60,7 @@ module FirstTimeDataGenerator
|
|||
repository_rows_to_assign = []
|
||||
# Generate random custom respository sample names and assign sample types
|
||||
# and groups
|
||||
|
||||
|
||||
repository_sample_name = (0...3).map { 65.+(rand(26)).chr }.join << '/'
|
||||
(1..5).each do |index|
|
||||
repository_row = RepositoryRow.create(
|
||||
|
|
|
@ -128,6 +128,5 @@ Rails.application.configure do
|
|||
config.x.new_team_on_signup = true
|
||||
else
|
||||
config.x.new_team_on_signup = false
|
||||
config.x.enable_tutorial = false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -162,6 +162,5 @@ Rails.application.configure do
|
|||
config.x.new_team_on_signup = true
|
||||
else
|
||||
config.x.new_team_on_signup = false
|
||||
config.x.enable_tutorial = false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue