This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Component: Form with creating, reading, updating, and deleting states | |
// Date: 2023-02-04 | |
// Version: SaasRock v0.8.2 | |
import { useTransition, useSubmit, Form, useSearchParams } from "@remix-run/react"; | |
import { t } from "i18next"; | |
import { useEffect, useRef, useState } from "react"; | |
import ButtonPrimary from "~/components/ui/buttons/ButtonPrimary"; | |
import ButtonSecondary from "~/components/ui/buttons/ButtonSecondary"; | |
import InputGroup from "~/components/ui/forms/InputGroup"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Route View (Client component): Table with rows and quick row overview | |
// Date: 2023-02-04 | |
// Version: SaasRock v0.8.2 | |
import { useLoaderData, useActionData, useSearchParams, Link, useNavigate } from "@remix-run/react"; | |
import { useState, useEffect } from "react"; | |
import { useTranslation } from "react-i18next"; | |
import ButtonPrimary from "~/components/ui/buttons/ButtonPrimary"; | |
import ExternalLinkEmptyIcon from "~/components/ui/icons/ExternalLinkEmptyIcon"; | |
import IndexPageLayout from "~/components/ui/layouts/IndexPageLayout"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clsx from "clsx"; | |
import { Fragment } from "react"; | |
import { DocumentTypeDto } from "~/modules/codeGeneratorTests/document-types/dtos/DocumentTypeDto"; | |
import { DocumentDto } from "~/modules/codeGeneratorTests/documents/dtos/DocumentDto"; | |
import DateUtils from "~/utils/shared/DateUtils"; | |
import DocumentTypeHelper from "../helpers/DocumentTypeHelper"; | |
interface Props { | |
year: number; | |
types: DocumentTypeDto[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Tesseract from "tesseract.js"; | |
import PdfService from "./PdfService"; | |
export const OcrTesseractLanguages = [ | |
{ name: "English", value: "eng" }, | |
{ name: "Spanish", value: "spa" }, | |
]; | |
async function scan(file: string, lang: string): Promise<string> { | |
return await new Promise(async (resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function convertToImages({ file }: { file: string }): Promise<{ name: string; base64: string; path: string }[]> { | |
return new Promise(async (resolve, reject) => { | |
await fetch("https://tools.saasrock.com/api/pdf-to-image?file=" + file) | |
.then(async (response) => { | |
const jsonBody = await response.json(); | |
const images = jsonBody.images as { name: string; base64: string; path: string }[]; | |
resolve(images); | |
}) | |
.catch((e) => { | |
reject(e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"entities": [ | |
{ | |
"type": "admin", | |
"name": "documentType", | |
"slug": "document-types", | |
"title": "Document Type", | |
"titlePlural": "Document Types", | |
"prefix": "DTY", | |
"properties": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Fragment } from "react"; | |
import { DocumentDto } from "../dtos/DocumentDto"; | |
import { DocumentTypeDto } from "../dtos/DocumentTypeDto"; | |
interface Props { | |
year: number; | |
types: DocumentTypeDto[]; | |
documents: DocumentDto[]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from "react"; | |
import { useTranslation } from "react-i18next"; | |
import { Colors } from "~/application/enums/shared/Colors"; | |
import ButtonTertiary from "~/components/ui/buttons/ButtonTertiary"; | |
import InputSelector from "~/components/ui/input/InputSelector"; | |
import CollapsibleRow from "~/components/ui/tables/CollapsibleRow"; | |
import { useAppData } from "~/utils/data/useAppData"; | |
import { TenantUserWithDetails } from "~/utils/db/tenants.db.server"; | |
import { SignerDto } from "../dtos/SignerDto"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Colors } from "~/application/enums/shared/Colors"; | |
import SimpleBadge from "~/components/ui/badges/SimpleBadge"; | |
import { SignerDto } from "../dtos/SignerDto"; | |
export default function ContractSignersList({ items }: { items?: SignerDto[] }) { | |
function sortedItems() { | |
return ( | |
items?.sort((a, b) => { | |
if (a.role === "signer" && b.role === "viewer") { | |
return -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from "fs"; | |
var hellosign = require("hellosign-sdk")({ key: process.env.DROPBOX_SIGN_API_KEY }); | |
export type DropboxSignatureRequestDto = { | |
signature_request_id: string; | |
test_mode: boolean; | |
title: string; | |
original_title: string; | |
subject: string; | |
message: string; |