diff --git a/packages/frontend/.eslintrc.json b/packages/frontend/.eslintrc.json
index 96d5591b..e7f396b4 100644
--- a/packages/frontend/.eslintrc.json
+++ b/packages/frontend/.eslintrc.json
@@ -16,8 +16,5 @@
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
- ],
- "rules": {
- "@typescript-eslint/no-explicit-any": "off"
- }
+ ]
}
diff --git a/packages/frontend/src/components/projects/create/ConnectAccount.tsx b/packages/frontend/src/components/projects/create/ConnectAccount.tsx
index 0864199c..305894c8 100644
--- a/packages/frontend/src/components/projects/create/ConnectAccount.tsx
+++ b/packages/frontend/src/components/projects/create/ConnectAccount.tsx
@@ -3,6 +3,7 @@ import React from 'react';
import OauthPopup from 'react-oauth-popup';
import { useGQLClient } from '../../../context/GQLClientContext';
+import ConnectAccountTabPanel from './ConnectAccountTabPanel';
const SCOPES = 'repo user';
const GITHUB_OAUTH_URL = `https://github.com/login/oauth/authorize?client_id=${
@@ -24,8 +25,9 @@ const ConnectAccount = ({ onAuth: onToken }: ConnectAccountInterface) => {
onToken(token);
};
+ // TODO: Use correct height
return (
-
+
^
Connect to your git account
@@ -47,6 +49,7 @@ const ConnectAccount = ({ onAuth: onToken }: ConnectAccountInterface) => {
+
);
};
diff --git a/packages/frontend/src/components/projects/create/ConnectAccountTabPanel.tsx b/packages/frontend/src/components/projects/create/ConnectAccountTabPanel.tsx
new file mode 100644
index 00000000..d73b8ceb
--- /dev/null
+++ b/packages/frontend/src/components/projects/create/ConnectAccountTabPanel.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+
+import { Tabs, TabsHeader, Tab } from '@material-tailwind/react';
+
+const ConnectAccountTabPanel = () => {
+ return (
+
+
+
+ Import a repository
+
+
+ Start with a template
+
+
+ {/* */}
+ {/* TODO: Add content */}
+ {/* */}
+
+ );
+};
+
+export default ConnectAccountTabPanel;
diff --git a/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx b/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx
index 9137148e..d2b3e6c1 100644
--- a/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx
+++ b/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useMemo } from 'react';
-import { Controller, useForm } from 'react-hook-form';
+import { Controller, useForm, SubmitHandler } from 'react-hook-form';
import toast from 'react-hot-toast';
import { Domain } from 'gql-client';
@@ -29,6 +29,12 @@ interface EditDomainDialogProp {
onUpdate: () => Promise
;
}
+type EditDomainValues = {
+ name: string;
+ branch: string;
+ redirectedTo: string;
+};
+
const EditDomainDialog = ({
domains,
open,
@@ -81,8 +87,8 @@ const EditDomainDialog = ({
},
});
- const updateDomainHandler = useCallback(
- async (data: any) => {
+ const updateDomainHandler: SubmitHandler = useCallback(
+ async (data) => {
const domainRedirectTo = domains.find(
(domainData) => data.redirectedTo === domainData.name,
);
diff --git a/packages/frontend/src/components/projects/project/settings/GitTabPanel.tsx b/packages/frontend/src/components/projects/project/settings/GitTabPanel.tsx
index d7310c8e..6d88cbb3 100644
--- a/packages/frontend/src/components/projects/project/settings/GitTabPanel.tsx
+++ b/packages/frontend/src/components/projects/project/settings/GitTabPanel.tsx
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect } from 'react';
-import { useForm } from 'react-hook-form';
+import { SubmitHandler, useForm } from 'react-hook-form';
import toast from 'react-hot-toast';
import { Project } from 'gql-client';
@@ -8,6 +8,14 @@ import { Button, Input, Switch, Typography } from '@material-tailwind/react';
import WebhookCard from './WebhookCard';
import { useGQLClient } from '../../../../context/GQLClientContext';
+type UpdateProdBranchValues = {
+ prodBranch: string;
+};
+
+type UpdateWebhooksValues = {
+ webhookUrl: string;
+};
+
const GitTabPanel = ({
project,
onUpdate,
@@ -27,21 +35,22 @@ const GitTabPanel = ({
},
});
- const updateProdBranchHandler = useCallback(
- async (data: any) => {
- const { updateProject } = await client.updateProject(project.id, {
- prodBranch: data.prodBranch,
- });
+ const updateProdBranchHandler: SubmitHandler =
+ useCallback(
+ async (data) => {
+ const { updateProject } = await client.updateProject(project.id, {
+ prodBranch: data.prodBranch,
+ });
- if (updateProject) {
- await onUpdate();
- toast.success('Production branch upadated successfully');
- } else {
- toast.error('Error updating production branch');
- }
- },
- [project],
- );
+ if (updateProject) {
+ await onUpdate();
+ toast.success('Production branch upadated successfully');
+ } else {
+ toast.error('Error updating production branch');
+ }
+ },
+ [project],
+ );
const {
register: registerWebhooks,
@@ -53,23 +62,24 @@ const GitTabPanel = ({
},
});
- const updateWebhooksHandler = useCallback(
- async (data: any) => {
- const { updateProject } = await client.updateProject(project.id, {
- webhooks: [...project.webhooks, data.webhookUrl],
- });
+ const updateWebhooksHandler: SubmitHandler =
+ useCallback(
+ async (data) => {
+ const { updateProject } = await client.updateProject(project.id, {
+ webhooks: [...project.webhooks, data.webhookUrl],
+ });
- if (updateProject) {
- await onUpdate();
- toast.success('Webhook added successfully');
- } else {
- toast.error('Error adding webhook');
- }
+ if (updateProject) {
+ await onUpdate();
+ toast.success('Webhook added successfully');
+ } else {
+ toast.error('Error adding webhook');
+ }
- resetWebhooks();
- },
- [project],
- );
+ resetWebhooks();
+ },
+ [project],
+ );
useEffect(() => {
resetProdBranch({
diff --git a/packages/frontend/src/components/shared/AsyncSelect.tsx b/packages/frontend/src/components/shared/AsyncSelect.tsx
index fb294455..8a5b3646 100644
--- a/packages/frontend/src/components/shared/AsyncSelect.tsx
+++ b/packages/frontend/src/components/shared/AsyncSelect.tsx
@@ -2,6 +2,8 @@
import React, { useEffect, useState } from 'react';
import { Select, SelectProps } from '@material-tailwind/react';
+// TODO: Use correct type for ref
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
const AsyncSelect = React.forwardRef((props: SelectProps, ref: any) => {
const [key, setKey] = useState(0);
diff --git a/packages/frontend/src/pages/projects/create/index.tsx b/packages/frontend/src/pages/projects/create/index.tsx
index 1f76fef6..ff0d93e1 100644
--- a/packages/frontend/src/pages/projects/create/index.tsx
+++ b/packages/frontend/src/pages/projects/create/index.tsx
@@ -9,7 +9,7 @@ import { useOctokit } from '../../../context/OctokitContext';
const NewProject = () => {
const { octokit, updateAuth } = useOctokit();
- return (
+ return Boolean(octokit) ? (
<>
Start with template
@@ -24,12 +24,10 @@ const NewProject = () => {
})}
Import a repository
- {Boolean(octokit) ? (
-
- ) : (
-
- )}
+
>
+ ) : (
+
);
};
diff --git a/packages/gql-client/.eslintrc.json b/packages/gql-client/.eslintrc.json
index 08ad3dfe..a0015fbc 100644
--- a/packages/gql-client/.eslintrc.json
+++ b/packages/gql-client/.eslintrc.json
@@ -17,7 +17,6 @@
],
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
- "@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",
{