Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Storybook workflow #10

Merged
merged 6 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/deploy.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and deploy to GitHub pages for testing

on:
push:
branches:
- dev # Trigger the action only on PR merges into dev
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
with:
persist-credentials: false
- name: Install and Build 🔧
run: | # Install npm packages and build the Storybook files
npm run build
npm run build-storybook
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: editioncrafter/storybook-static # The folder that the build-storybook script generates files.
clean: true # Automatically remove deleted files from the deploy branch
4 changes: 2 additions & 2 deletions editioncrafter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion editioncrafter/src/action/DocumentActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function parseSingleManifest(manifest, transcriptionTypes, document) {
const thumbnailURL = `${bodyId}/full/${thumbnailDimensions.join(',')}/0/default.jpg`;

const folio = {
id: folioID,
id: document ? `${document}_${folioID}` : folioID,
doc_id: document || manifest.id,
name: canvasLabel,
pageNumber: i,
Expand Down
4 changes: 3 additions & 1 deletion editioncrafter/src/component/DocumentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ const DocumentView = (props) => {
hasNext: current_hasNext,
previousFolioShortID: prevID,
nextFolioShortID: nextID,
documentID: doc.variorum ? doc.folioIndex[shortID].doc_id : doc.documentName,
};
};

Expand All @@ -384,6 +385,7 @@ const DocumentView = (props) => {
const viewType = determineViewType(side);
const key = viewPaneKey(side);
const folioID = docView[side].iiifShortID;
const document = docView[side].documentID;
const { transcriptionType } = docView[side];

if (viewType === 'ImageView') {
Expand Down Expand Up @@ -425,7 +427,7 @@ const DocumentView = (props) => {
documentView={docView}
documentViewActions={documentViewActions}
side={side}
selectedDoc={props.document.variorum && Object.keys(props.document.derivativeNames)[side === 'left' ? 0 : side === 'right' ? 1 : Object.keys(props.document.derivativeNames).length > 2 ? 2 : 1]}
selectedDoc={document ? document : props.document.variorum && Object.keys(props.document.derivativeNames)[side === 'left' ? 0 : side === 'right' ? 1 : Object.keys(props.document.derivativeNames).length > 2 ? 2 : 1]}
/>
);
} if (viewType === 'GlossaryView') {
Expand Down
48 changes: 36 additions & 12 deletions editioncrafter/stories/EditionCrafter.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,49 @@ export const IntervistePescatori = () => (
/>
);

export const MultiDocument = () => (
export const OrnamentDesignTranslation = () => (
<EditionCrafter
documentName='FHL_007548733_TAOS_BAPTISMS_BATCH_2 and eng-415-145a'
threePanel
documentName='Ornament : Design : Translation'
documentInfo={{
FHL_007548733_TAOS_BAPTISMS_BATCH_2: {
documentName: 'Taos Baptisms Batch 2',
caryatidum: {
documentName: 'caryatidum',
transcriptionTypes: {
'text-1': 'Text 1',
'text-2': 'Text 2',
},
iiifManifest: 'https://cu-mkp.github.io/odt-editioncrafter-data/texts/caryatidum/iiif/manifest.json',
},
grotisch_fur_alle_kunstler: {
documentName: 'grotisch_fur_alle_kunstler',
transcriptionTypes: {
'text-1': 'Text 1',
'text-2': 'Text 2',
},
iiifManifest: 'https://cu-mkp.github.io/odt-editioncrafter-data/texts/grotisch_fur_alle_kunstler/iiif/manifest.json',
},
mansches_de_coutiaus: {
documentName: 'mansches_de_coutiaus',
transcriptionTypes: {
'text-1': 'Text 1',
'text-2': 'Text 2',
},
iiifManifest: 'https://cu-mkp.github.io/odt-editioncrafter-data/texts/mansches_de_coutiaus/iiif/manifest.json',
},
passio_verbigenae: {
documentName: 'passio_verbigenae',
transcriptionTypes: {
translation: 'Translation',
transcription: 'Transcription',
'text-1': 'Text 1',
'text-2': 'Text 2',
},
iiifManifest: 'https://cu-mkp.github.io/editioncrafter/taos-baptisms-example/iiif/manifest.json',
iiifManifest: 'https://cu-mkp.github.io/odt-editioncrafter-data/texts/passio_verbigenae/iiif/manifest.json',
},
eng_415_145a: {
documentName: 'Eng 415-145a',
veelderley_veranderinghe_van_grotissen: {
documentName: 'veelderley_veranderinghe_van_grotissen',
transcriptionTypes: {
'eng-415-145a': 'Transcription',
'text-1': 'Text 1',
'text-2': 'Text 2',
},
iiifManifest: 'https://cu-mkp.github.io/bic-editioncrafter-data/eng-415-145a/iiif/manifest.json',
iiifManifest: 'https://cu-mkp.github.io/odt-editioncrafter-data/texts/veelderley_veranderinghe_van_grotissen/iiif/manifest.json',
},
}}
/>
Expand Down
Loading