diff --git a/backend/src/services/integration-auth/integration-sync-secret.ts b/backend/src/services/integration-auth/integration-sync-secret.ts index 449d2d14d..197c1f940 100644 --- a/backend/src/services/integration-auth/integration-sync-secret.ts +++ b/backend/src/services/integration-auth/integration-sync-secret.ts @@ -3632,15 +3632,13 @@ const syncSecretsBitBucket = async ({ let hasNextPage = true; - let variablesUrl: string; + const rootUrl = integration.targetServiceId + ? // scope: deployment environment + `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/deployments_config/environments/${integration.targetServiceId}/variables` + : // scope: repository + `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/pipelines_config/variables`; - if (integration.targetServiceId) { - // scope: deployment environment - variablesUrl = `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/deployments_config/environments/${integration.targetServiceId}/variables`; - } else { - // scope: repository - variablesUrl = `${IntegrationUrls.BITBUCKET_API_URL}/2.0/repositories/${integration.targetEnvironmentId}/${integration.appId}/pipelines_config/variables`; - } + let variablesUrl = rootUrl; while (hasNextPage) { const { data }: { data: VariablesResponse } = await request.get(variablesUrl, { @@ -3667,7 +3665,7 @@ const syncSecretsBitBucket = async ({ if (key in res) { // update existing secret await request.put( - `${variablesUrl}/${res[key].uuid}`, + `${rootUrl}/${res[key].uuid}`, { key, value: secrets[key].value, @@ -3683,7 +3681,7 @@ const syncSecretsBitBucket = async ({ } else { // create new secret await request.post( - variablesUrl, + rootUrl, { key, value: secrets[key].value, diff --git a/frontend/src/components/v2/MultiSelect/MultiSelect.tsx b/frontend/src/components/v2/FilterableSelect/FilterableSelect.tsx similarity index 92% rename from frontend/src/components/v2/MultiSelect/MultiSelect.tsx rename to frontend/src/components/v2/FilterableSelect/FilterableSelect.tsx index 987dda90f..5333d79d2 100644 --- a/frontend/src/components/v2/MultiSelect/MultiSelect.tsx +++ b/frontend/src/components/v2/FilterableSelect/FilterableSelect.tsx @@ -7,7 +7,7 @@ import Select, { Props } from "react-select"; import { faCheckCircle, faCircleXmark } from "@fortawesome/free-regular-svg-icons"; -import { faChevronDown, faX } from "@fortawesome/free-solid-svg-icons"; +import { faChevronDown, faXmark } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { twMerge } from "tailwind-merge"; @@ -30,7 +30,7 @@ const ClearIndicator = (props: ClearIndicatorProps) => { const MultiValueRemove = (props: MultiValueRemoveProps) => { return ( - + ); }; @@ -46,10 +46,10 @@ const Option = ({ isSelected, children, ...props }: OptionProps) => { ); }; -export const MultiSelect = ({ isMulti = true, ...props }: Props) => ( +export const FilterableSelect = ({ isMulti, closeMenuOnSelect, ...props }: Props) => (