Skip to content

Commit

Permalink
Display sourceDefined cursor field when possible (airbytehq#11436)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase authored Mar 30, 2022
1 parent 6db7a28 commit 39107bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export const StreamHeader: React.FC<StreamHeaderProps> = ({
cursorField,
destinationSyncMode,
} = stream.config;

const { defaultCursorField } = stream.stream;
const syncSchema = useMemo(
() => ({
syncMode,
Expand Down Expand Up @@ -126,9 +128,11 @@ export const StreamHeader: React.FC<StreamHeaderProps> = ({
<PathPopout
pathType={cursorType}
paths={paths}
path={cursorField}
path={
cursorType === "sourceDefined" ? defaultCursorField : cursorField
}
placeholder={
<FormattedMessage id="connectionForm.primaryKey.searchPlaceholder" />
<FormattedMessage id="connectionForm.cursor.searchPlaceholder" />
}
onPathChange={onCursorChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ type PathProps = {

export const PathPopout: React.FC<PathPopoutProps> = (props) => {
if (props.pathType === "sourceDefined") {
if (props.path) {
const text = props.path
? props.isMulti
? props.path.map(pathDisplayName).join(", ")
: pathDisplayName(props.path)
: "";

return <>{text}</>;
}
return <>{"<sourceDefined>"}</>;
}

Expand Down

0 comments on commit 39107bf

Please sign in to comment.