-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
🪟🎨 Connector form: Improve logs look and feel #20951
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b1a6d5c
improve logs look and feel in connector form
d6d277a
add button to toggle
595de52
Merge remote-tracking branch 'origin/master' into flash1293/improve-l…
41c0fda
lokk and feel
e75f5c0
Merge branch 'master' into flash1293/improve-logs-view
37050bb
Merge branch 'master' into flash1293/improve-logs-view
8f12cce
Merge branch 'master' into flash1293/improve-logs-view
e625ebc
Merge branch 'master' into flash1293/improve-logs-view
483057f
Merge remote-tracking branch 'origin/master' into flash1293/improve-l…
9febe06
Merge branch 'flash1293/improve-logs-view' of github.com:airbytehq/ai…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 9 additions & 5 deletions
14
airbyte-webapp/src/views/Connector/ConnectorCard/ConnectorCard.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
@use "../../../scss/variables" as vars; | ||
@use "scss/variables"; | ||
|
||
.cardForm { | ||
padding: 22px 27px 23px 24px; | ||
} | ||
|
||
.connectorSelectControl { | ||
margin-bottom: vars.$spacing-xl; | ||
margin-bottom: variables.$spacing-xl; | ||
} | ||
|
||
.loaderContainer { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: vars.$spacing-2xl 0; | ||
padding: variables.$spacing-2xl 0; | ||
} | ||
|
||
.loadingMessage { | ||
margin-top: vars.$spacing-md; | ||
margin-left: vars.$spacing-lg; | ||
margin-top: variables.$spacing-md; | ||
margin-left: variables.$spacing-lg; | ||
} | ||
|
||
.connectionTestLogs { | ||
margin-top: variables.$spacing-lg; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,10 @@ | ||||||
import { faChevronDown, faChevronRight } from "@fortawesome/free-solid-svg-icons"; | ||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
import React, { useEffect, useMemo, useState } from "react"; | ||||||
import { FormattedMessage } from "react-intl"; | ||||||
|
||||||
import { JobItem } from "components/JobItem/JobItem"; | ||||||
import JobLogs from "components/JobItem/components/JobLogs"; | ||||||
import { Button } from "components/ui/Button"; | ||||||
import { Card } from "components/ui/Card"; | ||||||
import { Spinner } from "components/ui/Spinner"; | ||||||
|
||||||
|
@@ -14,9 +17,13 @@ import { | |||||
} from "core/domain/connector"; | ||||||
import { DestinationRead, SourceRead, SynchronousJobRead } from "core/request/AirbyteClient"; | ||||||
import { LogsRequestError } from "core/request/LogsRequestError"; | ||||||
import { useAdvancedModeSetting } from "hooks/services/useAdvancedModeSetting"; | ||||||
import { generateMessageFromError } from "utils/errorStatusMessage"; | ||||||
import { ConnectorCardValues, ConnectorForm, ConnectorFormValues } from "views/Connector/ConnectorForm"; | ||||||
import { | ||||||
ConnectorCardValues, | ||||||
ConnectorForm, | ||||||
ConnectorFormProps, | ||||||
ConnectorFormValues, | ||||||
} from "views/Connector/ConnectorForm"; | ||||||
|
||||||
import { useDocumentationPanelContext } from "../ConnectorDocumentationLayout/DocumentationPanelContext"; | ||||||
import { ConnectorDefinitionTypeControl } from "../ConnectorForm/components/Controls/ConnectorServiceTypeControl"; | ||||||
|
@@ -81,7 +88,7 @@ export const ConnectorCard: React.FC<ConnectorCardCreateProps | ConnectorCardEdi | |||||
const [saved, setSaved] = useState(false); | ||||||
const [errorStatusRequest, setErrorStatusRequest] = useState<Error | null>(null); | ||||||
const [isFormSubmitting, setIsFormSubmitting] = useState(false); | ||||||
const [advancedMode] = useAdvancedModeSetting(); | ||||||
const [logsVisible, setLogsVisible] = useState(false); | ||||||
|
||||||
const { setDocumentationUrl, setDocumentationPanelOpen } = useDocumentationPanelContext(); | ||||||
const { | ||||||
|
@@ -132,6 +139,11 @@ export const ConnectorCard: React.FC<ConnectorCardCreateProps | ConnectorCardEdi | |||||
setDocumentationUrl, | ||||||
]); | ||||||
|
||||||
const handleTestConnector: ConnectorFormProps["testConnector"] = (v) => { | ||||||
setErrorStatusRequest(null); | ||||||
return testConnector(v); | ||||||
}; | ||||||
|
||||||
const onHandleSubmit = async (values: ConnectorFormValues) => { | ||||||
if (!selectedConnectorDefinition) { | ||||||
return; | ||||||
|
@@ -215,16 +227,28 @@ export const ConnectorCard: React.FC<ConnectorCardCreateProps | ConnectorCardEdi | |||||
isTestConnectionInProgress={isTestConnectionInProgress} | ||||||
connectionTestSuccess={connectionTestSuccess} | ||||||
onStopTesting={onStopTesting} | ||||||
testConnector={testConnector} | ||||||
testConnector={handleTestConnector} | ||||||
onSubmit={onHandleSubmit} | ||||||
formValues={formValues} | ||||||
errorMessage={error && generateMessageFromError(error)} | ||||||
successMessage={saved && props.isEditMode && <FormattedMessage id="form.changesSaved" />} | ||||||
connectorId={isEditMode ? getConnectorId(props.connector) : undefined} | ||||||
/> | ||||||
)} | ||||||
{/* Show the job log only if advanced mode is turned on or the actual job failed (not the check inside the job) */} | ||||||
{job && (advancedMode || !job.succeeded) && <JobItem job={job} />} | ||||||
{job && ( | ||||||
<div className={styles.connectionTestLogs}> | ||||||
<Button | ||||||
variant="clear" | ||||||
icon={<FontAwesomeIcon icon={logsVisible ? faChevronDown : faChevronRight} />} | ||||||
onClick={() => { | ||||||
setLogsVisible(!logsVisible); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
|
||||||
}} | ||||||
> | ||||||
<FormattedMessage id="connector.testLogs" /> | ||||||
</Button> | ||||||
{logsVisible && <JobLogs job={job} jobIsFailed />} | ||||||
</div> | ||||||
)} | ||||||
</div> | ||||||
</div> | ||||||
</Card> | ||||||
|
9 changes: 9 additions & 0 deletions
9
airbyte-webapp/src/views/Connector/ConnectorForm/components/EditControls.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like it may make more sense to use an expandable section here rather than a Button, similar to how the BuilderOptional component looks.
Since this button is just showing/hiding additional info, using the faAngleRight / faAngleDown icon next to some text that just says
Connection test logs
feels like a more natural UX. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, changed the button to look like this: