-
Notifications
You must be signed in to change notification settings - Fork 1
Erikhoff00/web 129 add a flag to events to hide them from the events overview 2 #2144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aTrueYety
wants to merge
12
commits into
master
Choose a base branch
from
erikhoff00/web-129-add-a-flag-to-events-to-hide-them-from-the-events-overview-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
55e99bd
Setup event status types and translations
e8640f1
Add event status to event dto
db6cef4
Setup event status in event schema
a131acb
Add event status field to event form
c7916b7
Fix event creation bug in legacy component page
42f96ae
remove harcoded string
706e589
Refactor event status options to conditionally include available stat…
a6a8517
Add translations for event status information modal; Add function to …
3d6601f
Add a close key to translations
30871d0
Add event status help modal and description to status options
599e631
feat: add new page for weekly opening times
BragonSB 22eccc8
Revert "feat: add new page for weekly opening times"
BragonSB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
56 changes: 40 additions & 16 deletions
56
frontend/src/PagesAdmin/EventCreatorAdminPage/steps/SummaryStep.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -1,27 +1,51 @@ | ||
| import type { UseFormReturn } from 'react-hook-form'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '~/Components'; | ||
| import { Dropdown, FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '~/Components'; | ||
| import type { DropdownOption } from '~/Components/Dropdown/Dropdown'; | ||
| import { KEY } from '~/i18n/constants'; | ||
| import type { EventStatus } from '~/types'; | ||
| import styles from '../EventCreatorAdminPage.module.scss'; | ||
| import type { FormType } from '../hooks/useEventCreatorForm'; | ||
|
|
||
| export function SummaryStep({ form }: { form: UseFormReturn<FormType> }) { | ||
| type Props = { | ||
| form: UseFormReturn<FormType>; | ||
| eventStatusOptions: DropdownOption<EventStatus>[]; | ||
| }; | ||
|
|
||
| export function SummaryStep({ form, eventStatusOptions }: Props) { | ||
| const { t } = useTranslation(); | ||
|
|
||
| return ( | ||
| <FormField | ||
| control={form.control} | ||
| name="visibility_from_dt" | ||
| key="visibility_from_dt" | ||
| render={({ field }) => ( | ||
| <FormItem className={styles.form_item}> | ||
| <FormLabel>{t(KEY.saksdokumentpage_publication_date) ?? ''}</FormLabel> | ||
| <FormControl> | ||
| <Input type="datetime-local" {...field} /> | ||
| </FormControl> | ||
| <FormMessage /> | ||
| </FormItem> | ||
| )} | ||
| /> | ||
| <div className={styles.input_row}> | ||
| <FormField | ||
| control={form.control} | ||
| name="visibility_from_dt" | ||
| key="visibility_from_dt" | ||
| render={({ field }) => ( | ||
| <FormItem className={styles.form_item}> | ||
| <FormLabel>{t(KEY.saksdokumentpage_publication_date) ?? ''}</FormLabel> | ||
| <FormControl> | ||
| <Input type="datetime-local" {...field} /> | ||
| </FormControl> | ||
| <FormMessage /> | ||
| </FormItem> | ||
| )} | ||
| /> | ||
|
|
||
| <FormField | ||
| control={form.control} | ||
| name="status" | ||
| key="status" | ||
| render={({ field }) => ( | ||
| <FormItem className={styles.form_item}> | ||
| <FormLabel>{t(KEY.event_status)}</FormLabel> | ||
| <FormControl> | ||
| <Dropdown options={eventStatusOptions} nullOption={{ label: t(KEY.common_choose) }} {...field} /> | ||
| </FormControl> | ||
| <FormMessage /> | ||
| </FormItem> | ||
| )} | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.