diff --git a/frontend/src/mocks/appConfigurationHandlers.js b/frontend/src/mocks/appConfigurationHandlers.js index 0cf605a27..d49f0809b 100644 --- a/frontend/src/mocks/appConfigurationHandlers.js +++ b/frontend/src/mocks/appConfigurationHandlers.js @@ -30,7 +30,7 @@ export const appConfigurationHandlers = [ datetime_format_display: 'August 05 2006, 3:05 PM', logo: '', fav_icon: '', - extra_config: null, + extra_config: {"git_config":{"branch":{"dev":"dev","prod":"main","staging":"staging"},"repo_url":"https://github.com/Healthlane-Technologies/Zango"},"sync_packages":true}, domains: [ { domain: 'zel3-neapp.zelthy.in', is_primary: true }, { domain: 'domainame2.com', is_primary: false }, diff --git a/frontend/src/pages/appConfiguration/components/AppConfiguration/DetailsTable/index.jsx b/frontend/src/pages/appConfiguration/components/AppConfiguration/DetailsTable/index.jsx index 3e2735233..bbf002e7a 100644 --- a/frontend/src/pages/appConfiguration/components/AppConfiguration/DetailsTable/index.jsx +++ b/frontend/src/pages/appConfiguration/components/AppConfiguration/DetailsTable/index.jsx @@ -2,6 +2,7 @@ import { useSelector } from 'react-redux'; import { ReactComponent as EachAppIcon } from '../../../../../assets/images/svg/each-app-icon.svg'; import { selectAppConfigurationData } from '../../../slice'; import EachDescriptionRow from './EachDescriptionRow'; +import { getRepoName } from '../../../../../utils/helper'; function DetailsTable() { const appConfigurationData = useSelector(selectAppConfigurationData); @@ -100,6 +101,56 @@ function DetailsTable() { } /> + + + {appConfigurationData?.app?.extra_config?.git_config?.repo_url ? getRepoName(appConfigurationData?.app?.extra_config?.git_config?.repo_url) : null} + + + ) : ( + + Not configured + + ) + } + /> + { + appConfigurationData?.app?.extra_config?.git_config?.repo_url ? (<> + + {appConfigurationData?.app?.extra_config?.git_config?.branch?.dev} + + } + /> + + {appConfigurationData?.app?.extra_config?.git_config?.branch?.staging} + + } + /> + + {appConfigurationData?.app?.extra_config?.git_config?.branch?.prod} + + } + /> + ) : null + } + ); diff --git a/frontend/src/utils/helper.js b/frontend/src/utils/helper.js index 6b2f2c30c..98291cb1c 100644 --- a/frontend/src/utils/helper.js +++ b/frontend/src/utils/helper.js @@ -35,3 +35,9 @@ export const getPlatformVersion = () => { return platformVersion; }; + +export function getRepoName(githubUrl) { + const regex = /github\.com\/([^/]+\/[^/]+)/; + const match = githubUrl.match(regex); + return match ? match[1] : null; +} \ No newline at end of file