Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 117 additions & 115 deletions Gemfile.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app/controllers/notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Controller for the Comments section of the Write Plan page
class NotesController < ApplicationController
include ConditionalUserMailer
require 'pp'
after_action :verify_authorized
respond_to :html

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/org_admin/departments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def destroy
@department = Department.find(params[:id])
@org_id = org_id
authorize @department
url = "#{admin_edit_org_path(@org_id)}\#departments"
url = "#{admin_edit_org_path(@org_id)}#departments"

if @department.destroy
flash[:notice] = success_message(@department, _('deleted'))
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/orgs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def admin_update
end
@org.save
end
redirect_to "#{admin_edit_org_path(@org)}\##{tab}",
redirect_to "#{admin_edit_org_path(@org)}##{tab}",
notice: success_message(@org, _('saved'))
else
failure = failure_message(@org, _('save')) if failure.blank?
redirect_to "#{admin_edit_org_path(@org)}\##{tab}", alert: failure
redirect_to "#{admin_edit_org_path(@org)}##{tab}", alert: failure
end
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def do_update(require_password = true, confirm = false)
set_flash_message :notice, success_message(current_user, _('saved'))
# Sign in the user bypassing validation in case his password changed
sign_in current_user, bypass: true
redirect_to "#{edit_user_registration_path}\#personal-details",
redirect_to "#{edit_user_registration_path}#personal-details",
notice: success_message(current_user, _('saved'))

else
Expand Down Expand Up @@ -280,12 +280,12 @@ def do_update_password(current_user, args)
set_flash_message :notice, success_message(current_user, _('saved'))
# TODO: this method is deprecated
sign_in current_user, bypass: true
redirect_to "#{edit_user_registration_path}\#password-details",
redirect_to "#{edit_user_registration_path}#password-details",
notice: success_message(current_user, _('saved'))

else
flash[:alert] = message.blank? ? failure_message(current_user, _('save')) : message
redirect_to "#{edit_user_registration_path}\#password-details"
redirect_to "#{edit_user_registration_path}#password-details"
end
end
# rubocop:enable Metrics/AbcSize, Metrics/PerceivedComplexity
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def update_email_preferences
pref.save

# Include active tab in redirect path
redirect_to "#{edit_user_registration_path}\#notification-preferences",
redirect_to "#{edit_user_registration_path}#notification-preferences",
notice: success_message(pref, _('saved'))
end
# rubocop:enable Metrics/AbcSize
Expand Down
2 changes: 0 additions & 2 deletions app/models/plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ class Plan < ApplicationRecord

alias_attribute :name, :title

attribute :visibility, :integer, default: 3

# ================
# = Associations =
# ================
Expand Down
5 changes: 1 addition & 4 deletions app/models/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ class Template < ApplicationRecord
attribute :version, :integer, default: 0
attribute :customization_of, :integer, default: nil
attribute :family_id, :integer, default: -> { Template.new_family_id }

# TODO: re-add visibility setting? (this is handled in org_admin/create and
# relies on the org_id in the current callback-form)
attribute :visibility, :integer, default: 0
attribute :visibility, default: Template.visibilities[:organisationally_visible]

# ================
# = Associations =
Expand Down
1 change: 1 addition & 0 deletions spec/factories/plans.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
FactoryBot.define do
factory :plan do
title { Faker::Company.bs }
visibility { Plan.visibilities[:privately_visible] }
template
org
identifier { SecureRandom.hex }
Expand Down
1,019 changes: 489 additions & 530 deletions yarn.lock

Large diffs are not rendered by default.