Skip to content

Commit

Permalink
excluded existing v-html cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Severino committed Oct 17, 2023
1 parent 3034b56 commit 6edd204
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/js/components/BibliographyTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
</tr>
</thead>
<tbody>
<!-- eslint-disable vue/no-v-html -->
<tr
v-for="(entry, i) in state.orderedBibliography"
:key="entry.id"
Expand Down Expand Up @@ -493,6 +494,8 @@
</div>
</td>
</tr>
<!-- eslint-enable vue/no-v-html -->

<tr>
<td :colspan="state.maxTableCols">
<button
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/CommentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@
v-if="comment.content"
class="card-body px-3 py-2"
>
<!-- eslint-disable -->
<p
class="card-text"
v-html="mentionify(comment.content)"
/>
<!-- eslint-enable -->
</div>
</slot>
<slot
Expand Down Expand Up @@ -182,10 +184,12 @@
@click.prevent="toggleReplies(comment)"
>
<div v-show="state.repliesOpen[comment.id]">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="t('global.comments.hide_reply', comment.replies_count, {cnt: comment.replies_count})" />
<i class="fas fa-fw fa-caret-up" />
</div>
<div v-show="!state.repliesOpen[comment.id]">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="t('global.comments.show_reply', comment.replies_count, {cnt: comment.replies_count})" />
<i class="fas fa-fw fa-caret-down" />
</div>
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/EntityDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,12 @@
v-if="state.commentsFetching"
class="mt-2"
>
<!-- eslint-disable vue/no-v-html -->
<p
class="alert alert-info mb-0"
v-html="t('global.comments.fetching')"
/>
<!-- eslint-enable vue/no-v-html -->
</div>
<div
v-else-if="state.commentFetchFailed"
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/NotFound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
<h2 class="display-2 fw-medium">
{{ t('main.app.not_found.title') }}
</h2>
<!-- eslint-disable vue/no-v-html -->
<p
class="lead"
v-html="t('main.app.not_found.msg', {site: currentRoute.path})"
/>
<!-- eslint-enable vue/no-v-html -->
<div class="mt-2 d-flex flex-row gap-4">
<router-link
class="btn btn-outline-primary"
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/Plugins.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
@click="update(plugin)"
>
<i class="fas fa-fw fa-download" />
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="t('main.plugins.update_to', {version: plugin.update_available})" />
</button>
<button
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/attribute/Iconclass.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<span>{{ state.keywords.join(' &bull; ') }}</span>
</div>
<footer class="blockquote-footer mt-2">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="t('main.entity.attributes.iconclass.cite_info', {class: v.value})" />
</footer>
</div>
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/attribute/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
v-for="(l, i) in v.value"
:key="i"
>
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="createAnchorFromUrl(l)" />
<a
href="#"
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/bibliography/BibtexCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
<i class="fas fa-fw fa-copy" />
</small>
</h5>
<!-- eslint-disable vue/no-v-html -->
<span
v-show="state.show"
:id="state.id"
v-html="bibtexify(code, type)"
/>
<!-- eslint-enable vue/no-v-html -->
</div>
</template>

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/modals/system/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
</div>
<hr>
<div class="d-flex flex-row justify-content-between">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="t('main.about.build_info')" />
<div>
<a
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/modals/system/Error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
/>
</div>
<div class="modal-body my-3">
<!-- eslint-disable vue/no-v-html -->
<p
v-if="state.hasRequest"
v-html="t('global.error.request_failed', {method: data.request.method, url: data.request.url, status: data.request.status})"
/>
<!-- eslint-enable vue/no-v-html -->
<alert
:message="`<span class='fw-light fst-italic'>${data.msg.error || JSON.stringify(data.msg)}</span>`"
:type="'error'"
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/modals/user/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@
{{ date(user.created_at, 'DD.MM.YYYY', true, true) }}
</span>
<br>
<!-- eslint-disable-->
<span
v-if="state.isDeactivated"
class="small text-muted bg-warning rounded px-2 py-1"
:title="user.deleted_at"
v-html="t('global.user.deactivated_since', {dt: date(user.deleted_at, 'DD.MM.YYYY', true, true)})"
/>
<!-- eslint-enable-->
</dd>
<dt class="col-md-6">
{{ t('global.email') }}
Expand Down
6 changes: 6 additions & 0 deletions resources/js/components/notification/NotificationBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@
>
<span>{{ state.sender.nickname }}</span>
</a>
<!-- eslint-disable-->
<span
v-html="t('global.notifications.body.user_left_comment_on', {
name: getCommentedObjectName(notf),
})"
/>
<!-- eslint-enable-->
<div>
<router-link :to="getNotificationSourceLink(notf)">
{{ t('global.notifications.body.goto_comments') }}
Expand Down Expand Up @@ -116,11 +118,13 @@
>
<span>{{ state.sender.nickname }}</span>
</a>
<!-- eslint-disable-->
<span
v-html="t('global.notifications.body.user_edited_entity', {
name: `${notf.info.name}`
})"
/>
<!-- eslint-enable-->
<div
class="text-info d-flex flex-row justify-content-between"
:class="state.smallClass"
Expand Down Expand Up @@ -176,6 +180,8 @@
@click.prevent="postReply()"
>
<i class="fas fa-fw fa-reply" />

<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="t('global.notifications.body.reply_to_user', {name: state.sender.nickname})" />
</button>
<button
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/preferences/GuiLanguage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
:placeholder="t('global.select.placeholder')"
@change="onChange"
/>
<!-- eslint-disable -->
<button
v-if="state.showSetButton"
type="button"
Expand All @@ -22,6 +23,7 @@
@click="setBrowserLanguage()"
v-html="t('main.preference.info.set_to_language', {lang: state.browserLanguage})"
/>
<!-- eslint-enable -->
</div>
</div>
</template>
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/preferences/ResetEmail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
class="row mt-3"
>
<div class="col-md-10 offset-md-2">
<!-- eslint-disable -->
<div
class="alert bg-info mb-0 w-50"
v-html="t('main.preference.info.password_reset_link')"
/>
<!-- eslint-enable -->
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/search/Global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@
</div>
</template>
<template #nooptions="">
<!-- eslint-disable -->
<div
v-if="!!state.query"
class="p-2"
v-html="t('global.search_no_results_for', {term: state.query})"
/>
<!-- eslint-enable -->
<div
v-else
class="p-1 text-muted"
Expand Down
8 changes: 8 additions & 0 deletions resources/js/components/search/Simple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@
</div>
</template>
<template #nooptions="">
<!-- eslint-disable -->
<div
v-if="!!state.query"
class="p-2"
v-html="t('global.search_no_results_for', {term: state.query})"
/>
<!-- eslint-enable -->
<div
v-else
class="p-1 text-muted"
Expand Down Expand Up @@ -115,18 +117,22 @@
filterFn: {
type: Function,
required: false,
default: (val) => val,
},
keyText: {
type: String,
required: false,
default: null,
},
keyFn: {
type: Function,
required: false,
default: null,
},
chain: {
type: String,
required: false,
default: null,
},
mode: {
type: String,
Expand All @@ -142,6 +148,7 @@
emits: ['selected', 'entry-click'],
setup(props, context) {
const { t } = useI18n();
const {
delay,
limit,
Expand All @@ -153,6 +160,7 @@
mode,
defaultValue,
} = toRefs(props);
if(!keyText.value && !keyFn.value) {
throw new Error('You have to either provide a key or key function for your search component!');
}
Expand Down

0 comments on commit 6edd204

Please sign in to comment.