Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
awolosz committed Aug 31, 2024
1 parent c7da201 commit a163dc4
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 69 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ module.exports = {
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
'@vue/eslint-config-prettier/skip-formatting',
],
parserOptions: {
ecmaVersion: 'latest'
}
},
rules: {
'vue/multi-word-component-names': 'off',
},
}
3 changes: 0 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<script lang="ts">
import { RouterView } from 'vue-router'
import Footer from './components/Footer.vue'
import Header from './components/Header.vue'
import { Tooltip } from 'bootstrap'
export default {
components: {
Expand Down
10 changes: 5 additions & 5 deletions src/components/FunctionButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
}
},
methods: {
copyShareLink(id: string) {
copyShareLink() {
console.log(this.$router);
navigator.clipboard.writeText(window.location.origin + this.$route.path);
Expand All @@ -26,8 +26,8 @@ export default {
this.isShareCopied = false;
}, 1500);
},
copyIdLink(id: string) {
navigator.clipboard.writeText(window.location.origin + "/" + this.synopsisStore.currentLanguage + "/" + this.synopsisStore.currentTranslation + "#" + id);
copyIdLink() {
navigator.clipboard.writeText(window.location.origin + "/" + this.synopsisStore.currentLanguage + "/" + this.synopsisStore.currentTranslation + "#" + this.id);
this.isIdCopied = true
setTimeout(() => {
this.isIdCopied = false;
Expand All @@ -54,11 +54,11 @@ export default {
<i class="bi bi-arrow-down-left-square fs-6"></i>
</button>
</router-link>
<button v-if="$route.name === 'synopsis'" @click="copyIdLink(id)" type="button"
<button v-if="$route.name === 'synopsis'" @click="copyIdLink()" type="button"
class=" float-right btn btn-light btn-sm ms-1 mb-1" :title="synopsisStore.currentDictionary.tooltips.location">
<i class="bi fs-6" :class="{ 'bi-link-45deg': !isIdCopied, 'bi-check': isIdCopied }"></i>
</button>
<button v-if="$route.name === 'section'" @click="copyShareLink(id)" type="button"
<button v-if="$route.name === 'section'" @click="copyShareLink()" type="button"
class="float-right btn btn-light btn-sm ms-1 mb-1" :title="synopsisStore.currentDictionary.tooltips.share">
<i class="bi fs-6" :class="{ 'bi-link-45deg': !isShareCopied, 'bi-check': isShareCopied }"></i>
</button>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
<i class="bi bi-globe2 fs-5 align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<template v-for="synopsis in synopsisStore.synopses">
<template v-for="synopsis in synopsisStore.synopses" :key="synopsis.language">
<li> <a @click="synopsis.language !== synopsisStore.currentLanguage ? synopsisStore.changeLanguage(synopsis.language) : null"
class="dropdown-item hoverable text-black"
:class="synopsis.language === synopsisStore.currentLanguage ? 'bg-dark-subtle' : ''">
Expand All @@ -91,7 +91,7 @@ export default {
<i class="bi bi-book fs-5 align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<template v-for="synopsis in synopsisStore.synopses">
<template v-for="synopsis in synopsisStore.synopses" :key="synopsis.translation">
<li> <a @click="synopsis.translation !== synopsisStore.currentTranslation ? synopsisStore.changeTranslation(synopsis.translation) : null"
class="dropdown-item hoverable text-black"
:class="synopsis.translation === synopsisStore.currentTranslation ? 'bg-dark-subtle' : ''">
Expand Down
96 changes: 49 additions & 47 deletions src/components/IndexRecord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,53 +25,55 @@ export default {
{{ chapterName }}
</h2>
</div>
<template v-for="subchapter in subchapters" class="row">
<h3 class="text-center fs-4">{{ subchapter.subchapter_name }}</h3>
<div class="table-responsive">
<table class="table bg-dark table-sm table-striped table-bordered">
<thead>
<tr>
<th class="fw-normal text-nowrap" scope="col"># ( <i
class="bi bi-arrow-down-left-square fs-6"></i> )</th>
<th class="fw-normal text-nowrap" scope="col">{{ synopsisStore.currentDictionary.index.title }} ( <i
class="bi bi-arrow-up-right-square fs-6"></i> )</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.mt }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.mk }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.lk }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.jn }}
</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr v-for="section in subchapter.sections">
<th class="col-lg-1 align-middle text-nowrap" scope="row">
<router-link :to="{ name: 'synopsis', hash: '#' + section.id }">
{{ section.id }}
</router-link>
</th>
<td class="col-lg-7 align-middle text-nowrap">
<router-link :to="{ name: 'section', params: { id: section.id } }">
{{ section.section_name }}
</router-link>
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.mt" />
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.mk" />
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.lk" />
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.jn" />
</td>
</tr>
</tbody>
</table>
<template v-for="subchapter in subchapters">
<div clas="row">
<h3 class="text-center fs-4">{{ subchapter.subchapter_name }}</h3>
<div class="table-responsive">
<table class="table bg-dark table-sm table-striped table-bordered">
<thead>
<tr>
<th class="fw-normal text-nowrap" scope="col"># ( <i
class="bi bi-arrow-down-left-square fs-6"></i> )</th>
<th class="fw-normal text-nowrap" scope="col">{{ synopsisStore.currentDictionary.index.title }} ( <i
class="bi bi-arrow-up-right-square fs-6"></i> )</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.mt }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.mk }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.lk }}
</th>
<th class="text-center fw-normal" scope="col">{{ synopsisStore.currentDictionary.evangelists.jn }}
</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr v-for="section in subchapter.sections">
<th class="col-lg-1 align-middle text-nowrap" scope="row">
<router-link :to="{ name: 'synopsis', hash: '#' + section.id }">
{{ section.id }}
</router-link>
</th>
<td class="col-lg-7 align-middle text-nowrap">
<router-link :to="{ name: 'section', params: { id: section.id } }">
{{ section.section_name }}
</router-link>
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.mt" />
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.mk" />
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.lk" />
</td>
<td class="col-lg-1 align-middle">
<IndexCitation :citations="section.jn" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
</template>
3 changes: 1 addition & 2 deletions src/components/Section.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import Citation from '@/components/Citation.vue'
import FunctionButtons from '@/components/FunctionButtons.vue'
import type { SectionScheme } from '@/interfaces/synopsisInterface'
import { useSynopsisStore } from "@/stores/SynopsisStore"
export default {
Expand Down Expand Up @@ -54,7 +53,7 @@ export default {
</div>
</div>

<template v-for="index in section.mt.length">
<template v-for="index in section.mt.length" :key="index">
<div class="row content mx-3">
<div class="col-lg-3 col-md-12 pb-3">
<Citation v-if="section.mt[index - 1] !== null" :citation="section.mt[index - 1]" evangelist="mt"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Subchapter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
</h4>
</div>

<Section v-for="section in subchapter.sections" :id="section.id"/>
<Section v-for="section in subchapter.sections" :id="section.id" :key="section.id"/>


</template>
5 changes: 2 additions & 3 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ContactView from '@/views/ContactView.vue'
import NotFoundView from '@/views/NotFoundView.vue'
import Section from '@/components/Section.vue'
import { useSynopsisStore } from "@/stores/SynopsisStore"
import { TypePredicateKind } from 'typescript'

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
Expand Down Expand Up @@ -49,7 +48,7 @@ const router = createRouter({
component: NotFoundView
},
],
scrollBehavior(to, from, savedPosition) {
scrollBehavior(to) {
if (to.hash) {
return {
el: to.hash,
Expand All @@ -61,7 +60,7 @@ const router = createRouter({
},
})

router.beforeEach((to, from) => {
router.beforeEach((to) => {
useSynopsisStore().setupLanguage(to.params.language)
useSynopsisStore().setupTranslation(to.params.translation)
})
Expand Down
2 changes: 1 addition & 1 deletion src/views/IndexView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {

<IndexRecord :chapter-name="synopsisStore.currentSynopsis.chapters[0].chapter_name"
:subchapters="synopsisStore.currentSynopsis.chapters[0].subchapters" />
<template v-for="chapterIndex in synopsisStore.currentSynopsis.chapters.length - 1">
<template v-for="chapterIndex in synopsisStore.currentSynopsis.chapters.length - 1" :key="chapterIndex">
<IndexRecord v-if="visibleIndex >= chapterIndex"
:chapter-name="synopsisStore.currentSynopsis.chapters[chapterIndex].chapter_name"
:subchapters="synopsisStore.currentSynopsis.chapters[chapterIndex].subchapters" />
Expand Down
5 changes: 2 additions & 3 deletions src/views/SynopsisView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import Chapter from '@/components/Chapter.vue'
import type { ChapterScheme } from '@/interfaces/synopsisInterface';
import { useSynopsisStore } from "@/stores/SynopsisStore"
Expand Down Expand Up @@ -88,8 +87,8 @@ export default {
</div>
</div>

<template v-show="!showScroller" v-for="chapterIndex in synopsisStore.currentSynopsis.chapters.length">
<Chapter v-if="visibleIndex >= chapterIndex - 1"
<template v-for="chapterIndex in synopsisStore.currentSynopsis.chapters.length">
<Chapter v-show="!showScroller" v-if="visibleIndex >= chapterIndex - 1"
:chapter="synopsisStore.currentSynopsis.chapters[chapterIndex - 1]" />
</template>

Expand Down

0 comments on commit a163dc4

Please sign in to comment.