Skip to content

Commit

Permalink
style: fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Aug 9, 2024
1 parent 8793484 commit 074ade6
Show file tree
Hide file tree
Showing 18 changed files with 172 additions and 176 deletions.
4 changes: 2 additions & 2 deletions core/client/components/KTab.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div v-if="hasTabs" class="fit column">
<!-- Tabs -->
<q-tabs
<q-tabs
v-model="current"
:no-caps="noCaps"
outside-arrows
Expand Down Expand Up @@ -92,4 +92,4 @@ function getLabel (index) {
function onTriggered (params) {
emit('triggered', params)
}
</script>
</script>
2 changes: 1 addition & 1 deletion core/client/components/action/KToggleFullscreenAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const actionRef = ref(null)
watch(Fullscreen, () => {
if (actionRef.value.isToggled !== Fullscreen.value) actionRef.value.toggle()
})
</script>
</script>
34 changes: 17 additions & 17 deletions core/client/components/collection/KCollection.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="column no-wrap">
<!--
Header
<!--
Header
-->
<div class="q-pr-xs q-pb-xs">
<slot name="header">
<KPanel
<KPanel
:content="header"
:class="headerClass"
/>
Expand Down Expand Up @@ -40,15 +40,15 @@
</div>
<template v-slot:loading>
<div class="text-center q-my-md">
<q-spinner-dots
color="primary"
size="40px"
<q-spinner-dots
color="primary"
size="40px"
/>
</div>
</template>
</q-infinite-scroll>
</div>
<!-- Paginated mode -->
<!-- Paginated mode -->
<div v-else class="fit row">
<template v-for="item in items" :key="item._id">
<div :class="rendererClass">
Expand All @@ -73,28 +73,28 @@
</div>
</div>
</div>
<!-- Empty slot -->
<!-- Empty slot -->
<div v-else>
<slot name="empty">
<div class="row justify-center">
<KStamp
icon="las la-exclamation-circle"
icon-size="1.6rem"
<KStamp
icon="las la-exclamation-circle"
icon-size="1.6rem"
:text="$t('KCollection.EMPTY_LABEL')"
direction="horizontal"
direction="horizontal"
class="q-pa-md"
/>
</div>
</slot>
</div>
<!--
<!--
Footer
-->
<div>
<slot name="footer">
<q-separator inset v-if="footer"/>
<KPanel
:content="footer"
<KPanel
:content="footer"
:class="footerClass"
/>
</slot>
Expand Down Expand Up @@ -199,9 +199,9 @@ function onItemSelected (item, section) {
}
function onCollectionRefreshed () {
emit('collection-refreshed', items.value)
// call done callback if needed
// call done callback if needed
if (doneFunction) {
doneFunction(items.value.length === nbTotalItems.value ? true : false)
doneFunction(items.value.length === nbTotalItems.value)
doneFunction = null
}
}
Expand Down
56 changes: 28 additions & 28 deletions core/client/components/collection/KTimeLine.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="column no-wrap">
<!--
Header
<!--
Header
-->
<div class="q-pr-xs q-pb-xs">
<slot name="header">
<KPanel
<KPanel
:content="header"
:class="headerClass"
/>
Expand All @@ -14,19 +14,19 @@
<div v-if="items.length > 0" class="scroll">
<!--
Content
-->
<q-timeline
-->
<q-timeline
color="primary"
:layout="layout"
>
<q-infinite-scroll
@load="onLoad"
<q-infinite-scroll
@load="onLoad"
:initial-index="1"
:offset="100"
:offset="100"
>
<template v-for="item in items" :key="item._id">
<!-- Heading entry if any -->
<q-timeline-entry
<q-timeline-entry
v-if="getHeading(item)"
:heading="true"
>
Expand All @@ -35,7 +35,7 @@
</div>
</q-timeline-entry>
<!-- Item entry -->
<q-timeline-entry
<q-timeline-entry
:color="getColor(item)"
>
<template v-slot:title>
Expand Down Expand Up @@ -65,43 +65,43 @@
:item="item"
:contextId="contextId"
:is="itemRenderer"
v-bind="renderer"
v-bind="renderer"
/>
</div>
</q-timeline-entry>
</template>
<template v-slot:loading>
<div class="text-center q-my-md">
<q-spinner-dots
color="primary"
size="40px"
<q-spinner-dots
color="primary"
size="40px"
/>
</div>
</template>
</q-infinite-scroll>
</q-timeline>
</div>
<!-- Empty slot -->
<!-- Empty slot -->
<div v-else>
<slot name="empty">
<div class="row justify-center">
<KStamp
icon="las la-exclamation-circle"
icon-size="1.6rem"
:text="$t('KTimeLine.EMPTY_LABEL')"
direction="horizontal"
<KStamp
icon="las la-exclamation-circle"
icon-size="1.6rem"
:text="$t('KTimeLine.EMPTY_LABEL')"
direction="horizontal"
/>
</div>
</slot>
</div>
<!--
<!--
Footer
-->
<div>
<slot name="footer">
<q-separator inset v-if="footer"/>
<KPanel
:content="footer"
<KPanel
:content="footer"
:class="footerClass"
/>
</slot>
Expand Down Expand Up @@ -132,7 +132,7 @@ const props = defineProps({
},
baseQuery: {
type: Object,
default: () => { return { $sort: { createdAt: -1 } } }
default: () => { return { $sort: { createdAt: -1 } } }
},
filterQuery: {
type: Object,
Expand Down Expand Up @@ -163,7 +163,7 @@ const props = defineProps({
},
schema: {
type: Object,
default: () => {
default: () => {
return {
colorField: 'color',
titleField: 'name',
Expand Down Expand Up @@ -249,9 +249,9 @@ function onCollectionRefreshed () {
_.forEach(items.value, (item, index) => {
item.previous = index > 0 ? items.value[index - 1] : null
})
// call done callback if needed
// call done callback if needed
if (doneFunction) {
doneFunction(items.value.length === nbTotalItems.value ? true : false)
doneFunction(items.value.length === nbTotalItems.value)
doneFunction = null
}
}
Expand Down Expand Up @@ -283,4 +283,4 @@ onBeforeUnmount(() => {
.q-timeline__content {
padding-bottom: 16px;
}
</style>
</style>
2 changes: 1 addition & 1 deletion core/client/components/document/KImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const props = defineProps({
},
options: {
type: Object,
default: () => {
default: () => {
return {
interactive: true
}
Expand Down
10 changes: 5 additions & 5 deletions core/client/components/document/KPdf.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ watch(() => props.url, async (value) => {
const blob = await response.blob()
const reader = new FileReader()
reader.onloadend = () => {
viewer = new Viewer({
domContainer: domViewer,
template: {
basePdf: reader.result,
viewer = new Viewer({
domContainer: domViewer,
template: {
basePdf: reader.result,
schemas: _.get(props.options, 'schemas', defaultSchemas)
},
inputs: _.get(props.options, 'inputs', defaultInputs)
inputs: _.get(props.options, 'inputs', defaultInputs)
})
}
reader.readAsDataURL(blob)
Expand Down
5 changes: 1 addition & 4 deletions core/client/components/layout/KPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ defineProps({
}
})
// Emit
const emit = defineEmits(['content-resized'])
// Data
const $q = useQuasar()
const { Layout } = useLayout()
Expand All @@ -158,7 +155,7 @@ const layoutOffset = ref(0)
// Computed
const contentStyleFunction = computed(() => {
const layoutPadding = $q.screen.xs ? 16: $q.screen.lt.xl ? 32 : 48
const layoutPadding = $q.screen.xs ? 16 : $q.screen.lt.xl ? 32 : 48
const widthOffset = layoutPadding
const heightOffset = layoutOffset.value + layoutPadding
return {
Expand Down
7 changes: 3 additions & 4 deletions core/client/components/layout/KWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ function refresh (newState, oldState) {
}
function setPinnedGeometry () {
const size = computeResponsiveSize(currentWindow.sizePolicy.pinned)
console.log(size)
let x, y
if (props.placement === 'top' || props.placement === 'bottom') {
x = $q.screen.width / 2 - size[0] / 2
Expand Down Expand Up @@ -386,9 +385,9 @@ const onResized = _.throttle((event) => {
}
}, 5)
const onScreenResized = _.throttle(() => {
if (currentWindow.state === 'pinned') setPinnedGeometry()
else if (currentWindow.state === 'maximized') setMaximizedGeometry()
else updateGeometry(currentWindow.position, currentWindow.size, true)
if (currentWindow.state === 'pinned') setPinnedGeometry()
else if (currentWindow.state === 'maximized') setMaximizedGeometry()
else updateGeometry(currentWindow.position, currentWindow.size, true)
}, 50)
function onHeaderResized (size) {
headerHeight.value = size.height
Expand Down
8 changes: 4 additions & 4 deletions core/client/components/time/KAbsoluteTimeRange.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<KDateTimeRange
v-model="dateTimeRangeModel"
v-model="dateTimeRangeModel"
:options="dateTimeRangeOptions"
:min="props.min"
:min="props.min"
:max="props.max"
:dense="props.dense"
:disabled="props.disabled"
Expand Down Expand Up @@ -68,7 +68,7 @@ watch(dateTimeRangeModel, (newDateTimeRange, oldDateTimeRange) => {
function onTimeRangeUpdated () {
const { start, end } = Time.getRange()
dateTimeRangeModel.value = {
start: start.toISOString(),
start: start.toISOString(),
end: end.toISOString()
}
}
Expand All @@ -80,4 +80,4 @@ onMounted(() => {
onBeforeUnmount(() => {
Events.off('time-range-changed', onTimeRangeUpdated)
})
</script>
</script>
2 changes: 1 addition & 1 deletion core/client/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Document = {
png: 'document/KImage'
},
htmlSanitizer: {
allowedTags: sanitize.defaults.allowedTags.concat([ 'img' ])
allowedTags: sanitize.defaults.allowedTags.concat(['img'])
},
mdConverter: {}
})
Expand Down
6 changes: 3 additions & 3 deletions core/client/units.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const Units = {
// Set the units object within the store
Store.set('units', _.defaultsDeep(config.units || {},
quantities,
{
{
default: {
length: 'm',
altitude: 'm',
Expand All @@ -230,8 +230,8 @@ export const Units = {
equivalentDoseRate: 'usvh',
notation: 'auto',
precision: 3
},
}
}
}
))
// Create units not defined by default in mathjs
this.getQuantities().forEach(quantity => {
Expand Down
8 changes: 4 additions & 4 deletions map/client/components/catalog/KCategoryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const headerClass = computed(() => {
const icon = computed(() => {
_.get(props.category, 'icon.name', _.get(props.category, 'icon'))
})
const defaultOpened = computed (() => {
let states = LocalStorage.get(localStorageKey)
const defaultOpened = computed(() => {
const states = LocalStorage.get(localStorageKey)
if (states && _.has(states, getId())) return states[getId()]
// if category explicitly specify default opened state, use that
if (_.has(props.category, 'options.open')) return props.category.options.open
Expand All @@ -67,8 +67,8 @@ function getId () {
return _.kebabCase(_.replace(props.category.name, 'Categories.', ''))
}
function onToggled (value) {
let states = LocalStorage.get(localStorageKey, {})
const states = LocalStorage.get(localStorageKey, {})
states[getId()] = value
LocalStorage.set(localStorageKey, states)
}
</script>
</script>
Loading

0 comments on commit 074ade6

Please sign in to comment.