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
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ See COPYRIGHT and LICENSE files for more details.
head.with_actions do
render Primer::Beta::Button.new(
tag: :a,
label: Agile::BacklogBucket.human_model_name,
label: BacklogBucket.human_model_name,
href: new_dialog_project_backlogs_backlog_buckets_path(project, all_backlogs_params),
data: {
controller: "async-dialog",
test_selector: "op-backlog-buckets--new-backlog-bucket-button"
}
) do |button|
button.with_leading_visual_icon(icon: :plus)
Agile::BacklogBucket.human_model_name
BacklogBucket.human_model_name
end
end
elsif allow_sprint_creation?(project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ See COPYRIGHT and LICENSE files for more details.
render(
Primer::Alpha::Select.new(
name: "target_id",
label: Agile::Sprint.human_model_name,
label: Sprint.human_model_name,
visually_hide_label: true
)
) do |select|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize(work_package:, project:, move_action:)
@work_package = work_package
@project = project
@move_action = move_action
@sprints = Agile::Sprint.for_project(@project).not_completed.order_by_date
@sprints = Sprint.for_project(@project).not_completed.order_by_date
@sprints = @sprints.where.not(id: work_package.sprint_id) if work_package.sprint_id
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def start_sprint_disabled_reason
end

def resolved_active_sprint_ids
active_sprint_ids || Agile::Sprint.for_project(sprint.project).active.pluck(:id)
active_sprint_ids || Sprint.for_project(sprint.project).active.pluck(:id)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BacklogBuckets::BaseContract < ModelContract
validate :user_authorized

def self.model
Agile::BacklogBucket
BacklogBucket
end

attribute :name
Expand Down
2 changes: 1 addition & 1 deletion modules/backlogs/app/contracts/sprints/base_contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BaseContract < ::ModelContract
validate :user_authorized

def self.model
Agile::Sprint
Sprint
end

attribute :name
Expand Down
2 changes: 1 addition & 1 deletion modules/backlogs/app/contracts/sprints/finish_contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class FinishContract < ModelContract
validate :no_unfinished_work_packages

def self.model
Agile::Sprint
Sprint
end

private
Expand Down
2 changes: 1 addition & 1 deletion modules/backlogs/app/contracts/sprints/start_contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def validate_dates_present

def validate_no_other_active_sprint
return unless model.in_planning?
return unless Agile::Sprint.where(project: model.project).active.where.not(id: model.id).exists?
return unless Sprint.where(project: model.project).active.where.not(id: model.id).exists?

errors.add :status, :only_one_active_sprint_allowed
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class MoveBetweenSprintsContract < ModelContract
private

def active_sprint_in_sharer_project
unless Agile::Sprint
.native_to_sprint_source(Agile::Sprint.find_by(id: model.sprint_id_was).project)
unless Sprint
.native_to_sprint_source(Sprint.find_by(id: model.sprint_id_was).project)
.in_planning
.exists?(id: model.sprint_id)
errors.add(:sprint, :not_eligible_for_moving)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BacklogBucketsController < BaseController
before_action :find_backlog_bucket, only: %i[edit_dialog update destroy]

def new_dialog
backlog_bucket = Agile::BacklogBucket.new(project: @project)
backlog_bucket = BacklogBucket.new(project: @project)

respond_with_dialog Backlogs::NewBacklogBucketDialogComponent.new(backlog_bucket:)
end
Expand Down Expand Up @@ -104,7 +104,7 @@ def check_feature_flag
end

def find_backlog_bucket
@backlog_bucket = Agile::BacklogBucket.where(project: @project).find(params[:id])
@backlog_bucket = BacklogBucket.where(project: @project).find(params[:id])
end

def backlog_bucket_params
Expand Down
12 changes: 6 additions & 6 deletions modules/backlogs/app/controllers/backlogs/backlog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ def split_view_base_route

def load_backlogs
if OpenProject::FeatureDecisions.backlog_buckets_active?
@backlog_buckets = Agile::BacklogBucket.for_project(@project)
@backlog_buckets = BacklogBucket.for_project(@project)
end

@sprints = Agile::Sprint.for_project(@project)
.not_completed
.order_by_date
.includes(:project, :task_boards)
@sprints = Sprint.for_project(@project)
.not_completed
.order_by_date
.includes(:project, :task_boards)

@stories_by_sprint_id = WorkPackage
.where(sprint: @sprints, project: @project)
.includes(:type, :status)
.order_by_position
.group_by(&:sprint_id)
@active_sprint_ids = @sprints.select(&:active?).map(&:id)
@inbox_work_packages = Backlog.inbox_for(project: @project)
@inbox_work_packages = WorkPackage.backlogs_inbox_for(project: @project)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def load_sprint
@sprint_id = params.delete(:sprint_id)
return unless @sprint_id

@sprint = Agile::Sprint.for_project(@project).visible.find(@sprint_id)
@sprint = Sprint.for_project(@project).visible.find(@sprint_id)
end
end
end
10 changes: 5 additions & 5 deletions modules/backlogs/app/controllers/backlogs/inbox_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def menu
backlog_items_scope = if OpenProject::FeatureDecisions.backlog_buckets_active? && @work_package.backlog_bucket_id
@work_package.backlog_bucket.work_packages
else
Backlog.inbox_for(project: @project)
WorkPackage.backlogs_inbox_for(project: @project)
end

max_position = backlog_items_scope.maximum(:position) || 0
open_sprints_exist = Agile::Sprint.for_project(@project).visible.not_completed.exists?
open_sprints_exist = Sprint.for_project(@project).visible.not_completed.exists?

render(Backlogs::InboxMenuComponent.new(
work_package: @work_package,
Expand Down Expand Up @@ -99,9 +99,9 @@ def load_work_package
end

def replace_inbox_component_via_turbo_stream
inbox_work_packages = Backlog.inbox_for(project: @project)
inbox_work_packages = WorkPackage.backlogs_inbox_for(project: @project)
backlog_buckets = if OpenProject::FeatureDecisions.backlog_buckets_active?
Agile::BacklogBucket.for_project(@project)
BacklogBucket.for_project(@project)
end

replace_via_turbo_stream(
Expand All @@ -115,7 +115,7 @@ def replace_inbox_component_via_turbo_stream
end

def replace_sprint_component_via_turbo_stream(sprint_id)
sprint = Agile::Sprint.for_project(@project).visible.find(sprint_id)
sprint = Sprint.for_project(@project).visible.find(sprint_id)
replace_via_turbo_stream(
component: Backlogs::SprintComponent.new(sprint:, project: @project),
method: :morph
Expand Down
10 changes: 5 additions & 5 deletions modules/backlogs/app/controllers/backlogs/sprints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ class SprintsController < BaseController
def new_dialog
call = ::Sprints::SetAttributesService.new(
user: current_user,
model: Agile::Sprint.new,
model: Sprint.new,
contract_class: ::EmptyContract
).call(attributes: converted_sprint_params)

respond_with_dialog Backlogs::NewSprintDialogComponent.new(sprint: call.result)
end

def edit_dialog
@sprint = Agile::Sprint.for_project(@project).visible.find(params[:sprint_id])
@sprint = Sprint.for_project(@project).visible.find(params[:sprint_id])

respond_with_dialog Backlogs::NewSprintDialogComponent.new(sprint: @sprint, state: :edit)
end

def refresh_form
id = edit_sprint_params.dig(:sprint, :id)
sprint = id.present? ? Agile::Sprint.for_project(@project).visible.find(id) : Agile::Sprint.new
sprint = id.present? ? Sprint.for_project(@project).visible.find(id) : Sprint.new

call = ::Sprints::SetAttributesService.new(
user: current_user,
Expand Down Expand Up @@ -156,7 +156,7 @@ def show_finish_sprint_dialog
Backlogs::FinishSprintDialogComponent.new(
sprint: @sprint,
project: @project,
available_sprints: Agile::Sprint.native_to_sprint_source(@project).in_planning.where.not(id: @sprint.id).order_by_date
available_sprints: Sprint.native_to_sprint_source(@project).in_planning.where.not(id: @sprint.id).order_by_date
)
)
end
Expand All @@ -165,7 +165,7 @@ def load_sprint_and_project
load_project

sprint_id = params[:sprint_id]
@sprint = Agile::Sprint.for_project(@project).visible.find(sprint_id) if sprint_id
@sprint = Sprint.for_project(@project).visible.find(sprint_id) if sprint_id
end

def sprint_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class WorkPackagesController < BaseController
# Deferred ActionMenu items (Primer include-fragment).
def menu
max_position = @allowed_stories.maximum(:position) || 0
open_sprints_exist = Agile::Sprint.for_project(@project).visible.not_completed.where.not(id: @sprint.id).exists?
open_sprints_exist = Sprint.for_project(@project).visible.not_completed.where.not(id: @sprint.id).exists?

render(Backlogs::StoryMenuListComponent.new(
story: @story,
Expand All @@ -51,7 +51,7 @@ def menu
layout: false)
end

# Move a story from an Agile::Sprint to another Agile::Sprint, or the Inbox.
# Move a story from an Sprint to another Sprint, or the Inbox.
def move
# The update service reloads the story internally (via #move_after),
# so we memoize the previous sprint_id before the call.
Expand Down Expand Up @@ -125,9 +125,9 @@ def moved_to_inbox
render_success_flash_message_via_turbo_stream(
message: I18n.t(:notice_successful_move, from: @sprint.name, to: I18n.t(:label_inbox))
)
inbox_work_packages = Backlog.inbox_for(project: @project)
inbox_work_packages = WorkPackage.backlogs_inbox_for(project: @project)
backlog_buckets = if OpenProject::FeatureDecisions.backlog_buckets_active?
Agile::BacklogBucket.for_project(@project)
BacklogBucket.for_project(@project)
end

replace_via_turbo_stream(
Expand Down
110 changes: 0 additions & 110 deletions modules/backlogs/app/models/agile/sprint.rb

This file was deleted.

Loading
Loading