Skip to content

Commit

Permalink
remove test card from empty actor form (#22199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Reuter committed Feb 1, 2023
1 parent 22fc241 commit 8866a3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"form.saveChangesAndTest": "Test and save",
"form.sourceRetest": "Retest saved source",
"form.destinationRetest": "Retest saved destination",
"form.test": "Test",
"form.sourceRetestTitle": "Test the source",
"form.destinationRetestTitle": "Test the destination",
"form.discardChanges": "Discard changes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ export const Controls: React.FC<IProps> = ({
onCancelClick,
...restProps
}) => {
const showTestCard =
hasDefinition &&
(isEditMode || isTestConnectionInProgress || restProps.connectionTestSuccess || restProps.errorMessage);
return (
<>
{hasDefinition && (
{showTestCard && (
<TestCard
{...restProps}
dirty={dirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ export const TestCard: React.FC<IProps> = ({
<FormattedMessage id={`form.${formType}RetestTitle`} />
</Text>
</FlexItem>
{isTestConnectionInProgress ? (
{isTestConnectionInProgress || !isEditMode ? (
<Button
className={styles.button}
icon={<FontAwesomeIcon icon={faClose} />}
variant="secondary"
type="button"
disabled={!isTestConnectionInProgress}
onClick={() => onCancelTesting?.()}
>
<FormattedMessage id="form.cancel" />
Expand All @@ -101,9 +102,9 @@ export const TestCard: React.FC<IProps> = ({
variant="secondary"
icon={<FontAwesomeIcon icon={faRefresh} />}
// disable if there are changes in edit mode because the retest API can currently only test the saved state
disabled={!isValid || (isEditMode && dirty)}
disabled={!isValid || dirty}
>
<FormattedMessage id={!isEditMode ? "form.test" : `form.${formType}Retest`} />
<FormattedMessage id={`form.${formType}Retest`} />
</Button>
)}
</FlexContainer>
Expand Down

0 comments on commit 8866a3c

Please sign in to comment.