Skip to content

Commit 551d6fc

Browse files
authored
Merge pull request #17 from Libertech-FR/app-developement
App developement
2 parents 4b75cc2 + 4cf81f9 commit 551d6fc

38 files changed

+2638
-905
lines changed

Makefile

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
IMGNAME?=ghcr.io/libertech-fr/teaket:latest
22
APPNAME?=teaket
3+
MINIO_ACCESS_KEY?=AKIAIOSFODNN7EXAMPLE
4+
MINIO_SECRET_KEY?=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
35

46
.DEFAULT_GOAL := help
57
help:
68
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
79
@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) \
810
| sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}'
911

12+
run-app:
13+
cd ./app && yarn dev
14+
15+
run-service:
16+
cd ./service && yarn start:dev
17+
18+
run: ## Run app and service
19+
@make dbs &
20+
@make run-app &
21+
@make run-service &
22+
1023
dbs: ## Start databases
1124
@docker volume create $(APPNAME)-mongodb
1225
@docker run -d --rm \
@@ -21,15 +34,33 @@ dbs: ## Start databases
2134
@docker volume create $(APPNAME)-redis
2235
@docker run -d --rm \
2336
--name $(APPNAME)-redis \
37+
-v $(APPNAME)-redis:/data \
2438
--network dev \
2539
-p 6379:6379 \
26-
redis
27-
@sleep 1
40+
redis || true
41+
@docker volume create $(APPNAME)-minio
42+
@docker run -d --rm \
43+
-p 9000:9000 \
44+
-p 9090:9090 \
45+
--name $(APPNAME)-minio \
46+
--network dev \
47+
-v $(APPNAME)-minio:/data \
48+
-e "MINIO_ACCESS_KEY=$(MINIO_ACCESS_KEY)" \
49+
-e "MINIO_SECRET_KEY=$(MINIO_SECRET_KEY)" \
50+
minio/minio server /data --console-address ":9090" || true
51+
@docker run --rm -it \
52+
--network dev \
53+
-e MINIO_BUCKET="teaket" \
54+
--entrypoint sh minio/mc -c "\
55+
mc config host add myminio http://teaket-minio:9000 \$(MINIO_ACCESS_KEY) \$(MINIO_SECRET_KEY) && \
56+
(mc mb myminio/teaket || true) \
57+
" || true
2858
@docker exec -it teaket-mongodb mongo --eval "rs.initiate({_id: 'rs0', members: [{_id: 0, host: '127.0.0.1:27017'}]})" || true
2959

3060
stop-dbs: ## Stop databases
3161
@docker stop $(APPNAME)-redis || true
3262
@docker stop $(APPNAME)-mongodb || true
63+
@docker stop $(APPNAME)-minio || true
3364

3465
buildseeds: ## Build populate image
3566
docker build -t seeding -f ./populate/Dockerfile ./populate

app/nuxt.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import pugPlugin from 'vite-plugin-pug'
33
import openapiTS from 'openapi-typescript'
44
import { writeFileSync } from 'fs'
55
import { resolve } from 'path'
6+
import timezone from 'dayjs/plugin/timezone'
67

78
const TK_APP_API_URL = process.env.TK_APP_API_URL || 'http://localhost:7100'
89

@@ -73,6 +74,17 @@ export default defineNuxtConfig({
7374
},
7475
},
7576
},
77+
dayjs: {
78+
locales: ['fr', 'en'],
79+
defaultLocale: 'fr',
80+
defaultTimezone: 'Paris',
81+
plugins: ['timezone', 'relativeTime']
82+
},
83+
pinia:{
84+
autoImports: [
85+
'defineStore'
86+
]
87+
},
7688
appConfig: {
7789
customSlots: {},
7890
},

