Skip to content

Commit a7ebf8e

Browse files
authored
Merge pull request #22836 from opf/implementation/71254-remove-legacy-sprint-model
Remove legacy Sprint model
2 parents bd6ddfe + ce8577f commit a7ebf8e

148 files changed

Lines changed: 808 additions & 1613 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/backlogs/app/components/backlogs/backlogs_component.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ See COPYRIGHT and LICENSE files for more details.
5353
head.with_actions do
5454
render Primer::Beta::Button.new(
5555
tag: :a,
56-
label: Agile::BacklogBucket.human_model_name,
56+
label: BacklogBucket.human_model_name,
5757
href: new_dialog_project_backlogs_backlog_buckets_path(project, all_backlogs_params),
5858
data: {
5959
controller: "async-dialog",
6060
test_selector: "op-backlog-buckets--new-backlog-bucket-button"
6161
}
6262
) do |button|
6363
button.with_leading_visual_icon(icon: :plus)
64-
Agile::BacklogBucket.human_model_name
64+
BacklogBucket.human_model_name
6565
end
6666
end
6767
elsif allow_sprint_creation?(project)

modules/backlogs/app/components/backlogs/move_to_sprint_dialog_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ See COPYRIGHT and LICENSE files for more details.
4141
render(
4242
Primer::Alpha::Select.new(
4343
name: "target_id",
44-
label: Agile::Sprint.human_model_name,
44+
label: Sprint.human_model_name,
4545
visually_hide_label: true
4646
)
4747
) do |select|

modules/backlogs/app/components/backlogs/move_to_sprint_dialog_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def initialize(work_package:, project:, move_action:)
4444
@work_package = work_package
4545
@project = project
4646
@move_action = move_action
47-
@sprints = Agile::Sprint.for_project(@project).not_completed.order_by_date
47+
@sprints = Sprint.for_project(@project).not_completed.order_by_date
4848
@sprints = @sprints.where.not(id: work_package.sprint_id) if work_package.sprint_id
4949
end
5050
end

modules/backlogs/app/components/backlogs/sprint_header_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def start_sprint_disabled_reason
122122
end
123123

124124
def resolved_active_sprint_ids
125-
active_sprint_ids || Agile::Sprint.for_project(sprint.project).active.pluck(:id)
125+
active_sprint_ids || Sprint.for_project(sprint.project).active.pluck(:id)
126126
end
127127
end
128128
end

modules/backlogs/app/contracts/backlog_buckets/base_contract.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BacklogBuckets::BaseContract < ModelContract
3232
validate :user_authorized
3333

3434
def self.model
35-
Agile::BacklogBucket
35+
BacklogBucket
3636
end
3737

3838
attribute :name

modules/backlogs/app/contracts/sprints/base_contract.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BaseContract < ::ModelContract
3333
validate :user_authorized
3434

3535
def self.model
36-
Agile::Sprint
36+
Sprint
3737
end
3838

3939
attribute :name

modules/backlogs/app/contracts/sprints/finish_contract.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FinishContract < ModelContract
3535
validate :no_unfinished_work_packages
3636

3737
def self.model
38-
Agile::Sprint
38+
Sprint
3939
end
4040

4141
private

modules/backlogs/app/contracts/sprints/start_contract.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def validate_dates_present
6767

6868
def validate_no_other_active_sprint
6969
return unless model.in_planning?
70-
return unless Agile::Sprint.where(project: model.project).active.where.not(id: model.id).exists?
70+
return unless Sprint.where(project: model.project).active.where.not(id: model.id).exists?
7171

7272
errors.add :status, :only_one_active_sprint_allowed
7373
end

modules/backlogs/app/contracts/work_packages/move_between_sprints_contract.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class MoveBetweenSprintsContract < ModelContract
4141
private
4242

4343
def active_sprint_in_sharer_project
44-
unless Agile::Sprint
45-
.native_to_sprint_source(Agile::Sprint.find_by(id: model.sprint_id_was).project)
44+
unless Sprint
45+
.native_to_sprint_source(Sprint.find_by(id: model.sprint_id_was).project)
4646
.in_planning
4747
.exists?(id: model.sprint_id)
4848
errors.add(:sprint, :not_eligible_for_moving)

modules/backlogs/app/controllers/backlogs/backlog_buckets_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class BacklogBucketsController < BaseController
3636
before_action :find_backlog_bucket, only: %i[edit_dialog update destroy]
3737

3838
def new_dialog
39-
backlog_bucket = Agile::BacklogBucket.new(project: @project)
39+
backlog_bucket = BacklogBucket.new(project: @project)
4040

4141
respond_with_dialog Backlogs::NewBacklogBucketDialogComponent.new(backlog_bucket:)
4242
end
@@ -104,7 +104,7 @@ def check_feature_flag
104104
end
105105

106106
def find_backlog_bucket
107-
@backlog_bucket = Agile::BacklogBucket.where(project: @project).find(params[:id])
107+
@backlog_bucket = BacklogBucket.where(project: @project).find(params[:id])
108108
end
109109

110110
def backlog_bucket_params

0 commit comments

Comments
 (0)