[WEB-4098] feat: noindex/nofollow (#7088)
* feat: noindex/nofollow - On login: nofollow - On app pages: noindex, nofollow https://app.plane.so/plane/browse/WEB-4098/ - https://nextjs.org/docs/app/api-reference/file-conventions/layout - https://nextjs.org/docs/app/building-your-application/routing/route-groups#creating-multiple-root-layouts - https://nextjs.org/docs/app/api-reference/functions/generate-metadata#link-relpreload * chore: address PR feedback
This commit is contained in:
parent
a3b9152a9b
commit
f8ca1e46b1
142 changed files with 92 additions and 16 deletions
3
web/app/(all)/installations/[provider]/layout.tsx
Normal file
3
web/app/(all)/installations/[provider]/layout.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function InstallationProviderLayout({ children }: { children: React.ReactNode }) {
|
||||
return children;
|
||||
}
|
||||
75
web/app/(all)/installations/[provider]/page.tsx
Normal file
75
web/app/(all)/installations/[provider]/page.tsx
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
"use client";
|
||||
|
||||
import React, { useEffect } from "react";
|
||||
import { useParams, useSearchParams } from "next/navigation";
|
||||
// ui
|
||||
import { LogoSpinner } from "@/components/common";
|
||||
// services
|
||||
import { AppInstallationService } from "@/services/app_installation.service";
|
||||
|
||||
// services
|
||||
const appInstallationService = new AppInstallationService();
|
||||
|
||||
export default function AppPostInstallation() {
|
||||
// params
|
||||
const { provider } = useParams();
|
||||
// query params
|
||||
const searchParams = useSearchParams();
|
||||
const installation_id = searchParams.get("installation_id");
|
||||
const state = searchParams.get("state");
|
||||
const code = searchParams.get("code");
|
||||
|
||||
useEffect(() => {
|
||||
if (provider === "github" && state && installation_id) {
|
||||
appInstallationService
|
||||
.addInstallationApp(state.toString(), provider, { installation_id })
|
||||
.then(() => {
|
||||
window.opener = null;
|
||||
window.open("", "_self");
|
||||
window.close();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
} else if (provider === "slack" && state && code) {
|
||||
const [workspaceSlug, projectId, integrationId] = state.toString().split(",");
|
||||
|
||||
if (!projectId) {
|
||||
const payload = {
|
||||
code,
|
||||
};
|
||||
appInstallationService
|
||||
.addInstallationApp(state.toString(), provider, payload)
|
||||
.then(() => {
|
||||
window.opener = null;
|
||||
window.open("", "_self");
|
||||
window.close();
|
||||
})
|
||||
.catch((err) => {
|
||||
throw err?.response;
|
||||
});
|
||||
} else {
|
||||
const payload = {
|
||||
code,
|
||||
};
|
||||
appInstallationService
|
||||
.addSlackChannel(workspaceSlug, projectId, integrationId, payload)
|
||||
.then(() => {
|
||||
window.opener = null;
|
||||
window.open("", "_self");
|
||||
window.close();
|
||||
})
|
||||
.catch((err) => {
|
||||
throw err?.response;
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [state, installation_id, provider, code]);
|
||||
|
||||
return (
|
||||
<div className="absolute left-0 top-0 z-50 flex h-full w-full flex-col items-center justify-center gap-y-3 bg-custom-background-80">
|
||||
<h2 className="text-2xl text-custom-text-100">Installing. Please wait...</h2>
|
||||
<LogoSpinner />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue