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

Revert ":window: :bug: Fix error message with missing docs" #17063

Merged
merged 1 commit into from
Sep 22, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const DocumentationPanel: React.FC = () => {
const { formatMessage } = useIntl();
const config = useConfig();
const { setDocumentationPanelOpen, documentationUrl } = useDocumentationPanelContext();
const { data: docs, isLoading, error } = useDocumentation(documentationUrl);
const { data: docs, isLoading } = useDocumentation(documentationUrl);

// @ts-expect-error rehype-slug currently has type conflicts due to duplicate vfile dependencies
const urlReplacerPlugin: PluggableList = useMemo<PluggableList>(() => {
Expand Down Expand Up @@ -55,7 +55,7 @@ export const DocumentationPanel: React.FC = () => {
<PageTitle withLine title={<FormattedMessage id="connector.setupGuide" />} />
<Markdown
className={styles.content}
content={docs && !error ? docs : formatMessage({ id: "connector.setupGuide.notFound" })}
content={!docs?.includes("<!DOCTYPE html>") ? docs : formatMessage({ id: "connector.setupGuide.notFound" })}
rehypePlugins={urlReplacerPlugin}
/>
</div>
Expand Down
14 changes: 0 additions & 14 deletions airbyte-webapp/src/core/domain/Documentation.test.ts

This file was deleted.

6 changes: 0 additions & 6 deletions airbyte-webapp/src/core/domain/Documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@ export const fetchDocumentation = async (url: string): Promise<string> => {
method: "GET",
});

const contentType = response.headers.get("content-type");

if (!contentType?.toLowerCase().includes("text/markdown")) {
throw new Error(`Documentation to be expected text/markdown, was ${contentType}`);
}

return await response.text();
};