Skip to content

Commit

Permalink
Merge pull request #104 from kloudlite/fix/redirect-repo-page
Browse files Browse the repository at this point in the history
KLO-175 : Fix/redirect repo page
  • Loading branch information
abdheshnayak authored Feb 29, 2024
2 parents 5eb1d65 + e4b02b9 commit 1b62aa7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/apps/console/page-components/app-states.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,12 @@ export const useAppState = () => {
const getRepoName = (imageUrl: string) => {
const parts: string[] = imageUrl.split(':');
const repoParts: string[] = parts[0].split('/');
console.log("repo name", repoParts[repoParts.length - 1])
return repoParts[repoParts.length - 1];
if (repoParts.length == 1) {
return repoParts[repoParts.length - 1];
} else {
const repoSlicePart: string[] = repoParts.slice(2)
return repoSlicePart.join("/")
}
}

const getImageTag = (imageUrl: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const ListView = ({ items, onDelete }: IResource) => {
return (
<List.Row
key={id}
to={`/${account}/repo/${name}`}
to={`/${account}/repo/${btoa(name)}`}
className="!p-3xl"
columns={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IProjectContext } from '../../$project+/_layout';

const LocalBreadcrum = () => {
const { repo, account } = useParams();
const repoName = atob(repo ? repo : "")
return (
<div className="flex flex-row items-center">
<Breadcrum.Button
Expand All @@ -29,9 +30,9 @@ const LocalBreadcrum = () => {
}
/>
<Breadcrum.Button
to={`/${account}/repo/${repo}`}
to={`/${account}/repo/${repoName}`}
LinkComponent={Link}
content={<span>{repo}</span>}
content={<span>{repoName}</span>}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const loader = async (ctx: IRemixCtx) => {
const promise = pWrapper(async () => {
ensureAccountSet(ctx);
const { data, errors } = await GQLServerHandler(ctx.request).listDigest({
repoName: repo,
repoName: atob(repo),
pagination: getPagination(ctx),
search: getSearch(ctx),
});
Expand Down

0 comments on commit 1b62aa7

Please sign in to comment.