diff --git a/src/main/scala/gitbucket/core/controller/AccountController.scala b/src/main/scala/gitbucket/core/controller/AccountController.scala index c4b2895..0857f04 100644 --- a/src/main/scala/gitbucket/core/controller/AccountController.scala +++ b/src/main/scala/gitbucket/core/controller/AccountController.scala @@ -38,21 +38,9 @@ with RequestCache trait AccountControllerBase extends AccountManagementControllerBase { - self: AccountService - with RepositoryService - with ActivityService - with WikiService - with LabelsService - with SshKeyService - with GpgKeyService - with OneselfAuthenticator - with UsersAuthenticator - with GroupManagerAuthenticator - with ReadableUsersAuthenticator - with AccessTokenService - with WebHookService - with PrioritiesService - with RepositoryCreationService => + self: AccountService & RepositoryService & ActivityService & WikiService & LabelsService & SshKeyService & + GpgKeyService & OneselfAuthenticator & UsersAuthenticator & GroupManagerAuthenticator & ReadableUsersAuthenticator & + AccessTokenService & WebHookService & PrioritiesService & RepositoryCreationService => case class AccountNewForm( userName: String, diff --git a/src/main/scala/gitbucket/core/controller/DashboardController.scala b/src/main/scala/gitbucket/core/controller/DashboardController.scala index 898ae7b..728a800 100644 --- a/src/main/scala/gitbucket/core/controller/DashboardController.scala +++ b/src/main/scala/gitbucket/core/controller/DashboardController.scala @@ -28,12 +28,8 @@ with RequestCache trait DashboardControllerBase extends ControllerBase { - self: IssuesService - with PullRequestService - with RepositoryService - with AccountService - with CommitStatusService - with UsersAuthenticator => + self: IssuesService & PullRequestService & RepositoryService & AccountService & CommitStatusService & + UsersAuthenticator => get("/dashboard/repos")(usersOnly { context.withLoginAccount { loginAccount => diff --git a/src/main/scala/gitbucket/core/controller/IndexController.scala b/src/main/scala/gitbucket/core/controller/IndexController.scala index 5b7ddb1..73a16f5 100644 --- a/src/main/scala/gitbucket/core/controller/IndexController.scala +++ b/src/main/scala/gitbucket/core/controller/IndexController.scala @@ -34,15 +34,8 @@ with RequestCache trait IndexControllerBase extends ControllerBase { - self: RepositoryService - with ActivityService - with AccountService - with RepositorySearchService - with UsersAuthenticator - with ReferrerAuthenticator - with AccessTokenService - with AccountFederationService - with OpenIDConnectService => + self: RepositoryService & ActivityService & AccountService & RepositorySearchService & UsersAuthenticator & + ReferrerAuthenticator & AccessTokenService & AccountFederationService & OpenIDConnectService => case class SignInForm(userName: String, password: String, hash: Option[String]) diff --git a/src/main/scala/gitbucket/core/controller/IssuesController.scala b/src/main/scala/gitbucket/core/controller/IssuesController.scala index 4e96b81..a6a0056 100644 --- a/src/main/scala/gitbucket/core/controller/IssuesController.scala +++ b/src/main/scala/gitbucket/core/controller/IssuesController.scala @@ -34,21 +34,10 @@ with RequestCache trait IssuesControllerBase extends ControllerBase { - self: IssuesService - with RepositoryService - with AccountService - with LabelsService - with MilestonesService - with ActivityService - with HandleCommentService - with IssueCreationService - with CustomFieldsService - with ReadableUsersAuthenticator - with ReferrerAuthenticator - with WritableUsersAuthenticator - with PullRequestService - with WebHookIssueCommentService - with PrioritiesService => + self: IssuesService & RepositoryService & AccountService & LabelsService & MilestonesService & ActivityService & + HandleCommentService & IssueCreationService & CustomFieldsService & ReadableUsersAuthenticator & + ReferrerAuthenticator & WritableUsersAuthenticator & PullRequestService & WebHookIssueCommentService & + PrioritiesService => case class IssueCreateForm( title: String, diff --git a/src/main/scala/gitbucket/core/controller/LabelsController.scala b/src/main/scala/gitbucket/core/controller/LabelsController.scala index 5701538..55ae896 100644 --- a/src/main/scala/gitbucket/core/controller/LabelsController.scala +++ b/src/main/scala/gitbucket/core/controller/LabelsController.scala @@ -28,11 +28,7 @@ with WritableUsersAuthenticator trait LabelsControllerBase extends ControllerBase { - self: LabelsService - with IssuesService - with RepositoryService - with ReferrerAuthenticator - with WritableUsersAuthenticator => + self: LabelsService & IssuesService & RepositoryService & ReferrerAuthenticator & WritableUsersAuthenticator => case class LabelForm(labelName: String, color: String) diff --git a/src/main/scala/gitbucket/core/controller/MilestonesController.scala b/src/main/scala/gitbucket/core/controller/MilestonesController.scala index ceaae31..ae82ff2 100644 --- a/src/main/scala/gitbucket/core/controller/MilestonesController.scala +++ b/src/main/scala/gitbucket/core/controller/MilestonesController.scala @@ -26,11 +26,8 @@ with WritableUsersAuthenticator trait MilestonesControllerBase extends ControllerBase { - self: MilestonesService - with RepositoryService - with CommitStatusService - with ReferrerAuthenticator - with WritableUsersAuthenticator => + self: MilestonesService & RepositoryService & CommitStatusService & ReferrerAuthenticator & + WritableUsersAuthenticator => case class MilestoneForm(title: String, description: Option[String], dueDate: Option[java.util.Date]) diff --git a/src/main/scala/gitbucket/core/controller/PrioritiesController.scala b/src/main/scala/gitbucket/core/controller/PrioritiesController.scala index 6231863..d4f9475 100644 --- a/src/main/scala/gitbucket/core/controller/PrioritiesController.scala +++ b/src/main/scala/gitbucket/core/controller/PrioritiesController.scala @@ -28,11 +28,7 @@ with WritableUsersAuthenticator trait PrioritiesControllerBase extends ControllerBase { - self: PrioritiesService - with IssuesService - with RepositoryService - with ReferrerAuthenticator - with WritableUsersAuthenticator => + self: PrioritiesService & IssuesService & RepositoryService & ReferrerAuthenticator & WritableUsersAuthenticator => case class PriorityForm(priorityName: String, description: Option[String], color: String) diff --git a/src/main/scala/gitbucket/core/controller/PullRequestsController.scala b/src/main/scala/gitbucket/core/controller/PullRequestsController.scala index 5fd39ed..04dee17 100644 --- a/src/main/scala/gitbucket/core/controller/PullRequestsController.scala +++ b/src/main/scala/gitbucket/core/controller/PullRequestsController.scala @@ -40,23 +40,10 @@ with RequestCache trait PullRequestsControllerBase extends ControllerBase { - self: RepositoryService - with AccountService - with IssuesService - with MilestonesService - with LabelsService - with CustomFieldsService - with CommitsService - with ActivityService - with PullRequestService - with WebHookPullRequestService - with ReadableUsersAuthenticator - with ReferrerAuthenticator - with WritableUsersAuthenticator - with CommitStatusService - with MergeService - with ProtectedBranchService - with PrioritiesService => + self: RepositoryService & AccountService & IssuesService & MilestonesService & LabelsService & CustomFieldsService & + CommitsService & ActivityService & PullRequestService & WebHookPullRequestService & ReadableUsersAuthenticator & + ReferrerAuthenticator & WritableUsersAuthenticator & CommitStatusService & MergeService & ProtectedBranchService & + PrioritiesService => val pullRequestForm = mapping( "title" -> trim(label("Title", text(required))), @@ -569,7 +556,7 @@ val (originOwner, tmpOriginBranch) = parseCompareIdentifier(origin, forkedRepository.owner) val (forkedOwner, tmpForkedBranch) = parseCompareIdentifier(forked, forkedRepository.owner) - (for ( + (for { originRepositoryName <- if (originOwner == forkedOwner) { Some(forkedRepository.name) @@ -579,9 +566,9 @@ .find(_.userName == originOwner) .map(_.repositoryName) } - }; + } originRepository <- getRepository(originOwner, originRepositoryName) - ) yield { + } yield { Using.resources( Git.open(getRepositoryDir(originRepository.owner, originRepository.name)), Git.open(getRepositoryDir(forkedRepository.owner, forkedRepository.name)) diff --git a/src/main/scala/gitbucket/core/controller/ReleasesController.scala b/src/main/scala/gitbucket/core/controller/ReleasesController.scala index 252ed71..f572bc2 100644 --- a/src/main/scala/gitbucket/core/controller/ReleasesController.scala +++ b/src/main/scala/gitbucket/core/controller/ReleasesController.scala @@ -33,13 +33,8 @@ with RequestCache trait ReleaseControllerBase extends ControllerBase { - self: RepositoryService - with AccountService - with ReleaseService - with ReadableUsersAuthenticator - with ReferrerAuthenticator - with WritableUsersAuthenticator - with ActivityService => + self: RepositoryService & AccountService & ReleaseService & ReadableUsersAuthenticator & ReferrerAuthenticator & + WritableUsersAuthenticator & ActivityService => case class ReleaseForm( name: String, diff --git a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala index 1b23379..808bf44 100644 --- a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala @@ -37,16 +37,8 @@ with RequestCache trait RepositorySettingsControllerBase extends ControllerBase { - self: RepositoryService - with AccountService - with WebHookService - with ProtectedBranchService - with CommitStatusService - with DeployKeyService - with CustomFieldsService - with ActivityService - with OwnerAuthenticator - with UsersAuthenticator => + self: RepositoryService & AccountService & WebHookService & ProtectedBranchService & CommitStatusService & + DeployKeyService & CustomFieldsService & ActivityService & OwnerAuthenticator & UsersAuthenticator => // for repository options case class OptionsForm( diff --git a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala index 1dab857..3cf7e8b 100644 --- a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala @@ -65,21 +65,10 @@ * The repository viewer. */ trait RepositoryViewerControllerBase extends ControllerBase { - self: RepositoryService - with RepositoryCommitFileService - with AccountService - with ActivityService - with IssuesService - with WebHookService - with CommitsService - with ReadableUsersAuthenticator - with ReferrerAuthenticator - with WritableUsersAuthenticator - with PullRequestService - with CommitStatusService - with WebHookPullRequestService - with WebHookPullRequestReviewCommentService - with ProtectedBranchService => + self: RepositoryService & RepositoryCommitFileService & AccountService & ActivityService & IssuesService & + WebHookService & CommitsService & ReadableUsersAuthenticator & ReferrerAuthenticator & WritableUsersAuthenticator & + PullRequestService & CommitStatusService & WebHookPullRequestService & WebHookPullRequestReviewCommentService & + ProtectedBranchService => ArchiveCommand.registerFormat("zip", new ZipFormat) ArchiveCommand.registerFormat("tar.gz", new TgzFormat) diff --git a/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala b/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala index e75714d..4835e5c 100644 --- a/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/SystemSettingsController.scala @@ -29,7 +29,7 @@ case class Column(name: String, primaryKey: Boolean) trait SystemSettingsControllerBase extends AccountManagementControllerBase { - self: AccountService with RepositoryService with AdminAuthenticator => + self: AccountService & RepositoryService & AdminAuthenticator => private val form = mapping( "baseUrl" -> trim(label("Base URL", optional(text()))), diff --git a/src/main/scala/gitbucket/core/controller/ValidationSupport.scala b/src/main/scala/gitbucket/core/controller/ValidationSupport.scala index 4ab8336..1e7e7f2 100644 --- a/src/main/scala/gitbucket/core/controller/ValidationSupport.scala +++ b/src/main/scala/gitbucket/core/controller/ValidationSupport.scala @@ -10,7 +10,7 @@ /** * Extends scalatra-forms to support the client-side validation and Ajax requests as well. */ -trait ValidationSupport extends FormSupport { self: ServletBase with JacksonJsonSupport with I18nSupport => +trait ValidationSupport extends FormSupport { self: ServletBase & JacksonJsonSupport & I18nSupport => def get[T](path: String, form: ValueType[T])(action: T => Any): Route = { registerValidate(path, form) diff --git a/src/main/scala/gitbucket/core/controller/WikiController.scala b/src/main/scala/gitbucket/core/controller/WikiController.scala index de1e097..028691e 100644 --- a/src/main/scala/gitbucket/core/controller/WikiController.scala +++ b/src/main/scala/gitbucket/core/controller/WikiController.scala @@ -29,13 +29,8 @@ with RequestCache trait WikiControllerBase extends ControllerBase { - self: WikiService - with RepositoryService - with AccountService - with ActivityService - with WebHookService - with ReadableUsersAuthenticator - with ReferrerAuthenticator => + self: WikiService & RepositoryService & AccountService & ActivityService & WebHookService & + ReadableUsersAuthenticator & ReferrerAuthenticator => case class WikiPageEditForm( pageName: String, diff --git a/src/main/scala/gitbucket/core/controller/api/ApiGitReferenceControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiGitReferenceControllerBase.scala index af368b2..fef3b49 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiGitReferenceControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiGitReferenceControllerBase.scala @@ -15,7 +15,7 @@ import scala.util.Using trait ApiGitReferenceControllerBase extends ControllerBase { - self: ReferrerAuthenticator with WritableUsersAuthenticator => + self: ReferrerAuthenticator & WritableUsersAuthenticator => private val logger = LoggerFactory.getLogger(classOf[ApiGitReferenceControllerBase]) diff --git a/src/main/scala/gitbucket/core/controller/api/ApiIssueCommentControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiIssueCommentControllerBase.scala index 9659929..3e8892e 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiIssueCommentControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiIssueCommentControllerBase.scala @@ -7,13 +7,8 @@ import org.scalatra.ActionResult trait ApiIssueCommentControllerBase extends ControllerBase { - self: AccountService - with IssuesService - with RepositoryService - with HandleCommentService - with MilestonesService - with ReadableUsersAuthenticator - with ReferrerAuthenticator => + self: AccountService & IssuesService & RepositoryService & HandleCommentService & MilestonesService & + ReadableUsersAuthenticator & ReferrerAuthenticator => /* * i. List issue comments for a repository * https://docs.github.com/en/rest/reference/issues#list-issue-comments-for-a-repository diff --git a/src/main/scala/gitbucket/core/controller/api/ApiIssueControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiIssueControllerBase.scala index c22e4bc..599547d 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiIssueControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiIssueControllerBase.scala @@ -9,12 +9,8 @@ import gitbucket.core.util.Implicits._ trait ApiIssueControllerBase extends ControllerBase { - self: AccountService - with IssuesService - with IssueCreationService - with MilestonesService - with ReadableUsersAuthenticator - with ReferrerAuthenticator => + self: AccountService & IssuesService & IssueCreationService & MilestonesService & ReadableUsersAuthenticator & + ReferrerAuthenticator => /* * i. List issues * https://developer.github.com/v3/issues/#list-issues diff --git a/src/main/scala/gitbucket/core/controller/api/ApiIssueLabelControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiIssueLabelControllerBase.scala index a4b45db..daa6fb0 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiIssueLabelControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiIssueLabelControllerBase.scala @@ -7,11 +7,7 @@ import org.scalatra.{Created, NoContent, UnprocessableEntity} trait ApiIssueLabelControllerBase extends ControllerBase { - self: AccountService - with IssuesService - with LabelsService - with ReferrerAuthenticator - with WritableUsersAuthenticator => + self: AccountService & IssuesService & LabelsService & ReferrerAuthenticator & WritableUsersAuthenticator => /* * i. List all labels for this repository diff --git a/src/main/scala/gitbucket/core/controller/api/ApiIssueMilestoneControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiIssueMilestoneControllerBase.scala index 9b55238..ddad86a 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiIssueMilestoneControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiIssueMilestoneControllerBase.scala @@ -7,7 +7,7 @@ import org.scalatra.NoContent trait ApiIssueMilestoneControllerBase extends ControllerBase { - self: MilestonesService with WritableUsersAuthenticator with ReferrerAuthenticator => + self: MilestonesService & WritableUsersAuthenticator & ReferrerAuthenticator => /* * i. List milestones diff --git a/src/main/scala/gitbucket/core/controller/api/ApiOrganizationControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiOrganizationControllerBase.scala index b5545ed..6453580 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiOrganizationControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiOrganizationControllerBase.scala @@ -6,7 +6,7 @@ import gitbucket.core.util.{AdminAuthenticator, UsersAuthenticator} trait ApiOrganizationControllerBase extends ControllerBase { - self: RepositoryService with AccountService with AdminAuthenticator with UsersAuthenticator => + self: RepositoryService & AccountService & AdminAuthenticator & UsersAuthenticator => /* * i. List your organizations diff --git a/src/main/scala/gitbucket/core/controller/api/ApiPullRequestControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiPullRequestControllerBase.scala index 550a53a..f2529bb 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiPullRequestControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiPullRequestControllerBase.scala @@ -16,14 +16,8 @@ import scala.jdk.CollectionConverters._ trait ApiPullRequestControllerBase extends ControllerBase { - self: AccountService - with IssuesService - with PullRequestService - with RepositoryService - with MergeService - with ReferrerAuthenticator - with ReadableUsersAuthenticator - with WritableUsersAuthenticator => + self: AccountService & IssuesService & PullRequestService & RepositoryService & MergeService & ReferrerAuthenticator & + ReadableUsersAuthenticator & WritableUsersAuthenticator => /* * i. Link Relations diff --git a/src/main/scala/gitbucket/core/controller/api/ApiReleaseControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiReleaseControllerBase.scala index e040ef0..93e7f13 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiReleaseControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiReleaseControllerBase.scala @@ -11,7 +11,7 @@ import org.scalatra.NoContent trait ApiReleaseControllerBase extends ControllerBase { - self: AccountService with ReleaseService with ReferrerAuthenticator with WritableUsersAuthenticator => + self: AccountService & ReleaseService & ReferrerAuthenticator & WritableUsersAuthenticator => /** * i. List releases for a repository diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryBranchControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryBranchControllerBase.scala index 6ec5635..82d4899 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryBranchControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryBranchControllerBase.scala @@ -12,15 +12,8 @@ import scala.util.Using trait ApiRepositoryBranchControllerBase extends ControllerBase { - self: RepositoryService - with AccountService - with OwnerAuthenticator - with UsersAuthenticator - with GroupManagerAuthenticator - with ProtectedBranchService - with ReferrerAuthenticator - with ReadableUsersAuthenticator - with WritableUsersAuthenticator => + self: RepositoryService & AccountService & OwnerAuthenticator & UsersAuthenticator & GroupManagerAuthenticator & + ProtectedBranchService & ReferrerAuthenticator & ReadableUsersAuthenticator & WritableUsersAuthenticator => /** * i. List branches diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCollaboratorControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCollaboratorControllerBase.scala index f234795..4a8ab09 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCollaboratorControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCollaboratorControllerBase.scala @@ -7,7 +7,7 @@ import org.scalatra.NoContent trait ApiRepositoryCollaboratorControllerBase extends ControllerBase { - self: RepositoryService with AccountService with ReferrerAuthenticator with OwnerAuthenticator => + self: RepositoryService & AccountService & ReferrerAuthenticator & OwnerAuthenticator => /* * i. List repository collaborators diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCommitControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCommitControllerBase.scala index c4c5322..49b9827 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCommitControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryCommitControllerBase.scala @@ -21,7 +21,7 @@ import scala.util.Using trait ApiRepositoryCommitControllerBase extends ControllerBase { - self: AccountService with CommitsService with ProtectedBranchService with ReferrerAuthenticator => + self: AccountService & CommitsService & ProtectedBranchService & ReferrerAuthenticator => /* * i. List commits on a repository * https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryContentsControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryContentsControllerBase.scala index 381d871..1f0c40b 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryContentsControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryContentsControllerBase.scala @@ -12,7 +12,7 @@ import scala.util.Using trait ApiRepositoryContentsControllerBase extends ControllerBase { - self: ReferrerAuthenticator with WritableUsersAuthenticator with RepositoryCommitFileService => + self: ReferrerAuthenticator & WritableUsersAuthenticator & RepositoryCommitFileService => /** * i. Get a repository README diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryControllerBase.scala index a9cd6eb..e4555b9 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryControllerBase.scala @@ -15,16 +15,9 @@ import scala.util.Using trait ApiRepositoryControllerBase extends ControllerBase { - self: RepositoryService - with ApiGitReferenceControllerBase - with RepositoryCreationService - with AccountService - with OwnerAuthenticator - with UsersAuthenticator - with GroupManagerAuthenticator - with ReferrerAuthenticator - with ReadableUsersAuthenticator - with WritableUsersAuthenticator => + self: RepositoryService & ApiGitReferenceControllerBase & RepositoryCreationService & AccountService & + OwnerAuthenticator & UsersAuthenticator & GroupManagerAuthenticator & ReferrerAuthenticator & + ReadableUsersAuthenticator & WritableUsersAuthenticator => /** * i. List your repositories diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryStatusControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryStatusControllerBase.scala index bf26ad5..e6d2241 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryStatusControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryStatusControllerBase.scala @@ -7,7 +7,7 @@ import gitbucket.core.util.{JGitUtil, ReferrerAuthenticator, WritableUsersAuthenticator} trait ApiRepositoryStatusControllerBase extends ControllerBase { - self: AccountService with CommitStatusService with ReferrerAuthenticator with WritableUsersAuthenticator => + self: AccountService & CommitStatusService & ReferrerAuthenticator & WritableUsersAuthenticator => /* * i. Create a status diff --git a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryWebhookControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryWebhookControllerBase.scala index 78f5b41..5bfe6c2 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiRepositoryWebhookControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiRepositoryWebhookControllerBase.scala @@ -8,7 +8,7 @@ import org.scalatra.NoContent trait ApiRepositoryWebhookControllerBase extends ControllerBase { - self: RepositoryService with WebHookService with ReferrerAuthenticator with WritableUsersAuthenticator => + self: RepositoryService & WebHookService & ReferrerAuthenticator & WritableUsersAuthenticator => /* * i. List repository webhooks diff --git a/src/main/scala/gitbucket/core/controller/api/ApiUserControllerBase.scala b/src/main/scala/gitbucket/core/controller/api/ApiUserControllerBase.scala index cbf37be..4b76554 100644 --- a/src/main/scala/gitbucket/core/controller/api/ApiUserControllerBase.scala +++ b/src/main/scala/gitbucket/core/controller/api/ApiUserControllerBase.scala @@ -8,7 +8,7 @@ import org.scalatra.NoContent trait ApiUserControllerBase extends ControllerBase { - self: RepositoryService with AccountService with AdminAuthenticator with UsersAuthenticator => + self: RepositoryService & AccountService & AdminAuthenticator & UsersAuthenticator => /** * i. Get a single user diff --git a/src/main/scala/gitbucket/core/service/CommitsService.scala b/src/main/scala/gitbucket/core/service/CommitsService.scala index d7f7d1d..782e8b5 100644 --- a/src/main/scala/gitbucket/core/service/CommitsService.scala +++ b/src/main/scala/gitbucket/core/service/CommitsService.scala @@ -16,7 +16,7 @@ import org.apache.commons.io.FileUtils trait CommitsService { - self: ActivityService with PullRequestService with WebHookPullRequestReviewCommentService => + self: ActivityService & PullRequestService & WebHookPullRequestReviewCommentService => def getCommitComments(owner: String, repository: String, commitId: String, includePullRequest: Boolean)(implicit s: Session diff --git a/src/main/scala/gitbucket/core/service/HandleCommentService.scala b/src/main/scala/gitbucket/core/service/HandleCommentService.scala index 52f297a..341194a 100644 --- a/src/main/scala/gitbucket/core/service/HandleCommentService.scala +++ b/src/main/scala/gitbucket/core/service/HandleCommentService.scala @@ -16,12 +16,8 @@ import gitbucket.core.util.Implicits._ trait HandleCommentService { - self: RepositoryService - with IssuesService - with ActivityService - with WebHookService - with WebHookIssueCommentService - with WebHookPullRequestService => + self: RepositoryService & IssuesService & ActivityService & WebHookService & WebHookIssueCommentService & + WebHookPullRequestService => /** * @see [[https://github.com/gitbucket/gitbucket/wiki/CommentAction]] diff --git a/src/main/scala/gitbucket/core/service/IssueCreationService.scala b/src/main/scala/gitbucket/core/service/IssueCreationService.scala index 467c462..49fcd17 100644 --- a/src/main/scala/gitbucket/core/service/IssueCreationService.scala +++ b/src/main/scala/gitbucket/core/service/IssueCreationService.scala @@ -10,7 +10,7 @@ trait IssueCreationService { - self: RepositoryService with WebHookIssueCommentService with LabelsService with IssuesService with ActivityService => + self: RepositoryService & WebHookIssueCommentService & LabelsService & IssuesService & ActivityService => def createIssue( repository: RepositoryInfo, diff --git a/src/main/scala/gitbucket/core/service/IssuesService.scala b/src/main/scala/gitbucket/core/service/IssuesService.scala index d2a9d2f..9832333 100644 --- a/src/main/scala/gitbucket/core/service/IssuesService.scala +++ b/src/main/scala/gitbucket/core/service/IssuesService.scala @@ -26,7 +26,7 @@ import scala.jdk.CollectionConverters._ trait IssuesService { - self: AccountService with RepositoryService with LabelsService with PrioritiesService with MilestonesService => + self: AccountService & RepositoryService & LabelsService & PrioritiesService & MilestonesService => import IssuesService._ def getIssue(owner: String, repository: String, issueId: String)(implicit s: Session) = diff --git a/src/main/scala/gitbucket/core/service/MergeService.scala b/src/main/scala/gitbucket/core/service/MergeService.scala index b9d9268..1e76379 100644 --- a/src/main/scala/gitbucket/core/service/MergeService.scala +++ b/src/main/scala/gitbucket/core/service/MergeService.scala @@ -23,13 +23,8 @@ import scala.util.Using trait MergeService { - self: AccountService - with ActivityService - with IssuesService - with RepositoryService - with PullRequestService - with WebHookPullRequestService - with WebHookService => + self: AccountService & ActivityService & IssuesService & RepositoryService & PullRequestService & + WebHookPullRequestService & WebHookService => import MergeService._ diff --git a/src/main/scala/gitbucket/core/service/PullRequestService.scala b/src/main/scala/gitbucket/core/service/PullRequestService.scala index ffbdeb9..3db36b5 100644 --- a/src/main/scala/gitbucket/core/service/PullRequestService.scala +++ b/src/main/scala/gitbucket/core/service/PullRequestService.scala @@ -25,13 +25,8 @@ import scala.util.Using trait PullRequestService { - self: IssuesService - with CommitsService - with WebHookService - with WebHookPullRequestService - with RepositoryService - with MergeService - with ActivityService => + self: IssuesService & CommitsService & WebHookService & WebHookPullRequestService & RepositoryService & MergeService & + ActivityService => import PullRequestService.* def getPullRequest(owner: String, repository: String, issueId: Int)(implicit diff --git a/src/main/scala/gitbucket/core/service/ReleaseService.scala b/src/main/scala/gitbucket/core/service/ReleaseService.scala index f6542d3..64f2194 100644 --- a/src/main/scala/gitbucket/core/service/ReleaseService.scala +++ b/src/main/scala/gitbucket/core/service/ReleaseService.scala @@ -8,7 +8,7 @@ import gitbucket.core.util.JGitUtil trait ReleaseService { - self: AccountService with RepositoryService => + self: AccountService & RepositoryService => def createReleaseAsset( owner: String, diff --git a/src/main/scala/gitbucket/core/service/RepositoryCommitFileService.scala b/src/main/scala/gitbucket/core/service/RepositoryCommitFileService.scala index efbd7a4..dd38a00 100644 --- a/src/main/scala/gitbucket/core/service/RepositoryCommitFileService.scala +++ b/src/main/scala/gitbucket/core/service/RepositoryCommitFileService.scala @@ -17,12 +17,8 @@ import scala.util.Using trait RepositoryCommitFileService { - self: AccountService - with ActivityService - with IssuesService - with PullRequestService - with WebHookPullRequestService - with RepositoryService => + self: AccountService & ActivityService & IssuesService & PullRequestService & WebHookPullRequestService & + RepositoryService => /** * Create multiple files by callback function. diff --git a/src/main/scala/gitbucket/core/service/RepositoryCreationService.scala b/src/main/scala/gitbucket/core/service/RepositoryCreationService.scala index b4e13c0..1961299 100644 --- a/src/main/scala/gitbucket/core/service/RepositoryCreationService.scala +++ b/src/main/scala/gitbucket/core/service/RepositoryCreationService.scala @@ -46,12 +46,7 @@ } trait RepositoryCreationService { - self: AccountService - with RepositoryService - with LabelsService - with WikiService - with ActivityService - with PrioritiesService => + self: AccountService & RepositoryService & LabelsService & WikiService & ActivityService & PrioritiesService => def canCreateRepository(repositoryOwner: String, loginAccount: Account)(implicit session: Session): Boolean = { repositoryOwner == loginAccount.userName || getGroupsByUserName(loginAccount.userName) diff --git a/src/main/scala/gitbucket/core/service/WebHookService.scala b/src/main/scala/gitbucket/core/service/WebHookService.scala index 1fdcaa4..2fb7c78 100644 --- a/src/main/scala/gitbucket/core/service/WebHookService.scala +++ b/src/main/scala/gitbucket/core/service/WebHookService.scala @@ -367,7 +367,7 @@ } trait WebHookPullRequestService extends WebHookService { - self: AccountService with RepositoryService with PullRequestService with IssuesService => + self: AccountService & RepositoryService & PullRequestService & IssuesService => import WebHookService._ // https://developer.github.com/v3/activity/events/types/#issuesevent @@ -513,7 +513,7 @@ } trait WebHookPullRequestReviewCommentService extends WebHookService { - self: AccountService with RepositoryService with PullRequestService with IssuesService with CommitsService => + self: AccountService & RepositoryService & PullRequestService & IssuesService & CommitsService => def callPullRequestReviewCommentWebHook( action: String, comment: CommitComment, @@ -561,7 +561,7 @@ } trait WebHookIssueCommentService extends WebHookPullRequestService { - self: AccountService with RepositoryService with PullRequestService with IssuesService => + self: AccountService & RepositoryService & PullRequestService & IssuesService => import WebHookService._ def callIssueCommentWebHook( diff --git a/src/main/scala/gitbucket/core/ssh/GitCommand.scala b/src/main/scala/gitbucket/core/ssh/GitCommand.scala index 8b72456..8628b38 100644 --- a/src/main/scala/gitbucket/core/ssh/GitCommand.scala +++ b/src/main/scala/gitbucket/core/ssh/GitCommand.scala @@ -92,7 +92,7 @@ } abstract class DefaultGitCommand(val owner: String, val repoName: String) extends GitCommand { - self: RepositoryService with AccountService with DeployKeyService => + self: RepositoryService & AccountService & DeployKeyService => protected def userName(authType: AuthType): String = { authType match { diff --git a/src/main/scala/gitbucket/core/util/Authenticator.scala b/src/main/scala/gitbucket/core/util/Authenticator.scala index 5805022..abd4eb5 100644 --- a/src/main/scala/gitbucket/core/util/Authenticator.scala +++ b/src/main/scala/gitbucket/core/util/Authenticator.scala @@ -25,7 +25,7 @@ /** * Allows only the repository owner and administrators. */ -trait OwnerAuthenticator { self: ControllerBase with RepositoryService with AccountService => +trait OwnerAuthenticator { self: ControllerBase & RepositoryService & AccountService => protected def ownerOnly(action: (RepositoryInfo) => Any) = { authenticate(action) } protected def ownerOnly[T](action: (T, RepositoryInfo) => Any) = (form: T) => { authenticate(action(form, _)) } @@ -82,7 +82,7 @@ /** * Allows only guests and signed in users who can access the repository. */ -trait ReferrerAuthenticator { self: ControllerBase with RepositoryService with AccountService => +trait ReferrerAuthenticator { self: ControllerBase & RepositoryService & AccountService => protected def referrersOnly(action: (RepositoryInfo) => Any) = { authenticate(action) } protected def referrersOnly[T](action: (T, RepositoryInfo) => Any) = (form: T) => { authenticate(action(form, _)) } @@ -102,7 +102,7 @@ /** * Allows only signed in users who have read permission for the repository. */ -trait ReadableUsersAuthenticator { self: ControllerBase with RepositoryService with AccountService => +trait ReadableUsersAuthenticator { self: ControllerBase & RepositoryService & AccountService => protected def readableUsersOnly(action: (RepositoryInfo) => Any) = { authenticate(action) } protected def readableUsersOnly[T](action: (T, RepositoryInfo) => Any) = (form: T) => { authenticate(action(form, _)) @@ -124,7 +124,7 @@ /** * Allows only signed in users who have write permission for the repository. */ -trait WritableUsersAuthenticator { self: ControllerBase with RepositoryService with AccountService => +trait WritableUsersAuthenticator { self: ControllerBase & RepositoryService & AccountService => protected def writableUsersOnly(action: (RepositoryInfo) => Any) = { authenticate(action) } protected def writableUsersOnly[T](action: (T, RepositoryInfo) => Any) = (form: T) => { authenticate(action(form, _)) @@ -151,7 +151,7 @@ /** * Allows only the group managers. */ -trait GroupManagerAuthenticator { self: ControllerBase with AccountService => +trait GroupManagerAuthenticator { self: ControllerBase & AccountService => protected def managersOnly(action: => Any) = { authenticate(action) } protected def managersOnly[T](action: T => Any) = (form: T) => { authenticate(action(form)) }