Skip to content
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

fix: stop displaying empty descriptions #346

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/Task/SearchableTaskNameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
import ChevronRight from '@material-ui/icons/ChevronRight';
import ErrorOutline from '@material-ui/icons/ErrorOutline';
import classnames from 'classnames';
import { noDescriptionString } from 'common/constants';
anrusina marked this conversation as resolved.
Show resolved Hide resolved
import { SearchResult } from 'components/common/SearchableList';
import {
SearchableNamedEntity,
Expand Down Expand Up @@ -79,15 +78,17 @@ const TaskNameRow: React.FC<TaskNameRowProps> = ({ label, entityName }) => {
const styles = useStyles();
const listStyles = useNamedEntityListStyles();
const [inViewRef, inView] = useInView(intersectionOptions);
const description = entityName.metadata.description || noDescriptionString;
const description = entityName?.metadata?.description;

return (
<div ref={inViewRef} className={listStyles.searchResult}>
<div className={listStyles.itemName}>
<div className={styles.taskName}>{label}</div>
<Typography variant="body2" className={styles.description}>
{description}
</Typography>
{description && (
<Typography variant="body2" className={styles.description}>
{description}
</Typography>
)}
{!!inView && <TaskInterface taskName={entityName} />}
</div>
<ChevronRight className={listStyles.itemChevron} />
Expand Down
9 changes: 6 additions & 3 deletions src/components/Workflow/SearchableWorkflowNameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { WorkflowExecutionPhase } from 'models/Execution/enums';
import { Shimmer } from 'components/common/Shimmer';
import { WorkflowExecutionIdentifier } from 'models/Execution/types';
import { debounce } from 'lodash';
import { Typography } from '@material-ui/core';
import { WorkflowListStructureItem } from './types';
import ProjectStatusBar from '../Project/ProjectStatusBar';
import { workflowNoInputsString } from '../Launch/LaunchForm/constants';
Expand Down Expand Up @@ -120,9 +121,11 @@ const SearchableWorkflowNameItem: React.FC<SearchableWorkflowNameItemProps> = Re
<DeviceHub className={styles.itemIcon} />
<div>{id.name}</div>
</div>
<div className={styles.itemDescriptionRow}>
{description?.length ? description : 'This workflow has no description.'}
</div>
{description && (
<Typography variant="body2" className={styles.itemDescriptionRow}>
{description}
</Typography>
)}
<div className={styles.itemRow}>
<div className={styles.itemLabel}>Last execution time</div>
<div className={styles.w100}>
Expand Down