-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PORTALS-2651 - various components #1544
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Select } from '@mui/material' | ||
import { EntityType, Reference } from '@sage-bionetworks/synapse-types' | ||
import { CellContext } from '@tanstack/react-table' | ||
import { SyntheticEvent, useEffect } from 'react' | ||
import { Form } from 'react-bootstrap' | ||
import { useEffect } from 'react' | ||
import { useGetVersionsInfinite } from '../../../../../synapse-queries/index' | ||
import { isTableType } from '../../../../../utils/functions/EntityTypeUtils' | ||
import IconSvg from '../../../../IconSvg/IconSvg' | ||
|
@@ -111,17 +111,17 @@ export function EntityFinderVersionCell(props: EntityFinderVersionCellProps) { | |
return ( | ||
<div> | ||
{versions && versions.length > 0 ? ( | ||
<Form.Control | ||
role="listbox" | ||
size="sm" | ||
as="select" | ||
<Select | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
native | ||
fullWidth | ||
value={currentSelectedVersionOptionValue} | ||
onClick={(event: SyntheticEvent<HTMLSelectElement>) => { | ||
onClick={event => { | ||
event.stopPropagation() | ||
}} | ||
sx={{ height: '30px' }} | ||
onChange={event => { | ||
event.stopPropagation() | ||
const version = parseInt(event.target.value) | ||
const version = parseInt((event.target as HTMLInputElement).value) | ||
toggleSelection({ | ||
targetId: id, | ||
targetVersionNumber: | ||
|
@@ -143,7 +143,7 @@ export function EntityFinderVersionCell(props: EntityFinderVersionCellProps) { | |
</option> | ||
) | ||
})} | ||
</Form.Control> | ||
</Select> | ||
) : ( | ||
latestVersionText | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import { Badge, Drawer, List, ListItemButton, Tooltip } from '@mui/material' | ||
import { | ||
Badge, | ||
Drawer, | ||
InputAdornment, | ||
List, | ||
ListItemButton, | ||
TextField, | ||
Tooltip, | ||
} from '@mui/material' | ||
import { | ||
Direction, | ||
SubmissionSortField, | ||
SubmissionState, | ||
} from '@sage-bionetworks/synapse-types' | ||
import { useState } from 'react' | ||
import { Form } from 'react-bootstrap' | ||
import { useState, KeyboardEvent } from 'react' | ||
import SynapseIconWhite from '../../assets/icons/SynapseIconWhite' | ||
import SynapseLogoName from '../../assets/icons/SynapseLogoName' | ||
import SynapseClient from '../../synapse-client' | ||
|
@@ -416,26 +423,32 @@ export function SynapseNavDrawer({ | |
<IconSvg icon="addCircleOutline" /> | ||
</a> | ||
</Tooltip> | ||
<div className="searchInputWithIcon"> | ||
<IconSvg icon="searchOutlined" /> | ||
<Form.Control | ||
type="search" | ||
placeholder="Search All Projects" | ||
value={projectSearchText} | ||
onChange={event => { | ||
setProjectSearchText(event.target.value) | ||
}} | ||
onKeyDown={(event: any) => { | ||
if (event.key === 'Enter') { | ||
if (event.target.value !== '') { | ||
setProjectSearchText('') | ||
handleDrawerClose() | ||
onProjectSearch(event.target.value) | ||
} | ||
<TextField | ||
type="search" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
placeholder="Search All Projects" | ||
value={projectSearchText} | ||
onChange={event => { | ||
setProjectSearchText(event.target.value) | ||
}} | ||
onKeyDown={(event: KeyboardEvent<HTMLInputElement>) => { | ||
if (event.key === 'Enter') { | ||
if ((event.target as HTMLInputElement).value !== '') { | ||
setProjectSearchText('') | ||
handleDrawerClose() | ||
onProjectSearch( | ||
(event.target as HTMLInputElement).value, | ||
) | ||
} | ||
}} | ||
/> | ||
</div> | ||
} | ||
}} | ||
InputProps={{ | ||
startAdornment: ( | ||
<InputAdornment position="start"> | ||
<IconSvg icon="searchOutlined" /> | ||
</InputAdornment> | ||
), | ||
}} | ||
/> | ||
<div className="linkList" onClick={handleDrawerClose}> | ||
<a | ||
className="SRC-whiteText" | ||
|
@@ -544,30 +557,35 @@ export function SynapseNavDrawer({ | |
{selectedItem == NavItem.HELP && ( | ||
<> | ||
<div className="header">Help</div> | ||
<div className="searchInputWithIcon"> | ||
<IconSvg icon="searchOutlined" /> | ||
<Form.Control | ||
type="search" | ||
placeholder="Search Synapse Documentation" | ||
value={docSiteSearchText} | ||
onChange={event => { | ||
setDocSiteSearchText(event.target.value) | ||
}} | ||
onKeyDown={(event: any) => { | ||
if (event.key === 'Enter') { | ||
if (event.target.value !== '') { | ||
window.open( | ||
`https://help.synapse.org/search.html?max=10&s=docs&q=${encodeURI( | ||
event.target.value, | ||
)}`, | ||
) | ||
setDocSiteSearchText('') | ||
handleDrawerClose() | ||
} | ||
<TextField | ||
type="search" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
placeholder="Search Documentation" | ||
value={docSiteSearchText} | ||
onChange={event => { | ||
setDocSiteSearchText(event.target.value) | ||
}} | ||
InputProps={{ | ||
startAdornment: ( | ||
<InputAdornment position="start"> | ||
<IconSvg icon="searchOutlined" /> | ||
</InputAdornment> | ||
), | ||
}} | ||
onKeyDown={event => { | ||
if (event.key === 'Enter') { | ||
if ((event.target as HTMLInputElement).value !== '') { | ||
window.open( | ||
`https://help.synapse.org/search.html?max=10&s=docs&q=${encodeURI( | ||
(event.target as HTMLInputElement).value, | ||
)}`, | ||
) | ||
setDocSiteSearchText('') | ||
handleDrawerClose() | ||
} | ||
}} | ||
/> | ||
</div> | ||
} | ||
}} | ||
/> | ||
|
||
<div className="linkList" onClick={handleDrawerClose}> | ||
<a | ||
className="SRC-whiteText" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Select } from '@mui/material' | ||
import { EntityRef } from '@sage-bionetworks/synapse-types' | ||
import { CellContext } from '@tanstack/react-table' | ||
import { SyntheticEvent, useEffect } from 'react' | ||
import { Form } from 'react-bootstrap' | ||
import { useEffect } from 'react' | ||
import { useGetVersionsInfinite } from '../../../synapse-queries/index' | ||
import { DatasetItemsEditorTableData } from './DatasetItemsEditor' | ||
|
||
|
@@ -47,17 +47,17 @@ export function DatasetEditorVersionCell(props: DatasetEditorVersionCellProps) { | |
return ( | ||
<div> | ||
{versions && versions.length > 0 && ( | ||
<Form.Control | ||
role="listbox" | ||
size="sm" | ||
as="select" | ||
<Select | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
native | ||
fullWidth | ||
value={versionNumber} | ||
onClick={(event: SyntheticEvent<HTMLSelectElement>) => { | ||
sx={{ height: '30px' }} | ||
onClick={event => { | ||
event.stopPropagation() | ||
}} | ||
onChange={event => { | ||
event.stopPropagation() | ||
const version = parseInt(event.target.value) | ||
const version = parseInt((event.target as HTMLInputElement).value) | ||
toggleSelection({ | ||
entityId: entityId, | ||
versionNumber: version, | ||
|
@@ -82,7 +82,7 @@ export function DatasetEditorVersionCell(props: DatasetEditorVersionCellProps) { | |
</option> | ||
) | ||
})} | ||
</Form.Control> | ||
</Select> | ||
)} | ||
</div> | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix bug in Story