Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions admin_ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineComponent({
document.title = this.siteName
},
async beforeCreate() {
let app = this
const app = this

// Handle auth errors - redirect to login.
axios.interceptors.response.use(
Expand Down Expand Up @@ -98,7 +98,7 @@ export default defineComponent({
function (error) {
if (error.response && error.response.status == 405) {
console.log("Method not allowed")
let message: i.APIResponseMessage = {
const message: i.APIResponseMessage = {
contents:
"Method not supported - running in read only mode.",
type: "error"
Expand Down Expand Up @@ -132,7 +132,7 @@ export default defineComponent({
function (error) {
if (error.response && error.response.status == 502) {
console.log("The server can't be reached.")
let message: i.APIResponseMessage = {
const message: i.APIResponseMessage = {
contents:
"The server can't be reached - please try later.",
type: "error"
Expand Down
4 changes: 2 additions & 2 deletions admin_ui/src/components/AddRowForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default defineComponent({
const json: { [key: string]: any } = {}
for (const i of form.entries()) {
const key = i[0]
let value = i[1]
const value = i[1]

json[key] = convertFormValue({
key,
Expand Down Expand Up @@ -103,7 +103,7 @@ export default defineComponent({
}
},
async mounted() {
let response = await this.$store.dispatch("getNew", this.tableName)
const response = await this.$store.dispatch("getNew", this.tableName)
this.defaults = response.data
}
})
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/CSVModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const fetchExportedRows = async () => {
.join(delimiter.value)
)
].join("\n")
let csv = new Blob([data], {
const csv = new Blob([data], {
type: "text/csv;charset=utf-8;"
})
const url: string = URL.createObjectURL(csv)
Expand Down
8 changes: 4 additions & 4 deletions admin_ui/src/components/EditRowForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default defineComponent({
const json: { [key: string]: any } = {}
for (const i of form.entries()) {
const key = i[0]
let value = i[1]
const value = i[1]

json[key] = convertFormValue({
key,
Expand All @@ -118,7 +118,7 @@ export default defineComponent({
})
}

let config: UpdateRow = {
const config: UpdateRow = {
tableName: this.tableName,
rowID: this.rowID,
data: json
Expand Down Expand Up @@ -152,7 +152,7 @@ export default defineComponent({
},
async deleteRow() {
if (window.confirm("Are you sure you want to delete this row?")) {
let config: DeleteRow = {
const config: DeleteRow = {
tableName: this.tableName,
rowID: this.rowID
}
Expand All @@ -167,7 +167,7 @@ export default defineComponent({
)
}

var message: APIResponseMessage = {
const message: APIResponseMessage = {
contents: "Unable to delete the row.",
type: "error"
}
Expand Down
4 changes: 2 additions & 2 deletions admin_ui/src/components/FormAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default defineComponent({
const json: { [key: string]: any } = {}
for (const i of form.entries()) {
const key = i[0]
let value: any = i[1]
const value: any = i[1]

json[key] = convertFormValue({
key,
Expand All @@ -125,7 +125,7 @@ export default defineComponent({
{ responseType: "blob" }
)
} catch (error) {
var message: APIResponseMessage = {
const message: APIResponseMessage = {
contents: "The form has errors.",
type: "error"
}
Expand Down
8 changes: 4 additions & 4 deletions admin_ui/src/components/InputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export default defineComponent({
},
methods: {
setTextareaHeight() {
let element = this.$refs.textarea as HTMLTextAreaElement
const element = this.$refs.textarea as HTMLTextAreaElement
if (element) {
if (element.scrollHeight > element.clientHeight) {
const cursorPosition = element.selectionStart
Expand Down Expand Up @@ -402,7 +402,7 @@ export default defineComponent({
return
}

let formData = new FormData()
const formData = new FormData()
formData.append("table_name", this.currentTableName)
formData.append("column_name", this.columnName)
formData.append("file", file)
Expand Down Expand Up @@ -449,7 +449,7 @@ export default defineComponent({
}
}

let message: APIResponseMessage = {
const message: APIResponseMessage = {
contents: errorMessage,
type: "error"
}
Expand All @@ -466,7 +466,7 @@ export default defineComponent({
this.localValue = value
}

let app = this
const app = this

setTimeout(function () {
app.setTextareaHeight()
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/KeySearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default defineComponent({
clearTimeout(this.debounceTimer)
}

let app = this
const app = this

this.debounceTimer = window.setTimeout(async () => {
app.offset = 0
Expand Down
4 changes: 2 additions & 2 deletions admin_ui/src/components/OrderByModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export default defineComponent({
}
},
mounted() {
let orderByConfigs: OrderByConfig[] | null = this.$store.state.orderBy
const orderByConfigs: OrderByConfig[] | null = this.$store.state.orderBy

let localCopy: OrderByConfig[] = orderByConfigs
const localCopy: OrderByConfig[] = orderByConfigs
? orderByConfigs.map((i) => {
return { ...i }
})
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default defineComponent({
return this.$store.state.pageSize || 1
},
pageCount() {
let count = Math.ceil(this.rowCount / this.pageSize)
const count = Math.ceil(this.rowCount / this.pageSize)
return count < 1 ? 1 : count
},
currentTableName() {
Expand Down
6 changes: 3 additions & 3 deletions admin_ui/src/components/RowFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default defineComponent({
this.$emit("closeSideBar", false)
},
showSuccess(contents: string) {
var message: APIResponseMessage = {
const message: APIResponseMessage = {
contents: contents,
type: "success"
}
Expand Down Expand Up @@ -99,8 +99,8 @@ export default defineComponent({
},
async clearFilters() {
console.log("Clearing ...")
let form: any = this.$refs.form
let _ = [...form.elements].forEach((element) => {
const form: any = this.$refs.form
const _ = [...form.elements].forEach((element) => {
if (element.type == "hidden") {
element.value = ""
}
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/RowForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default defineComponent({
},
methods: {
getValue(columnName: string) {
let value = this.row ? this.row[columnName] : undefined
const value = this.row ? this.row[columnName] : undefined
return value
},
isRequired(columnName: string) {
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/TimeWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const localValue = ref<string>("")

// We dynamically work out the time format based on the time resolution.
const timeFormat = computed(() => {
var format = "HH:mm"
let format = "HH:mm"

if (timeResolution.value < 60) {
format += ":ss"
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/TimestampWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const localValue = ref<string>("")

// We dynamically work out the datetime format based on the time resolution.
const datetimeFormat = computed(() => {
var format = "YYYY-MM-DDTHH:mm"
let format = "YYYY-MM-DDTHH:mm"

if (timeResolution.value < 60) {
format += ":ss"
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/components/TimestamptzWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const timezone = ref<string>(localStorage.getItem(TIMEZONE_KEY) ?? "UTC")

// We dynamically work out the datetime format based on the time resolution.
const datetimeFormat = computed(() => {
var format = "YYYY-MM-DDTHH:mm"
let format = "YYYY-MM-DDTHH:mm"

if (timeResolution.value < 60) {
format += ":ss"
Expand Down
4 changes: 2 additions & 2 deletions admin_ui/src/components/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ export default defineComponent({
}
},
mounted() {
let app = this
const app = this
function onResize() {
app.popupVisible = false
}
this.onResize = onResize
window.addEventListener("resize", onResize)
},
destroyed() {
unmounted() {
if (this.onResize) {
window.removeEventListener("resize", this.onResize)
}
Expand Down
2 changes: 1 addition & 1 deletion admin_ui/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default defineComponent({

await this.$store.dispatch("fetchUser")

let nextURL = this.$route.query.nextURL as string
const nextURL = this.$route.query.nextURL as string

if (nextURL && !nextURL.startsWith("/login")) {
await this.$router.push({ path: nextURL })
Expand Down
10 changes: 5 additions & 5 deletions admin_ui/src/views/RowListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,14 @@ export default defineComponent({
return this.schema.extra.primary_key_name || "id"
},
linkColumnName(): string {
let schema: Schema = this.schema
const schema: Schema = this.schema
return schema.extra.link_column_name
},
// We create an object for quickly mapping a choice value to it's
// display value. It maps column name -> choice value -> display value.
// For example {'genre': {1: 'Sci-Fi'}}
choicesLookup() {
let schema = this.schema
const schema = this.schema
const output: {
[key: string]: { [key: string | number]: string } | null
} = {}
Expand Down Expand Up @@ -609,7 +609,7 @@ export default defineComponent({
if (value === null) {
return null
}
let string = String(value)
const string = String(value)
if (string.length > 100) {
return string.substring(0, 80) + "..."
}
Expand Down Expand Up @@ -664,7 +664,7 @@ export default defineComponent({
}
},
showSuccess(contents: string) {
var message: APIResponseMessage = {
const message: APIResponseMessage = {
contents: contents,
type: "success"
}
Expand Down Expand Up @@ -708,7 +708,7 @@ export default defineComponent({
)
const errorString = errors.join(", ")

var message: APIResponseMessage = {
const message: APIResponseMessage = {
contents: `Unable to delete row ${this.selectedRows[i]} (${errorString})`,
type: "error"
}
Expand Down
Loading