diff --git a/README.md b/README.md index b8325d0..b0f3f8e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@

Embloy Genius

- This repository contains the code for the web application of Embloy Genius. In the future it will be available online at: [https://genius.embloy.com](https://genius.embloy.com) ## License diff --git a/app/analytics/page.js b/app/analytics/page.js index 5142904..a11d8c3 100644 --- a/app/analytics/page.js +++ b/app/analytics/page.js @@ -1,18 +1,20 @@ "use client"; -import React from "react"; +import React, { useEffect } from "react"; +import { useRouter } from "next/navigation"; +import { EmbloyPageMount, EmbloyPage, EmbloyPageBody } from "@/app/components/ui/misc/page"; -import { EmbloyPageMount, EmbloyPage, EmbloyPageBody, EmbloyPageBodySection, EmbloySubPage } from "@/app/components/ui/misc/page"; +export default function Analytics() { + const router = useRouter(); -export default function Analytics() { return ( + useEffect(() => { + router.back(); + }, [router]); + + return ( - - - + - - - ); } diff --git a/app/components/dom/bottom/footerbar.js b/app/components/dom/bottom/footerbar.js index f7470f8..0e29d33 100644 --- a/app/components/dom/bottom/footerbar.js +++ b/app/components/dom/bottom/footerbar.js @@ -17,14 +17,14 @@ const Footerbar = () => { } - let user = useContext(UserContext) + let {user, company, subscription} = useContext(UserContext) let store = useContext(StoreContext) return ( <>
+ className="z-20 w-full h-14 border-t-[1px] border-etna dark:border-ischia flex flex-row items-center justify-center bg-body">
diff --git a/app/components/dom/main/datatable/DataTableColumnHeader.tsx b/app/components/dom/main/datatable/DataTableColumnHeader.tsx index 9aa1087..0e715ad 100644 --- a/app/components/dom/main/datatable/DataTableColumnHeader.tsx +++ b/app/components/dom/main/datatable/DataTableColumnHeader.tsx @@ -35,7 +35,7 @@ export function DataTableColumnHeader({
- + -
+
Page {table.getState().pagination.pageIndex + 1} of{" "} {table.getPageCount()} +
-
-
) @@ -164,14 +164,14 @@ export function DataTablePagination({
- Rows per page + Rows/page + } + + + {children} + +
+
+
+
+ +
+
+
+
+ {dropdown && ( +
+ + + + + + + + + + +
+ )} +
+
+
+ + + + + + +
+ {shareDropdownOpen && !dummy && ( +
+ {hasOptions && } + {optionsOpen && formats?.length === 0 && ( + + + {localOptions.map((opt, optIndex) => ( + + { + if (e.target.value?.trim() !== "") { + handleOptionChange(optIndex, e.target.value) + }} + } + className="text-black bg-palatinio dark:bg-transparent dark:text-white border border-etna dark:border-amarone w-full rounded-md text-xs pl-1.5" + /> + + + ))} + + + + )} + {optionsOpen && formats?.length > 0 && ( + + + + + + + + + )} + + + + + {tag} + +
+ )} +
+ + ); + } +} + +const fileFormats = { + text: ["pdf", "doc", "docx", "txt", "rtf", "odt", "xml"], + image: ["jpg", "jpeg", "png", "gif", "bmp", "tiff", "tif", "svg"], + video: ["mp4", "avi", "mov", "wmv", "flv", "mkv", "webm"], + audio: ["ogg", "mp3", "wav", "wma", "aac", "m4a"], + compressed: ["zip", "rar", "tar", "7z", "gz", "bz2"], + spreadsheet: ["xls", "xlsx", "ods"], + presentation: ["ppt", "pptx"], +}; +const allFormats = Object.values(fileFormats).flat(); + +export function AnswerPreview({data, handleDataReload, editable=false, onChange}) { + console.log("Data", data); + const [locData, setLocData] = useState<{ application_answers: any[] } | any>({ application_answers: [] }); + const [original, setOriginal] = useState(data) + useEffect(() => { + if ( + data && + Object.keys(locData)?.length === 1 && + locData.application_answers?.length === 0 + ) { + let bin = data; + bin.application_answers.sort((a, b) => a.application_option_id - b.application_option_id); + setLocData(bin); + setOriginal(bin); + } else { + + } + }, []); + return ( + + {((original.application_answers === undefined || original.application_answers === null)) ? ( + No Answers provided + ) : ( + + {locData.application_answers.map((option, index) => { + return ( + <> + {JSON.stringify(option, null, 2)} + { }} + options={option.options} + hasOptions={option.question_type === "single_choice" || option.question_type === "multiple_choice" || option.question_type === "file"} + formats={option.question_type === "file" ? allFormats : []} + defaultOptions={option.options?.length === 0 ? false : true} + tag={option.question_type?.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")} + > + {(() => { + switch (option.question_type) { + case "link": + return ( +
+ +
+ ); + case "short_text": + return ( +
+ + {}} + /> +
+ ); + case "long_text": + + return ( +
+