Skip to content

Commit

Permalink
Get rid of dotenv on ui level, fix type path
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbyul-here committed Aug 7, 2024
1 parent 20f8e38 commit 39808d6
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getString, getNavItemsFromVedaConfig } from 'veda';
import { InternalNavLink, ExternalNavLink, ModalNavLink, DropdownNavLink, NAVITEM_TYPE } from '$components/common/page-header/types';
import { InternalNavLink, ExternalNavLink, ModalNavLink, DropdownNavLink, NAVITEM_TYPE } from '$components/common/page-header/types.d';

import { checkEnvFlag } from '$utils/utils';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import DropdownScrollable from '../dropdown-scrollable';
import GoogleForm from '../google-form';
import { AlignmentEnum, InternalNavLink, ExternalNavLink, NavLinkItem, DropdownNavLink, ModalNavLink, NavItem } from './types';

import { NAVITEM_TYPE } from './types';
import { NAVITEM_TYPE } from './types.d';
import GlobalMenuLinkCSS from '$styles/menu-link';
import { useMediaQuery } from '$utils/use-media-query';

Expand Down
72 changes: 0 additions & 72 deletions mock/veda.config.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,3 @@
const dotEnvConfig = require('dotenv').config();
const { parsed: config } = dotEnvConfig;
function checkEnvFlag(value) {
return (value ?? '').toLowerCase() === 'true';
}

let mainNavItems = [
{
title: 'Test',
type: 'dropdown',
children: [
{
title: 'test dropdown',
to: '/stories',
type: 'internalLink'
}
]
},
{
title: 'Data Catalog',
to: '/data-catalog',
type: 'internalLink'
},
{
title: checkEnvFlag(config.FEATURE_NEW_EXPLORATION)
? 'Exploration'
: 'Analysis',
to: checkEnvFlag(config.FEATURE_NEW_EXPLORATION)
? '/exploration'
: '/analysis',
type: 'internalLink'
},
{
title: 'stories',
to: '/stories',
type: 'internalLink'
}
];

if (!!config.HUB_URL && !!config.HUB_NAME)
mainNavItems = [
...mainNavItems,
{
title: process.env.HUB_NAME,
href: process.env.HUB_URL,
type: 'externalLink'
}
];

let subNavItems = [
{
title: 'About',
to: '/about',
type: 'internalLink'
}
];

if (config.GOOGLE_FORM) {
subNavItems = [
...subNavItems,
{
title: 'Contact us',
src: config.GOOGLE_FORM,
type: 'modal'
}
];
}

module.exports = {
datasets: './datasets/*.data.mdx',
stories: './stories/*.stories.mdx',
Expand All @@ -90,9 +22,5 @@ module.exports = {
url: 'stories/emit-and-aviris-3',
expires: '2024-08-03T12:00:00-04:00',
type: 'info'
},
navItems: {
mainNavItems,
subNavItems
}
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
"d3": "^7.6.1",
"d3-scale-chromatic": "^3.0.0",
"date-fns": "^2.28.0",
"dotenv": "^16.4.5",
"file-saver": "^2.0.5",
"focus-trap-react": "^10.2.3",
"framer-motion": "^10.12.21",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6993,11 +6993,6 @@ dotenv-expand@^5.1.0:
resolved "http://verdaccio.ds.io:4873/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0"
integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==

dotenv@^16.4.5:
version "16.4.5"
resolved "http://verdaccio.ds.io:4873/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

dotenv@^7.0.0:
version "7.0.0"
resolved "http://verdaccio.ds.io:4873/dotenv/-/dotenv-7.0.0.tgz#a2be3cd52736673206e8a85fb5210eea29628e7c"
Expand Down

0 comments on commit 39808d6

Please sign in to comment.