Skip to content

Commit

Permalink
feat: Formatting & linting fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Dziekoński <[email protected]>
  • Loading branch information
mdziekon committed Dec 16, 2023
1 parent 4ace234 commit e6a3c33
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
8 changes: 7 additions & 1 deletion src/components/panels/JobqueuePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@
</template>

<template #item="{ item, index }">
<jobqueue-entry :key="item.job_id" :item="item" :item-queue-index="index" :queue-length="jobs.length" :show-print-button-for-first="false" :content-td-width="contentTdWidth" />
<jobqueue-entry
:key="item.job_id"
:item="item"
:item-queue-index="index"
:queue-length="jobs.length"
:show-print-button-for-first="false"
:content-td-width="contentTdWidth" />
</template>
</v-data-table>
<resize-observer @notify="handleResize" />
Expand Down
26 changes: 21 additions & 5 deletions src/components/panels/Status/JobqueueEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@
<v-icon class="mr-1">{{ mdiFormatVerticalAlignTop }}</v-icon>
{{ $t('JobQueue.MoveToJobQueueStart') }}
</v-list-item>
<v-list-item v-if="!isFirstQueueItem && !isSecondQueueItem" @click="changeQueueItemPosition(contextMenu.item, contextMenu.itemQueueIndex - 1)">
<v-list-item
v-if="!isFirstQueueItem && !isSecondQueueItem"
@click="changeQueueItemPosition(contextMenu.item, contextMenu.itemQueueIndex - 1)">
<v-icon class="mr-1">{{ mdiArrowUpThin }}</v-icon>
{{ $t('JobQueue.MoveQueueItemUp') }}
</v-list-item>
<v-list-item v-if="!isLastQueueItem && !isNextToLastQueueItem" @click="changeQueueItemPosition(contextMenu.item, contextMenu.itemQueueIndex + 1)">
<v-list-item
v-if="!isLastQueueItem && !isNextToLastQueueItem"
@click="changeQueueItemPosition(contextMenu.item, contextMenu.itemQueueIndex + 1)">
<v-icon class="mr-1">{{ mdiArrowDownThin }}</v-icon>
{{ $t('JobQueue.MoveQueueItemDown') }}
</v-list-item>
Expand Down Expand Up @@ -134,7 +138,19 @@ import Component from 'vue-class-component'
import { Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { ServerJobQueueStateJob } from '@/store/server/jobQueue/types'
import { mdiChevronDown, mdiChevronUp, mdiCloseThick, mdiCounter, mdiFile, mdiPlay, mdiPlaylistRemove, mdiFormatVerticalAlignTop, mdiFormatVerticalAlignBottom, mdiArrowUpThin, mdiArrowDownThin } from '@mdi/js'
import {
mdiChevronDown,
mdiChevronUp,
mdiCloseThick,
mdiCounter,
mdiFile,
mdiPlay,
mdiPlaylistRemove,
mdiFormatVerticalAlignTop,
mdiFormatVerticalAlignBottom,
mdiArrowUpThin,
mdiArrowDownThin,
} from '@mdi/js'
import NumberInput from '@/components/inputs/NumberInput.vue'
import { defaultBigThumbnailBackground } from '@/store/variables'
@Component({
Expand Down Expand Up @@ -200,11 +216,11 @@ export default class StatusPanelJobqueueEntry extends Mixins(BaseMixin) {
}
get isLastQueueItem() {
return this.itemQueueIndex === (this.queueLength - 1)
return this.itemQueueIndex === this.queueLength - 1
}
get isNextToLastQueueItem() {
return this.itemQueueIndex === (this.queueLength - 2)
return this.itemQueueIndex === this.queueLength - 2
}
get styleContentTdWidth() {
Expand Down
8 changes: 4 additions & 4 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,17 @@
"JobQueue": {
"AllJobs": "All Jobs",
"Cancel": "Cancel",
"MoveToJobQueueStart": "Move to Queue's start",
"MoveToJobQueueEnd": "Move to Queue's end",
"MoveQueueItemUp" :"Move up",
"MoveQueueItemDown" :"Move down",
"ChangeCount": "Change count",
"Count": "Count",
"Empty": "Empty",
"InvalidCountEmpty": "Input must not be empty!",
"InvalidCountGreaterZero": "Input must be greater than 0!",
"JobQueue": "Job Queue",
"Jobs": "Jobs",
"MoveQueueItemDown": "Move down",
"MoveQueueItemUp": "Move up",
"MoveToJobQueueEnd": "Move to Queue's end",
"MoveToJobQueueStart": "Move to Queue's start",
"Pause": "Pause",
"RemoveFromQueue": "Remove from Queue",
"Start": "Start"
Expand Down
8 changes: 4 additions & 4 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,17 @@
"JobQueue": {
"AllJobs": "Wszystkie wydruki",
"Cancel": "Anuluj",
"MoveToJobQueueStart": "Przenieś na początek kolejki",
"MoveToJobQueueEnd": "Przenieś na koniec kolejki",
"MoveQueueItemUp": "Przenieś wyżej",
"MoveQueueItemDown": "Przenieś niżej",
"ChangeCount": "Zmień ilość",
"Count": "Ilość",
"Empty": "Puste",
"InvalidCountEmpty": "Pole wejściowe nie może być puste!",
"InvalidCountGreaterZero": "Wprowadzona wartość musi być większa niż 0!",
"JobQueue": "Kolejka wydruków",
"Jobs": "Wydruki",
"MoveQueueItemDown": "Przenieś niżej",
"MoveQueueItemUp": "Przenieś wyżej",
"MoveToJobQueueEnd": "Przenieś na koniec kolejki",
"MoveToJobQueueStart": "Przenieś na początek kolejki",
"Pause": "Pauza",
"RemoveFromQueue": "Usuń z kolejki",
"Start": "Start"
Expand Down
2 changes: 1 addition & 1 deletion src/store/server/jobQueue/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const actions: ActionTree<ServerJobQueueState, RootState> = {

changePosition({ getters }, payload: { job_id: string; positionIndex: number }) {
const filenames: string[] = []
const jobs = getters['getJobs'] as ServerJobQueueStateJob[];
const jobs = getters['getJobs'] as ServerJobQueueStateJob[]

const jobToMoveIndex = jobs.findIndex((job: ServerJobQueueStateJob) => job.job_id === payload.job_id)

Expand Down

0 comments on commit e6a3c33

Please sign in to comment.