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

Remove test card from empty actor form #22199

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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