[OP-19546] Migrate lodash sortBy in module frontends

The linked-plugin frontends share the global `_` but were outside the
frontend/src sweep. Switches `sortBy` in the GitLab and GitHub modules to
the `lodash-es` named import (`_.flatten` here is handled in #23732).
This commit is contained in:
Alexander Brandon Coles
2026-06-13 19:13:36 +01:00
parent ef7bf7bb06
commit 73461d1da6
3 changed files with 6 additions and 3 deletions
@@ -26,6 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
import { sortBy } from 'lodash-es';
import { ChangeDetectionStrategy, Component, HostBinding, Input, OnInit, inject } from '@angular/core';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -63,7 +64,7 @@ export class TabPrsComponent implements OnInit {
.githubPullRequests
.ofWorkPackage(this.workPackage)
.pipe(
map((elements) => _.sortBy(elements, 'updatedAt')),
map((elements) => sortBy(elements, 'updatedAt')),
shareReplay(1),
);
}
@@ -27,6 +27,7 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
import { sortBy } from 'lodash-es';
import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource";
import { HalResource } from "core-app/features/hal/resources/hal-resource";
import { Injectable, inject } from '@angular/core';
@@ -45,6 +46,6 @@ export class WorkPackagesGitlabIssueService extends WorkPackageLinkedResourceCac
}
protected sortList(gitlabIssue:HalResource[], attr = 'createdAt'):HalResource[] {
return _.sortBy(_.flatten(gitlabIssue), attr);
return sortBy(_.flatten(gitlabIssue), attr);
}
}
@@ -27,6 +27,7 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
import { sortBy } from 'lodash-es';
import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource";
import { HalResource } from "core-app/features/hal/resources/hal-resource";
import { Injectable, inject } from '@angular/core';
@@ -45,6 +46,6 @@ export class WorkPackagesGitlabMrsService extends WorkPackageLinkedResourceCache
}
protected sortList(mergeRequests:HalResource[], attr = 'createdAt'):HalResource[] {
return _.sortBy(_.flatten(mergeRequests), attr);
return sortBy(_.flatten(mergeRequests), attr);
}
}