Skip to content

Commit 2a88a18

Browse files
authored
Merge pull request #22 from Libertech-FR/app-developement
App developement
2 parents 3ca476d + 28e3dda commit 2a88a18

File tree

22 files changed

+1493
-415
lines changed

22 files changed

+1493
-415
lines changed

app/nuxt.config.ts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,7 @@ export default defineNuxtConfig({
2828
global: true,
2929
dirs: [{ path: '~/components', prefix: 'tk' }],
3030
},
31-
modules: [
32-
'@nuxt-alt/auth',
33-
'@nuxt-alt/http',
34-
'@pinia/nuxt',
35-
'nuxt-quasar-ui',
36-
'@vueuse/nuxt',
37-
'dayjs-nuxt',
38-
...appSetup(),
39-
],
31+
modules: ['@nuxt-alt/auth', '@nuxt-alt/http', '@pinia/nuxt', 'nuxt-quasar-ui', '@vueuse/nuxt', 'dayjs-nuxt', ...appSetup()],
4032
auth: {
4133
globalMiddleware: true,
4234
rewriteRedirects: true,
@@ -78,18 +70,24 @@ export default defineNuxtConfig({
7870
locales: ['fr', 'en'],
7971
defaultLocale: 'fr',
8072
defaultTimezone: 'Paris',
81-
plugins: ['timezone', 'relativeTime']
73+
plugins: ['timezone', 'relativeTime'],
8274
},
83-
pinia:{
84-
autoImports: [
85-
'defineStore'
86-
]
75+
pinia: {
76+
autoImports: ['defineStore'],
8777
},
8878
appConfig: {
8979
customSlots: {},
9080
},
9181
quasar: {
9282
iconSet: 'mdi-v5',
83+
plugins: ['Notify'],
84+
config: {
85+
notify: {
86+
timeout: 2500,
87+
position: 'top-right',
88+
actions: [{ icon: 'mdi-close', color: 'white' }],
89+
},
90+
},
9391
},
9492
vite: {
9593
define: {
@@ -98,6 +96,7 @@ export default defineNuxtConfig({
9896
plugins: [
9997
pugPlugin(<any>{
10098
pretty: true,
99+
compilerOptions: {},
101100
}),
102101
],
103102
},
@@ -112,7 +111,7 @@ export default defineNuxtConfig({
112111
shim: false,
113112
},
114113
hooks: {
115-
'ready': async () => {
114+
ready: async () => {
116115
console.log('[OpenapiTS] Generating .nuxt/types/service-api.d.ts...')
117116
try {
118117
const fileData = await openapiTS(`${TK_APP_API_URL}/swagger/json`)
@@ -121,6 +120,6 @@ export default defineNuxtConfig({
121120
} catch (error) {
122121
console.debug('[OpenapiTS] Error while generating .nuxt/types/service-api.d.ts', error)
123122
}
124-
}
125-
}
123+
},
124+
},
126125
})

app/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"@nuxt-alt/http": "^1.6.8",
1717
"@pinia/nuxt": "^0.4.11",
1818
"@quasar/extras": "^1.16.6",
19+
"@tiptap/pm": "^2.1.11",
20+
"@tiptap/starter-kit": "^2.1.11",
21+
"@tiptap/vue-3": "^2.1.11",
1922
"@vueuse/router": "^10.4.1",
2023
"bson-objectid": "^2.0.4",
2124
"cookie": "^0.5.0",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<editor-content :editor="editor" />
3+
</template>
4+
5+
<script setup>
6+
import { useEditor, EditorContent } from '@tiptap/vue-3'
7+
import StarterKit from '@tiptap/starter-kit'
8+
9+
const editor = useEditor({
10+
content: '<p>I’m running Tiptap with Vue.js. 🎉</p>',
11+
extensions: [
12+
StarterKit,
13+
],
14+
})
15+
</script>

app/src/components/searchfilters/Main.vue

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
11
<template lang="pug">
22
.row.q-gutter-sm.items-center.q-mt-sm
3-
//- .col.col-md-2
4-
//- q-select(:options="fieldTypes" label="Type de champ" v-model="fieldType" clearable @update:model-value="clearFields(['field', 'comparator'])")
5-
.col.col-md-2
6-
q-select(:options="fields" label="Champs" v-model="field" clearable @update:model-value="onFieldChange($event)")
7-
.col.col-md-2
8-
q-select(:options="comparatorFilteredByType" label="Comparateurs" v-model="comparator" clearable @update:model-value="clearFields([])" :disable="isFieldDisabled.comparator")
9-
template(v-slot:selected-item="scope")
10-
q-icon(:name="scope.opt.icon" size="xs")
11-
template(v-slot:option="scope")
12-
q-item(v-bind="scope.itemProps")
13-
q-item-section(avatar)
14-
q-icon(:name="scope.opt.icon")
15-
q-item-section
16-
q-item-label
17-
span {{ scope.opt.label }}
18-
19-
.col-12.col-md-2(v-show="!comparator?.multiplefields")
20-
q-input(v-model="search" label="Rechercher" clearable :type="searchInputType" :disable="isFieldDisabled.search" :prefix="comparator?.prefix" :suffix="comparator?.suffix")
21-
.col-6.col-md-2(v-show="comparator?.multiplefields")
22-
q-input(v-model="searchMin" label="Min" clearable :type="searchInputType" :disable="isFieldDisabled.search" )
23-
.col-6.col-md-2(v-show="comparator?.multiplefields")
24-
q-input(v-model="searchMax" label="Max" clearable :type="searchInputType" :disable="isFieldDisabled.search" )
25-
.col-12.col-md-1
26-
q-btn(color="primary" @click="addFilter" :disable="isFieldDisabled.addButton") Ajouter
27-
q-space
28-
.col-12.col-md-2
29-
tk-SearchfiltersRightSelect(ref="rightSelect")
3+
//- .col.col-md-2
4+
//- q-select(:options="fieldTypes" label="Type de champ" v-model="fieldType" clearable @update:model-value="clearFields(['field', 'comparator'])")
5+
.col.col-md-2
6+
q-select(:options="fields" label="Champs" v-model="field" clearable @update:model-value="onFieldChange($event)")
7+
.col.col-md-2
8+
q-select(:options="comparatorFilteredByType" label="Comparateurs" v-model="comparator" clearable @update:model-value="clearFields([])" :disable="isFieldDisabled.comparator")
9+
template(v-slot:selected-item="scope")
10+
q-icon(:name="scope.opt.icon" size="xs")
11+
template(v-slot:option="scope")
12+
q-item(v-bind="scope.itemProps")
13+
q-item-section(avatar)
14+
q-icon(:name="scope.opt.icon")
15+
q-item-section
16+
q-item-label
17+
span {{ scope.opt.label }}
18+
19+
.col-12.col-md-2(v-show="!comparator?.multiplefields")
20+
q-input(v-model="search" label="Rechercher" clearable :type="searchInputType" :disable="isFieldDisabled.search" :prefix="comparator?.prefix" :suffix="comparator?.suffix")
21+
.col-6.col-md-2(v-show="comparator?.multiplefields")
22+
q-input(v-model="searchMin" label="Min" clearable :type="searchInputType" :disable="isFieldDisabled.search" )
23+
.col-6.col-md-2(v-show="comparator?.multiplefields")
24+
q-input(v-model="searchMax" label="Max" clearable :type="searchInputType" :disable="isFieldDisabled.search" )
25+
.col-12.col-md-1
26+
q-btn(color="primary" @click="addFilter" :disable="isFieldDisabled.addButton") Ajouter
27+
q-space
28+
.col-12.col-md-2
29+
tk-SearchfiltersRightSelect(ref="rightSelect")
3030
</template>
3131

3232
<script lang="ts" setup>
3333
import { ref, computed, inject } from 'vue'
3434
import { useRouter, useRoute } from 'nuxt/app'
3535
import { useDayjs } from '#imports';
36+
import { pushQuery } from '~/composables'
3637
import type { Filter, Field, Comparator, SearchFilter } from '~/types'
3738
const dayjs = useDayjs()
3839
@@ -95,11 +96,11 @@ const addFilter = async () => {
9596
if (!searchFilter) return
9697
if (searchFilter.comparator.multiplefields) {
9798
for (const { key, value } of parseMultipleFilter(searchFilter)) {
98-
await pushQuery(key, value)
99+
await pushQuery({ key, value })
99100
}
100101
} else {
101102
const { key, value } = parseSimpleFilter(searchFilter)
102-
await pushQuery(key, value)
103+
await pushQuery({ key, value })
103104
}
104105
}
105106
@@ -130,15 +131,15 @@ const parseMultipleFilter = (searchFilter: SearchFilter) => {
130131
return [min, max]
131132
}
132133
133-
const pushQuery = async (key: string, value: string) => {
134-
const query = {
135-
...route.query,
136-
}
137-
query[key] = value
138-
await router.push({
139-
query
140-
})
141-
}
134+
// const pushQuery = async (key: string, value: string) => {
135+
// const query = {
136+
// ...route.query,
137+
// }
138+
// query[key] = value
139+
// await router.push({
140+
// query
141+
// })
142+
// }
142143
143144
const getSearchFilter = computed(() => {
144145
if (field.value === undefined || field.value === null) return null

0 commit comments

Comments
 (0)