Skip to content

Commit

Permalink
Merge pull request #622 from credebl/develop
Browse files Browse the repository at this point in the history
Develop to Qa
  • Loading branch information
nishad-ayanworks authored Mar 12, 2024
2 parents 5b5c618 + 78a0a6b commit d8f82b0
Show file tree
Hide file tree
Showing 37 changed files with 288 additions and 264 deletions.
21 changes: 18 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
PUBLIC_BASE_URL=
PUBLIC_CRYPTO_PRIVATE_KEY=
PUBLIC_SUPABASE_URL=
PUBLIC_SUPABASE_KEY=
PUBLIC_SUPABASE_JWT_SECRET=

PUBLIC_SHOW_NAME_AS_LOGO= # Please provide true if you want to give platform name with logo

PUBLIC_PLATFORM_NAME= # Please specify your paltform name
PUBLIC_PLATFORM_LOGO= # Please specify your logo file link
PUBLIC_POWERED_BY= # Please specify your powered by org name
PUBLIC_PLATFORM_WEB_URL= # Please specify your platform web URL
PUBLIC_POWERED_BY_URL= # Please specify your support URL
PUBLIC_PLATFORM_DOCS_URL= # Please specify your documentation URL
PUBLIC_PLATFORM_GIT= # Please specify your Github URL
PUBLIC_PLATFORM_SUPPORT_EMAIL= # Please specify your support email
PUBLIC_PLATFORM_TWITTER_URL= # Please specify your twitter URL
PUBLIC_PLATFROM_DISCORD_SUPPORT= # Please specify your discord support url





File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions src/api/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ export const spinupSharedAgent = async (data: object, orgId: string) => {
};

