mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
fix: hide powered by on certificate for platform documents
This commit is contained in:
@ -6,6 +6,7 @@ import { redirect } from 'react-router';
|
|||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
import { UAParser } from 'ua-parser-js';
|
import { UAParser } from 'ua-parser-js';
|
||||||
|
|
||||||
|
import { isDocumentPlatform } from '@documenso/ee/server-only/util/is-document-platform';
|
||||||
import { APP_I18N_OPTIONS, ZSupportedLanguageCodeSchema } from '@documenso/lib/constants/i18n';
|
import { APP_I18N_OPTIONS, ZSupportedLanguageCodeSchema } from '@documenso/lib/constants/i18n';
|
||||||
import {
|
import {
|
||||||
RECIPIENT_ROLES_DESCRIPTION,
|
RECIPIENT_ROLES_DESCRIPTION,
|
||||||
@ -59,6 +60,8 @@ export async function loader({ request }: Route.LoaderArgs) {
|
|||||||
throw redirect('/');
|
throw redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isPlatformDocument = await isDocumentPlatform(document);
|
||||||
|
|
||||||
const documentLanguage = ZSupportedLanguageCodeSchema.parse(document.documentMeta?.language);
|
const documentLanguage = ZSupportedLanguageCodeSchema.parse(document.documentMeta?.language);
|
||||||
|
|
||||||
const auditLogs = await getDocumentCertificateAuditLogs({
|
const auditLogs = await getDocumentCertificateAuditLogs({
|
||||||
@ -70,6 +73,7 @@ export async function loader({ request }: Route.LoaderArgs) {
|
|||||||
return {
|
return {
|
||||||
document,
|
document,
|
||||||
documentLanguage,
|
documentLanguage,
|
||||||
|
isPlatformDocument,
|
||||||
auditLogs,
|
auditLogs,
|
||||||
messages,
|
messages,
|
||||||
};
|
};
|
||||||
@ -85,7 +89,7 @@ export async function loader({ request }: Route.LoaderArgs) {
|
|||||||
* Update: Maybe <Trans> tags work now after RR7 migration.
|
* Update: Maybe <Trans> tags work now after RR7 migration.
|
||||||
*/
|
*/
|
||||||
export default function SigningCertificate({ loaderData }: Route.ComponentProps) {
|
export default function SigningCertificate({ loaderData }: Route.ComponentProps) {
|
||||||
const { document, documentLanguage, auditLogs, messages } = loaderData;
|
const { document, documentLanguage, isPlatformDocument, auditLogs, messages } = loaderData;
|
||||||
|
|
||||||
const { i18n, _ } = useLingui();
|
const { i18n, _ } = useLingui();
|
||||||
|
|
||||||
@ -337,15 +341,17 @@ export default function SigningCertificate({ loaderData }: Route.ComponentProps)
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<div className="my-8 flex-row-reverse">
|
{isPlatformDocument && (
|
||||||
<div className="flex items-end justify-end gap-x-4">
|
<div className="my-8 flex-row-reverse">
|
||||||
<p className="flex-shrink-0 text-sm font-medium print:text-xs">
|
<div className="flex items-end justify-end gap-x-4">
|
||||||
{_(msg`Signing certificate provided by`)}:
|
<p className="flex-shrink-0 text-sm font-medium print:text-xs">
|
||||||
</p>
|
{_(msg`Signing certificate provided by`)}:
|
||||||
|
</p>
|
||||||
|
|
||||||
<BrandingLogo className="max-h-6 print:max-h-4" />
|
<BrandingLogo className="max-h-6 print:max-h-4" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user