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

feat: added attachment field #428

Merged
merged 1 commit into from
Sep 8, 2023
Merged
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended",
],
env: {
Expand Down
2 changes: 1 addition & 1 deletion assets/CcField.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/DatePicker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

152 changes: 149 additions & 3 deletions assets/new-request-form.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/shared.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21,697 changes: 12,644 additions & 9,053 deletions assets/vendor.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
"@zendeskgarden/react-datepickers": "8.69.9",
"@zendeskgarden/react-dropdowns.next": "8.69.9",
"@zendeskgarden/react-forms": "8.69.9",
"@zendeskgarden/react-loaders": "8.69.9",
"@zendeskgarden/react-notifications": "8.69.9",
"@zendeskgarden/react-tags": "8.69.9",
"@zendeskgarden/react-theming": "8.69.9",
"@zendeskgarden/react-tooltips": "8.69.9",
"dompurify": "3.0.5",
"eslint-plugin-check-file": "^2.6.2",
"node-fetch": "2.6.9",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^14.2.3",
"react-is": "^17.0.2",
"styled-components": "^5.3.11"
},
Expand Down Expand Up @@ -59,6 +62,7 @@
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "8.0.2",
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
Expand Down
3 changes: 3 additions & 0 deletions src/modules/new-request-form/NewRequestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Alert } from "@zendeskgarden/react-notifications";
import { useSubmitHandler } from "./useSubmitHandler";
import { Suspense, lazy, useState } from "react";
import { usePrefilledTicketFields } from "./usePrefilledTicketFields";
import { Attachments } from "./fields/attachments/Attachments";

export interface NewRequestFormProps {
ticketForms: TicketForm[];
Expand Down Expand Up @@ -130,6 +131,8 @@ export function NewRequestForm({
</Suspense>
)
);
case "attachments":
return <Attachments field={field} />;
default:
return <></>;
}
Expand Down
7 changes: 7 additions & 0 deletions src/modules/new-request-form/data-types/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ export interface Field {
type: string;
id: string;
options: FieldOption[];
attachments?: Attachment[];
}

export interface FieldOption {
name: string;
value: string;
}

export interface Attachment {
id: string;
file_name: string;
url: string;
}
Loading