Skip to content

Commit

Permalink
Merge pull request #2964 from quantified-uncertainty/create-pull-requ…
Browse files Browse the repository at this point in the history
…est/patch

Bump versions after 0.9.2 release
  • Loading branch information
berekuk authored Jan 12, 2024
2 parents 3e097e6 + 5be13ee commit e61a435
Show file tree
Hide file tree
Showing 23 changed files with 599 additions and 320 deletions.
7 changes: 7 additions & 0 deletions .changeset/next-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@quri/squiggle-lang": patch
"@quri/squiggle-components": patch
"@quri/prettier-plugin-squiggle": patch
"@quri/squiggle-textmate-grammar": patch
"vscode-squiggle": patch
---
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quri/squiggle-components",
"version": "0.9.2",
"version": "0.9.3-0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"relay-runtime": "^16.1.0",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.0",
"squiggle-lang-0.9.0": "npm:@quri/[email protected]",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
44 changes: 0 additions & 44 deletions packages/hub/src/app/admin/AdminPage.tsx

This file was deleted.

163 changes: 0 additions & 163 deletions packages/hub/src/app/admin/UpgradeModels.tsx

This file was deleted.

35 changes: 35 additions & 0 deletions packages/hub/src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { getServerSession } from "next-auth";
import { PropsWithChildren } from "react";

import { LockIcon } from "@quri/ui";

import { FullLayoutWithPadding } from "@/components/layout/FullLayoutWithPadding";
import { NarrowPageLayout } from "@/components/layout/NarrowPageLayout";
import { H1 } from "@/components/ui/Headers";

import { authOptions } from "../api/auth/[...nextauth]/authOptions";

export default async function AdminLayout({ children }: PropsWithChildren) {
const session = await getServerSession(authOptions);

const email = session?.user.email;

const { ROOT_EMAILS } = process.env;
if (!email || !ROOT_EMAILS?.includes(email)) {
return <NarrowPageLayout>Access denied.</NarrowPageLayout>;
}

return (
<div>
<div className="bg-red-200 p-4">
<H1>
<div className="flex gap-1 items-center">
<LockIcon />
<span>Admin console</span>
</div>
</H1>
</div>
<FullLayoutWithPadding>{children}</FullLayoutWithPadding>
</div>
);
}
37 changes: 7 additions & 30 deletions packages/hub/src/app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
import { Metadata } from "next";
import { getServerSession } from "next-auth";
import { FC } from "react";

import { FullLayoutWithPadding } from "@/components/layout/FullLayoutWithPadding";
import { NarrowPageLayout } from "@/components/layout/NarrowPageLayout";
import { loadPageQuery } from "@/relay/loadPageQuery";
import { StyledLink } from "@/components/ui/StyledLink";

import { authOptions } from "../api/auth/[...nextauth]/authOptions";
import { AdminPage } from "./AdminPage";

import QueryNode, {
AdminPageQuery,
} from "@/__generated__/AdminPageQuery.graphql";

const OuterAdminPageAuthenticated: FC = async () => {
const query = await loadPageQuery<AdminPageQuery>(QueryNode, {});
export default async function OuterAdminPage() {
// permissions are checked in ./layout.tsx

return (
<FullLayoutWithPadding>
<AdminPage query={query} />
</FullLayoutWithPadding>
<div className="flex flex-col gap-2">
<StyledLink href="/admin/search">Search</StyledLink>
<StyledLink href="/admin/upgrade-versions">Upgrade versions</StyledLink>
</div>
);
};

export default async function OuterAdminPage() {
const session = await getServerSession(authOptions);

const email = session?.user.email;

const { ROOT_EMAILS } = process.env;
if (!email || !ROOT_EMAILS?.includes(email)) {
return <NarrowPageLayout>Access denied.</NarrowPageLayout>;
}

return <OuterAdminPageAuthenticated />;
}

export const metadata: Metadata = {
Expand Down
Loading

3 comments on commit e61a435

@vercel
Copy link

@vercel vercel bot commented on e61a435 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e61a435 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e61a435 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.