Skip to content

Commit 3320fe7

Browse files
authored
eslint fixes (#445)
1 parent 5f47e16 commit 3320fe7

17 files changed

+35
-35
lines changed

admin_ui/src/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default defineComponent({
5757
document.title = this.siteName
5858
},
5959
async beforeCreate() {
60-
let app = this
60+
const app = this
6161
6262
// Handle auth errors - redirect to login.
6363
axios.interceptors.response.use(
@@ -98,7 +98,7 @@ export default defineComponent({
9898
function (error) {
9999
if (error.response && error.response.status == 405) {
100100
console.log("Method not allowed")
101-
let message: i.APIResponseMessage = {
101+
const message: i.APIResponseMessage = {
102102
contents:
103103
"Method not supported - running in read only mode.",
104104
type: "error"
@@ -132,7 +132,7 @@ export default defineComponent({
132132
function (error) {
133133
if (error.response && error.response.status == 502) {
134134
console.log("The server can't be reached.")
135-
let message: i.APIResponseMessage = {
135+
const message: i.APIResponseMessage = {
136136
contents:
137137
"The server can't be reached - please try later.",
138138
type: "error"

admin_ui/src/components/AddRowForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default defineComponent({
5858
const json: { [key: string]: any } = {}
5959
for (const i of form.entries()) {
6060
const key = i[0]
61-
let value = i[1]
61+
const value = i[1]
6262
6363
json[key] = convertFormValue({
6464
key,
@@ -103,7 +103,7 @@ export default defineComponent({
103103
}
104104
},
105105
async mounted() {
106-
let response = await this.$store.dispatch("getNew", this.tableName)
106+
const response = await this.$store.dispatch("getNew", this.tableName)
107107
this.defaults = response.data
108108
}
109109
})

admin_ui/src/components/CSVModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ const fetchExportedRows = async () => {
262262
.join(delimiter.value)
263263
)
264264
].join("\n")
265-
let csv = new Blob([data], {
265+
const csv = new Blob([data], {
266266
type: "text/csv;charset=utf-8;"
267267
})
268268
const url: string = URL.createObjectURL(csv)

admin_ui/src/components/EditRowForm.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default defineComponent({
109109
const json: { [key: string]: any } = {}
110110
for (const i of form.entries()) {
111111
const key = i[0]
112-
let value = i[1]
112+
const value = i[1]
113113
114114
json[key] = convertFormValue({
115115
key,
@@ -118,7 +118,7 @@ export default defineComponent({
118118
})
119119
}
120120
121-
let config: UpdateRow = {
121+
const config: UpdateRow = {
122122
tableName: this.tableName,
123123
rowID: this.rowID,
124124
data: json
@@ -152,7 +152,7 @@ export default defineComponent({
152152
},
153153
async deleteRow() {
154154
if (window.confirm("Are you sure you want to delete this row?")) {
155-
let config: DeleteRow = {
155+
const config: DeleteRow = {
156156
tableName: this.tableName,
157157
rowID: this.rowID
158158
}
@@ -167,7 +167,7 @@ export default defineComponent({
167167
)
168168
}
169169
170-
var message: APIResponseMessage = {
170+
const message: APIResponseMessage = {
171171
contents: "Unable to delete the row.",
172172
type: "error"
173173
}

admin_ui/src/components/FormAdd.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default defineComponent({
109109
const json: { [key: string]: any } = {}
110110
for (const i of form.entries()) {
111111
const key = i[0]
112-
let value: any = i[1]
112+
const value: any = i[1]
113113
114114
json[key] = convertFormValue({
115115
key,
@@ -125,7 +125,7 @@ export default defineComponent({
125125
{ responseType: "blob" }
126126
)
127127
} catch (error) {
128-
var message: APIResponseMessage = {
128+
const message: APIResponseMessage = {
129129
contents: "The form has errors.",
130130
type: "error"
131131
}

admin_ui/src/components/InputField.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export default defineComponent({
368368
},
369369
methods: {
370370
setTextareaHeight() {
371-
let element = this.$refs.textarea as HTMLTextAreaElement
371+
const element = this.$refs.textarea as HTMLTextAreaElement
372372
if (element) {
373373
if (element.scrollHeight > element.clientHeight) {
374374
const cursorPosition = element.selectionStart
@@ -402,7 +402,7 @@ export default defineComponent({
402402
return
403403
}
404404
405-
let formData = new FormData()
405+
const formData = new FormData()
406406
formData.append("table_name", this.currentTableName)
407407
formData.append("column_name", this.columnName)
408408
formData.append("file", file)
@@ -449,7 +449,7 @@ export default defineComponent({
449449
}
450450
}
451451
452-
let message: APIResponseMessage = {
452+
const message: APIResponseMessage = {
453453
contents: errorMessage,
454454
type: "error"
455455
}
@@ -466,7 +466,7 @@ export default defineComponent({
466466
this.localValue = value
467467
}
468468
469-
let app = this
469+
const app = this
470470
471471
setTimeout(function () {
472472
app.setTextareaHeight()

admin_ui/src/components/KeySearchModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default defineComponent({
133133
clearTimeout(this.debounceTimer)
134134
}
135135
136-
let app = this
136+
const app = this
137137
138138
this.debounceTimer = window.setTimeout(async () => {
139139
app.offset = 0

admin_ui/src/components/OrderByModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export default defineComponent({
111111
}
112112
},
113113
mounted() {
114-
let orderByConfigs: OrderByConfig[] | null = this.$store.state.orderBy
114+
const orderByConfigs: OrderByConfig[] | null = this.$store.state.orderBy
115115
116-
let localCopy: OrderByConfig[] = orderByConfigs
116+
const localCopy: OrderByConfig[] = orderByConfigs
117117
? orderByConfigs.map((i) => {
118118
return { ...i }
119119
})

admin_ui/src/components/Pagination.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default defineComponent({
4141
return this.$store.state.pageSize || 1
4242
},
4343
pageCount() {
44-
let count = Math.ceil(this.rowCount / this.pageSize)
44+
const count = Math.ceil(this.rowCount / this.pageSize)
4545
return count < 1 ? 1 : count
4646
},
4747
currentTableName() {

admin_ui/src/components/RowFilter.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default defineComponent({
4141
this.$emit("closeSideBar", false)
4242
},
4343
showSuccess(contents: string) {
44-
var message: APIResponseMessage = {
44+
const message: APIResponseMessage = {
4545
contents: contents,
4646
type: "success"
4747
}
@@ -99,8 +99,8 @@ export default defineComponent({
9999
},
100100
async clearFilters() {
101101
console.log("Clearing ...")
102-
let form: any = this.$refs.form
103-
let _ = [...form.elements].forEach((element) => {
102+
const form: any = this.$refs.form
103+
const _ = [...form.elements].forEach((element) => {
104104
if (element.type == "hidden") {
105105
element.value = ""
106106
}

0 commit comments

Comments
 (0)