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

feat: fix jira oauth #495

Merged
merged 11 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ FRESHSALES_CRM_CLOUD_CLIENT_SECRET=
# Attio
ATTIO_CRM_CLOUD_CLIENT_ID=
ATTIO_CRM_CLOUD_CLIENT_SECRET=

# Close
CLOSE_CRM_CLOUD_CLIENT_ID=
CLOSE_CRM_CLOUD_CLIENT_SECRET=

# ================================================
# Ticketing
# ================================================
Expand Down
2 changes: 1 addition & 1 deletion apps/client-ts/src/app/(Dashboard)/api-keys/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function Page() {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});

posthog?.capture('api_key_created', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const CreateUserForm = () => {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const LoginUserForm = () => {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function CatalogWidget() {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("Connection_strategy_OAuth2_updated", {
id_project: idProject,
Expand Down Expand Up @@ -159,7 +159,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("Connection_strategy_OAuth2_created", {
id_project: idProject,
Expand Down Expand Up @@ -201,7 +201,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("Connection_strategy_API_KEY_updated", {
id_project: idProject,
Expand Down Expand Up @@ -230,7 +230,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("Connection_strategy_API_KEY_created", {
id_project: idProject,
Expand Down Expand Up @@ -277,7 +277,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("Connection_strategy_BASIC_AUTH_updated", {
id_project: idProject,
Expand Down Expand Up @@ -307,7 +307,7 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("Connection_strategy_BASIC_AUTH_created", {
id_project: idProject,
Expand Down Expand Up @@ -373,10 +373,9 @@ export function ConnectorDisplay({ item }: ItemDisplayProps) {
)
;
},
error: 'Error',
});
error: (err: any) => err.message || 'Error'
});


setSwitchEnabled(enabled);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ function FirstStepForm({setClose}: {setClose: () => void}) {
)
;
},
error: 'Error',
});
error: (err: any) => err.message || 'Error'
});
posthog?.capture("field_defined", {
id_project: idProject,
mode: config.DISTRIBUTION
Expand Down Expand Up @@ -323,8 +323,8 @@ function SecondStepForm({setClose}: {setClose: () => void}) {
)
;
},
error: 'Error',
});
error: (err: any) => err.message || 'Error'
});
nextStep();
posthog?.capture("field_mapped", {
id_project: idProject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function DefineForm({ onClose }: {onClose: () => void}) {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("field_defined", {
id_project: idProject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function MapForm({ onClose, fieldToMap }: {onClose: () => void; fieldToMa
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("field_mapped", {
id_project: idProject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const [successImporting, setSuccessImporting]=useState(false)
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
setShowNewLinkedUserDialog({open: false})
posthog?.capture("linked_account_created", {
Expand Down Expand Up @@ -155,7 +155,7 @@ const [successImporting, setSuccessImporting]=useState(false)
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
posthog?.capture("batch_linked_account_created", {
id_project: idProject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const AddWebhook = () => {
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
handleOpenChange(false);
posthog?.capture("webhook_created", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function useColumns(webhooks: Webhook[] | undefined, setWebhooks: React.D
id: webhook_id,
active: status,
}),
{
{
loading: 'Loading...',
success: (data: any) => {
const index = webhooks!.findIndex(webhook => webhook.id_webhook_endpoint === webhook_id);
Expand All @@ -44,8 +44,8 @@ export function useColumns(webhooks: Webhook[] | undefined, setWebhooks: React.D
)
;
},
error: 'Error',
});
error: (err: any) => err.message || 'Error'
});
}

const handleCopy = (token: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const AddConnectionButton = ({
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});

posthog?.capture("magic_link_created", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function DataTableRowActions<TData>({
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
break;
case 'api-key':
Expand All @@ -82,7 +82,7 @@ export function DataTableRowActions<TData>({
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion apps/client-ts/src/components/shared/team-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function TeamSwitcher({ className ,projects}: TeamSwitcherProps)
)
;
},
error: 'Error',
error: (err: any) => err.message || 'Error'
});
setShowNewDialog({open: false})
projectForm.reset();
Expand Down
4 changes: 2 additions & 2 deletions apps/client-ts/src/components/ui/file-uploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ export function FileUploader(props: FileUploaderProps) {
setFiles([])
return `${target} uploaded`
},
error: `Failed to upload ${target}`,
})
error: (err: any) => err.message || 'Error'
});
}
},

Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateApiKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useCreateApiKey = () => {
});

if (!response.ok) {
throw new Error('Failed to add api key');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateBatchLinkedUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const useCreateBatchLinkedUser = () => {
});

if (!response.ok) {
throw new Error('Failed to batch add linked user');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const useCreateConnectionStrategy = () => {
});

if (!response.ok) {
throw new Error('Failed to add Connection Strategy');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateLinkedUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const useCreateLinkedUser = () => {
});

if (!response.ok) {
throw new Error('Failed to add linked user');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateMagicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useCreateMagicLink = () => {
});

if (!response.ok) {
throw new Error('Failed to generate link');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useCreateProfile = () => {
});

if (!response.ok) {
throw new Error('Failed to add profile');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const useCreateProject = () => {
});

if (!response.ok) {
throw new Error('Failed to add project');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useCreateUser = () => {
});

if (!response.ok) {
throw new Error("Email already associated with other account!!")
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useCreateWebhook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const useCreateWebhook = () => {
});

if (!response.ok) {
throw new Error('Failed to add project');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useDefineField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useDefineField = () => {
});

if (!response.ok) {
throw new Error('Failed to define field mapping');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useMapField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useMapField = () => {
});

if (!response.ok) {
throw new Error('Failed to map field mapping');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/create/useRefreshAccessToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const useRefreshAccessToken = () => {
});

if (!response.ok) {
throw new Error("Login Failed!!")
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/delete/useDeleteApiKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const useDeleteApiKey = () => {
});

if (!response.ok) {
throw new Error('Failed to delete api key');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}
return response.json();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const useDeleteConnectionStrategy = () => {
});

if (!response.ok) {
throw new Error('Failed to delete cs');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}

return response.json();
Expand Down
3 changes: 2 additions & 1 deletion apps/client-ts/src/hooks/delete/useDeleteWebhook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const useDeleteWebhook = () => {
});

if (!response.ok) {
throw new Error('Failed to delete api key');
const errorData = await response.json();
throw new Error(errorData.message || "Unknown error occurred");
}
return response.json();
};
Expand Down
Loading
Loading