Skip to content

Commit

Permalink
Merge pull request #316 from helxplatform/develop
Browse files Browse the repository at this point in the history
Adding Develop changes to main
  • Loading branch information
hina-shah authored Oct 21, 2024
2 parents 4172937 + 66d0156 commit 5bc7573
Show file tree
Hide file tree
Showing 74 changed files with 8,131 additions and 3,780 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"prefer-const": "warn",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true,
"ignoreProperties": true
}
]
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-var-requires": "off"
},
"settings": {
"react": {
Expand Down
7,544 changes: 4,682 additions & 2,862 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
"private": true,
"homepage": "/static/frontend",
"dependencies": {
"@ant-design/plots": "^1.0.9",
"@ant-design/plots": "^1.2.5",
"@ant-design/pro-form": "^1.74.7",
"@antv/g2plot": "^2.4.8",
"@floating-ui/dom": "^1.6.10",
"@gatsbyjs/reach-router": "^1.3.9",
"@groupe/shepherd.js": "^13.0.3",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/node": "^18.7.8",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"antd": "^4.22.6",
"axios": "^0.27.2",
"chroma-js": "^2.4.2",
Expand All @@ -25,6 +24,7 @@
"js-cookie": "^3.0.1",
"lunr": "^2.3.9",
"nanoevents": "^6.0.2",
"rc-texty": "^0.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-highlight-words": "^0.18.0",
Expand All @@ -33,6 +33,7 @@
"styled-components": "^5.3.0",
"timeago-react": "^3.0.2",
"use-debounce": "^7.0.0",
"uuid": "^9.0.1",
"web-vitals": "^1.0.1"
},
"scripts": {
Expand Down Expand Up @@ -68,10 +69,14 @@
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/gatsbyjs__reach-router": "^2.0.4",
"@types/js-cookie": "^3.0.1",
"@types/lunr": "^2.3.7",
"@types/node": "^18.11.9",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/react-highlight-words": "^0.20.0",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"babel-loader": "^9.1.2",
Expand Down
12 changes: 9 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { useEffect } from 'react'
import { LocationProvider, Router as ReachRouter, globalHistory, useLocation } from '@gatsbyjs/reach-router'
import {
EnvironmentProvider, ActivityProvider, AppProvider, InstanceProvider,
AnalyticsProvider, DestProvider, useEnvironment, useAnalytics, WorkspacesAPIProvider
AnalyticsProvider, DestProvider, useEnvironment, useAnalytics, WorkspacesAPIProvider,
TourProvider,
} from './contexts'
import { Layout } from './components/layout'
import { HelxSearch } from './components/search'
import { NotFoundView } from './views'

const ContextProviders = ({ children }) => {
Expand All @@ -16,7 +18,11 @@ const ContextProviders = ({ children }) => {
<AnalyticsProvider>
<ActivityProvider>
<InstanceProvider>
{children}
<HelxSearch>
<TourProvider>
{children}
</TourProvider>
</HelxSearch>
</InstanceProvider>
</ActivityProvider>
</AnalyticsProvider>
Expand All @@ -32,7 +38,7 @@ const Router = () => {
const { analytics, analyticsEvents } = useAnalytics();
const location = useLocation();
const baseRouterPath = context.workspaces_enabled === 'true' ? '/helx' : '/'

// Component mount
useEffect(() => {
const unlisten = globalHistory.listen(({ location }) => {
Expand Down
33 changes: 33 additions & 0 deletions src/components/debounced-range-slider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Slider } from 'antd'
import { useEffect, useState } from 'react'
import { useDebounce } from 'use-debounce'

export const DebouncedRangeSlider = ({ value, onChange, onInternalChange=() => {}, debounce=500, ...props }) => {
const [_internalValue, setInternalValue] = useState(undefined)
const [internalValue] = useDebounce(_internalValue, debounce)

const internalOnChange = (range) => {
setInternalValue(range)
}

useEffect(() => {
setInternalValue(value)
}, [value])

useEffect(() => {
onChange(internalValue)
}, [internalValue])

useEffect(() => {
onInternalChange(_internalValue)
}, [_internalValue])

return (
<Slider
range
value={ _internalValue }
onChange={ internalOnChange }
{ ...props }
/>
)
}
22 changes: 22 additions & 0 deletions src/components/guided-tour/guided-tour-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useMemo } from 'react'
import { Button } from 'antd'
import { useEnvironment, useTourContext } from '../../contexts'
import classNames from 'classnames'
import './guided-tour.css'

export const GuidedTourButton = ({ }) => {
const { tour, tourStarted } = useTourContext()!
const { context } = useEnvironment() as any

return (
<div className="guided-tour-button-container">
<Button
className={ classNames("guided-tour-button", context.brand) }
disabled={ tourStarted }
onClick={ () => !tourStarted && tour.start() }
>
Take a Tour
</Button>
</div>
)
}
36 changes: 36 additions & 0 deletions src/components/guided-tour/guided-tour.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.guided-tour-button-container {
display: flex;
position: fixed;
top: 60%;
right: 0;
z-index: 99;
transform: rotate(-90deg) translateY(-100%);
transform-origin: top right;
}

button.guided-tour-button {
padding: 8px 32px;
height: 40px;
font-weight: 600;
font-size: 16px;
/* Improves readability when rotated */
letter-spacing: .8px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom-width: 0;

}

.guided-tour-button.heal {
background-color: #982465;
color: white;
border-color: #982465;
}
.guided-tour-button.heal:hover {
color: #c41d7f;
border-color: #c41d7f;
}
.guided-tour-button.heal:active, .guided-tour-button.heal:focus {
color: #982465;
border-color: #982465;
}
1 change: 1 addition & 0 deletions src/components/guided-tour/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './guided-tour-button'
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export * from './debounced-input'
export * from './bouncing-dots'
export * from './side-collapse'
export * from './info-helpers'
export * from './debounced-range-slider'
export * from './guided-tour'
1 change: 1 addition & 0 deletions src/components/info-helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './info-tooltip'
export * from './info-popover'
export * from './info-button'
24 changes: 24 additions & 0 deletions src/components/info-helpers/info-popover.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ReactNode } from 'react'
import { Popover, PopoverProps } from 'antd'
import { InfoCircleFilled } from '@ant-design/icons'
import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon'
import { InfoIcon, InfoIconProps } from './info-icon'

type InfoPopoverProps = PopoverProps & {
iconProps?: InfoIconProps
}

export const InfoPopover = ({
iconProps={},
...popoverProps
}: InfoPopoverProps) => {
return (
<Popover
className="info-popover"
trigger="click"
{...popoverProps }
>
<InfoIcon { ...iconProps } />
</Popover>
)
}
2 changes: 1 addition & 1 deletion src/components/layout/back-top.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ArrowUpOutlined } from '@ant-design/icons'

const { useBreakpoint } = Grid

export const BackTop = ({ style, ...props }) => {
export const BackTop = ({ style={}, ...props }) => {
const { md } = useBreakpoint()
return (
<AntBackTop
Expand Down
7 changes: 5 additions & 2 deletions src/components/layout/layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Fragment, useState } from 'react'
import { Layout as AntLayout, Button, Menu, Grid, Divider } from 'antd'
import { LinkOutlined } from '@ant-design/icons'
import { useLocation, Link } from '@gatsbyjs/reach-router'
import { useLocation, useNavigate, Link } from '@gatsbyjs/reach-router'
import { useEnvironment, useAnalytics, useWorkspacesAPI } from '../../contexts';
import { MobileMenu } from './menu';
import { SidePanel } from '../side-panel/side-panel';
Expand All @@ -17,6 +17,7 @@ export const Layout = ({ children }) => {
const { md } = useBreakpoint()
const baseLinkPath = context.workspaces_enabled === 'true' ? '/helx' : ''
const location = useLocation();
const navigate = useNavigate()

// Logging out is an async operation. It's better to wait until it's complete to avoid
// session persistence errors (helx-278).
Expand Down Expand Up @@ -56,7 +57,9 @@ export const Layout = ({ children }) => {
<Menu.Item style={{ visibility: 'hidden' }}></Menu.Item>
<Menu.Item style={{ visibility: 'hidden' }}></Menu.Item>
{routes.map(m => m['text'] !== '' && (
<Menu.Item key={`${m.path}`}><Link to={`${baseLinkPath}${m.path}`}>{m.text}</Link></Menu.Item>
<Menu.Item key={`${m.path}`} onClick={ () => navigate(`${baseLinkPath}${m.path}`) }>
<Link to={ `${baseLinkPath}${m.path}` }>{m.text}</Link>
</Menu.Item>
))}
{context.workspaces_enabled && !apiLoading && (
appstoreContext.links.map((link) => (
Expand Down
50 changes: 49 additions & 1 deletion src/components/search/concept-modal/concept-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,56 @@
width: 100%;
}

.concept-modal > .ant-modal-content {
display: flex;
flex-direction: column;
}

.concept-modal > .ant-modal-content > .ant-modal-footer {
background: white;
z-index: 1;
}

.concept-modal .ant-modal-body > .ant-space {
/* Override the inline-flex */
display: flex;
align-items: stretch;
max-height: 60vh;
}
.concept-modal .ant-modal-body > .ant-space > .ant-space-item {
overflow: auto;
}

/* Space item container for concept-modal-tabs */
.concept-modal .ant-modal-body .ant-space .ant-space-item:first-child {
flex: none;
}

.concept-modal-tabs {
width: auto;
display: flex;
flex-direction: column;
}

.concept-modal-tabs .ant-menu-item {
display: inline-flex !important;
width: auto !important;
margin-top: 0 !important;
padding-left: 0 !important;
padding-right: 0;
}
.concept-modal-tabs .ant-menu-title-content {
flex: none !important;
overflow: visible !important;
width: 100%;
}
.concept-modal-tabs .ant-menu-title-content > .tab-menu-item-wrapper {
padding-left: 24px;
padding-right: 16px;
}

.concept-modal-body > .ant-space-item:nth-child(2) {
width: 100% !important;
/* width: 100% !important; */
flex-grow: 1;
}

Expand Down
Loading

0 comments on commit 5bc7573

Please sign in to comment.