Add back Gong connector to sidebar + fix formatting issues

This commit is contained in:
Weves
2023-10-13 12:05:33 -07:00
committed by Chris Weaver
parent dbf59d2acc
commit 17e00b186e
3 changed files with 82 additions and 56 deletions

View File

@ -63,8 +63,11 @@ const MainSection = () => {
connectorIndexingStatus.connector.source === "document360" connectorIndexingStatus.connector.source === "document360"
); );
const document360Credential: Credential<Document360CredentialJson> | undefined = const document360Credential:
credentialsData.find((credential) => credential.credential_json?.document360_api_token); | Credential<Document360CredentialJson>
| undefined = credentialsData.find(
(credential) => credential.credential_json?.document360_api_token
);
return ( return (
<> <>
@ -92,9 +95,16 @@ const MainSection = () => {
) : ( ) : (
<> <>
<p className="text-sm mb-4"> <p className="text-sm mb-4">
To use the Document360 connector, you must first provide the API token To use the Document360 connector, you must first provide the API
and portal ID corresponding to your Document360 setup. For more details, token and portal ID corresponding to your Document360 setup. For
see the <a className="text-blue-500" href="https://apidocs.document360.com/apidocs/api-token">official Document360 documentation</a>. more details, see the{" "}
<a
className="text-blue-500"
href="https://apidocs.document360.com/apidocs/api-token"
>
official Document360 documentation
</a>
.
</p> </p>
<div className="border-solid border-gray-600 border rounded-md p-6 mt-2"> <div className="border-solid border-gray-600 border rounded-md p-6 mt-2">
<CredentialForm<Document360CredentialJson> <CredentialForm<Document360CredentialJson>
@ -105,14 +115,13 @@ const MainSection = () => {
label="Document360 API Token:" label="Document360 API Token:"
type="password" type="password"
/> />
<TextFormField <TextFormField name="portal_id" label="Portal ID:" />
name="portal_id"
label="Portal ID:"
/>
</> </>
} }
validationSchema={Yup.object().shape({ validationSchema={Yup.object().shape({
document360_api_token: Yup.string().required("Please enter your Document360 API token"), document360_api_token: Yup.string().required(
"Please enter your Document360 API token"
),
portal_id: Yup.string().required("Please enter your portal ID"), portal_id: Yup.string().required("Please enter your portal ID"),
})} })}
initialValues={{ initialValues={{
@ -136,7 +145,8 @@ const MainSection = () => {
{document360ConnectorIndexingStatuses.length > 0 && ( {document360ConnectorIndexingStatuses.length > 0 && (
<> <>
<p className="text-sm mb-2"> <p className="text-sm mb-2">
We index the latest articles from each workspace listed below regularly. We index the latest articles from each workspace listed below
regularly.
</p> </p>
<div className="mb-2"> <div className="mb-2">
<ConnectorsTable<Document360Config, Document360CredentialJson> <ConnectorsTable<Document360Config, Document360CredentialJson>
@ -156,9 +166,13 @@ const MainSection = () => {
header: "Categories", header: "Categories",
key: "categories", key: "categories",
getValue: (ccPairStatus) => getValue: (ccPairStatus) =>
ccPairStatus.connector.connector_specific_config.categories && ccPairStatus.connector.connector_specific_config
ccPairStatus.connector.connector_specific_config.categories.length > 0 .categories &&
? ccPairStatus.connector.connector_specific_config.categories.join(", ") ccPairStatus.connector.connector_specific_config.categories
.length > 0
? ccPairStatus.connector.connector_specific_config.categories.join(
", "
)
: "", : "",
}, },
]} ]}
@ -182,7 +196,9 @@ const MainSection = () => {
<ConnectorForm<Document360Config> <ConnectorForm<Document360Config>
nameBuilder={(values) => nameBuilder={(values) =>
values.categories values.categories
? `Document360Connector-${values.workspace}-${values.categories.join("_")}` ? `Document360Connector-${
values.workspace
}-${values.categories.join("_")}`
: `Document360Connector-${values.workspace}` : `Document360Connector-${values.workspace}`
} }
source="document360" source="document360"
@ -219,9 +235,9 @@ const MainSection = () => {
</div> </div>
) : ( ) : (
<p className="text-sm"> <p className="text-sm">
Please provide your Document360 API token and portal ID in Step 1 first! Once done with Please provide your Document360 API token and portal ID in Step 1
that, you can then specify which Document360 categories you want to make first! Once done with that, you can then specify which Document360
searchable. categories you want to make searchable.
</p> </p>
)} )}
</> </>

View File

@ -24,6 +24,7 @@ import {
CPUIcon, CPUIcon,
Document360Icon, Document360Icon,
GoogleSitesIcon, GoogleSitesIcon,
GongIcon,
} from "@/components/icons/icons"; } from "@/components/icons/icons";
import { getAuthDisabledSS, getCurrentUserSS } from "@/lib/userSS"; import { getAuthDisabledSS, getCurrentUserSS } from "@/lib/userSS";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
@ -175,6 +176,15 @@ export async function Layout({ children }: { children: React.ReactNode }) {
), ),
link: "/admin/connectors/zulip", link: "/admin/connectors/zulip",
}, },
{
name: (
<div className="flex">
<GongIcon size={16} />
<div className="ml-1">Gong</div>
</div>
),
link: "/admin/connectors/gong",
},
{ {
name: ( name: (
<div className="flex"> <div className="flex">