Skip to content

Commit

Permalink
Merge branch 'master' into martinhaintz/fix-flutter-multiview
Browse files Browse the repository at this point in the history
* master: (121 commits)
  Bump API schema to 1ce35106 (#11467)
  Bump API schema to fe37a3fa (#11465)
  Bump API schema to e9717315 (#11464)
  fix(remix): Add verify step to manual guide (#11463)
  Bump API schema to ff5880ca (#11457)
  docs(cron): Add note about luxon timezones (#11451)
  Bump API schema to f0e51113 (#11454)
  Add User Feedback alerts to main Alerts docs page (#11446)
  fix: Bun import (#11450)
  Bump API schema to d8309de0 (#11447)
  Update Intro to Sentry page (#11443)
  fix(releases): Document `release:latest` filter behaviour (#11423)
  Bump API schema to d6663c91 (#11442)
  feat(js): Document dataloaderIntegration released with 8.31.0 (#11416)
  docs(go): Add custom instrumentation page for tracing (#11429)
  ref(onboarding): Update word (#11440)
  feat(nuxt): Update server setup docs (#11415)
  Update docs on running getsentry locally (#11428)
  Callout to add .env to .gitignore #11430
  fix(dart): beforeSend code snippet (#11197)
  ...
  • Loading branch information
mar-hai committed Oct 1, 2024
2 parents 4b69eae + e8c469e commit b7f5dc3
Show file tree
Hide file tree
Showing 263 changed files with 4,563 additions and 2,240 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
force:
description: Force a release even when there are release-blockers (optional)
required: false
schedule:
# This is when we release the self-hosted repo
- cron: "1 18 15 * *"
jobs:
release:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
--foreground-secondary: var(--gray-11);
--accent: var(--accent-purple);
--foreground: var(--gray-12);
--cursor-checkbox: pointer;
::selection {
background-color: var(--accent-a7);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry/nextjs": "8.20.0",
"@sentry/nextjs": "8.29.0",
"@spotlightjs/spotlight": "^2.1.1",
"next": "^15.0.0-canary.83",
"next-auth": "^4.24.5",
Expand Down
63 changes: 3 additions & 60 deletions apps/changelog/src/app/changelog/%5Fadmin/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import {Fragment, Suspense} from 'react';
import {Fragment, Suspense, useActionState} from 'react';
import Link from 'next/link';

import {prismaClient} from '@/server/prisma-client';
import {editChangelog} from '@/server/actions/changelog';
import {TitleSlug} from '@/client/components/titleSlug';
import {FileUpload} from '@/client/components/fileUpload';
import {Select} from '@/client/components/ui/Select';
import {ForwardRefEditor} from '@/client/components/forwardRefEditor';
import {Button} from '@/client/components/ui/Button';
import {EditChangelogForm} from '@/client/components/forms/editChangelogForm';

export default async function ChangelogCreatePage({params}: {params: {id: string}}) {
const categories = await prismaClient.category.findMany({
Expand Down Expand Up @@ -38,59 +33,7 @@ export default async function ChangelogCreatePage({params}: {params: {id: string

return (
<section className="overflow-x-auto col-start-3 col-span-8">
<form action={editChangelog} className="px-2 w-full">
<input type="hidden" name="id" value={changelog.id} />
<TitleSlug defaultSlug={changelog.slug} defaultTitle={changelog.title} />
<FileUpload defaultFile={changelog.image || ''} />
<div className="my-6">
<label htmlFor="summary" className="block text-xs font-medium text-gray-700">
Summary
<Fragment>
&nbsp;<span className="font-bold text-secondary">*</span>
</Fragment>
</label>
<textarea name="summary" className="w-full" required>
{changelog.summary}
</textarea>
<span className="text-xs text-gray-500 italic">
This will be shown in the list
</span>
</div>
<div>
<Select
name="categories"
className="mt-1 mb-6"
label="Category"
placeholder="Select Category"
defaultValue={changelog.categories.map(category => ({
label: category.name,
value: category.name,
}))}
options={categories.map(category => ({
label: category.name,
value: category.name,
}))}
isMulti
/>
</div>

<Suspense fallback={null}>
<ForwardRefEditor
name="content"
defaultValue={changelog.content || ''}
className="w-full"
/>
</Suspense>

<footer className="flex items-center justify-between mt-2 mb-8">
<Link href="/changelog/_admin" className="underline text-gray-500">
Return to Changelogs list
</Link>
<div>
<Button type="submit">Update</Button>
</div>
</footer>
</form>
<EditChangelogForm changelog={changelog} categories={categories} />
</section>
);
}
15 changes: 9 additions & 6 deletions apps/changelog/src/app/changelog/%5Fadmin/confirm.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
'use client';

import type {PropsWithChildren} from 'react';
import {ServerActionPayloadInterface} from '@/server/actions/serverActionPayload.interface';
import {useActionState, type PropsWithChildren} from 'react';

export default function Confirm({
action,
changelog,
children,
}: PropsWithChildren<{
action: (formData: FormData) => Promise<void | {
message: string;
}>;
action: (
currentFormState: ServerActionPayloadInterface,
formData: FormData
) => Promise<ServerActionPayloadInterface>;
changelog: {id: string};
}>) {
const [_state, formAction] = useActionState(action, {});
return (
<form
action={action}
action={formAction}
className="inline-block"
onSubmit={e => {
e.preventDefault();
// eslint-disable-next-line no-alert
if (confirm('Are you sure?')) {
action(new FormData(e.currentTarget));
formAction(new FormData(e.currentTarget));
}
}}
>
Expand Down
53 changes: 3 additions & 50 deletions apps/changelog/src/app/changelog/%5Fadmin/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import {Fragment} from 'react';
import Link from 'next/link';
import {prismaClient} from '@/server/prisma-client';
import {createChangelog} from '@/server/actions/changelog';
import {TitleSlug} from '@/client/components/titleSlug';
import {FileUpload} from '@/client/components/fileUpload';
import {Select} from '@/client/components/ui/Select';
import {ForwardRefEditor} from '@/client/components/forwardRefEditor';
import {Button} from '@/client/components/ui/Button';

import {getServerSession} from 'next-auth/next';
import {notFound} from 'next/navigation';
import {authOptions} from '@/server/authOptions';
import {CreateChangelogForm} from '@/client/components/forms/createChangelogForm';

export default async function ChangelogCreatePage() {
const session = await getServerSession(authOptions);
Expand All @@ -26,48 +20,7 @@ export default async function ChangelogCreatePage() {

return (
<section className="overflow-x-auto col-start-3 col-span-8">
<form action={createChangelog} className="px-2 w-full">
<TitleSlug />
<FileUpload />
<div className="my-6">
<label htmlFor="summary" className="block text-xs font-medium text-gray-700">
Summary
<Fragment>
&nbsp;<span className="font-bold text-secondary">*</span>
</Fragment>
</label>
<textarea name="summary" className="w-full" required />
<span className="text-xs text-gray-500 italic">
This will be shown in the list
</span>
</div>
<div>
<Select
name="categories"
className="mt-1 mb-6"
label="Category"
placeholder="Select Category"
options={categories.map(category => ({
label: category.name,
value: category.name,
}))}
isMulti
/>
</div>

<ForwardRefEditor name="content" className="w-full" />

<footer className="flex items-center justify-between mt-2">
<Link href="/changelog/_admin" className="underline text-gray-500">
Return to Changelogs list
</Link>
<div>
<Button type="submit">Create (not published yet)</Button>
<br />
<span className="text-xs text-gray-500 italic">You can publish it later</span>
</div>
</footer>
</form>
<CreateChangelogForm categories={categories} />
</section>
);
}
59 changes: 59 additions & 0 deletions apps/changelog/src/client/components/forms/createChangelogForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use client';

import {createChangelog} from '@/server/actions/changelog';
import {TitleSlug} from '@/client/components/titleSlug';
import {FileUpload} from '@/client/components/fileUpload';
import {Select} from '@/client/components/ui/Select';
import {ForwardRefEditor} from '@/client/components/forwardRefEditor';
import {Button} from '@/client/components/ui/Button';
import {Fragment, useActionState} from 'react';
import Link from 'next/link';
import {Category} from '@prisma/client';

export const CreateChangelogForm = ({categories}: {categories: Category[]}) => {
const [_state, formAction] = useActionState(createChangelog, {});
return (
<form action={formAction} className="px-2 w-full">
<TitleSlug />
<FileUpload />
<div className="my-6">
<label htmlFor="summary" className="block text-xs font-medium text-gray-700">
Summary
<Fragment>
&nbsp;<span className="font-bold text-secondary">*</span>
</Fragment>
</label>
<textarea name="summary" className="w-full" required />
<span className="text-xs text-gray-500 italic">
This will be shown in the list
</span>
</div>
<div>
<Select
name="categories"
className="mt-1 mb-6"
label="Category"
placeholder="Select Category"
options={categories.map(category => ({
label: category.name,
value: category.name,
}))}
isMulti
/>
</div>

<ForwardRefEditor name="content" className="w-full" />

<footer className="flex items-center justify-between mt-2">
<Link href="/changelog/_admin" className="underline text-gray-500">
Return to Changelogs list
</Link>
<div>
<Button type="submit">Create (not published yet)</Button>
<br />
<span className="text-xs text-gray-500 italic">You can publish it later</span>
</div>
</footer>
</form>
);
};
76 changes: 76 additions & 0 deletions apps/changelog/src/client/components/forms/editChangelogForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
'use client';

import {editChangelog} from '@/server/actions/changelog';
import {TitleSlug} from '@/client/components/titleSlug';
import {FileUpload} from '@/client/components/fileUpload';
import {Select} from '@/client/components/ui/Select';
import {ForwardRefEditor} from '@/client/components/forwardRefEditor';
import {Button} from '@/client/components/ui/Button';
import {Fragment, Suspense, useActionState} from 'react';
import {Changelog, Category} from '@prisma/client';
import Link from 'next/link';

export const EditChangelogForm = ({
changelog,
categories,
}: {
changelog: Changelog;
categories: Category[];
}) => {
const [_state, formAction] = useActionState(editChangelog, {});
return (
<form action={formAction} className="px-2 w-full">
<input type="hidden" name="id" value={changelog.id} />
<TitleSlug defaultSlug={changelog.slug} defaultTitle={changelog.title} />
<FileUpload defaultFile={changelog.image || ''} />
<div className="my-6">
<label htmlFor="summary" className="block text-xs font-medium text-gray-700">
Summary
<Fragment>
&nbsp;<span className="font-bold text-secondary">*</span>
</Fragment>
</label>
<textarea name="summary" className="w-full" required>
{changelog.summary}
</textarea>
<span className="text-xs text-gray-500 italic">
This will be shown in the list
</span>
</div>
<div>
<Select
name="categories"
className="mt-1 mb-6"
label="Category"
placeholder="Select Category"
defaultValue={categories.map(category => ({
label: category.name,
value: category.name,
}))}
options={categories.map(category => ({
label: category.name,
value: category.name,
}))}
isMulti
/>
</div>

<Suspense fallback={null}>
<ForwardRefEditor
name="content"
defaultValue={changelog.content || ''}
className="w-full"
/>
</Suspense>

<footer className="flex items-center justify-between mt-2 mb-8">
<Link href="/changelog/_admin" className="underline text-gray-500">
Return to Changelogs list
</Link>
<div>
<Button type="submit">Update</Button>
</div>
</footer>
</form>
);
};
32 changes: 2 additions & 30 deletions apps/changelog/src/client/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,38 +492,10 @@ const NAV_ITEMS: NavItemsProps[] = [
{
id: 'blog',
title: 'Blog',
type: 'button',
type: 'a',
to: 'https://blog.sentry.io',
variant: 'ghost',
className: '',
children: [
{
id: 'blogMenu',
title: '',
children: [
{
id: 'sentryBlog',
title: 'Sentry Blog',
to: 'https://blog.sentry.io/',
variant: 'ghost',
type: 'a',
},
{
id: 'enggBlog',
title: 'Engineering Blog',
to: 'https://sentry.engineering/',
variant: 'ghost',
type: 'a',
},
{
id: 'changelog',
title: 'Changelog',
to: 'https://sentry.io/changelog/',
variant: 'ghost',
type: 'a',
},
],
},
],
},
{
id: 'sandbox',
Expand Down
Loading

0 comments on commit b7f5dc3

Please sign in to comment.