Skip to content

Commit

Permalink
Show dynamic values in "limit reached" text (#11418)
Browse files Browse the repository at this point in the history
  • Loading branch information
ambirdsall committed Feb 24, 2024
1 parent 7a4b017 commit 34348f6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const PageDisplay: React.FC<PageDisplayProps> = ({ page, className, infer
const {
streamRead,
schemaWarnings: { incompatibleSchemaErrors, schemaDifferences },
testReadLimits: { recordLimit, pageLimit, sliceLimit },
} = useConnectorBuilderTestRead();

const autoImportSchema = useAutoImportSchema(testStreamIndex);
Expand All @@ -54,7 +55,10 @@ export const PageDisplay: React.FC<PageDisplayProps> = ({ page, className, infer
{`${formatMessage({ id: "connectorBuilder.recordsTab" })} (${page.records.length})`}
{!streamRead.isFetching && streamRead.data && streamRead.data.test_read_limit_reached && (
<InfoTooltip>
<FormattedMessage id="connectorBuilder.streamTestLimitReached" />
<FormattedMessage
id="connectorBuilder.streamTestLimitReached"
values={{ recordLimit, pageLimit, sliceLimit }}
/>
</InfoTooltip>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const StreamTester: React.FC<{
dataUpdatedAt,
errorUpdatedAt,
},
testReadLimits: { recordLimit, pageLimit, sliceLimit },
} = useConnectorBuilderTestRead();
const [showLimitWarning, setShowLimitWarning] = useLocalStorage("connectorBuilderLimitWarning", true);
const mode = useBuilderWatch("mode");
Expand Down Expand Up @@ -187,7 +188,12 @@ export const StreamTester: React.FC<{
{!isFetching && streamReadData && streamReadData.test_read_limit_reached && showLimitWarning && (
<Message
type="warning"
text={<FormattedMessage id="connectorBuilder.streamTestLimitReached" />}
text={
<FormattedMessage
id="connectorBuilder.streamTestLimitReached"
values={{ recordLimit, pageLimit, sliceLimit }}
/>
}
onClose={() => {
setShowLimitWarning(false);
}}
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@
"connectorBuilder.forkPage.prompt": "Load an existing connector",
"connectorBuilder.loadingStreamList": "Loading",
"connectorBuilder.noStreamSelected": "No stream selected",
"connectorBuilder.streamTestLimitReached": "Stream testing limit reached. During testing a maximum of 1000 records, or 5 stream partitions with 5 pages each will be returned.",
"connectorBuilder.streamTestLimitReached": "Stream testing limit reached. During testing a maximum of {recordLimit} records, or {sliceLimit} stream partitions with {pageLimit} pages each will be returned.",
"connectorBuilder.builderPrompt.button": "Build your connector",
"connectorBuilder.builderPrompt.title": "Need to build your own source?",
"connectorBuilder.builderPrompt.description": "Build your source with our {adjective} {noun}",
Expand Down

0 comments on commit 34348f6

Please sign in to comment.