Skip to content

Commit

Permalink
init #31 and #32
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGecko committed May 30, 2022
1 parent 8ee0296 commit 6e2fef5
Show file tree
Hide file tree
Showing 21 changed files with 513 additions and 1,909 deletions.
12 changes: 6 additions & 6 deletions src/components/document/edition/DocumentEditionCommentaries.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
:key="com.label"
>
<div v-show="com.label === selectedCommentaryLabel">
<commentary-editor
<transcription-editor
v-if="hasCommentaryTypes(com.label)"
section="commentaries"
:key="commentariesLoading"
:initial-content="getCommentaryContent(com.label)"
:type="com.id"
change-action="commentaries/changed"
/>
<message
v-else
Expand All @@ -62,14 +63,14 @@
import { mapState, mapGetters, mapActions } from 'vuex';
import CommentaryEditor from '../../editors/CommentaryEditor.vue'
import TranscriptionEditor from '../../editors/TranscriptionEditor.vue'
import CommentariesActionBar from './actionbars/CommentariesActionBar.vue'
import Message from '../../Message'
export default {
name: "DocumentEditionCommentaries",
components: {
CommentaryEditor,
TranscriptionEditor,
CommentariesActionBar,
Message,
},
Expand All @@ -82,8 +83,7 @@ export default {
}
},
computed: {
...mapState('document', ['document']),
...mapState('document', ['transcriptionLoading']),
...mapState('document', ['document', 'transcriptionLoading']),
...mapState('commentaries', ['commentaryTypes', 'selectedCommentaryLabel', 'commentariesLoading']),
...mapGetters('commentaries', ['getCommentary', 'hasCommentaryTypes']),
},
Expand Down
36 changes: 0 additions & 36 deletions src/components/document/edition/DocumentEditionFacsimile.vue

This file was deleted.

38 changes: 0 additions & 38 deletions src/components/document/edition/DocumentEditionSpeechParts.vue

This file was deleted.

20 changes: 13 additions & 7 deletions src/components/document/edition/DocumentEditionTranscription.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
<template>
<div>
<section>
<transcription-action-bar :section="section"/>
<transcription-editor
:key="transcriptionLoading"
:initial-content="transcriptionWithNotes"
v-if="!transcriptionLoading"
:section="section"
:initial-content="transcriptionContent"
change-action="transcription/changed"
/>
</div>
</section>
</template>


<script>
import { mapState, mapGetters } from 'vuex';
import TranscriptionEditor from "@/components/editors/TranscriptionEditor.vue"
import TranscriptionActionBar from "@/components/document/edition/actionbars/TranscriptionActionBar.vue";
export default {
name: "DocumentEditionTranscription",
components: {
TranscriptionEditor
TranscriptionEditor, TranscriptionActionBar
},
props: {
transcriptionWithNotes: {type: String, default: ""}
section: {type: String, required: true}
},
computed: {
...mapState('transcription', ['transcriptionLoading'])
...mapState('transcription', ['transcriptionContent', 'transcriptionLoading']),
...mapGetters('document', ['documentOwner']),
...mapState('user', ['currentUser'])
},
async created() {
},
Expand Down
51 changes: 16 additions & 35 deletions src/components/document/edition/DocumentEditionTranslation.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,37 @@
<template>
<div>
<div>
<translation-action-bar />
</div>

<div
v-if="transcriptionAlignmentMode"
class="columns"
>
<transcription-editor
v-if="transcriptionWithTextAlignment"
class="column"
:initial-content="transcriptionWithTextAlignment"
/>
<translation-editor
v-if="translationWithTextAlignment"
class="column"
:initial-content="translationWithTextAlignment"
/>
</div>
<translation-editor
v-else
:key="'translation' + translationLoading"
:initial-content="translationWithNotes"
<section>
<translation-action-bar/>
<transcription-editor
v-if="!translationLoading"
section="translation"
:key="translationLoading"
:initial-content="translationContent"
change-action="translation/changed"
/>
</div>
</section>
</template>


<script>
import { mapState, mapGetters } from 'vuex';
import TranslationEditor from "@/components/editors/TranslationEditor.vue"
import TranscriptionEditor from "@/components/editors/TranscriptionEditor.vue"
import TranslationActionBar from "@/components/document/edition/actionbars/TranslationActionBar.vue";
export default {
name: "DocumentEditionTranslation",
components: {
TranslationEditor,
TranscriptionEditor,
TranslationActionBar
},
props: {
translationWithNotes: {type: String, default: ""}
},
computed: {
...mapState('translation', ['translationLoading', 'savingStatus', 'translationContent', 'translationWithTextAlignment']),
...mapState('transcription', ['transcriptionLoading', 'savingStatus', 'transcriptionContent', 'transcriptionWithTextAlignment']),
...mapState('workflow', ['transcriptionAlignmentMode']),
...mapGetters('transcription', ['isTranscriptionSaved']),
...mapGetters('translation', ['isTranslationSaved'])
...mapState('translation', ['translationContent', 'translationLoading']),
},
async created() {
},
methods: {
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,29 @@
</p>
<!-- VALIDATE / UNVALIDATE TRANSCRIPTION -->
<p
v-if="currentUserIsTeacher && selectedUserId == document.user_id"
v-if="section ==='transcription' && currentUserIsTeacher && selectedUserId == document.user_id"
class="control"
>
<validate-transcription-button :doc-id="document.id" />
</p>

<p
v-if="section ==='speechparts' && currentUserIsTeacher && selectedUserId == document.user_id"
class="control m-b-md"
>
<validate-speech-parts-button :doc-id="document.id" />
</p>

<!-- CLONE TRANSCRIPTION -->
<p
v-if="currentUserIsTeacher && currentUser.id !== selectedUserId"
v-if="section ==='transcription' && currentUserIsTeacher && currentUser.id !== selectedUserId"
class="control"
>
<clone-transcription-button />
</p>
<!-- DELETE TRANSCRIPTION -->
<p
v-if="currentUserIsTeacher || !isTranscriptionReadOnly"
v-if="section === 'transcription' && (currentUserIsTeacher || !isTranscriptionReadOnly)"
class="control"
>
<delete-transcription-button
Expand All @@ -46,13 +54,19 @@ import ValidateTranscriptionButton from '../actions/ValidateTranscriptionButton.
import DeleteTranscriptionButton from '../actions/DeleteTranscriptionButton.vue'
import CloneTranscriptionButton from '../actions/CloneTranscriptionButton.vue'
import ValidateSpeechPartsButton from '../actions/ValidateSpeechPartsButton.vue'
export default {
name: 'TranscriptionActionBar',
components: {
SaveTranscriptionButton,
ValidateTranscriptionButton,
DeleteTranscriptionButton,
CloneTranscriptionButton
CloneTranscriptionButton,
ValidateSpeechPartsButton
},
props: {
section: {type: String, required: true}
},
computed: {
...mapState('document', ['document']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ export default {
]),
showAlignmentButton() {
return this.isTranslationValidated && this.currentUserIsTeacher
},
...mapGetters('translation', ['translationSegmentsFromQuill']),
...mapGetters('transcription', ['transcriptionSegmentsFromQuill']),
warningConditions() {
return this.transcriptionSegmentsFromQuill.length === this.translationSegmentsFromQuill.length
}
},
methods: {
Expand Down
Loading

0 comments on commit 6e2fef5

Please sign in to comment.