MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / Preferences

Function Preferences

apps/OpenSign/src/pages/Preferences.jsx:29–691  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27import { useDispatch, useSelector } from "react-redux";
28
29const Preferences = () => {
30 const appName =
31 "OpenSign™";
32 const { t } = useTranslation();
33 const dispatch = useDispatch();
34 const { isLoader, isTopLoader, alertInfo } = useSelector(
35 (state) => state.user
36 );
37 const [signatureType, setSignatureType] = useState([]);
38 const [errMsg, setErrMsg] = useState("");
39 const [isNotifyOnSignatures, setIsNotifyOnSignatures] = useState();
40 const [timezone, setTimezone] = useState(usertimezone);
41 const [activeTab, setactiveTab] = useState(0);
42 const generaltab = {
43 name: "general",
44 title: t("general"),
45 icon: "fa-light fa-gears"
46 };
47 const [tab, setTab] = useState([generaltab]);
48 const [sendinOrder, setSendinOrder] = useState(true);
49 const [isTourEnabled, setIsTourEnabled] = useState(false);
50 const [dateFormat, setDateFormat] = useState("MM/DD/YYYY");
51 const [is12HourTime, setIs12HourTime] = useState(false);
52 const [isLTVEnabled, setIsLTVEnabled] = useState(false);
53 const [fileNameFormat, setFileNameFormat] = useState("DOCNAME");
54 const [useNameAsSender, setUseNameAsSender] = useState(false);
55
56 useEffect(() => {
57 fetchSignType();
58 // eslint-disable-next-line react-hooks/exhaustive-deps
59 }, []);
60
61 const showAlert = (type, msg) => {
62 dispatch(setAlertInfo({ type, msg }));
63 setTimeout(() => {
64 dispatch(setAlertInfo({ type: "success", msg: "" }));
65 }, 2000);
66 };
67
68 const fetchSignType = withSessionValidation(async () => {
69 dispatch(setTopLoader(true));
70 const EmailTab = [
71 { name: "email", title: t("email"), icon: "fa-light fa-envelope" }
72 ];
73
74 const arr = [
75 generaltab,
76 { name: "widgets", title: t("widgets"), icon: "fa-light fa-list" },
77 ...EmailTab,
78 ];
79 setTab(arr);
80 try {
81 const user = JSON.parse(
82 localStorage.getItem(
83 `Parse/${localStorage.getItem("parseAppId")}/currentUser`
84 )
85 );
86 const tenantDetails = await getTenantDetails(user?.objectId);

Callers

nothing calls this directly

Calls 7

withSessionValidationFunction · 0.90
getTenantDetailsFunction · 0.90
handleSignatureTypeFunction · 0.90
tabNameFunction · 0.85
showAlertFunction · 0.70
handleCheckboxChangeFunction · 0.70
handleNotifySignChangeFunction · 0.70

Tested by

no test coverage detected