diff --git a/build.gradle.kts b/build.gradle.kts index cca92c5e..39a89c78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -59,7 +59,7 @@ dependencies { implementation("org.xerial:sqlite-jdbc") implementation("org.liquibase:liquibase-core") - val exposedVersion = "0.41.1" + val exposedVersion = "0.43.0" implementation("org.jetbrains.exposed:exposed-spring-boot-starter:$exposedVersion") implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion") // implementation("org.nuvito.spring.data:sqlite-dialect:1.0-SNAPSHOT") diff --git a/src/jelu-ui/src/assets/style.css b/src/jelu-ui/src/assets/style.css index 50d73c70..4a28039b 100644 --- a/src/jelu-ui/src/assets/style.css +++ b/src/jelu-ui/src/assets/style.css @@ -100,7 +100,6 @@ @apply radio radio-primary radio-sm bg-none; } - .o-pag__link { @apply btn text-neutral-content !important; } @@ -141,6 +140,18 @@ @apply text-gray-700; } +.o-ctrl-input > input[type="number"] { + @apply w-24; +} + +.o-acp .o-ctrl-input .o-input { + @apply w-fit sm:w-full bg-base-100 text-base-content border-base-200 focus:input-accent grow; +} + +.o-acp { + @apply grow !important; +} + /* end oruga customization with daisyui */ .swal2-container { @@ -346,3 +357,7 @@ .jelu-cursor-text { @apply cursor-text !important; } + +.jl-formkit .o-input { + @apply w-fit sm:w-full bg-base-100 text-base-content border-primary focus:input-accent; +} diff --git a/src/jelu-ui/src/components/AddBook.vue b/src/jelu-ui/src/components/AddBook.vue index 5d41dc20..21c9ad3a 100644 --- a/src/jelu-ui/src/components/AddBook.vue +++ b/src/jelu-ui/src/components/AddBook.vue @@ -15,6 +15,8 @@ import { key } from '../store'; import { ObjectUtils } from "../utils/ObjectUtils"; import { StringUtils } from "../utils/StringUtils"; import AutoImportFormModalVue from "./AutoImportFormModal.vue"; +import { SeriesOrder } from "../model/Series"; +import SeriesInput from "./SeriesInput.vue"; const { t } = useI18n({ inheritLocale: true, @@ -37,9 +39,6 @@ const form = reactive({ isbn13: "", publisher: "", pageCount: null, - // publishedDate: null, - series: "", - numberInSeries: null, personalNotes: "", owned: null, borrowed: null, @@ -94,9 +93,11 @@ let tags: Ref> = ref([]); let translators: Ref> = ref([]); let filteredTranslators: Ref> = ref([]); +let seriesCopy: Ref> = ref([]) + const showModal: Ref = ref(false) const metadata: Ref = ref(null) -// let hasImage: Ref = ref(metadata?.value?.image != null) + let hasImage = computed(() => { return StringUtils.isNotBlank(metadata.value?.image) }) @@ -136,10 +137,16 @@ const importBook = async () => { authors.value.forEach((a) => userBook.book.authors?.push(a)); tags.value.forEach((t) => userBook.book.tags?.push(t)); translators.value.forEach((tr) => userBook.book.translators?.push(tr)); + seriesCopy.value.forEach((s) => { + if (s.name.trim().length > 0) { + userBook.book.series?.push(s) + } + }) if (StringUtils.isNotBlank(imageUrl.value)) { userBook.book.image = imageUrl.value; } else if (!deleteImage.value + && metadata.value != null && metadata.value?.image != null && StringUtils.isNotBlank(metadata.value.image)) { userBook.book.image = metadata.value.image @@ -171,7 +178,6 @@ const importBook = async () => { await router.push({name: 'my-books'}) } catch (error: any) { progress.value = false - // errorMessage.value = error.message ObjectUtils.toast(oruga, "danger", t('labels.error_message', {msg : error.message}), 4000) } } else { @@ -190,8 +196,7 @@ const fillBook = (formdata: any, publishedDate: Date | null): UserBook => { image: formdata.image, pageCount: formdata.pageCount, publishedDate: publishedDate?.toISOString(), - series: formdata.series, - numberInSeries: formdata.numberInSeries, + series: [], googleId: formdata.googleId, amazonId: formdata.amazonId, goodreadsId: formdata.goodreadsId, @@ -225,11 +230,9 @@ const clearForm = () => { form.isbn13 = ""; form.publisher = ""; form.pageCount = null; - // form.publishedDate = null; publishedDate.value = null - form.series = "" + seriesCopy.value = [] form.language = "" - form.numberInSeries = null form.owned = null form.personalNotes = "" form.amazonId = "" @@ -241,7 +244,6 @@ const clearForm = () => { const clearDatePicker = () => { // close datepicker on reset - // form.publishedDate = null; publishedDate.value = null }; @@ -382,6 +384,8 @@ function modalClosed() { const mergeMetadata = () => { for (let key in metadata.value) { + console.log("key") + console.log(key) if (key in form) { let castKey = key as (keyof typeof metadata.value & keyof typeof form); (form[castKey] as any) = metadata.value[castKey]; @@ -400,6 +404,12 @@ const mergeMetadata = () => { if (metadata.value?.publishedDate && StringUtils.isNotBlank(metadata.value?.publishedDate)) { publishedDate.value = new Date(metadata.value?.publishedDate) } + if (metadata.value?.series != null && metadata.value?.series?.length > 0) { + seriesCopy.value.push({ + "name": metadata.value?.series, + "numberInSeries" : metadata.value.numberInSeries + }) + } } const isbn10ValidationMessage = ref("") @@ -452,10 +462,10 @@ let displayDatepicker = computed(() => {