Skip to content

Commit

Permalink
chore: Apply more Eslint fixes (#54)
Browse files Browse the repository at this point in the history
* chore: Apply more Eslint fixes

* Exclude hard to fix lint errors

* Fix previously ignored lint errors

* Apply fixes in `WaveComService`
  • Loading branch information
dmohns authored Mar 6, 2024
1 parent e7b5fd0 commit 5270299
Show file tree
Hide file tree
Showing 36 changed files with 54 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Website/ui/src/modules/Assets/AddAsset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<md-option disabled value>--{{ $tc('words.select') }}--</md-option>
<md-option
:value="applianceType.id"
v-for="(applianceType, index) in assetTypeService.list"
v-for="applianceType in assetTypeService.list"
:key="applianceType.id"
>{{ applianceType.name }}
</md-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<md-option disabled value>--{{ $tc('words.select') }}--</md-option>
<md-option
:value="appliance.id"
v-for="(appliance, index) in appliances"
v-for="appliance in appliances"
:key="appliance.id"
>{{ appliance.name }}
</md-option>
Expand Down Expand Up @@ -63,7 +63,7 @@
<md-option disabled value>--{{ $tc('words.select') }}--</md-option>
<md-option
:value="appliance.id"
v-for="(appliance, index) in appliances"
v-for="appliance in appliances"
:key="appliance.id"
>{{ appliance.name }}
</md-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<md-option disabled value>--{{ $tc('words.select') }}--</md-option>
<md-option
:value="appliance.id"
v-for="(appliance, index) in applianceService.list"
v-for="appliance in applianceService.list"
:key="appliance.id"
>{{ appliance.name }}
</md-option>
Expand Down Expand Up @@ -119,7 +119,7 @@
<md-option disabled value>--{{ $tc('words.select') }}--</md-option>
<md-option
:value="appliance.id"
v-for="(appliance, index) in applianceService.list"
v-for="appliance in applianceService.list"
:key="appliance.id"
>{{ appliance.name }}
</md-option>
Expand Down Expand Up @@ -229,6 +229,7 @@
:options="deviceSelectionList"
:loading="loading"
:show-no-results="true">
<!-- eslint-disable-next-line vue/no-unused-vars -->
<template slot="clear" slot-scope="props">
<div class="multiselect__clear" v-if="deviceSelectionList.length"></div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ import { AssetRateService } from '@/services/AssetRateService'
import moment from 'moment'
import { EventBus } from '@/shared/eventbus'
import { AppliancePaymentService } from '@/services/AppliancePaymentService'
import SellApplianceModal from '@/modules/Client/Appliances/SellApplianceModal.vue'
export default {
name: 'SoldApplianceDetail',
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Client/SmsHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@

<script>
import Widget from '../../shared/widget'
import { resources } from '@/resources'
import { EventBus } from '@/shared/eventbus'
import moment from 'moment'
import { SmsService } from '@/services/SmsService'
Expand Down
3 changes: 1 addition & 2 deletions Website/ui/src/modules/Cluster/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ import { MappingService, MARKER_TYPE } from '@/services/MappingService'
import { notify } from '@/mixins'
import FinancialOverview from '@/modules/Dashboard/FinancialOverview'
import { EventBus } from '@/shared/eventbus'
import Loader from '@/shared/Loader'
import moment from 'moment'
import ClusterMap from '@/modules/Map/ClusterMap.vue'
export default {
name: 'Dashboard',
mixins: [notify],
components: {
Loader,
RevenueTrends,
FinancialOverview,
BoxGroup,
Expand Down
1 change: 1 addition & 0 deletions Website/ui/src/modules/Cluster/RevenueTrends.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default {
})
},
watch: {
// eslint-disable-next-line no-unused-vars
clusterRevenueAnalysis (newVal, oldVal) {
this.clusterService.clusterTrends = newVal
this.clusterService.fillTrends()
Expand Down
4 changes: 2 additions & 2 deletions Website/ui/src/modules/Dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ import '@/shared/TableList'
import BoxGroup from '@/modules/Dashboard/BoxGroup'
import FinancialOverview from '@/modules/Dashboard/FinancialOverview'
import DashboardMap from '@/modules/Map/DashboardMap.vue'
import Loader from '@/shared/Loader.vue'
import { notify } from '@/mixins/notify'
import Widget from '@/shared/widget.vue'
import moment from 'moment'
import { MappingService, MARKER_TYPE } from '@/services/MappingService'
export default {
name: 'Dashboard',
components: { DashboardMap, Loader, FinancialOverview, BoxGroup, Widget },
components: { DashboardMap, FinancialOverview, BoxGroup, Widget },
mixins: [notify],
data () {
return {
Expand Down
2 changes: 2 additions & 0 deletions Website/ui/src/modules/Dashboard/FinancialOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default {
mixins: [notify],
props: {
clusterId: {
// eslint-disable-next-line vue/require-prop-type-constructor
type: Number | null,
default: null,
},
Expand Down Expand Up @@ -112,6 +113,7 @@ export default {
},
watch: {
// eslint-disable-next-line no-unused-vars
revenue (newVal, oldVal) {
this.clusterService.financialData = newVal
}
Expand Down
2 changes: 0 additions & 2 deletions Website/ui/src/modules/EBikes/AddEBikeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
</template>

<script>
import Widget from '@/shared/widget.vue'
import {ManufacturerService} from '@/services/ManufacturerService'
import {ApplianceService} from '@/services/ApplianceService'
import {timing, notify} from '@/mixins'
Expand All @@ -85,7 +84,6 @@ const APPLIANCE_TYPE_ID = 2
export default {
name: 'AddEBikeModal',
components: {Widget},
mixins: [notify, timing],
props: {
showAddEBike: {
Expand Down
3 changes: 1 addition & 2 deletions Website/ui/src/modules/EBikes/EBikeDetailModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@
</template>

<script>
import Widget from '@/shared/widget.vue'
import {notify, timing} from '@/mixins'
import {EBikeService} from '@/services/EBikeService'
import Box from '@/modules/Box.vue'
export default {
name: 'EBikeDetailModal',
components: {Box, Widget},
components: {Box},
mixins: [notify, timing],
props: {
showEBikeDetail: {
Expand Down
3 changes: 1 addition & 2 deletions Website/ui/src/modules/EBikes/EBikes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ import {EventBus} from '@/shared/eventbus'
import Widget from '@/shared/widget'
import AddEBikeModal from '@/modules/EBikes/AddEBikeModal.vue'
import {EBikeService} from '@/services/EBikeService'
import AddSolarHomeSystemModal from '@/modules/SolarHomeSystem/AddSolarHomeSystemModal.vue'
import EBikeDetailModal from '@/modules/EBikes/EBikeDetailModal.vue'
export default {
name: 'EBikes',
mixins: [notify, timing],
components: {EBikeDetailModal, AddSolarHomeSystemModal, AddEBikeModal, Widget},
components: {EBikeDetailModal, AddEBikeModal, Widget},
data () {
return {
eBikeService: new EBikeService(),
Expand Down
5 changes: 0 additions & 5 deletions Website/ui/src/modules/Map/ClientMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
</template>

<script>
import Widget from '@/shared/widget.vue'
import {ICON_OPTIONS, ICONS, MARKER_TYPE} from '@/services/MappingService'
import {notify, sharedMap} from '@/mixins'
export default {
name: 'ClientMap',
mixins: [notify, sharedMap],
components: {
Widget,
Map,
},
mounted () {
this.map.on('draw:edited', (event) => {
const editedItems = []
Expand Down
5 changes: 3 additions & 2 deletions Website/ui/src/modules/Map/MiniGridMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default {
mixins: [sharedMap, notify],
props: {
miniGridId: {
// eslint-disable-next-line vue/require-prop-type-constructor
type: Number | String,
required: false
}
Expand All @@ -37,7 +38,7 @@ export default {
this.map.on('draw:created', (event) => {
const type = event.layerType
const layer = event.layer
const drawnLayers = drawingLayer.getLayers()
// const drawnLayers = drawingLayer.getLayers()
let cluster = null
map.eachLayer(function (layer) {
if (layer.getBounds) {
Expand Down Expand Up @@ -139,7 +140,7 @@ export default {
// "this" cannot be used inside the L.geoJson function
const nonEditableLayers = this.nonEditableLayer
const editableLayers = this.editableLayer
// const editableLayers = this.editableLayer
const geoDataItems = this.geoDataItems
const map = this.map
const drawnCluster = L.geoJson(drawing, {
Expand Down
2 changes: 1 addition & 1 deletion Website/ui/src/modules/Map/VillageMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
this.map.on('draw:created', (event) => {
const type = event.layerType
const layer = event.layer
const drawnLayers = drawingLayer.getLayers()
// const drawnLayers = drawingLayer.getLayers()
let cluster = null
map.eachLayer(function (layer) {
if (layer.getBounds) {
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Meter/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ import Widget from '@/shared/widget'
import { TariffService } from '@/services/TariffService'
import { ConnectionTypeService } from '@/services/ConnectionTypeService'
import { ConnectionGroupService } from '@/services/ConnectionGroupService'
import { SubConnectionTypeService } from '@/services/SubConnectionTypeService'
import { MeterService } from '@/services/MeterService'
import { currency } from '@/mixins/currency'
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/MiniGrid/AddMiniGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export default {
components: {
MgMap,
Widget,
Map,
RedirectionModal
},
data () {
Expand Down
3 changes: 1 addition & 2 deletions Website/ui/src/modules/MiniGrid/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
import RevenueTargetPerCustomerType from '@/modules/MiniGrid/RevenueTargetPerCustomerType.vue'
import EnergyChartBox from '@/modules/MiniGrid/EnergyChartBox.vue'
import MiniGridMap from '@/modules/Map/MiniGridMap.vue'
import TargetList from '@/modules/MiniGrid/TargetList.vue'
import RevenueTrends from '@/modules/MiniGrid/RevenueTrends.vue'
import BoxGroup from '@/modules/MiniGrid/BoxGroup.vue'
import TicketsOverview from '@/modules/MiniGrid/TicketsOverview.vue'
Expand All @@ -188,14 +187,14 @@ import Stepper from '@/shared/stepper.vue'
import { ICONS, MappingService } from '@/services/MappingService'
import Widget from '@/shared/widget'
import { DeviceAddressService } from '@/services/DeviceAddressService'
import moment from 'moment'
export default {
name: 'Dashboard',
components: {
RevenueTargetPerCustomerType,
EnergyChartBox,
MiniGridMap,
TargetList,
RevenueTrends,
Stepper,
BoxGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

<script>
import Widget from '../../shared/widget'
import { BatchRevenueService } from '@/services/BatchRevenueService'
import Loader from '@/shared/Loader.vue'
import { EventBus } from '@/shared/eventbus'
Expand Down
5 changes: 2 additions & 3 deletions Website/ui/src/modules/Register/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,11 @@
MicroPowerManager</h2>
</div>
<div class="md-layout md-gutter">
<div v-for="plugin in mpmPluginsService.list"
class="box md-layout-item md-size-25 md-small-size-50">
<div v-for="plugin in mpmPluginsService.list" :key=plugin.id class="box md-layout-item md-size-25 md-small-size-50">
<div class="header-text">{{ plugin.name }}
<input type="checkbox" v-model="plugin.checked"/>
</div>
<small class="sub-text" v-html="plugin.description">{{ plugin.description }}</small>
<small class="sub-text">{{ plugin.description }}</small>

</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Website/ui/src/modules/Settings/PluginSettings.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div>
<div class="md-layout md-gutter">
<div v-for="plugin in plugins" class="box md-layout-item md-size-25 md-small-size-50">
<div v-for="plugin in plugins" :key=plugin.id class="box md-layout-item md-size-25 md-small-size-50">
<div class="header-text">{{ plugin.name }}</div>
<small class="sub-text" v-html="plugin.description">{{ plugin.description }}</small>
<small class="sub-text">{{ plugin.description }}</small>
<md-switch v-model="plugin.checked" @change="onSwitchChange($event,plugin)" class="data-stream-switch"
:disabled="switching"/>
</div>
Expand Down
4 changes: 1 addition & 3 deletions Website/ui/src/modules/Settings/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import Widget from '@/shared/widget'
import MainSettings from './MainSettings'
import MapSettings from './MapSettings'
import TicketSettings from './TicketSettings'
import SmsSettings from './SmsSettings'
import MailSettings from './MailSettings'
import { MainSettingsService } from '@/services/MainSettingsService'
import { MapSettingsService } from '@/services/MapSettingsService'
import { TicketSettingsService } from '@/services/TicketSettingsService'
Expand All @@ -42,7 +40,7 @@ import { notify } from '@/mixins'
export default {
name: 'Settings',
mixins: [notify],
components: { PluginSettings, Widget, MainSettings, MapSettings, TicketSettings, SmsSettings, MailSettings },
components: { PluginSettings, Widget, MainSettings, MapSettings, SmsSettings },
data () {
return {
mainSettingsService: new MainSettingsService(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
</template>

<script>
import Widget from '@/shared/widget.vue'
import { SolarHomeSystemService } from '@/services/SolarHomeSystemService'
import { ManufacturerService } from '@/services/ManufacturerService'
import { ApplianceService } from '@/services/ApplianceService'
Expand All @@ -85,7 +84,6 @@ const APPLIANCE_TYPE_ID = 1
export default {
name: 'AddSolarHomeSystemModal',
components: { Widget },
mixins: [notify, timing],
props: {
showAddShs: {
Expand Down
4 changes: 1 addition & 3 deletions Website/ui/src/modules/Ticket/UserManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@

<script>
import { notify } from '@/mixins/notify'
import Modal from '@/modal/modal.vue'
import AddExternalTicketingUser from '@/modules/Ticket/AddExternalTicketingUser.vue'
import Widget from '@/shared/widget.vue'
import { TicketUserService } from '@/services/TicketUserService'
import { EventBus } from '@/shared/eventbus'
export default {
name: 'UserManagement',
mixing: [notify],
components: { Modal, AddExternalTicketingUser, Widget },
components: { Widget },
data () {
return {
subscriber: 'ticket-user-list',
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Village/AddVillage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export default {
components: {
VillageMap,
Widget,
Map,
RedirectionModal
},
data () {
Expand Down
4 changes: 1 addition & 3 deletions Website/ui/src/pages/Report/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
</template>

<script>
import BookKeeping from '@/modules/ExportedReports/BookKeeping'
import Reports from '@/modules/ExportedReports/Reports'
import PeriodicReports from '@/modules/ExportedReports/PeriodicReports.vue'
export default {
name: 'ReportsPage',
components: { PeriodicReports, BookKeeping, Reports }
components: { Reports }
}
</script>

Expand Down
Loading

0 comments on commit 5270299

Please sign in to comment.