Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions src/app/dashboard/events/[id]/participants/table/mocked-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const mockedAttributes: Attribute[] = [
type: "text",
createdAt: "2025-02-20T08:30:00Z",
updatedAt: "2025-02-20T08:30:00Z",
allowOther: false,
},
{
id: 2,
Expand All @@ -25,6 +26,7 @@ export const mockedAttributes: Attribute[] = [
type: "text",
createdAt: "2025-02-20T08:30:00Z",
updatedAt: "2025-02-20T08:30:00Z",
allowOther: false,
},
{
id: 3,
Expand All @@ -37,6 +39,7 @@ export const mockedAttributes: Attribute[] = [
type: "number",
createdAt: "2025-02-20T08:30:00Z",
updatedAt: "2025-02-20T08:30:00Z",
allowOther: false,
},
{
id: 4,
Expand All @@ -49,6 +52,7 @@ export const mockedAttributes: Attribute[] = [
type: "select",
createdAt: "2025-02-20T08:30:00Z",
updatedAt: "2025-02-20T08:30:00Z",
allowOther: false,
},
{
id: 5,
Expand All @@ -69,6 +73,7 @@ export const mockedAttributes: Attribute[] = [
type: "select",
createdAt: "2025-02-20T08:30:00Z",
updatedAt: "2025-02-20T08:30:00Z",
allowOther: false,
},
{
id: 6,
Expand All @@ -81,6 +86,7 @@ export const mockedAttributes: Attribute[] = [
type: "checkbox",
createdAt: "2025-02-20T08:31:00Z",
updatedAt: "2025-02-20T08:31:00Z",
allowOther: false,
},
{
id: 7,
Expand All @@ -93,6 +99,7 @@ export const mockedAttributes: Attribute[] = [
type: "select",
createdAt: "2025-02-20T08:32:00Z",
updatedAt: "2025-02-20T08:32:00Z",
allowOther: false,
},
{
id: 8,
Expand All @@ -105,6 +112,7 @@ export const mockedAttributes: Attribute[] = [
type: "date",
createdAt: "2025-02-20T08:33:00Z",
updatedAt: "2025-02-20T08:33:00Z",
allowOther: false,
},
{
id: 9,
Expand All @@ -117,6 +125,7 @@ export const mockedAttributes: Attribute[] = [
type: "text",
createdAt: "2025-02-20T08:34:00Z",
updatedAt: "2025-02-20T08:34:00Z",
allowOther: false,
},
{
id: 10,
Expand All @@ -129,6 +138,7 @@ export const mockedAttributes: Attribute[] = [
type: "tel",
createdAt: "2025-02-20T08:35:00Z",
updatedAt: "2025-02-20T08:35:00Z",
allowOther: false,
},
{
id: 11,
Expand All @@ -141,6 +151,7 @@ export const mockedAttributes: Attribute[] = [
type: "text",
createdAt: "2025-02-20T08:36:00Z",
updatedAt: "2025-02-20T08:36:00Z",
allowOther: false,
},
{
id: 12,
Expand All @@ -159,6 +170,7 @@ export const mockedAttributes: Attribute[] = [
type: "select",
createdAt: "2025-02-20T08:37:00Z",
updatedAt: "2025-02-20T08:37:00Z",
allowOther: false,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export const selectCaseData: TestCaseData = {
type: "select",
createdAt: "2025-07-01T10:05:00Z",
updatedAt: "2025-07-01T10:05:00Z",
allowOther: false,
},
],
attributeType: "select",
Expand Down Expand Up @@ -240,6 +241,7 @@ export const emailCaseData: TestCaseData = {
type: "email",
createdAt: "2025-07-01T10:06:00Z",
updatedAt: "2025-07-01T10:06:00Z",
allowOther: false,
},
],
attributeType: "email",
Expand Down Expand Up @@ -306,6 +308,7 @@ export const textareaCaseData: TestCaseData = {
type: "textarea",
createdAt: "2025-07-01T10:07:00Z",
updatedAt: "2025-07-01T10:07:00Z",
allowOther: false,
},
],
attributeType: "textarea",
Expand Down Expand Up @@ -372,6 +375,7 @@ export const multiselectCaseData: TestCaseData = {
type: "multiselect",
createdAt: "2025-07-01T10:09:00Z",
updatedAt: "2025-07-01T10:09:00Z",
allowOther: false,
},
],
attributeType: "multiselect",
Expand Down Expand Up @@ -438,6 +442,7 @@ export const colorCaseData: TestCaseData = {
type: "color",
createdAt: "2025-07-01T10:13:00Z",
updatedAt: "2025-07-01T10:13:00Z",
allowOther: false,
},
],
attributeType: "color",
Expand Down Expand Up @@ -504,6 +509,7 @@ export const numberCaseData: TestCaseData = {
type: "number",
createdAt: "2025-07-01T10:00:00Z",
updatedAt: "2025-07-01T10:00:00Z",
allowOther: false,
},
],
attributeType: "number",
Expand Down Expand Up @@ -570,6 +576,7 @@ export const telCaseData: TestCaseData = {
type: "tel",
createdAt: "2025-07-01T10:12:00Z",
updatedAt: "2025-07-01T10:12:00Z",
allowOther: false,
},
],
attributeType: "tel",
Expand Down Expand Up @@ -636,6 +643,7 @@ export const checkboxCaseData: TestCaseData = {
type: "checkbox",
createdAt: "2025-07-01T10:01:00Z",
updatedAt: "2025-07-01T10:01:00Z",
allowOther: false,
},
],
attributeType: "checkbox",
Expand Down Expand Up @@ -702,6 +710,7 @@ export const timeCaseData: TestCaseData = {
type: "time",
createdAt: "2025-07-01T10:02:00Z",
updatedAt: "2025-07-01T10:02:00Z",
allowOther: false,
},
],
attributeType: "time",
Expand Down Expand Up @@ -768,6 +777,7 @@ export const dateCaseData: TestCaseData = {
type: "date",
createdAt: "2025-07-01T10:11:00Z",
updatedAt: "2025-07-01T10:11:00Z",
allowOther: false,
},
],
attributeType: "date",
Expand Down Expand Up @@ -834,6 +844,7 @@ export const datetimeCaseData: TestCaseData = {
type: "datetime",
createdAt: "2025-07-01T10:04:00Z",
updatedAt: "2025-07-01T10:04:00Z",
allowOther: false,
},
],
attributeType: "datetime",
Expand Down Expand Up @@ -917,6 +928,7 @@ export const selectAndMultiselectTestCaseData: TestCaseData = {
type: "select",
createdAt: "2025-07-01T10:05:00Z",
updatedAt: "2025-07-01T10:05:00Z",
allowOther: false,
},
{
id: 10,
Expand All @@ -929,6 +941,7 @@ export const selectAndMultiselectTestCaseData: TestCaseData = {
type: "multiselect",
createdAt: "2025-07-01T10:09:00Z",
updatedAt: "2025-07-01T10:09:00Z",
allowOther: false,
},
],
};
Expand Down Expand Up @@ -963,6 +976,7 @@ export const editParticipantTestCaseData: TestCaseData = {
type: "number",
createdAt: "2025-07-01T10:05:00Z",
updatedAt: "2025-07-01T10:05:00Z",
allowOther: false,
},
{
id: 10,
Expand All @@ -975,6 +989,7 @@ export const editParticipantTestCaseData: TestCaseData = {
type: "text",
createdAt: "2025-07-01T10:09:00Z",
updatedAt: "2025-07-01T10:09:00Z",
allowOther: false,
},
],
};
Expand Down
2 changes: 2 additions & 0 deletions src/app/dashboard/events/[id]/settings/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export async function updateEvent(
: undefined,
isSensitiveData: change.data.isSensitiveData,
reason: change.data.reason,
allowOther: change.data.allowOther,
}),
},
);
Expand Down Expand Up @@ -315,6 +316,7 @@ export async function updateEvent(
: undefined,
isSensitiveData: change.data.isSensitiveData,
reason: change.data.reason,
allowOther: change.data.allowOther,
}),
},
);
Expand Down
1 change: 1 addition & 0 deletions src/app/dashboard/events/[id]/settings/change-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type AttributeChangeData = Pick<
| "order"
| "isSensitiveData"
| "reason"
| "allowOther"
> & { id?: number };

export interface AttributeChange {
Expand Down
1 change: 1 addition & 0 deletions src/app/dashboard/events/[id]/settings/settings-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export function EventSettingsTabs({
isSensitiveData: attribute.isSensitiveData,
reason: attribute.reason ?? "",
order: attribute.order ?? 0,
allowOther: attribute.allowOther,
})),
},
});
Expand Down
2 changes: 2 additions & 0 deletions src/app/dashboard/events/[id]/settings/tabs/attributes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type AttributeFormData = Pick<
| "order"
| "isSensitiveData"
| "reason"
| "allowOther"
> & { id?: number };

const toChangeData = (
Expand All @@ -32,6 +33,7 @@ const toChangeData = (
reason: attribute.isSensitiveData
? (attribute.reason ?? original?.reason ?? null)
: null,
allowOther: attribute.allowOther,
});

export function Attributes({ attributes, setAttributesChanges }: TabProps) {
Expand Down
Loading
Loading