Skip to content

Commit

Permalink
chore: Apply eslint fixes (#53)
Browse files Browse the repository at this point in the history
* Apply eslint fixes

* Apply `eslint` fixes for vue files

* More eslint fixes
  • Loading branch information
dmohns authored Mar 4, 2024
1 parent 11b6a0e commit e7b5fd0
Show file tree
Hide file tree
Showing 53 changed files with 471 additions and 485 deletions.
6 changes: 3 additions & 3 deletions Website/ui/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
presets: [
'@vue/cli-plugin-babel/preset'
]
}
4 changes: 2 additions & 2 deletions Website/ui/src/classes/paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export class Paginator {
param['page'] = page
param['per_page'] = this.perPage
return axios.get(this.url, {
params: param
}
params: param
}
).then(response => {
let data = response.data
this.from = data.from
Expand Down
68 changes: 34 additions & 34 deletions Website/ui/src/layouts/MobileTopNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,44 +104,44 @@
import Breadcrumb from '../shared/Breadcrumb'
export default {
name: 'MobileTopNavBar',
components: {Breadcrumb},
data() {
return {
open: false,
mobileSidebarVisible: false
}
},
watch: {
$route() {
this.hideSidebar()
}
},
methods: {
logout() {
this.$store.dispatch('auth/logOut').then(() => {
this.$router.replace('/login')
})
},
showSidebar() {
this.mobileSidebarVisible = true
this.$sidebar.displaySidebar(true)
name: 'MobileTopNavBar',
components: {Breadcrumb},
data() {
return {
open: false,
mobileSidebarVisible: false
}
},
hideSidebar() {
this.mobileSidebarVisible = false
this.$sidebar.displaySidebar(false)
watch: {
$route() {
this.hideSidebar()
}
},
replaceRoute(route) {
this.$router.replace(route)
}
methods: {
logout() {
this.$store.dispatch('auth/logOut').then(() => {
this.$router.replace('/login')
})
},
showSidebar() {
this.mobileSidebarVisible = true
this.$sidebar.displaySidebar(true)
},
hideSidebar() {
this.mobileSidebarVisible = false
this.$sidebar.displaySidebar(false)
},
replaceRoute(route) {
this.$router.replace(route)
}
},
computed: {
adminName() {
return this.$store.getters['auth/getAuthenticateUser'].name
},
}
computed: {
adminName() {
return this.$store.getters['auth/getAuthenticateUser'].name
},
}
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion Website/ui/src/mixins/mapSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const sharedMap = {
if (layer._icon) {
layer.remove()
}
});
})
},
},
computed: {
Expand Down
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 @@ -105,7 +105,7 @@ export default {
}
try {
this.loading = true
const appliances = await this.applianceService.createAppliance()
const appliances = await this.applianceService.createAppliance()
this.loading = false
this.alertNotify('success', this.$tc('phrases.newAppliance', 1))
Expand Down
13 changes: 6 additions & 7 deletions Website/ui/src/modules/Client/Appliances/SellApplianceModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,13 @@ export default {
if (this.isDeviceBindingRequired(appliance)) {
this.isDeviceSelectionRequired = true
this.deviceSelectionList = availableDevices.filter((device) => {
debugger
switch (appliance.assetTypeId) {
case APPLIANCE_TYPE_SHS_ID:
return (device.deviceType === 'solar_home_system' && device.device.assetId === this.selectedApplianceId)
case APPLIANCE_TYPE_E_BIKE_ID:
return (device.deviceType === 'e_bike' && device.device.assetId === this.selectedApplianceId)
default:
return false
case APPLIANCE_TYPE_SHS_ID:
return (device.deviceType === 'solar_home_system' && device.device.assetId === this.selectedApplianceId)
case APPLIANCE_TYPE_E_BIKE_ID:
return (device.deviceType === 'e_bike' && device.device.assetId === this.selectedApplianceId)
default:
return false
}
}).map(device => {
return {
Expand Down
16 changes: 8 additions & 8 deletions Website/ui/src/modules/Client/Client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ export default {
const lon = parseFloat(points[1])
let markerType = ''
switch (device.device_type) {
case 'e_bike':
markerType = MARKER_TYPE.E_BIKE
break
case 'shs':
markerType = MARKER_TYPE.SHS
break
default:
markerType = MARKER_TYPE.METER
case 'e_bike':
markerType = MARKER_TYPE.E_BIKE
break
case 'shs':
markerType = MARKER_TYPE.SHS
break
default:
markerType = MARKER_TYPE.METER
}
markingInfos.push({
id: device.id,
Expand Down
4 changes: 2 additions & 2 deletions Website/ui/src/modules/Client/Clients.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import {People} from '@/classes/people'
import {timing} from '@/mixins/timing'
import i18n from '../../i18n'
import AddClientModal from '@/modules/Client/AddClientModal.vue'
import {OutstandingDebtsExportService} from "@/services/OutstandingDebtsExportService";
import {OutstandingDebtsExportService} from '@/services/OutstandingDebtsExportService'
const debounce = require('debounce')
Expand Down Expand Up @@ -176,7 +176,7 @@ export default {
this.searchTerm = ''
},
exportDebts () {
const email = this.$store.getters['auth/getAuthenticateUser'].email;
const email = this.$store.getters['auth/getAuthenticateUser'].email
window.open(this.outstandingDebtsExportService.exportOutstandingDebts(email))
}
}
Expand Down
24 changes: 12 additions & 12 deletions Website/ui/src/modules/Client/PaymentDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ export default {
async getFlow (period = 'M') {
switch (period) {
case 'Y':
this.periodName = this.$tc('words.annually')
break
case 'M':
this.periodName = this.$tc('words.month', 2)
break
case 'W':
this.periodName = this.$tc('words.week', 2)
break
case 'D':
this.periodName = this.$tc('words.day', 2)
break
case 'Y':
this.periodName = this.$tc('words.annually')
break
case 'M':
this.periodName = this.$tc('words.month', 2)
break
case 'W':
this.periodName = this.$tc('words.week', 2)
break
case 'D':
this.periodName = this.$tc('words.day', 2)
break
}
try {
await this.paymentService.getPaymentDetail(this.personId, period)
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Cluster/AddCluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ export default {
editedItems.forEach((item) => {
const editedGeoDataItem = this.mappingService.searchedOrDrawnItems.find(x => x.type === item.type)
if (editedGeoDataItem) {
debugger
editedGeoDataItem.geojson.coordinates = item.geojson.coordinates
editedGeoDataItem.lat = item.lat
editedGeoDataItem.lon = item.lon
Expand Down
2 changes: 1 addition & 1 deletion Website/ui/src/modules/EBikes/AddEBikeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import Widget from '@/shared/widget.vue'
import {ManufacturerService} from '@/services/ManufacturerService'
import {ApplianceService} from '@/services/ApplianceService'
import {timing, notify} from '@/mixins'
import {EBikeService} from "@/services/EBikeService";
import {EBikeService} from '@/services/EBikeService'
//these are fixed values in the database
const MANUFACTURER_TYPE = 'e-bike'
Expand Down
8 changes: 4 additions & 4 deletions Website/ui/src/modules/EBikes/EBikeDetailModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@
</template>

<script>
import Widget from "@/shared/widget.vue";
import {notify, timing} from "@/mixins";
import {EBikeService} from "@/services/EBikeService";
import Box from "@/modules/Box.vue";
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',
Expand Down
6 changes: 3 additions & 3 deletions Website/ui/src/modules/EBikes/EBikes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ import {notify, timing} from '@/mixins'
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";
import {EBikeService} from '@/services/EBikeService'
import AddSolarHomeSystemModal from '@/modules/SolarHomeSystem/AddSolarHomeSystemModal.vue'
import EBikeDetailModal from '@/modules/EBikes/EBikeDetailModal.vue'
export default {
name: 'EBikes',
Expand Down
2 changes: 1 addition & 1 deletion Website/ui/src/modules/Map/ClusterMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default {
miniGridMarker.bindTooltip('Mini Grid: ' + markingInfo.name)
const parent = this
miniGridMarker.on('click', function () {
parent.routeToDetail(`/dashboards/mini-grid`,markingInfo.id)
parent.routeToDetail('/dashboards/mini-grid',markingInfo.id)
})
if (markingInfo.dataStream > 0) {
miniGridMarker.addTo(dataLoggerActiveMiniGrids)
Expand Down
18 changes: 9 additions & 9 deletions Website/ui/src/modules/Map/MiniGridMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default {
},
setDeviceMarkers () {
this.mappingService.markingInfos.filter((markingInfo) => markingInfo.markerType === MARKER_TYPE.METER || markingInfo.markerType === MARKER_TYPE.SHS || markingInfo.markerType === MARKER_TYPE.E_BIKE).map((markingInfo) => {
const deviceMarkerIcon = L.icon({
const deviceMarkerIcon = L.icon({
...ICON_OPTIONS,
iconUrl: ICONS[markingInfo.markerType]
})
Expand Down Expand Up @@ -271,14 +271,14 @@ export default {
const lon = parseFloat(points[1])
let markerType = ''
switch (device.device_type) {
case 'e_bike':
markerType = MARKER_TYPE.E_BIKE
break
case 'shs':
markerType = MARKER_TYPE.SHS
break
default:
markerType = MARKER_TYPE.METER
case 'e_bike':
markerType = MARKER_TYPE.E_BIKE
break
case 'shs':
markerType = MARKER_TYPE.SHS
break
default:
markerType = MARKER_TYPE.METER
}
markingInfos.push({
id: miniGridWithGeoData.id,
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 @@ -23,7 +23,7 @@ export default {
if (layer.getBounds) {
cluster = layer
}
});
})
const bounds = cluster.getBounds()
this.removeExistingMarkers()
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Meter/Basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default {
})
this.meter.owner = device.person
console.log(this.meter.owner)
debugger
this.alertNotify('success', 'Updated Successfully.')
this.resetOwnerEditing()
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion Website/ui/src/modules/MiniGrid/AddMiniGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default {
methods: {
async getClusters () {
try {
await this.clusterService.getClusters()
await this.clusterService.getClusters()
if (this.clusterService.list.length) {
this.selectedClusterId = this.clusterService.list[this.clusterService.list.length - 1].id
} else {
Expand Down
2 changes: 1 addition & 1 deletion Website/ui/src/modules/MiniGrid/EnergyChartBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default {
return
}
this.batteryService.prepareChartData()
this.batteryService.prepareChartData()
})
},
initPVChart () {
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/MiniGrid/RevenuePerCustomerType.vue
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
1 change: 0 additions & 1 deletion Website/ui/src/modules/MiniGrid/TicketsOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
</template>

<script>
import { RevenueService } from '@/services/RevenueService'
import Widget from '../../shared/widget'
import Loader from '@/shared/Loader.vue'
import { EventBus } from '@/shared/eventbus'
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Sms/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ export default {
})
},
searchSms (text) {
debugger
this.numberList = this.smsService.searchSms(text)
}
}
Expand Down
1 change: 0 additions & 1 deletion Website/ui/src/modules/Sms/NewSms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ export default {
this.smsService.resultList = []
},
addNumberToReceivers (phone) {
debugger
this.smsService.receiverList.push({
id: -1,
display: phone,
Expand Down
Loading

0 comments on commit e7b5fd0

Please sign in to comment.