From 09c60d2468f69651755d8a8f1a5046407aa30d82 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Thu, 12 Apr 2018 14:38:22 +0200 Subject: [PATCH] Fixes per @Ducz0r's request --- app/assets/stylesheets/settings.scss | 3 --- app/controllers/projects_controller.rb | 2 +- app/utilities/first_time_data_generator.rb | 8 ++------ config/environments/development.rb | 1 - config/environments/production.rb | 1 - 5 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 app/assets/stylesheets/settings.scss diff --git a/app/assets/stylesheets/settings.scss b/app/assets/stylesheets/settings.scss deleted file mode 100644 index 002b244eb..000000000 --- a/app/assets/stylesheets/settings.scss +++ /dev/null @@ -1,3 +0,0 @@ -#reset-tutorial-btn { - margin-top: 5px; -} diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f11502c44..9e76748d7 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -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 diff --git a/app/utilities/first_time_data_generator.rb b/app/utilities/first_time_data_generator.rb index 2d1ca3261..4c29d7227 100644 --- a/app/utilities/first_time_data_generator.rb +++ b/app/utilities/first_time_data_generator.rb @@ -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( diff --git a/config/environments/development.rb b/config/environments/development.rb index 8ec4be8e6..9ce54f6c7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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 diff --git a/config/environments/production.rb b/config/environments/production.rb index a9683c26e..1d305a383 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -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