Closed camdendotlol closed 1 year ago
This is great - I tried out #13 with some test data and that worked great for me. On #16, I was hitting an error here switching pages. It was blocking me, so I fixed it with this modification:
function* resolveGlossary(manifest) {
const glossary = yield select(justGlossary);
if (!glossary.loaded) {
if (
!manifest?.seeAlso
|| manifest.seeAlso.length === 0
|| !manifest.seeAlso[0].id
) {
throw new Error('Missing glossary link in seeAlso array.');
}
const glossaryURL = manifest.seeAlso[0].id;
const response = yield axios.get(glossaryURL);
yield putResolveAction('GlossaryActions.loadGlossary', response.data);
}
}
If this looks good, please include it in your PR, I didn't check it in on my end. Also, I think it will be necessary to make the glossary an optional thing, not every project will have one. This is probably a seperate issue/feature.
I haven't looked at #14 and #15 yet but will feedback here when I do.
Hi @camdendotlol I looked at this for a bit, it would be a lot easier for me to test if you could patch in the code for the glossary, makes stuff on my branch of editioncrafter-cli work beter.
@NickLaiacona Just seeing this now - I'll set a reminder to do it first thing Monday.
@NickLaiacona Done.
Note
Since Nick is away this week and I have several interconnected tasks, I've decided to make all the changes in one PR. I know it's not the best as far as code review goes, but it's difficult to work across several branches that build upon one another and I know the rebases would be a whole project in themselves.
Summary
Introduction
story from the Storybook folder so EditionCrafter will pop up right away when younpm run storybook
13 - Configurable transcription types
Navigation
component to use the values from theconfig
object when building the transcription type dropdownloadFolio
to only resolve thefolio
object when all transcription types are loadedfolio
object is being mutated within that function and not being used in e.g. a Redux store or a component's state, the components don't know to re-render when a new transcription type finishes loading. This caused crashes when attempting to switch between types in the viewer. With this change, I've made it watch for all the types to load using a tracker object, and onlyresolve
when they've all finished - the component can then rely on having all the data for all the transcription types. In the long run, it would be a lot better to refactorloadFolio
so it writes to a Redux state, so any components that connect to it automatically re-render. But this issue is fixed for now!TranscriptionView
to handle when a folio doesn't have a given transcription15 - Inline figures
htmlToReactParserOptions
to handlefigure
elements from the TEIThis assumes a structure of:
The
figDesc
is optional, but if it exists the function will add analt
tag and afigCaption
HTML element containing the text.14 - Moving comments from JSON file to TEI
TranscriptionView
to display theEditorComment
popup when atei-note
element is encounteredcomments.json
technique, including the Redux state stuff and loading logicNote
The note contents are still parsed as HTML using
html-react-parser
. It may be desirable to simplify this to a simple string display, but I didn't want to assume anything.16 - Glossary file in manifest
config
objectThe changes on the CLI side at https://github.com/cu-mkp/editioncrafter-cli/pull/11 are more substantial and more likely to require changes.
Screenshots
Inline figure