Skip to content

Commit

Permalink
fixed format
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Aug 23, 2024
1 parent 9d511b1 commit 7ea7d39
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/ArchivesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const lastPreviousArchive: Ref<Archive> = computed(
const additionalPreviousArchives: Ref<Array<Archive>> = computed(() =>
previousArchives.value.filter((item) => item.id != lastPreviousArchive.value.id)
)
const hasAdditionalPrevious: Ref<boolean> = computed(() => additionalPreviousArchives.value.length > 0)
const hasAdditionalPrevious: Ref<boolean> = computed(
() => additionalPreviousArchives.value.length > 0
)
function showAllPrevious(event: Event) {
event.preventDefault()
Expand Down
14 changes: 5 additions & 9 deletions frontend/src/components/ImageUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const image_img_field: Ref<HTMLImageElement | null> = ref(null)
const storeApp = useAppStore()
function openFilePicker() {
if (image_file_field.value !== null)
image_file_field.value.click()
if (image_file_field.value !== null) image_file_field.value.click()
}
const imageDimensions = (dataUrl: string) =>
Expand All @@ -50,12 +49,10 @@ const imageDimensions = (dataUrl: string) =>
})
function updateImage(event: Event) {
if (event.target === null)
return
if (event.target === null) return
const target = (event.target as HTMLInputElement)
if (target.files === null)
return
const target = event.target as HTMLInputElement
if (target.files === null) return
const file = target.files[0]
const reader = new FileReader()
Expand Down Expand Up @@ -115,8 +112,7 @@ function updateImage(event: Event) {
}
}
if (image_img_field.value)
image_img_field.value.src = 'data:image/png;base64,' + bytes
if (image_img_field.value) image_img_field.value.src = 'data:image/png;base64,' + bytes
emit('change', bytes)
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/LatestArchive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const props = defineProps<{ archive: Archive }>()
const canBeDownloaded: Ref<boolean> = computed(() => props.archive.status == ArchiveStatus.READY)
const archiveFileSize: Ref<string> = computed(() => humanifyFileSize(props.archive.filesize!))
const humanRequestedOn: Ref<string> = computed(() => (props.archive.requested_on) ? formattedDate(props.archive.requested_on) : '-')
const humanRequestedOn: Ref<string> = computed(() =>
props.archive.requested_on ? formattedDate(props.archive.requested_on) : '-'
)
function formattedDate(date: string): string {
return DateTime.fromISO(date).toLocaleString(DateTime.DATETIME_MED_WITH_WEEKDAY)
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/components/ZIMMetadataComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,18 @@ function formModalFromArchive() {
return {
title: storeProject.lastProjectPendingArchive.config.title || '',
description: storeProject.lastProjectPendingArchive.config.description || '',
name: storeProject.lastProjectPendingArchive.config.name || (storeProject.lastProject === null) ? '' : `${storeProject.lastProject.name}`,
name:
storeProject.lastProjectPendingArchive.config.name || storeProject.lastProject === null
? ''
: `${storeProject.lastProject.name}`,
publisher: storeProject.lastProjectPendingArchive.config.publisher || 'nautilus by openZIM',
creator: storeProject.lastProjectPendingArchive.config.creator || '',
languages: storeProject.lastProjectPendingArchive.config.languages || 'eng',
tags: storeProject.lastProjectPendingArchive.config.tags || [],
illustration:
storeProject.lastProjectPendingArchive.config.illustration || DEFAULT_ILLUSTRATION,
main_logo: storeProject.lastProjectPendingArchive.config.main_logo || DEFAULT_MAIN_LOGO,
filename:
storeProject.lastProjectPendingArchive.config.filename ||
`nautilus.zim`,
filename: storeProject.lastProjectPendingArchive.config.filename || `nautilus.zim`,
email: storeProject.lastProjectPendingArchive.config.email || ''
}
}
Expand Down Expand Up @@ -270,7 +271,7 @@ async function actuallyUpdateMetadata() {
}
try {
if (storeProject.lastProjectId === null || storeProject.lastProjectPendingArchive === null)
throw("missing IDs")
throw 'missing IDs'
const response = await storeApp.axiosInstance.patch<string>(
`/projects/${storeProject.lastProjectId}/archives/${storeProject.lastProjectPendingArchive.id}`,
archivePatchData
Expand All @@ -290,7 +291,7 @@ async function requestZIM() {
const archivePostData = { email: archiveMetadataFormModal.value.email || '' }
try {
if (storeProject.lastProjectId === null || storeProject.lastProjectPendingArchive === null)
throw("missing IDs")
throw 'missing IDs'
const response = await storeApp.axiosInstance.post<string>(
`/projects/${storeProject.lastProjectId}/archives/${storeProject.lastProjectPendingArchive.id}/request`,
archivePostData
Expand Down

0 comments on commit 7ea7d39

Please sign in to comment.