You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/11/10 12:09:37 UTC
[GitHub] [incubator-devlake] mintsweet opened a new pull request, #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
mintsweet opened a new pull request, #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717
# Summary
<!--
Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes.
Please fill out as many sections below as possible.
-->
1. remove content about the miller-columns test.
2. optimize some content about miller-columns
3. gitlab project chooses to support the miller-columns component
### Related Issues
#3670
### Screenshots


### Other Information
Nothing.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1311197374
> 
This is expected as you can't tell how many subsets it has.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1311168880
@likyh GitLab in the prototype does not support selecting public repo, but GitHub will support choose public repo.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022357566
##########
config-ui/src/components/gitlab/project-selector/use-gitlab-project-selector.ts:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { useState, useEffect, useMemo } from 'react'
+
+import request from '../request'
+import { getGitLabProxyApiPrefix } from '../config'
+
+export interface UseGitLabProjectSelectorProps {
+ connectionId: string
+ search: string
+ membership: boolean
+}
+
+export const useGitLabProjectSelector = ({
+ connectionId,
+ search,
+ membership
+}: UseGitLabProjectSelectorProps) => {
+ const [loading, setLoading] = useState(false)
+ const [items, setItems] = useState([])
+
+ const prefix = useMemo(
+ () => getGitLabProxyApiPrefix(connectionId),
+ [connectionId]
+ )
+
+ useEffect(() => {
+ if (!search) return
+ setLoading(true)
+
+ const apiPath = `${prefix}/projects`
+
+ const timer = setTimeout(async () => {
+ const res = await request(apiPath, { data: { search, membership } })
+ setItems(
+ res.map((it: any) => ({
+ id: it.id,
Review Comment:
Components should not know about the **GitLabProject** object and will handle it at the **DataScope** level.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1019808529
##########
config-ui/src/components/miller-columns/hooks/use-miller-columns.ts:
##########
@@ -29,31 +29,49 @@ export interface UseMillerColumnsProps {
items: ItemType[]
activeItemId?: ItemType['id']
onActiveItemId?: (id: ItemType['id']) => void
- selectedItemIds?: Array<ItemType['id']>
+ selectedItemIds: Array<ItemType['id']>
onSelectedItemIds?: (ids: Array<ItemType['id']>) => void
+ onExpandItem?: (item: ItemType) => void
}
export const useMillerColumns = ({
items,
onActiveItemId,
onSelectedItemIds,
+ onExpandItem,
...props
Review Comment:
why not use `activeItemId` instead of `...props`
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022359298
##########
config-ui/src/components/gitlab/project-selector/use-gitlab-project-selector.ts:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { useState, useEffect, useMemo } from 'react'
+
+import request from '../request'
+import { getGitLabProxyApiPrefix } from '../config'
+
+export interface UseGitLabProjectSelectorProps {
+ connectionId: string
+ search: string
+ membership: boolean
+}
+
+export const useGitLabProjectSelector = ({
+ connectionId,
+ search,
+ membership
+}: UseGitLabProjectSelectorProps) => {
+ const [loading, setLoading] = useState(false)
+ const [items, setItems] = useState([])
+
+ const prefix = useMemo(
+ () => getGitLabProxyApiPrefix(connectionId),
+ [connectionId]
+ )
+
+ useEffect(() => {
+ if (!search) return
+ setLoading(true)
+
+ const apiPath = `${prefix}/projects`
+
+ const timer = setTimeout(async () => {
+ const res = await request(apiPath, { data: { search, membership } })
+ setItems(
+ res.map((it: any) => ({
+ id: it.id,
+ key: it.id,
+ title: it.name_with_namespace,
+ shortTitle: it.name
+ }))
+ )
+ setLoading(false)
+ }, 1000)
Review Comment:
1000?
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1019815951
##########
config-ui/src/components/blueprints/create-workflow/DataScopes.jsx:
##########
@@ -212,17 +213,13 @@ const DataScopes = (props) => {
<>
<h4>Projects *</h4>
<p>Select the project you would like to sync.</p>
- <GitlabProjectsSelector
- onFetch={fetchGitlabProjects}
Review Comment:
delete unused `fetchGitlabProjects` and other code like `useGitlab`.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022358220
##########
config-ui/src/components/gitlab/project-selector/use-gitlab-project-selector.ts:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { useState, useEffect, useMemo } from 'react'
+
+import request from '../request'
+import { getGitLabProxyApiPrefix } from '../config'
+
+export interface UseGitLabProjectSelectorProps {
+ connectionId: string
+ search: string
+ membership: boolean
+}
+
+export const useGitLabProjectSelector = ({
+ connectionId,
+ search,
+ membership
+}: UseGitLabProjectSelectorProps) => {
+ const [loading, setLoading] = useState(false)
+ const [items, setItems] = useState([])
+
+ const prefix = useMemo(
+ () => getGitLabProxyApiPrefix(connectionId),
+ [connectionId]
+ )
+
+ useEffect(() => {
+ if (!search) return
+ setLoading(true)
+
+ const apiPath = `${prefix}/projects`
+
+ const timer = setTimeout(async () => {
+ const res = await request(apiPath, { data: { search, membership } })
+ setItems(
+ res.map((it: any) => ({
+ id: it.id,
+ key: it.id,
+ title: it.name_with_namespace,
+ shortTitle: it.name
+ }))
+ )
+ setLoading(false)
+ }, 1000)
+
+ return () => clearTimeout(timer)
+ }, [prefix, search, membership])
+
+ return useMemo(() => {
Review Comment:
`useMemo` is to prevent the refresh of the parent component from causing this custom hook to be re-executed. This hook should only be re-executed when the **items** are updated.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022356663
##########
config-ui/src/components/gitlab/project-selector/use-gitlab-project-selector.ts:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { useState, useEffect, useMemo } from 'react'
+
+import request from '../request'
+import { getGitLabProxyApiPrefix } from '../config'
+
+export interface UseGitLabProjectSelectorProps {
+ connectionId: string
+ search: string
+ membership: boolean
+}
+
+export const useGitLabProjectSelector = ({
+ connectionId,
+ search,
+ membership
+}: UseGitLabProjectSelectorProps) => {
+ const [loading, setLoading] = useState(false)
+ const [items, setItems] = useState([])
+
+ const prefix = useMemo(
+ () => getGitLabProxyApiPrefix(connectionId),
+ [connectionId]
+ )
+
+ useEffect(() => {
+ if (!search) return
+ setLoading(true)
+
+ const apiPath = `${prefix}/projects`
+
+ const timer = setTimeout(async () => {
+ const res = await request(apiPath, { data: { search, membership } })
+ setItems(
+ res.map((it: any) => ({
+ id: it.id,
Review Comment:
just return pure objects? Does this mean we will delete the class `GitlabProject` in the future? If so, define a type for items
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022360011
##########
config-ui/src/components/gitlab/project-selector/use-gitlab-project-selector.ts:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { useState, useEffect, useMemo } from 'react'
+
+import request from '../request'
+import { getGitLabProxyApiPrefix } from '../config'
+
+export interface UseGitLabProjectSelectorProps {
+ connectionId: string
+ search: string
+ membership: boolean
+}
+
+export const useGitLabProjectSelector = ({
+ connectionId,
+ search,
+ membership
+}: UseGitLabProjectSelectorProps) => {
+ const [loading, setLoading] = useState(false)
+ const [items, setItems] = useState([])
+
+ const prefix = useMemo(
+ () => getGitLabProxyApiPrefix(connectionId),
+ [connectionId]
+ )
+
+ useEffect(() => {
+ if (!search) return
+ setLoading(true)
+
+ const apiPath = `${prefix}/projects`
+
+ const timer = setTimeout(async () => {
+ const res = await request(apiPath, { data: { search, membership } })
+ setItems(
+ res.map((it: any) => ({
+ id: it.id,
+ key: it.id,
+ title: it.name_with_namespace,
+ shortTitle: it.name
+ }))
+ )
+ setLoading(false)
+ }, 1000)
Review Comment:
I observed that currently, 200 would have a lot of extra requests, one second as an anti-shake is not a significant number.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1315089759
@likyh a
> There are some small bugs:
>
> 1. not show "Fetching" when request new data
> 
> 2. close selector when the value is empty
> 
> 3. When I delete a repo in the below selector, the miller-column does not update.
> 4. the click area is too small. The title should have the ability to control the checkbox.
> 
> 5. the same repo display twice
> 
@likyh done.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1019809224
##########
config-ui/src/components/miller-columns/hooks/use-miller-columns.ts:
##########
@@ -29,31 +29,49 @@ export interface UseMillerColumnsProps {
items: ItemType[]
activeItemId?: ItemType['id']
onActiveItemId?: (id: ItemType['id']) => void
- selectedItemIds?: Array<ItemType['id']>
+ selectedItemIds: Array<ItemType['id']>
onSelectedItemIds?: (ids: Array<ItemType['id']>) => void
+ onExpandItem?: (item: ItemType) => void
}
export const useMillerColumns = ({
items,
onActiveItemId,
onSelectedItemIds,
+ onExpandItem,
...props
Review Comment:
This is a controlled component. The component itself has the props activeItemId. It is controlled by judging whether it is externally passed in.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1019813736
##########
config-ui/src/components/miller-columns/custom/request.ts:
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import type { AxiosRequestConfig } from 'axios'
+import axios from 'axios'
+
+const instance = axios.create({
+ baseURL: '/api'
+})
+
+export type ReuqestConfig = {
+ method?: AxiosRequestConfig['method']
+ data?: unknown
+ timeout?: number
+ signal?: AbortSignal
+ headers?: Record<string, string>
+}
+
+const request = (path: string, config?: ReuqestConfig) => {
Review Comment:
a new request? Do you plan to use this to replace the old one?
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022356473
##########
config-ui/src/pages/blueprints/blueprint-settings.jsx:
##########
@@ -64,7 +64,6 @@ import BlueprintDataScopesDialog from '@/components/blueprints/BlueprintDataScop
import BlueprintNavigationLinks from '@/components/blueprints/BlueprintNavigationLinks'
import DataScopesGrid from '@/components/blueprints/DataScopesGrid'
import AdvancedJSON from '@/components/blueprints/create-workflow/AdvancedJSON'
-import useGitlab from '@/hooks/useGitlab'
import {
GITLAB_API_PROXY_ENDPOINT,
Review Comment:
sorry, missed this part, I'll delete it right away
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022357373
##########
config-ui/src/components/gitlab/project-selector/use-gitlab-project-selector.ts:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { useState, useEffect, useMemo } from 'react'
+
+import request from '../request'
+import { getGitLabProxyApiPrefix } from '../config'
+
+export interface UseGitLabProjectSelectorProps {
+ connectionId: string
+ search: string
+ membership: boolean
+}
+
+export const useGitLabProjectSelector = ({
+ connectionId,
+ search,
+ membership
+}: UseGitLabProjectSelectorProps) => {
+ const [loading, setLoading] = useState(false)
+ const [items, setItems] = useState([])
+
+ const prefix = useMemo(
+ () => getGitLabProxyApiPrefix(connectionId),
+ [connectionId]
+ )
+
+ useEffect(() => {
+ if (!search) return
+ setLoading(true)
+
+ const apiPath = `${prefix}/projects`
+
+ const timer = setTimeout(async () => {
+ const res = await request(apiPath, { data: { search, membership } })
+ setItems(
+ res.map((it: any) => ({
+ id: it.id,
+ key: it.id,
+ title: it.name_with_namespace,
+ shortTitle: it.name
+ }))
+ )
+ setLoading(false)
+ }, 1000)
+
+ return () => clearTimeout(timer)
+ }, [prefix, search, membership])
+
+ return useMemo(() => {
Review Comment:
Why return state in memo?
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1314847567
There are some small bugs:
1. not show "Fetching" when request new data

2. close selector when the value is empty

3. When I delete a repo in the below selector, the miller-column does not update.
4. the click area is too small. The title should have the ability to control the checkbox.

5. the same repo display twice

--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1311193551
> @likyh GitLab in the prototype does not support choosing public repo, but GitHub will support choosing public repo.
Emm, @yumengwang03 @Startrekzky
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1311192952

--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#issuecomment-1311136928
How can I choose public repo?
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1022354309
##########
config-ui/src/pages/blueprints/blueprint-settings.jsx:
##########
@@ -64,7 +64,6 @@ import BlueprintDataScopesDialog from '@/components/blueprints/BlueprintDataScop
import BlueprintNavigationLinks from '@/components/blueprints/BlueprintNavigationLinks'
import DataScopesGrid from '@/components/blueprints/DataScopesGrid'
import AdvancedJSON from '@/components/blueprints/create-workflow/AdvancedJSON'
-import useGitlab from '@/hooks/useGitlab'
import {
GITLAB_API_PROXY_ENDPOINT,
Review Comment:
delete these consts either?
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
mintsweet commented on code in PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717#discussion_r1019815052
##########
config-ui/src/components/miller-columns/custom/request.ts:
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import type { AxiosRequestConfig } from 'axios'
+import axios from 'axios'
+
+const instance = axios.create({
+ baseURL: '/api'
+})
+
+export type ReuqestConfig = {
+ method?: AxiosRequestConfig['method']
+ data?: unknown
+ timeout?: number
+ signal?: AbortSignal
+ headers?: Record<string, string>
+}
+
+const request = (path: string, config?: ReuqestConfig) => {
Review Comment:
Yes, because the old one doesn't even return the most basic `resp.data`, you need to go to `.data` additionally.
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh merged pull request #3717: feat(config-ui): gitlab project chooses to support the miller-columns component
Posted by GitBox <gi...@apache.org>.
likyh merged PR #3717:
URL: https://github.com/apache/incubator-devlake/pull/3717
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org