mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 17:51:49 +10:00
fix: merge conflicts
This commit is contained in:
@ -366,7 +366,7 @@ export const formatDocumentAuditLogAction = (auditLog: TDocumentAuditLog, userId
|
||||
})
|
||||
.with({ type: DOCUMENT_AUDIT_LOG_TYPE.EMAIL_SENT }, ({ data }) => ({
|
||||
anonymous: `Email ${data.isResending ? 'resent' : 'sent'}`,
|
||||
identified: `${data.isResending ? 'resent' : 'sent'} an email`,
|
||||
identified: `${data.isResending ? 'resent' : 'sent'} an email to ${data.recipientEmail}`,
|
||||
}))
|
||||
.with({ type: DOCUMENT_AUDIT_LOG_TYPE.DOCUMENT_COMPLETED }, () => {
|
||||
// Clear the prefix since this should be considered an 'anonymous' event.
|
||||
|
||||
@ -39,3 +39,27 @@ export const validateFieldsInserted = (fields: Field[]): boolean => {
|
||||
|
||||
return uninsertedFields.length === 0;
|
||||
};
|
||||
|
||||
export const validateFieldsUninserted = (): boolean => {
|
||||
const fieldCardElements = document.getElementsByClassName('react-draggable');
|
||||
|
||||
const errorElements: HTMLElement[] = [];
|
||||
|
||||
Array.from(fieldCardElements).forEach((element) => {
|
||||
const innerDiv = element.querySelector('div');
|
||||
const hasError = innerDiv?.getAttribute('data-error') === 'true';
|
||||
|
||||
if (hasError) {
|
||||
errorElements.push(element as HTMLElement);
|
||||
} else {
|
||||
element.removeAttribute('data-error');
|
||||
}
|
||||
});
|
||||
|
||||
if (errorElements.length > 0) {
|
||||
errorElements[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
return false;
|
||||
}
|
||||
|
||||
return errorElements.length === 0;
|
||||
};
|
||||
|
||||
@ -7,9 +7,10 @@ import type { I18nLocaleData, SupportedLanguageCodes } from '../constants/i18n';
|
||||
import { APP_I18N_OPTIONS } from '../constants/i18n';
|
||||
|
||||
export async function dynamicActivate(i18nInstance: I18n, locale: string) {
|
||||
const { messages } = await import(
|
||||
`../translations/${locale}/${IS_APP_WEB ? 'web' : 'marketing'}.js`
|
||||
);
|
||||
const extension = process.env.NODE_ENV === 'development' ? 'po' : 'js';
|
||||
const context = IS_APP_WEB ? 'web' : 'marketing';
|
||||
|
||||
const { messages } = await import(`../translations/${locale}/${context}.${extension}`);
|
||||
|
||||
i18nInstance.loadAndActivate({ locale, messages });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user