Skip to content

Commit

Permalink
refactor: change icons in HistoryListEntryMaintenance
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Mar 19, 2024
1 parent 49e9721 commit 8fedaa4
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions src/components/panels/History/HistoryListEntryMaintenance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<v-simple-checkbox v-ripple :value="isSelected" class="pa-0 mr-0" @click.stop="select(!isSelected)" />
</td>
<td class="px-0 text-center" style="width: 32px">
<v-icon color="primary">{{ mdiNotebook }}</v-icon>
<v-icon color="primary">{{ icon }}</v-icon>
</td>
<td>{{ item.name }}</td>
<td class="text-right text-no-wrap">
<v-tooltip top :disabled="item.reminder?.type === null">
<v-tooltip v-if="reminder !== null" top>
<template #activator="{ on, attrs }">
<v-icon small color="primary" v-bind="attrs" v-on="on">
{{ mdiAlarm }}
{{ alarmIcon }}
</v-icon>
</template>
<div>
Expand Down Expand Up @@ -61,8 +61,17 @@
import { Component, Mixins, Prop } from 'vue-property-decorator'
import Panel from '@/components/ui/Panel.vue'
import BaseMixin from '@/components/mixins/base'
import { mdiAdjust, mdiAlarm, mdiCalendar, mdiDelete, mdiNotebook, mdiTextBoxSearch } from '@mdi/js'
import { HistoryListPanelRow } from '@/components/panels/HistoryListPanel.vue'
import {
mdiAdjust,
mdiAlarm,
mdiAlarmMultiple,
mdiCalendar,
mdiDelete,
mdiNotebook,
mdiNotebookCheck,
mdiTextBoxSearch,
} from '@mdi/js'
import { HistoryListPanelCol } from '@/components/panels/HistoryListPanel.vue'
import { GuiMaintenanceStateEntry } from '@/store/gui/maintenance/types'
import HistoryListPanelDetailMaintenance from '@/components/dialogs/HistoryListPanelDetailMaintenance.vue'
Expand All @@ -84,7 +93,7 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
contextMenuY = 0
@Prop({ type: Object, required: true }) readonly item!: GuiMaintenanceStateEntry
@Prop({ type: Array, required: true }) readonly tableFields!: HistoryListPanelRow[]
@Prop({ type: Array, required: true }) readonly tableFields!: HistoryListPanelCol[]
@Prop({ type: Boolean, required: true }) readonly isSelected!: boolean
get cssClasses() {
Expand Down Expand Up @@ -162,6 +171,22 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
return `${this.restDays.toFixed(0)} / ${value} days`
}
get reminder() {
return this.item.reminder?.type ?? null
}
get alarmIcon() {
if (this.reminder === 'repeat') return mdiAlarmMultiple
return mdiAlarm
}
get icon() {
if (this.item.end_time !== null) return mdiNotebookCheck
return mdiNotebook
}
select(newVal: boolean) {
this.$emit('select', newVal)
}
Expand Down

0 comments on commit 8fedaa4

Please sign in to comment.