e2corporation commented on code in PR #3356:
URL: https://github.com/apache/incubator-devlake/pull/3356#discussion_r991324555
##########
config-ui/src/hooks/useDataScopesManager.jsx:
##########
@@ -365,38 +365,64 @@ function useDataScopesManager({
const getGithubProjects = useCallback(
(c) =>
- [Providers.GITHUB].includes(c.plugin)
- ? c.scope.map(
- (s) =>
- new GitHubProject({
- id: `${s.options?.owner}/${s.options?.repo}`,
- key: `${s.options?.owner}/${s.options?.repo}`,
- owner: s.options?.owner,
- repo: s.options?.repo,
- value: `${s.options?.owner}/${s.options?.repo}`,
- title: `${s.options?.owner}/${s.options?.repo}`
- })
- )
- : [],
+ c.scope.map(
+ (s) =>
+ new GitHubProject({
+ id: `${s.options?.owner}/${s.options?.repo}`,
+ key: `${s.options?.owner}/${s.options?.repo}`,
+ owner: s.options?.owner,
+ repo: s.options?.repo,
+ value: `${s.options?.owner}/${s.options?.repo}`,
+ title: `${s.options?.owner}/${s.options?.repo}`
+ })
+ ),
[]
)
const getGitlabProjects = useCallback(
(c) =>
- [Providers.GITLAB].includes(c.plugin)
- ? c.scope.map(
- (s) =>
- new GitlabProject({
- id: s.options?.projectId,
- key: s.options?.projectId,
- value: s.options?.projectId,
- title: s.options?.title || `Project ${s.options?.projectId}`
- })
- )
- : [],
+ c.scope.map(
+ (s) =>
+ new GitlabProject({
+ id: s.options?.projectId,
+ key: s.options?.projectId,
+ value: s.options?.projectId,
+ title: s.options?.title || `Project ${s.options?.projectId}`
+ })
+ ),
+ []
+ )
+
+ const getJenkinsProjects = useCallback(
+ (c) =>
+ c.scope.map(
+ (s) =>
+ new GitlabProject({
Review Comment:
See comment about creating new `JenkinsJob` Model and use it here instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]