export const getOrganizationRoles = async () => {
const url = `${apiRoutes.organizations.orgRoles}`;

const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}/roles`;
const token = await getFromLocalStorage(storageKeys.TOKEN);

const config = {
Expand Down
27 changes: 12 additions & 15 deletions src/app/LayoutCommon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import { SITE_TITLE } from './constants.js';
const { class: clazz, metaData } = Astro.props;
const baseUrl = process.env.PUBLIC_BASE_URL || import.meta.env.PUBLIC_BASE_URL;
const encryptKey =
process.env.PUBLIC_CRYPTO_PRIVATE_KEY ||
import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY;
const supabaseUrl =
process.env.PUBLIC_SUPABASE_URL || import.meta.env.PUBLIC_SUPABASE_URL;
const supabaseKey =
process.env.PUBLIC_SUPABASE_KEY || import.meta.env.PUBLIC_SUPABASE_KEY;
const initData: any = {};
const envKeys = [...Object.keys(process.env), ...Object.keys(import.meta.env)];
envKeys.forEach((item) => {
initData[item] = process.env[item] || import.meta.env[item];
});
---

<!DOCTYPE html>
Expand All @@ -29,7 +27,7 @@ const supabaseKey =
sitemap={url('sitemap-index.xml')}
client:load
/>
<meta property="og:image" content="https://credebl.id/images/CREDEBL_ICON.png" />
<meta property="og:image" content={initData.PUBLIC_PLATFORM_LOGO} />
<script is:inline>
if (
localStorage.getItem('color-theme') === 'dark' ||
Expand Down Expand Up @@ -58,12 +56,11 @@ const supabaseKey =
import 'flowbite';
import 'flowbite/dist/datepicker.js';
</script>

<script define:vars={{ baseUrl, encryptKey, supabaseUrl, supabaseKey }}>
globalThis.baseUrl = baseUrl;
globalThis.encryptKey = encryptKey;
globalThis.supabaseUrl = supabaseUrl;
globalThis.supabaseKey = supabaseKey;
<script define:vars={{ initData, envKeys }}>

envKeys.forEach((item) => {
globalThis[item] = initData[item];
});
</script>

<style is:global>
Expand Down
12 changes: 2 additions & 10 deletions src/app/NavBarSidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SignOutButton from '../components/SignOutButton/index';
import AgentHealth from '../commonComponents/AgentHealth';
import { getFromCookies } from '../api/Auth';
import { RolePermissions } from '../config/permissions';
import LogoFile from '../commonComponents/LogoFile.jsx';
const { hideOrgAgent } = Astro.props;
Expand Down Expand Up @@ -69,18 +70,9 @@ const permittedPages = RolePermissions.find(
pathRoutes.users.dashboard}
class="flex ml-2 md:mr-24"
>
<img
src="/images/CREDEBL_ICON.png"
class="h-8 mr-3"
alt="CREDEBL Logo"
/>
<span
class="self-center text-xl font-semibold sm:text-2xl whitespace-nowrap dark:text-white"
>CREDEBL</span
>
<LogoFile />
</a>
</div>

<div class="flex items-center">
<>
{
Expand Down
37 changes: 5 additions & 32 deletions src/app/NavBarStacked.astro
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
---
import { asset, url } from '../lib/data.js';
import LogoFile from "../commonComponents/LogoFile";
---

<nav
class="fixed z-50 w-full bg-white border-b border-gray-200 sm:py-2 dark:bg-gray-800 dark:border-gray-700"
>
<div class="container py-3 mx-auto">
<div>

<div class="flex items-center justify-between">
<div class="flex items-center justify-start">
<a class="flex mr-4" href='/'>
<img
src='/images/CREDEBL_ICON.png'
class="h-8 mr-3"
alt="CREDEBL Logo"
/>
<span
class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white"
>CREDEBL</span
>
<a class="flex ml-2 md:mr-24" href="/">
<LogoFile />
</a>

</div>

<div>
<!-- <a
href="/authentication/sign-in"
class="text-white bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
>
<svg
class="w-5 h-5 mr-2 -ml-1"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"
></path>
</svg>
Login/Register
</a> -->
<button
data-collapse-toggle="mobile-menu"
type="button"
Expand Down
5 changes: 3 additions & 2 deletions src/app/SideBar.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import EcosystemSidebarOption from '../components/Ecosystem/EcosystemSidebarOption';
import { envConfig } from '../config/envConfig';
import { pathRoutes } from '../config/pathRoutes';
/* eslint max-lines: 'off' */
---
Expand Down Expand Up @@ -257,7 +258,7 @@ import { pathRoutes } from '../config/pathRoutes';
<div class="border-t border-gray-200 dark:!border-gray-700 pt-3">
<li>
<a
href={'https://github.com/credebl'}
href={envConfig.PLATFORM_DATA.git}
target="_blank"
class="flex items-center p-2 text-base text-gray-900 transition duration-75 rounded-lg hover:bg-gray-100 group dark:text-gray-200 dark:hover:bg-gray-700"
>
Expand Down Expand Up @@ -305,7 +306,7 @@ import { pathRoutes } from '../config/pathRoutes';

<li>
<a
href="https://discord.com/invite/w4hnQT7NJG"
href={envConfig.PLATFORM_DATA.discord}
target="_blank"
class="flex items-center p-2 text-base text-gray-900 transition duration-75 rounded-lg hover:bg-gray-100 group dark:text-gray-200 dark:hover:bg-gray-700"
>
Expand Down
11 changes: 8 additions & 3 deletions src/app/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
export const API_URL = `${import.meta.env.SITE}${import.meta.env.BASE_URL}api/`;

import { envConfig } from '../config/envConfig';
const env = import.meta.env;

export const API_URL = `${env.SITE}${env.BASE_URL}api/`;


export const REMOTE_ASSETS_BASE_URL = `https://flowbite-admin-dashboard.vercel.app`;

export const SITE_TITLE = 'CREDEBL - Self-Sovereign Identity Platform';
export const SITE_TITLE = `${envConfig.PLATFORM_DATA.name} - Self-Sovereign Identity Platform`;

/* Useful flag for sourcing from `./data` entirely, disabling randomize layer */
export const RANDOMIZE = Boolean(import.meta.env.RANDOMIZE) || true;
export const RANDOMIZE = Boolean(env.RANDOMIZE) || true;

// NOTE: Unmapped
// export const SIDEBAR = [
Expand Down
22 changes: 22 additions & 0 deletions src/commonComponents/LogoFile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { envConfig } from '../config/envConfig';

const LogoFile = () => {
return (
<>
<img
src={envConfig.PLATFORM_DATA.logo}
className="h-8 mr-3"
alt={`${envConfig.PLATFORM_DATA.name} logo`}
/>
{envConfig.PLATFORM_DATA.nameAsLogo === 'true' && (
<span className="self-center text-xl font-semibold sm:text-2xl whitespace-nowrap dark:text-white">
{envConfig.PLATFORM_DATA.name}
</span>
)}
</>

)
}

