Skip to content

Commit

Permalink
Merge pull request #51 from cu-mkp/cm/default-transcription-type
Browse files Browse the repository at this point in the history
Don't hardcode default `tl` transcription type
  • Loading branch information
camdendotlol authored Aug 10, 2023
2 parents 3e1ef67 + 8dc04d7 commit 6ccb82a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 5 additions & 3 deletions editioncrafter/src/component/DocumentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class DocumentView extends Component {
const {
folioID, transcriptionType, folioID2, transcriptionType2,
} = this.props.router.params;
const { document } = this.props;
let viewports;
const firstTranscriptionType = Object.keys(document.transcriptionTypes)[0];

if (!folioID) {
// route /folios
Expand All @@ -138,7 +140,7 @@ class DocumentView extends Component {
},
right: {
folioID: '-1',
transcriptionType: 'tl',
transcriptionType: firstTranscriptionType,
},
};
} else {
Expand All @@ -149,13 +151,13 @@ class DocumentView extends Component {
// route /ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2
leftTranscriptionType = transcriptionType;
rightFolioID = folioID2;
rightTranscriptionType = transcriptionType2 || 'tl';
rightTranscriptionType = transcriptionType2 || firstTranscriptionType;
} else {
// route /ec/:folioID
// route /ec/:folioID/:transcriptionType
leftTranscriptionType = 'f';
rightFolioID = folioID;
rightTranscriptionType = transcriptionType || 'tl';
rightTranscriptionType = transcriptionType || firstTranscriptionType;
}

viewports = {
Expand Down
10 changes: 7 additions & 3 deletions editioncrafter/src/component/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,14 @@ class Navigation extends React.Component {
onClick={this.changeType}
>
{Object.keys(this.props.document.transcriptionTypes).map(ttKey => (
<MenuItem value={ttKey}>{this.props.document.transcriptionTypes[ttKey]}</MenuItem>
<MenuItem value={ttKey} key={ttKey}>{this.props.document.transcriptionTypes[ttKey]}</MenuItem>
))}
<MenuItem value="f">{DocumentHelper.transcriptionTypeLabels.f}</MenuItem>
<MenuItem value="glossary">{DocumentHelper.transcriptionTypeLabels.glossary}</MenuItem>
<MenuItem value="f" key="f">
{DocumentHelper.transcriptionTypeLabels.f}
</MenuItem>
<MenuItem value="glossary" key="glossary">
{DocumentHelper.transcriptionTypeLabels.glossary}
</MenuItem>
</Select>
<span
title="Toggle folio help"
Expand Down
4 changes: 2 additions & 2 deletions editioncrafter/stories/EditionCrafter.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const baseConfig = {
export const Development = () => (
<EditionCrafter config={{
...baseConfig,
iiifManifest: 'http://localhost:8080/fr640_3r-3v-example/iiif/manifest.json'
iiifManifest: 'http://localhost:8080/fr640_3r-3v-example/iiif/manifest.json',
}}
/>
);

export const Testing = () => (
<EditionCrafter config={{
...baseConfig,
iiifManifest: 'https://cu-mkp.github.io/editioncrafter-data/fr640_3r-3v-example/iiif/manifest.json'
iiifManifest: 'https://cu-mkp.github.io/editioncrafter-data/fr640_3r-3v-example/iiif/manifest.json',
}}
/>
);
Expand Down

0 comments on commit 6ccb82a

Please sign in to comment.