Skip to content
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

Feature/widget preview resource overview - gedeeltelijk werkend #107

Merged
merged 19 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fde81d3
Rendering of preview working, now to couple the settings to the preview
LorenzoJokhan Dec 20, 2023
6456e7e
Made helper jsx funtion to create simple YesNoSelects that is reusabl…
LorenzoJokhan Dec 20, 2023
707df35
Removed unlogical options
LorenzoJokhan Dec 21, 2023
204960b
Made YesNoSelect No longer dependant
LorenzoJokhan Dec 21, 2023
0df1516
added sort
LorenzoJokhan Dec 21, 2023
4b03686
Add safety check to filters
LorenzoJokhan Dec 21, 2023
86327c1
Merge branch 'main' into feature/widget-preview-resource-overview
LorenzoJokhan Dec 21, 2023
40f622b
Removed redundant choices and made display more configurable
LorenzoJokhan Dec 21, 2023
6896fbb
Sorting definitions are now fully managed on the admin side, for bett…
LorenzoJokhan Dec 22, 2023
7990a1d
Reduced amount of code by a lot
LorenzoJokhan Dec 22, 2023
438d237
Tag filters are now managed by group
LorenzoJokhan Dec 22, 2023
4944fa2
Added a way to fully define the tagfiltering on the admin panel side
LorenzoJokhan Dec 22, 2023
b622809
Cleanup
LorenzoJokhan Dec 22, 2023
7c40196
Merge branch 'main' into feature/widget-preview-resource-overview
LorenzoJokhan Jan 2, 2024
9aa7faf
Removed unused field
LorenzoJokhan Jan 2, 2024
cd17382
Removing and adding taggroups in admin also supports preview
LorenzoJokhan Jan 2, 2024
3e22a8c
Placeholder changes for taggroups now get reflected in preview
LorenzoJokhan Jan 2, 2024
776946f
Replaced tagGroups name with implicit field.name
LorenzoJokhan Jan 2, 2024
3143b3d
Removed extra input for summary length, moved it to display
LorenzoJokhan Jan 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/admin-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"http-proxy-middleware": "^2.0.6",
"leaflet": "^1.9.4",
"leaflet-draw": "^1.0.4",
"lodash": "^4.17.21",
"lucide-react": "^0.276.0",
"next": "^13.4.17",
"next-auth": "^4.23.1",
Expand All @@ -57,6 +58,7 @@
"@types/cron": "^2.4.0",
"@types/leaflet": "^1.9.6",
"@types/leaflet-draw": "^1.0.9",
"@types/lodash": "^4.14.202",
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-csv": "^1.1.8",
Expand Down
42 changes: 42 additions & 0 deletions apps/admin-server/src/lib/form-widget-helpers/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ControllerRenderProps } from 'react-hook-form';
import {
FormControl,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/form';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
import { Input } from '@openstad/ui/src';

// Simple yes/no selector that uses a props.onFieldchanged method to emit changes
export function YesNoSelect(
field: ControllerRenderProps<any, any>,
props: { onFieldChanged?: (key: string, value: any) => void }
) {
return (
<Select
onValueChange={(e: string) => {
if (props.onFieldChanged) {
props.onFieldChanged(field.name, e === 'true');
}
field.onChange(e === 'true');
}}
value={field.value ? 'true' : 'false'}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Ja" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="true">Ja</SelectItem>
<SelectItem value="false">Nee</SelectItem>
</SelectContent>
</Select>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import * as z from 'zod';
import { CommentsWidgetProps } from '@openstad/comments/src/comments';
import { EditFieldProps } from '@/lib/EditFieldProps';
import { EditFieldProps } from '@/lib/form-widget-helpers/EditFieldProps';
import { useFieldDebounce } from '@/hooks/useFieldDebounce';

const formSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Heading } from '@/components/ui/typography';
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import * as z from 'zod';
import { EditFieldProps } from '@/lib/EditFieldProps';
import { EditFieldProps } from '@/lib/form-widget-helpers/EditFieldProps';
import { CommentsWidgetProps } from '@openstad/comments/src/comments';

const formSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Input } from '@/components/ui/input';
import { Separator } from '@/components/ui/separator';
import { Heading } from '@/components/ui/typography';
import { useFieldDebounce } from '@/hooks/useFieldDebounce';
import { EditFieldProps } from '@/lib/EditFieldProps';
import { EditFieldProps } from '@/lib/form-widget-helpers/EditFieldProps';
import { zodResolver } from '@hookform/resolvers/zod';
import { CommentsWidgetProps } from '@openstad/comments/src/comments';
import { useForm } from 'react-hook-form';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import * as z from 'zod';
import { Heading } from '@/components/ui/typography';
import { Separator } from '@/components/ui/separator';
import { LikeProps } from '@openstad/likes/src/likes';
import { EditFieldProps } from '@/lib/EditFieldProps';
import { EditFieldProps } from '@/lib/form-widget-helpers/EditFieldProps';
import { useFieldDebounce } from '@/hooks/useFieldDebounce';

const formSchema = z.object({
Expand Down
Loading