Merge pull request #339 from OpenSignLabs/staging

fix: remove logo from certificate for white labeled user
This commit is contained in:
prafull-opensignlabs
2025-02-21 12:40:33 +00:00
parent 369deb6e26
commit d85ed954f1
8 changed files with 52 additions and 44 deletions
+4 -5
View File
@@ -58,7 +58,7 @@
"reactour": "^1.19.4",
"redux": "^5.0.1",
"redux-thunk": "^3.1.0",
"regex-parser": "^2.3.1",
"regex-parser": "^2.3.0",
"serve": "^14.2.4",
"styled-components": "^5.3.0",
"web-vitals": "^4.2.4",
@@ -24085,10 +24085,9 @@
}
},
"node_modules/regex-parser": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.3.1.tgz",
"integrity": "sha512-yXLRqatcCuKtVHsWrNg0JL3l1zGfdXeEvDa0bdu4tCDQw0RpMDZsqbkyRTUnKMR0tXF627V2oEWjBEaEdqTwtQ==",
"license": "MIT"
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.3.0.tgz",
"integrity": "sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg=="
},
"node_modules/regexp.prototype.flags": {
"version": "1.5.4",
+1 -1
View File
@@ -53,7 +53,7 @@
"reactour": "^1.19.4",
"redux": "^5.0.1",
"redux-thunk": "^3.1.0",
"regex-parser": "^2.3.1",
"regex-parser": "^2.3.0",
"serve": "^14.2.4",
"styled-components": "^5.3.0",
"web-vitals": "^4.2.4",
+13 -5
View File
@@ -65,7 +65,11 @@ function GuestLogin() {
const handleServerUrl = async () => {
setAppLogo(logo);
localStorage.clear();
localStorage.clear(); // Clears everything
localStorage.setItem(
"appname",
"OpenSign™"
);
//save isGuestSigner true in local to handle login flow header in mobile view
localStorage.setItem("isGuestSigner", true);
saveLanguageInLocal(i18n);
@@ -220,11 +224,15 @@ function GuestLogin() {
{isLoading.isLoad ? (
<LoaderWithMsg isLoading={isLoading} />
) : (
<div className="p-14 h">
<div className="m-1 md:m-2 p-[30px] text-base-content bg-base-100 op-card shadow-md">
<div className="md:w-[250px] md:h-[66px] inline-block overflow-hidden mt-2 mb-11">
<div className="pb-1 md:pb-4 pt-10 md:px-10 lg:px-16">
<div className="md:p-4 lg:p-10 p-4 text-base-content bg-base-100 op-card shadow-md">
<div className="w-[250px] h-[66px] inline-block overflow-hidden mb-6">
{appLogo && (
<img src={appLogo} className="object-contain" alt="logo" />
<img
src={appLogo}
className="object-contain h-full"
alt="logo"
/>
)}
</div>
{contactId ? (
+12 -13
View File
@@ -65,19 +65,18 @@ function DownloadPdfZip(props) {
throw new Error(`Failed to fetch certificate PDF: ${certificateUrl}`);
}
const pdf2Blob = await pdf2Response.blob();
// Add files to ZIP
zip.file(
`${sanitizeFileName(pdfName)}_signed_by_${appName}.pdf`,
pdf1Blob
);
zip.file(`Certificate_signed_by_${appName}.pdf`, pdf2Blob);
// Generate the ZIP and trigger download
const zipBlob = await zip.generateAsync({ type: "blob" });
saveAs(
zipBlob,
`${sanitizeFileName(pdfName)}_signed_by_${appName}.zip`
);
// Add files to ZIP
zip.file(
`${sanitizeFileName(pdfName)}_signed_by_${appName}.pdf`,
pdf1Blob
);
zip.file(`Certificate_signed_by_${appName}.pdf`, pdf2Blob);
// Generate the ZIP and trigger download
const zipBlob = await zip.generateAsync({ type: "blob" });
saveAs(
zipBlob,
`${sanitizeFileName(pdfName)}_signed_by_${appName}.zip`
);
setSelectType(1);
props.setIsDownloadModal(false);
setIsDownloading("");
+2 -1
View File
@@ -5,7 +5,8 @@ import { PDFDocument } from 'pdf-lib';
dotenv.config();
export const cloudServerUrl = 'http://localhost:8080/app';
export const appName = process.env.APP_NAME || 'OpenSign™';
export const appName =
'OpenSign™';
export function customAPIurl() {
const url = new URL(cloudServerUrl);
return url.pathname === '/api/app' ? url.origin + '/api' : url.origin;
@@ -1,7 +1,9 @@
import { PDFDocument, StandardFonts, rgb } from 'pdf-lib';
import { PDFDocument, rgb } from 'pdf-lib';
import fs from 'node:fs';
import fontkit from '@pdf-lib/fontkit';
import { formatTimeInTimezone } from '../../../Utils.js';
import {
formatTimeInTimezone,
} from '../../../Utils.js';
export default async function GenerateCertificate(docDetails) {
const timezone = docDetails?.ExtUserPtr?.Timezone || '';
@@ -73,12 +75,12 @@ export default async function GenerateCertificate(docDetails) {
borderColor: borderColor,
borderWidth: 1,
});
page.drawImage(pngImage, {
x: 30,
y: 790,
width: 100,
height: 25,
});
page.drawImage(pngImage, {
x: 30,
y: 790,
width: 100,
height: 25,
});
page.drawText(generatedOn, {
x: 320,
+8 -9
View File
@@ -41,8 +41,8 @@
"ws": "^8.18.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.26.8",
"eslint": "^9.20.1",
"@babel/eslint-parser": "^7.26.5",
"eslint": "^9.20.0",
"jasmine": "^5.6.0",
"mongodb-runner": "^5.7.1",
"nodemon": "^3.1.9",
@@ -5975,11 +5975,10 @@
}
},
"node_modules/@babel/eslint-parser": {
"version": "7.26.8",
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.26.8.tgz",
"integrity": "sha512-3tBctaHRW6xSub26z7n8uyOTwwUsCdvIug/oxBH9n6yCO5hMj2vwDJAo7RbBMKrM7P+W2j61zLKviJQFGOYKMg==",
"version": "7.26.5",
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.26.5.tgz",
"integrity": "sha512-Kkm8C8uxI842AwQADxl0GbcG1rupELYLShazYEZO/2DYjhyWXJIOUVOE3tBYm6JXzUCNJOZEzqc4rCW/jsEQYQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
"eslint-visitor-keys": "^2.1.0",
@@ -12733,9 +12732,9 @@
}
},
"node_modules/eslint": {
"version": "9.20.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz",
"integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==",
"version": "9.20.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.0.tgz",
"integrity": "sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA==",
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
+2 -2
View File
@@ -51,8 +51,8 @@
},
"type": "module",
"devDependencies": {
"@babel/eslint-parser": "^7.26.8",
"eslint": "^9.20.1",
"@babel/eslint-parser": "^7.26.5",
"eslint": "^9.20.0",
"jasmine": "^5.6.0",
"mongodb-runner": "^5.7.1",
"nodemon": "^3.1.9",