Skip to content

Commit

Permalink
Merge pull request #115 from bcgov/dev
Browse files Browse the repository at this point in the history
Deploy to production
  • Loading branch information
jlangy authored Oct 6, 2023
2 parents 13c3f46 + e32f6f9 commit ddd48ca
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ yarn-error.log*
*.key
*.cert
get-pip.py
venv
4 changes: 2 additions & 2 deletions app/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const RightMenuItems = () => (
</a>
</HoverItem>
<HoverItem>
<a href="https://github.com/bcgov/ocp-sso/wiki" target="_blank" title="Documentation" rel="noreferrer">
<a href="https://github.com/bcgov/sso-keycloak/wiki" target="_blank" title="Documentation" rel="noreferrer">
<FontAwesomeIcon size="2x" icon={faFileAlt} />
</a>
</HoverItem>
Expand Down Expand Up @@ -190,7 +190,7 @@ function Layout({ children, onLoginClick, onLogoutClick }: any) {
<FontAwesomeIcon size="2x" icon={faEnvelope} />
</a>
&nbsp;&nbsp;
<a href="https://github.com/bcgov/ocp-sso/wiki" target="_blank" title="Wiki" rel="noreferrer">
<a href="https://github.com/bcgov/sso-keycloak/wiki" target="_blank" title="Wiki" rel="noreferrer">
<FontAwesomeIcon size="2x" icon={faFileAlt} />
</a>
</li>
Expand Down
7 changes: 6 additions & 1 deletion app/page-partials/my-dashboard/RealmTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import Button from '@button-inc/bcgov-theme/Button';
import { RealmProfile } from 'types/realm-profile';
import Table from 'components/Table';
import Link from '@button-inc/bcgov-theme/Link';

interface Props {
realms: RealmProfile[];
Expand Down Expand Up @@ -91,7 +92,11 @@ function RealmTable({ realms, onEditClick }: Props) {
},
{
header: 'Rocket Chat Channel',
cell: (row) => row.renderValue(),
cell: (row) => (
<Link href={row.renderValue() as string} external>
Rocketchat
</Link>
),
accessorKey: 'rcChannel',
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/pages/api/realms/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
return res.send(realms);
} catch (err: any) {
console.error(err);
res.status(200).json({ success: false, error: err.message || err });
res.status(500).json({ success: false, error: err.message || err });
}
}
6 changes: 5 additions & 1 deletion app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ const Home = () => {
};

const handleDashboard = async () => {
router.push(`/my-dashboard`);
if (session?.status === 'authenticated') {
router.push(`/my-dashboard`);
} else {
handleLogin();
}
};

return (
Expand Down
9 changes: 8 additions & 1 deletion app/pages/my-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ function MyDashboard() {
setSelectedId(null);
};

if (hasError) return null;
if (hasError)
return (
<TopAlertWrapper>
<Alert variant="warning" closable={true}>
There was en error while loading your realm information. Please try refreshing the page.
</Alert>
</TopAlertWrapper>
);

return (
<>
Expand Down

0 comments on commit ddd48ca

Please sign in to comment.