diff --git a/app/react/edge/edge-stacks/ItemView/EnvironmentsDatatable/columns.tsx b/app/react/edge/edge-stacks/ItemView/EnvironmentsDatatable/columns.tsx index 094f873f6..c84abe341 100644 --- a/app/react/edge/edge-stacks/ItemView/EnvironmentsDatatable/columns.tsx +++ b/app/react/edge/edge-stacks/ItemView/EnvironmentsDatatable/columns.tsx @@ -9,6 +9,7 @@ import UpToDate from '@/assets/ico/icon_up-to-date.svg?c'; import { isoDateFromTimestamp } from '@/portainer/filters/filters'; import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; import { getDashboardRoute } from '@/react/portainer/environments/utils'; +import { cleanGitRepoUrl } from '@/react/portainer/gitops/utils'; import { Button } from '@@/buttons'; import { Icon } from '@@/Icon'; @@ -187,7 +188,9 @@ function TargetVersionCell({ {row.original.TargetCommitHash ? (
@@ -236,7 +239,9 @@ function DeployedVersionCell({
{statusIcon} diff --git a/app/react/edge/edge-stacks/ListView/EdgeStacksDatatable/columns.tsx b/app/react/edge/edge-stacks/ListView/EdgeStacksDatatable/columns.tsx index 354b9669a..8167f35f8 100644 --- a/app/react/edge/edge-stacks/ListView/EdgeStacksDatatable/columns.tsx +++ b/app/react/edge/edge-stacks/ListView/EdgeStacksDatatable/columns.tsx @@ -3,6 +3,7 @@ import _ from 'lodash'; import { isoDateFromTimestamp } from '@/portainer/filters/filters'; import { isBE } from '@/react/portainer/feature-flags/feature-flags.service'; +import { cleanGitRepoUrl } from '@/react/portainer/gitops/utils'; import { buildNameColumn } from '@@/datatables/NameCell'; import { Link } from '@@/Link'; @@ -151,7 +152,9 @@ export const columns = _.compact([
{item.GitConfig.ConfigHash.slice(0, 7)} diff --git a/app/react/portainer/gitops/utils.ts b/app/react/portainer/gitops/utils.ts index 654dd1755..79f6a1eff 100644 --- a/app/react/portainer/gitops/utils.ts +++ b/app/react/portainer/gitops/utils.ts @@ -32,3 +32,10 @@ export function confirmEnableTLSVerify() { 'Enabling the verification of TLS certificates without ensuring the correct configuration of your Certificate Authority (CA) for self-signed certificates can result in deployment failures.', }); } + +export function cleanGitRepoUrl(url: string) { + return url + .trim() // remove leading and trailing whitespace + .replace(/\/$/, '') // if there's a trailing slash, remove it + .replace(/\.git$/, ''); // if there's a trailing .git extension, remove it +}