Skip to content

Commit

Permalink
detail about github url & branches
Browse files Browse the repository at this point in the history
  • Loading branch information
adhiraj23zelthy committed Oct 25, 2024
1 parent 3715caf commit c72bffe
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/mocks/appConfigurationHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -100,6 +101,56 @@ function DetailsTable() {
</span>
}
/>
<EachDescriptionRow
label="Github Repository:"
content={
appConfigurationData?.app?.extra_config?.git_config?.repo_url ? (
<a
href={appConfigurationData?.app?.extra_config?.git_config?.repo_url}
alt="#"
target={'_blank'}
className="w-fit"
>
<span className="whitespace-nowrap font-lato text-[14px] font-bold leading-[20px] tracking-[0.2px] text-[#5047ED]">
{appConfigurationData?.app?.extra_config?.git_config?.repo_url ? getRepoName(appConfigurationData?.app?.extra_config?.git_config?.repo_url) : null}
</span>
</a>
) : (
<span className="whitespace-nowrap font-lato text-[14px] font-bold leading-[20px] tracking-[0.2px] text-[#212429]">
Not configured
</span>
)
}
/>
{
appConfigurationData?.app?.extra_config?.git_config?.repo_url ? (<>
<EachDescriptionRow
label="Development:"
content={
<span className="whitespace-nowrap font-lato text-[14px] font-bold leading-[20px] tracking-[0.2px] text-[#212429]">
{appConfigurationData?.app?.extra_config?.git_config?.branch?.dev}
</span>
}
/>
<EachDescriptionRow
label="Staging:"
content={
<span className="whitespace-nowrap font-lato text-[14px] font-bold leading-[20px] tracking-[0.2px] text-[#212429]">
{appConfigurationData?.app?.extra_config?.git_config?.branch?.staging}
</span>
}
/>
<EachDescriptionRow
label="Production:"
content={
<span className="whitespace-nowrap font-lato text-[14px] font-bold leading-[20px] tracking-[0.2px] text-[#212429]">
{appConfigurationData?.app?.extra_config?.git_config?.branch?.prod}
</span>
}
/>
</>) : null
}

</tbody>
</table>
);
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit c72bffe

Please sign in to comment.