Compare commits
5 Commits
v0.0.30
...
feat/admin
| Author | SHA1 | Date | |
|---|---|---|---|
| 311f523647 | |||
|
|
0d0aa788db | ||
| c010bdc262 | |||
|
|
0e905bfcbe | ||
| e6bb4ddf6a |
10
.idea/data_source_mapping.xml
generated
Normal file
10
.idea/data_source_mapping.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourcePerFileMappings">
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_1.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_2.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_3.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_4.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
66
.idea/workspace.xml
generated
66
.idea/workspace.xml
generated
@@ -4,8 +4,16 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : update numéro de version">
|
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : test auto-tag-develop.yml (auto incrément version)">
|
||||||
|
<change afterPath="$PROJECT_DIR$/frontend/composables/useAppVersion.ts" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/config/packages/security.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/config/packages/security.yaml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/app.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/app.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/layouts/default.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/layouts/default.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/pages/login.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/pages/login.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Dto/AppVersion.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/ApiResource/AppVersion.php" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/State/AppVersionProvider.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/State/AppVersionProvider.php" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -294,30 +302,6 @@
|
|||||||
<workItem from="1770195959162" duration="18915000" />
|
<workItem from="1770195959162" duration="18915000" />
|
||||||
<workItem from="1770274844804" duration="3940000" />
|
<workItem from="1770274844804" duration="3940000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00006" summary="fix : correction du useApi pour qu'il n'y ait plus de retry lors d'une erreur 500 par exemple">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768318875533</created>
|
|
||||||
<option name="number" value="00006" />
|
|
||||||
<option name="presentableId" value="LOCAL-00006" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768318875533</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00007" summary="test : ajout de TU sur les services et providers">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768318921478</created>
|
|
||||||
<option name="number" value="00007" />
|
|
||||||
<option name="presentableId" value="LOCAL-00007" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768318921478</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00008" summary="feat : ajout de la génération du bon de reception, correction de la base du formulaire multi-etape de reception et ajout d'une gestion d'erreur global">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768498751836</created>
|
|
||||||
<option name="number" value="00008" />
|
|
||||||
<option name="presentableId" value="LOCAL-00008" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768498751836</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00009" summary="feat : ajout d'une gestion d'erreur au global côté front avec la lib toaster et I18n pour centraliser les messages d'erreur">
|
<task id="LOCAL-00009" summary="feat : ajout d'une gestion d'erreur au global côté front avec la lib toaster et I18n pour centraliser les messages d'erreur">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
<created>1768555180530</created>
|
<created>1768555180530</created>
|
||||||
@@ -686,7 +670,31 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1770370216428</updated>
|
<updated>1770370216428</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="55" />
|
<task id="LOCAL-00055" summary="fix : auto-tag-develop.yml">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770370700697</created>
|
||||||
|
<option name="number" value="00055" />
|
||||||
|
<option name="presentableId" value="LOCAL-00055" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770370700698</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00056" summary="fix : auto-tag-develop.yml">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770370919043</created>
|
||||||
|
<option name="number" value="00056" />
|
||||||
|
<option name="presentableId" value="LOCAL-00056" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770370919043</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00057" summary="feat : test auto-tag-develop.yml (auto incrément version)">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770371073055</created>
|
||||||
|
<option name="number" value="00057" />
|
||||||
|
<option name="presentableId" value="LOCAL-00057" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770371073055</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="58" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -736,8 +744,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="fix : doc de déploiement" />
|
|
||||||
<MESSAGE value="fix : doc et script de déploiement" />
|
|
||||||
<MESSAGE value="fix : gitea workflow" />
|
<MESSAGE value="fix : gitea workflow" />
|
||||||
<MESSAGE value="fix : script de déploiement" />
|
<MESSAGE value="fix : script de déploiement" />
|
||||||
<MESSAGE value="feat : ajout plus d'information sur la liste des réceptions côté front sur la page d'accueil" />
|
<MESSAGE value="feat : ajout plus d'information sur la liste des réceptions côté front sur la page d'accueil" />
|
||||||
@@ -761,7 +767,9 @@
|
|||||||
<MESSAGE value="fix : logo centré en mod mobile" />
|
<MESSAGE value="fix : logo centré en mod mobile" />
|
||||||
<MESSAGE value="feat : ajout d'un numéro de version automatique via la CI" />
|
<MESSAGE value="feat : ajout d'un numéro de version automatique via la CI" />
|
||||||
<MESSAGE value="feat : update numéro de version" />
|
<MESSAGE value="feat : update numéro de version" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat : update numéro de version" />
|
<MESSAGE value="fix : auto-tag-develop.yml" />
|
||||||
|
<MESSAGE value="feat : test auto-tag-develop.yml (auto incrément version)" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="feat : test auto-tag-develop.yml (auto incrément version)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XSLT-Support.FileAssociations.UIState">
|
<component name="XSLT-Support.FileAssociations.UIState">
|
||||||
<expand />
|
<expand />
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ security:
|
|||||||
- { path: ^/api/users, roles: PUBLIC_ACCESS, methods: [GET] }
|
- { path: ^/api/users, roles: PUBLIC_ACCESS, methods: [GET] }
|
||||||
# Doc API (swagger) en public
|
# Doc API (swagger) en public
|
||||||
- { path: ^/api/docs, roles: PUBLIC_ACCESS }
|
- { path: ^/api/docs, roles: PUBLIC_ACCESS }
|
||||||
|
# Version de l'application en public
|
||||||
|
- { path: ^/api/version, roles: PUBLIC_ACCESS, methods: [GET] }
|
||||||
# Tout le reste nécessite un JWT
|
# Tout le reste nécessite un JWT
|
||||||
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
|
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
parameters:
|
||||||
app.version: '0.0.30'
|
app.version: '0.0.32'
|
||||||
|
|||||||
@@ -3,3 +3,11 @@
|
|||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const { load } = useAppVersion()
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
load()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|||||||
17
frontend/composables/useAppVersion.ts
Normal file
17
frontend/composables/useAppVersion.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
export const useAppVersion = () => {
|
||||||
|
const api = useApi()
|
||||||
|
const version = useState<string | null>('app-version', () => null)
|
||||||
|
|
||||||
|
const load = async () => {
|
||||||
|
if (version.value) {
|
||||||
|
return version.value
|
||||||
|
}
|
||||||
|
const response = await api.get<{ version: string }>('version', {}, {
|
||||||
|
toast: false
|
||||||
|
})
|
||||||
|
version.value = response.version
|
||||||
|
return version.value
|
||||||
|
}
|
||||||
|
|
||||||
|
return { version, load }
|
||||||
|
}
|
||||||
@@ -26,10 +26,17 @@
|
|||||||
|
|
||||||
<div class="overflow-y-auto min-h-0 p-4 space-y-3">
|
<div class="overflow-y-auto min-h-0 p-4 space-y-3">
|
||||||
<!-- Liste des liens à ajouter ci-dessous -->
|
<!-- Liste des liens à ajouter ci-dessous -->
|
||||||
|
<!--Button pour afficher le component admin-users -->
|
||||||
|
<NuxtLink
|
||||||
|
to="/admin/user-list"
|
||||||
|
class="block px-4 py-2 rounded hover:bg-primary-600 transition"
|
||||||
|
>
|
||||||
|
Utilisateurs
|
||||||
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
|
<p class="font-bold text-white text-left">v{{ version }}</p>
|
||||||
<button
|
<button
|
||||||
@click="handleLogout"
|
@click="handleLogout"
|
||||||
class="w-full bg-red-600 hover:bg-red-700 py-2 rounded font-bold"
|
class="w-full bg-red-600 hover:bg-red-700 py-2 rounded font-bold"
|
||||||
@@ -37,6 +44,7 @@
|
|||||||
Déconnexion
|
Déconnexion
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<main class="min-h-0 overflow-auto px-12 py-12 ">
|
<main class="min-h-0 overflow-auto px-12 py-12 ">
|
||||||
@@ -50,7 +58,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import auth from "~/layouts/auth.vue";
|
||||||
|
|
||||||
|
const { version } = useAppVersion()
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
try {
|
try {
|
||||||
await auth.logout()
|
await auth.logout()
|
||||||
|
|||||||
@@ -100,6 +100,9 @@
|
|||||||
<main class="mx-auto w-full max-w-[1280px] pb-0">
|
<main class="mx-auto w-full max-w-[1280px] pb-0">
|
||||||
<slot/>
|
<slot/>
|
||||||
</main>
|
</main>
|
||||||
|
<footer class="w-full mt-8 bg-primary-500 p-6">
|
||||||
|
<p class="font-bold text-white text-right">v{{ version }}</p>
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -109,6 +112,7 @@ import { useAuthStore } from '~/stores/auth'
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
const isMenuOpen = ref(false)
|
const isMenuOpen = ref(false)
|
||||||
|
const { version } = useAppVersion()
|
||||||
|
|
||||||
const closeMenu = () => {
|
const closeMenu = () => {
|
||||||
isMenuOpen.value = false
|
isMenuOpen.value = false
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<admin-users v-if="activeCode === 'users'" />
|
||||||
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'admin'
|
layout: 'admin'
|
||||||
})
|
})
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const activeCode = computed(() => (route.query.code as string))
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
|
||||||
<h1>test</h1>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
64
frontend/pages/admin/user-list.vue
Normal file
64
frontend/pages/admin/user-list.vue
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex items-center justify-between gap-10">
|
||||||
|
<h1 class="text-3xl font-bold uppercase">Utilisateurs</h1>
|
||||||
|
<button
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
|
@click="null"
|
||||||
|
>
|
||||||
|
Ajouter
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="mt-6 border border-slate-200 mb-16 ">
|
||||||
|
<div class="grid grid-cols-3 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
||||||
|
<div>Username</div>
|
||||||
|
<div>Role</div>
|
||||||
|
<div>Action</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="user in userList"
|
||||||
|
:key="user.id"
|
||||||
|
class="grid grid-cols-3 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200 items-center"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
{{ user.username}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ user.roles?.join(', ') || ' ---' }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="p-4">
|
||||||
|
<button
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
|
@click="null"
|
||||||
|
>
|
||||||
|
Modifier
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
definePageMeta({
|
||||||
|
layout: 'admin'
|
||||||
|
})
|
||||||
|
|
||||||
|
import type {UserData} from "~/services/dto/user-data";
|
||||||
|
import {getUsers} from "~/services/auth";
|
||||||
|
|
||||||
|
const userList = ref<UserData[]>([])
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
userList.value = await getUsers()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -46,7 +46,8 @@
|
|||||||
>
|
>
|
||||||
Connexion
|
Connexion
|
||||||
</button>
|
</button>
|
||||||
</form>
|
<p class="font-bold">v{{ version }}</p>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -57,6 +58,7 @@ import { useAuthStore } from '~/stores/auth'
|
|||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
const { version } = useAppVersion()
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'auth'
|
layout: 'auth'
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export interface UserData {
|
export interface UserData {
|
||||||
id: number
|
id: number
|
||||||
username: string
|
username: string
|
||||||
|
roles?: string[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Dto;
|
namespace App\ApiResource;
|
||||||
|
|
||||||
use ApiPlatform\Metadata\ApiResource;
|
use ApiPlatform\Metadata\ApiResource;
|
||||||
use ApiPlatform\Metadata\Get;
|
use ApiPlatform\Metadata\Get;
|
||||||
@@ -17,7 +17,6 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
|||||||
provider: AppVersionProvider::class,
|
provider: AppVersionProvider::class,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
security: "is_granted('ROLE_USER')",
|
|
||||||
)]
|
)]
|
||||||
final class AppVersion
|
final class AppVersion
|
||||||
{
|
{
|
||||||
0
src/Entity/.gitignore
vendored
0
src/Entity/.gitignore
vendored
@@ -49,6 +49,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
private string $username = '';
|
private string $username = '';
|
||||||
|
|
||||||
#[ORM\Column(type: 'json')]
|
#[ORM\Column(type: 'json')]
|
||||||
|
#[Groups(['user:read'])]
|
||||||
private array $roles = [];
|
private array $roles = [];
|
||||||
|
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace App\State;
|
|||||||
|
|
||||||
use ApiPlatform\Metadata\Operation;
|
use ApiPlatform\Metadata\Operation;
|
||||||
use ApiPlatform\State\ProviderInterface;
|
use ApiPlatform\State\ProviderInterface;
|
||||||
use App\Dto\AppVersion;
|
use App\ApiResource\AppVersion;
|
||||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||||
|
|
||||||
final readonly class AppVersionProvider implements ProviderInterface
|
final readonly class AppVersionProvider implements ProviderInterface
|
||||||
|
|||||||
Reference in New Issue
Block a user