-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into martinhaintz/fix-flutter-multiview
* 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
Showing
263 changed files
with
4,563 additions
and
2,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
apps/changelog/src/client/components/forms/createChangelogForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
<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
76
apps/changelog/src/client/components/forms/editChangelogForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
<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> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.