app/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@
1717
"@pinia/nuxt": "^0.4.11",
1818
"@quasar/extras": "^1.16.6",
1919
"@vueuse/router": "^10.4.1",
20+
"bson-objectid": "^2.0.4",
2021
"cookie": "^0.5.0",
2122
"pinia": "^2.1.6",
2223
"quasar": "^2.12.6"
2324
},
2425
"devDependencies": {
2526
"@nuxt/devtools": "latest",
2627
"@types/node": "^18.17.3",
28+
"@typescript-eslint/eslint-plugin": "^6.6.0",
29+
"@typescript-eslint/parser": "^6.6.0",
2730
"@vueuse/core": "^10.4.1",
2831
"@vueuse/nuxt": "^10.4.1",
2932
"dayjs-nuxt": "^1.1.2",
30-
"@typescript-eslint/eslint-plugin": "^6.6.0",
31-
"@typescript-eslint/parser": "^6.6.0",
3233
"eslint": "^8.49.0",
3334
"nuxt": "~3.6.5",
3435
"nuxt-quasar-ui": "^2.0.5",

app/src/components/searchfilters/RightSelect.vue

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ q-select(
1313
@add="addFilter($event)"
1414
@remove="removeFilter($event)"
1515
)
16-
template(v-slot:option="{ index, itemProps, opt, selected, toggleOption }")
17-
q-item-label(v-bind="itemProps" v-if="opt.header" header) {{ opt.label }}
18-
//@click.capture='addFilter({index, value: opt})'
19-
q-item(v-bind="itemProps" v-else)
20-
q-item-section(side)
21-
q-icon(:name="opt.icon" :color="opt.color" size="xs")
22-
q-item-section
23-
q-item-label(v-html="opt.label")
24-
q-item-section(side)
25-
q-toggle(:model-value="selected" @update:model-value="toggleOption")
16+
template(v-slot:option="{ index, itemProps, opt, selected, toggleOption }")
17+
q-item-label(v-bind="itemProps" v-if="opt.header" header) {{ opt.label }}
18+
//@click.capture='addFilter({index, value: opt})'
19+
q-item(v-bind="itemProps" v-else)
20+
q-item-section(side)
21+
q-icon(:name="opt.icon" :color="opt.color" size="xs")
22+
q-item-section
23+
q-item-label(v-html="opt.label")
24+
q-item-section(side)
25+
q-toggle(:model-value="selected" @update:model-value="toggleOption")
2626

2727
</template>
2828

@@ -32,7 +32,7 @@ import type { Ref } from 'vue'
3232
import { useHttpApi } from "~/composables/useHttpApi";
3333
import type { components } from '#build/types/service-api'
3434
import { useRoute, useRouter } from 'nuxt/app';
35-
35+
import { ticketType, lifeSteps } from "#imports";
3636
type Category = components['schemas']['CategoriesDto']
3737
type State = components['schemas']['StatesDto']
3838
@@ -49,12 +49,7 @@ const router = useRouter()
4949
5050
const { data: statesData } = inject('stateFetch')
5151
const { data: categoriesData } = inject('categoriesFetch')
52-
const ticketType: {
53-
label: string,
54-
value: number,
55-
icon: string,
56-
color: string
57-
}[] | undefined = inject('ticketType')
52+
5853
onMounted(() => {
5954
getFilters()
6055
})
@@ -88,12 +83,6 @@ const getFilters = () => {
8883
8984
9085
const filters = ref<Option[]>([])
91-
const lifeSteps = ref<Option[]>([
92-
{ label: 'Lifestep', header: true },
93-
{ label: 'Ouvert', value: '1', group: 'lifestep', icon: 'mdi-circle', color: "green" },
94-
{ label: 'Clos', value: '0', group: 'lifestep', icon: 'mdi-circle', color: "red" },
95-
])
96-
9786
const options = computed(() => {
9887
// const categories: Option[] = categoriesData.value.data.map((category: Category) => {
9988
// return {
@@ -103,7 +92,7 @@ const options = computed(() => {
10392
// }
10493
// }) ?? []
10594
// categories.unshift({ label: 'Catégories', header: true })
106-
const ticketTypeOptions: Option[] = ticketType.value.map((type) => {
95+
const ticketTypeOptions: Option[] = ticketType.map((type) => {
10796
return {
10897
label: type.label,
10998
value: type.value.toString(),
@@ -123,8 +112,9 @@ const options = computed(() => {
123112
}
124113
}) ?? []
125114
states.unshift({ label: 'États', header: true })
115+
lifeSteps.unshift({ label: 'Étapes de vie', header: true })
126116
return [
127-
...lifeSteps.value,
117+
...lifeSteps,
128118
...ticketTypeOptions,
129119
// ...categories,
130120
...states

app/src/components/searchfilters/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template lang="pug" @keypress="addFilter">
1+
<template lang="pug" @keypress.enter="addFilter">
22
.q-ma-sm
33
tk-SearchfiltersMain(ref="mainData")
44
//Filters chips
Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
<template lang="pug">
2-
q-card.bg-gray-4
3-
q-card-section
4-
.text-h6 Autres sections
5-
q-separator(inset)
6-
q-card-actions(align="center" vertical)
7-
q-btn(color="primary" flat) Mes tickets
8-
q-btn(color="primary" flat) Tout les tickets
9-
q-separator(inset)
10-
q-card-actions(align="center" vertical)
11-
q-btn(v-for="projet in projets.data" color="primary" flat :key="projet.id" :to="`/ticket/${projet.id}`") {{ projet.name }}
12-
2+
div
3+
q-toolbar
4+
q-breadcrumbs
5+
q-breadcrumbs-el(to="/") Accueil
6+
q-breadcrumbs-el(to="/tickets") Tickets
7+
q-breadcrumbs-el(:label="sequence")
8+
q-expansion-item(label="Autres sections").bg-gray-4
9+
q-card.bg-gray-4
10+
q-separator(inset)
11+
q-card-actions(align="center" vertical)
12+
q-btn(color="primary" flat) Mes tickets
13+
q-btn(color="primary" flat) Tout les tickets
14+
q-separator(inset)
15+
q-card-actions(align="center" vertical)
16+
q-btn(v-for="projet in projets.data" color="primary" flat :key="projet.id" :to="`/ticket/${projet.id}`") {{ projet.name }}
1317
</template>
1418

1519
<script lang="ts" setup>
1620
import { ref, onMounted, computed } from 'vue'
1721
import { useHttpApi } from '~/composables/useHttpApi';
22+
1823
const { data: projets } = await useHttpApi(`core/project`)
24+
defineProps({
25+
sequence: {
26+
type: String,
27+
required: true
28+
}
29+
})
1930
2031
</script>

0 commit comments

Comments
 (0)