{
handleInputChange(e);
@@ -815,7 +818,7 @@ export default function InnerFramePopup() {
}
}
onClick={async () => {
- if (isJsonValidate) {
+ if (jsonValidation.length == 0) {
setMessagePrint('');
const pdfGen = new global.PdfGenStatic(
JSON.parse(kitchenFaucet),
@@ -830,6 +833,22 @@ export default function InnerFramePopup() {
return;
}
setMessagePrint((prev) => `${prev }\nSuccessful pdf generation.`);
+ } else {
+ let cleanerMessage = jsonValidation.map(
+ txt => {
+ console.log(txt);
+ console.log("txt.includes('outputPath')", txt.includes('outputPath'));
+ if(txt.includes('outputPath')) {
+ return "Please choose an export folder";
+ } else if(txt.includes('Unknown section type')) {
+ return "Please choose at least one 'Print type'";
+ } else if(txt.includes('requires ranges')) {
+ return "Canon specification : please choose at least one book";
+ }
+ return txt;
+ }
+ ).join('\n');
+ setMessagePrint(`# Error\n${cleanerMessage}`);
}
}}
>
diff --git a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/BookList.js b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/BookList.js
new file mode 100644
index 00000000..332bd64f
--- /dev/null
+++ b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/BookList.js
@@ -0,0 +1,17 @@
+import React from 'react';
+
+export const BookList = ({ books }) => {
+ return (
+
+ {books.map((book, index) => (
+
+
+
+ {book}
+
+
+
+ ))}
+
+ );
+};
diff --git a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/BCVHeaderWrapper.js b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/BCVHeaderWrapper.js
index 8341a0b1..15ba088c 100644
--- a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/BCVHeaderWrapper.js
+++ b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/BCVHeaderWrapper.js
@@ -1,12 +1,14 @@
import { useEffect, useState, useContext } from 'react';
import { Modal } from '@material-ui/core';
import { ProjectContext } from '@/components/context/ProjectContext';
+import { ReferenceContext } from '@/components/context/ReferenceContext';
import SelectBook from '@/components/EditorPage/Navigation/reference/SelectBook';
import { useBibleReference } from 'bible-reference-rcl';
import { XMarkIcon } from '@heroicons/react/24/outline';
import { useTranslation } from 'react-i18next';
import Layout from '../../../../../../public/icons/basil/Solid/Interface/Layout.svg';
import { TextOnlyTooltip, LoopSwitch } from '../fieldPicker/customMuiComponent';
+import { BookList } from '../BookList';
export function BCVWrapperSortableList({
keyWrapper,
@@ -21,11 +23,16 @@ export function BCVWrapperSortableList({
const initialVerse = '1';
const { t } = useTranslation();
+ const {
+ state: {
+ bookId,
+ },
+ } = useContext(ReferenceContext);
const {
state: { bookList },
} = useBibleReference({
- initialBook,
+ initialBook: bookId,
initialChapter,
initialVerse,
});
@@ -33,7 +40,7 @@ export function BCVWrapperSortableList({
states: { canonList },
} = useContext(ProjectContext);
// end get all book from current project
- const [selectedBooks, setSelectedBooks] = useState([]);
+ const [selectedBooks, setSelectedBooks] = useState(bookId ? [bookId.toUpperCase()] : []);
const [openModalBook, setOpenModalBook] = useState(false);
useEffect(() => {
@@ -47,7 +54,7 @@ export function BCVWrapperSortableList({
return (
-
+
{advanceMode ? (
- Ressources in the loop will be added to
- the export, form
+ Projects in the loop are added one by one to the document,
+ for each book selected above.
Translation
@@ -212,7 +219,10 @@ export function BCVWrapperSortableList({
>
{t('label-custom')}
+
+
+ {
@@ -70,8 +75,8 @@ export function JXLHeaderWrapper({
fontWeight: 400,
}}
>
- Ressources in the loop will be added to
- the export, form
+ Projects in the loop are added one by one to the document,
+ for each book selected above.
)}
diff --git a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/OBSHeaderWrapper.js b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/OBSHeaderWrapper.js
index 1c9e7679..ecfa5a55 100644
--- a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/OBSHeaderWrapper.js
+++ b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/HeaderWrapper/OBSHeaderWrapper.js
@@ -127,8 +127,8 @@ export function OBSWrapperSortableList({
fontWeight: 400,
}}
>
- Ressources in the loop will be added to
- the export, form
+ Projects in the loop are added one by one to the document,
+ for each book selected above.
)}
diff --git a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/SectionAccordion.js b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/SectionAccordion.js
index ab7f094d..ebcd027c 100644
--- a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/SectionAccordion.js
+++ b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/SectionAccordion.js
@@ -20,6 +20,20 @@ const convertionWrapperType = (type) => {
}
};
+const hashPrintTypes = {
+ 'bcvBible': 'Bible by verse',
+ 'bookNote': 'Book Note',
+ '4ColumnSpread': 'Four resources on facing pages',
+ '2Column': 'Two resources in two columns',
+ 'biblePlusNotes': 'Notes focus (by verse)',
+ 'paraBible': 'Formatted Bible',
+ 'markdown': 'Simple formatting',
+ // 'jxlSpread': 'Juxtalinear on facing pages',
+ 'jxlSimple': 'Juxtalinear',
+ 'obs': 'Obs',
+ 'obsPlusNotes': 'Obs with Notes',
+}
+
export function AccordionPicker({
language,
setSelected,
@@ -236,7 +250,7 @@ export function AccordionPicker({
}}
>
{keySpecification !== 'null'
- ? keySpecification
+ ? hashPrintTypes[keySpecification]
: 'select a print type'}
diff --git a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/WrapperTemplate.js b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/WrapperTemplate.js
index c0e3831d..74eb0eb4 100644
--- a/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/WrapperTemplate.js
+++ b/renderer/src/layouts/editor/pdfGenInterface/pdfGenWrappers/WrapperTemplate.js
@@ -228,7 +228,7 @@ export function WrapperTemplate({
}}
>