mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
chore: fix vue/custom-event-name-casing ESLint rule
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
772e0349fc
commit
a0871deec4
3 changed files with 28 additions and 52 deletions
|
|
@ -133,7 +133,6 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import type { INode } from '@nextcloud/files'
|
||||
import type { PropType } from 'vue'
|
||||
import type { Version } from '../utils/versions.ts'
|
||||
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
|
|
@ -154,44 +153,23 @@ import Pencil from 'vue-material-design-icons/PencilOutline.vue'
|
|||
import Delete from 'vue-material-design-icons/TrashCanOutline.vue'
|
||||
import Download from 'vue-material-design-icons/TrayArrowDown.vue'
|
||||
|
||||
const props = defineProps({
|
||||
version: {
|
||||
type: Object as PropType<Version>,
|
||||
required: true,
|
||||
},
|
||||
const props = defineProps<{
|
||||
version: Version
|
||||
node: INode
|
||||
isCurrent: boolean
|
||||
isFirstVersion: boolean
|
||||
loadPreview: boolean
|
||||
canView: boolean
|
||||
canCompare: boolean
|
||||
}>()
|
||||
|
||||
node: {
|
||||
type: Object as PropType<INode>,
|
||||
required: true,
|
||||
},
|
||||
|
||||
isCurrent: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
isFirstVersion: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
loadPreview: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
canView: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
canCompare: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['click', 'compare', 'restore', 'delete', 'label-update-request'])
|
||||
const emit = defineEmits<{
|
||||
click: [version: Version]
|
||||
compare: [version: Version]
|
||||
restore: [version: Version]
|
||||
delete: [version: Version]
|
||||
labelUpdateRequest: []
|
||||
}>()
|
||||
|
||||
const previewLoaded = ref(false)
|
||||
const previewErrored = ref(false)
|
||||
|
|
@ -287,7 +265,7 @@ const isDownloadable = computed(() => {
|
|||
* Label update request
|
||||
*/
|
||||
function labelUpdate() {
|
||||
emit('label-update-request')
|
||||
emit('labelUpdateRequest')
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -318,7 +296,7 @@ function click(event: MouseEvent) {
|
|||
event.preventDefault()
|
||||
}
|
||||
|
||||
emit('click', { version: props.version })
|
||||
emit('click', props.version)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -328,7 +306,7 @@ function compareVersion() {
|
|||
if (!props.canView) {
|
||||
throw new Error('Cannot compare version of this file')
|
||||
}
|
||||
emit('compare', { version: props.version })
|
||||
emit('compare', props.version)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export default defineComponent({
|
|||
},
|
||||
},
|
||||
|
||||
emits: ['need-content'],
|
||||
emits: ['needContent'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -234,7 +234,7 @@ export default defineComponent({
|
|||
|
||||
/**
|
||||
* Whether the user is near the bottom.
|
||||
* If true, then the need-content event will be emitted.
|
||||
* If true, then the needContent event will be emitted.
|
||||
*/
|
||||
isNearBottom(): boolean {
|
||||
const buffer = this.containerHeight * this.bottomBufferRatio
|
||||
|
|
@ -257,15 +257,15 @@ export default defineComponent({
|
|||
isNearBottom(value) {
|
||||
logger.debug('[VirtualScrolling] isNearBottom changed', { value })
|
||||
if (value) {
|
||||
this.$emit('need-content')
|
||||
this.$emit('needContent')
|
||||
}
|
||||
},
|
||||
|
||||
visibleSections() {
|
||||
// Re-emit need-content when rows is updated and isNearBottom is still true.
|
||||
// Re-emit needContent when rows is updated and isNearBottom is still true.
|
||||
// If the height of added rows is under `bottomBufferRatio`, `isNearBottom` will still be true so we need more content.
|
||||
if (this.isNearBottom) {
|
||||
this.$emit('need-content')
|
||||
this.$emit('needContent')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -234,10 +234,9 @@ async function handleDelete(version: Version) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param payload - The event payload
|
||||
* @param payload.version - The version to open
|
||||
* @param version - The version to open
|
||||
*/
|
||||
function openVersion({ version }: { version: Version }) {
|
||||
function openVersion(version: Version) {
|
||||
if (props.node === null) {
|
||||
return
|
||||
}
|
||||
|
|
@ -261,10 +260,9 @@ function openVersion({ version }: { version: Version }) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param payload - The event payload
|
||||
* @param payload.version - The version to compare
|
||||
* @param version - The version to compare
|
||||
*/
|
||||
function compareVersion({ version }: { version: Version }) {
|
||||
function compareVersion(version: Version) {
|
||||
const _versions = versions.value.map((version) => ({ ...version, previewUrl: undefined }))
|
||||
|
||||
window.OCA.Viewer.compare(
|
||||
|
|
|
|||
Loading…
Reference in a new issue