export default LogoFile;
30 changes: 12 additions & 18 deletions src/commonComponents/PublicNavbar.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
import { pathRoutes } from '../config/pathRoutes';
import ColorModeSwitcher from '../components/ColorModeSwitcher.astro';
import { envConfig } from '../config/envConfig';
import LogoFile from './LogoFile';
const { limitedWidth } = Astro.props;
Expand Down Expand Up @@ -53,22 +55,14 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
</svg>
</button>
<a href="/" class="flex items-center">
<img
src="/images/CREDEBL_ICON.png"
class="h-8 mr-3"
alt="CREDEBL Logo"
/>
<span
class="hidden md:block self-center text-2xl font-semibold whitespace-nowrap dark:text-white"
>
CREDEBL
</span>
<LogoFile />
</a>
<div class="hidden lg:block ml-2">
<a
href="https://docs.credebl.id/en/intro/what-is-credebl/"
href={envConfig.PLATFORM_DATA.docs}
class="text-gray-600 py-2 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-md px-4 lg:px-3 lg:py-2.5 ml-4 dark:text-white focus:outline-none hover:bg-gray-100 dark:hover:bg-gray-800"
>

Documentation
</a>
<a
Expand All @@ -82,7 +76,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
class="flex md:order-2 ml-auto sm:mt-0 mt-4 space-x-4 justify-center items-center"
>
<a
href="https://github.com/credebl"
href={envConfig.PLATFORM_DATA.git}
target="_blank"
class="hidden md:block"
>
Expand All @@ -99,7 +93,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
</svg>
</a>
<a
href="https://discord.gg/w4hnQT7NJG"
href={envConfig.PLATFORM_DATA.discord}
class="hidden md:block"
target="_blank"
>
Expand All @@ -116,7 +110,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
</svg>
</a>
<a
href="https://twitter.com/i/flow/login?redirect_after_login=%2Fcredebl"
href={envConfig.PLATFORM_DATA.twitter}
class="hidden md:block"
target="_blank"
>
Expand Down Expand Up @@ -170,7 +164,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
>
<li>
<a
href="https://docs.credebl.id/en/intro/what-is-credebl/"
href={envConfig.PLATFORM_DATA.docs}
class="block py-2 pl-3 pr-4 border-b text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700"
>Documentation</a
>
Expand All @@ -190,7 +184,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
>

<a
href="https://github.com/credebl"
href={envConfig.PLATFORM_DATA.git}
class="mr-3 mt-2"
target="_blank"
>
Expand All @@ -208,7 +202,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
</svg>
</a>
<a
href="https://discord.gg/w4hnQT7NJG"
href={envConfig.PLATFORM_DATA.discord}
class="mr-3 mt-2"
target="_blank"
>
Expand All @@ -225,7 +219,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
</svg>
</a>
<a
href="https://twitter.com/i/flow/login?redirect_after_login=%2Fcredebl"
href={envConfig.PLATFORM_DATA.twitter}
class="mr-3 mt-2"
target="_blank"
>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Authentication/FooterBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { envConfig } from '../../config/envConfig';

const FooterBar = () => {
return (
Expand All @@ -7,7 +8,7 @@ const FooterBar = () => {
<p className="text-sm text-center text-gray-500">
&copy; 2019 - {new Date().getFullYear()}
<a className="hover:underline" target="_blank"
> Blockster Labs
> {envConfig.PLATFORM_DATA.poweredBy}
</a> | All rights reserved.
</p>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Authentication/KeyCloakResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { PassInvisible, PassVisible } from './Svg.js';
import { pathRoutes } from '../../config/pathRoutes';
import type { IPassword, IProps, IValues } from './interfaces';
import React from 'react';
import { envConfig } from '../../config/envConfig';

const KeyClockResetPassword = (props: IProps) => {
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -67,7 +68,7 @@ const KeyClockResetPassword = (props: IProps) => {
Choose a new password for your account
</p>
<p className="text-yellow-600 text-sm font-normal">
CREDEBL has an update for your seamless experience. We request you to
{envConfig.PLATFORM_DATA.name} has an update for your seamless experience. We request you to
please reset your password for it.
</p>
</Modal.Header>
Expand Down
Loading

0 comments on commit d8f82b0

Please sign in to comment.