Skip to content

Commit

Permalink
Revert "Fix error message with missing docs (airbytehq#17014)" (airby…
Browse files Browse the repository at this point in the history
…tehq#17063)

This reverts commit e931b69.
  • Loading branch information
krishnaglick authored and robbinhan committed Sep 29, 2022
1 parent 7f281af commit 9868655
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
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();
};

0 comments on commit 9868655

Please sign in to comment.