Skip to content

Commit

Permalink
[Story]- Updated documentation urls
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Nagendra committed Feb 7, 2024
1 parent 8c33ae8 commit fa47c38
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions pages/api/checkConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ const checkConnection = async (req: NextApiRequest, res: NextApiResponse) => {
// Handle the response data as needed
res.status(200).json(data);
} catch (error: any) {
const errorMessage = error?.response?.data ?? error.message;
// send error to bugsnag
sendErrorToBugsnag(error.message);
sendErrorToBugsnag(errorMessage);
// Handle any error that occurred during the request
res.status(500).json({ error: error.message });
res.status(500).json({ error: errorMessage });
}
};

Expand Down
1 change: 1 addition & 0 deletions pages/spaces/[wid]/syncs/create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const SyncFlow = () => {

const displayInstructions = () => {
const documentationUrl = constants.docs.syncs;

const title = 'Sync Documentation';
const linkText = 'sync';
return <Instructions documentationUrl={documentationUrl} title={title} linkText={linkText} type={'sync'} />;
Expand Down
4 changes: 2 additions & 2 deletions src/constants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const constants = {
SELECT_CONNECTOR_LAYOUT_TITLE: 'Select connector'
},
docs: {
syncs: 'https://valmi.io/docs/concepts/syncs',
tracks: 'https://valmi.io/docs/concepts/tracks'
syncs: 'https://www.valmi.io/docs/concepts/syncs',
tracks: 'https://www.valmi.io/docs/concepts/tracks'
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ import { memo } from 'react';

const ConnectorInstuctions = ({ data, selected_connector }: { data: any; selected_connector: any }) => {
const connectorDocumentationUrl = data ? getConnectorDocumentationUrl(data) : '';

const segments = connectorDocumentationUrl.split('/'); // Split the URL by "/"
const name = segments.at(-1); // Get the last segment

const connectorType = segments.at(-2);

const documentationUrl = `https://www.valmi.io/docs/integrations/${connectorType}/${name}`;

const title = 'Connector Documentation';
const linkText = selected_connector ? selected_connector.display_name : '';
return (
<Instructions documentationUrl={connectorDocumentationUrl} title={title} linkText={linkText} type={'connection'} />
);

return <Instructions documentationUrl={documentationUrl} title={title} linkText={linkText} type={'connection'} />;
};

export default memo(ConnectorInstuctions);
7 changes: 3 additions & 4 deletions src/content/DestinationWarehouses/DestinationInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ type InstructionsProps = {
};

const DestinationInstructions = ({ data, type, destinationType }: InstructionsProps) => {
// TODO: documentation url changes based on schema.

destinationType = destinationType === 'postgres' ? 'postgresql' : destinationType;
const documentationUrl =
type === 'destination'
? `https://www.valmi.io/docs/events/destinations/warehouses${destinationType}`
: 'https://www.valmi.io/docs/events/sources/streams/default';
? `https://www.valmi.io/docs/events/destinations/${destinationType}`
: `https://www.valmi.io/docs/events/sources/shopify`;

const title = type === 'destination' ? 'Destination warehouses' : 'Streams';

Expand Down
1 change: 1 addition & 0 deletions src/content/Events/EventInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { memo } from 'react';

const TrackInstructions = ({ data }: { data: any }) => {
// const documentationUrl = 'https://www.valmi.io/docs/overview';

const documentationUrl = 'https://www.valmi.io/docs/events/connections/default';
const title = 'Tracks';
const linkText = 'tracks.';
Expand Down
2 changes: 1 addition & 1 deletion src/content/OAuthApps/OAuthInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type InstructionsProps = {
const OAuthInstructions = ({ data, type }: InstructionsProps) => {
// TODO: documentation url changes based on schema.

const documentationUrl = `https://www.valmi.io/docs/oauth/schema/${type}`;
const documentationUrl = `https://www.valmi.io/docs/authentication/oauth/${type}`;

const title = 'OAuth Configuration';

Expand Down

0 comments on commit fa47c38

Please sign in to comment.