Skip to content

Commit

Permalink
feat(CollectionHome): add "pull" to row hamburger menu
Browse files Browse the repository at this point in the history
* fix: remove "home" header from network home
* fix: clicking an unpublished status icon in collection home no longer opens a link
* fix: disable SQL / compare view in production AND dev environments
  • Loading branch information
b5 committed Oct 9, 2020
1 parent ba4a268 commit 1d7ac10
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions app/components/collection/collectionHome/StatusIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const StatusIcons: React.FC<StatusIconsProps> = ({ data, onClickFolder }) => {
return (
<>
<span className="dataset-link" data-tip={published ? 'published' : 'unpublished'}>
<ExternalLink href={`${QRI_CLOUD_URL}/${username}/${name}`}>
{published && <ExternalLink href={`${QRI_CLOUD_URL}/${username}/${name}`}>
<Icon icon="publish" size="sm" color={published ? 'dark' : 'medium'}/>
</ExternalLink>
</ExternalLink>}
{!published && <Icon icon="publish" size="sm" color={published ? 'dark' : 'medium'}/>}
</span>
{onClickFolder && <a onClick={(e: React.MouseEvent) => onClickFolder(row, e)} className="dataset-link" data-tip={fsiPath ? 'working directory' : 'no working directory'}>
<Icon icon="openInFinder" size="sm" color={fsiPath ? 'dark' : 'medium'}/>
Expand Down
15 changes: 12 additions & 3 deletions app/components/collection/collectionHome/TableRowHamburger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@ import Hamburger from '../../chrome/Hamburger'

import { VersionInfo } from '../../../models/store'
import { Modal, ModalType } from '../../../models/modals'
import { removeDatasetAndFetch } from '../../../actions/api'
import { removeDatasetAndFetch, pullDataset } from '../../../actions/api'
import { setModal } from '../../../actions/ui'
import { connectComponentToProps } from '../../../utils/connectComponentToProps'

interface TableRowHamburgerProps {
data: VersionInfo
setModal: (modal: Modal) => void
removeDatasetAndFetch: (...args: Parameters<typeof removeDatasetAndFetch>) => Promise<AnyAction>
pullDataset: (username: string, name: string) => Promise<AnyAction>
}

const TableRowHamburger: React.FC<TableRowHamburgerProps> = ({ data, setModal, removeDatasetAndFetch }) => {
const TableRowHamburger: React.FC<TableRowHamburgerProps> = ({ data, setModal, removeDatasetAndFetch, pullDataset }) => {
const { username, name, fsiPath } = data
const onRemoveHandler = async (keepFiles: boolean) => removeDatasetAndFetch(username, name, !!fsiPath, keepFiles)

const actions = [
{
icon: 'download',
text: 'Pull',
onClick: () => {
pullDataset(username, name)
}
},
{
icon: 'download',
text: 'Export',
Expand Down Expand Up @@ -52,6 +60,7 @@ export default connectComponentToProps(
{},
{
setModal,
removeDatasetAndFetch
removeDatasetAndFetch,
pullDataset
}
)
1 change: 0 additions & 1 deletion app/components/network/NetworkHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const NetworkHome: React.FunctionComponent<NetworkHomeProps> = ({ history

return (
<div className='network_home'>
<h2>Home</h2>
<SearchBox onEnter={handleOnEnter} id='search-box' />
{featured && featured.length && <div>
<h4>Featured Datasets</h4>
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = merge(baseConfig, {
*
*/
'__BUILD__': {
'ENABLE_SQL_WORKBENCH': JSON.stringify(true)
'ENABLE_SQL_WORKBENCH': JSON.stringify(false)
}
}),

Expand Down

0 comments on commit 1d7ac10

Please sign in to comment.