Skip to content

Commit

Permalink
Merge pull request #633 from onursumer/fix-synapse-file-linkout
Browse files Browse the repository at this point in the history
Link out to synapse regardless of level
  • Loading branch information
inodb authored May 22, 2024
2 parents 99f3813 + 8b92628 commit 2e1b1a8
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions packages/data-portal-explore/src/components/FileTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

import { doesFileIncludeLevel1OrLevel2SequencingData } from '../lib/helpers';
import { truncatedTableCell } from '../lib/dataTableHelpers';
import SimpleScrollPane from './SimpleScrollPane';
import { makeListColumn } from '../lib/fileTableHelpers';
Expand All @@ -22,7 +21,9 @@ import styles from './fileTable.module.scss';

import {
EnhancedDataTable,
getDefaultDataTableStyle,
IEnhancedDataTableColumn,
selectorToColumnName,
} from '@htan/data-portal-table';
import {
AttributeNames,
Expand All @@ -33,14 +34,12 @@ import {
} from '@htan/data-portal-utils';
import {
commonStyles,
DownloadSourceCategory,
Entity,
FileAttributeMap,
getViewerValues,
ViewDetailsModal,
} from '@htan/data-portal-commons';
import {
getDefaultDataTableStyle,
selectorToColumnName,
} from '@htan/data-portal-table';
import { getViewerValues, ViewDetailsModal } from '@htan/data-portal-commons';

const CDS_MANIFEST_FILENAME = 'cds_manifest.csv';

Expand Down Expand Up @@ -474,23 +473,21 @@ export class FileTable extends React.Component<IFileTableProps> {
cell: (file: Entity) => {
const truncatedFilename = truncateFilename(file.Filename);
const linkOut =
doesFileIncludeLevel1OrLevel2SequencingData(file) ||
(file.Component.startsWith('Imaging') &&
(file.level === 'Level 1' ||
file.level === 'Level 2')) ? (
<span
className={commonStyles.clickable}
onClick={(e) => this.onClick(e, file)}
>
{truncatedFilename}
</span>
) : (
file.downloadSource ===
DownloadSourceCategory.synapse ? (
<a
target="_blank"
href={`https://www.synapse.org/#!Synapse:${file.synapseId}`}
>
{truncatedFilename}
</a>
) : (
<span
className={commonStyles.clickable}
onClick={(e) => this.onClick(e, file)}
>
{truncatedFilename}
</span>
);

return (
Expand Down

0 comments on commit 2e1b1a8

Please sign in to comment.