Skip to content

Commit

Permalink
11.21.2 (avec fil d'ariane)
Browse files Browse the repository at this point in the history
  • Loading branch information
JabX committed Nov 18, 2024
1 parent 2d67ce8 commit 08fe8a4
Show file tree
Hide file tree
Showing 10 changed files with 346 additions and 426 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html lang="fr">
<head>
<title>Starter Kit Focus v4 - 11.21.0</title>
<title>Starter Kit Focus v4 - 11.21.2</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
Expand Down
683 changes: 298 additions & 385 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "focus4-starter-kit",
"version": "11.21.0",
"version": "11.21.2",
"description": "Starter kit pour Focus V4",
"repository": "http://www.github.com/klee-contrib/focus4-starter-kit",
"main": "src/index.ts",
Expand All @@ -13,8 +13,8 @@
"start": "vite"
},
"dependencies": {
"@focus4/tooling": "11.21.0",
"focus4": "11.21.0",
"@focus4/tooling": "11.21.2",
"focus4": "11.21.2",
"vite-plugin-mock-dev-server": "1.8.0"
},
"devDependencies": {
Expand Down
12 changes: 11 additions & 1 deletion src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ import "numeral/locales/fr";

import {common} from "./common";
import {securite} from "./securite";
import {router} from "./router";

i18next.init({
lng: "fr",
resources: {fr: {translation: {focus, common, securite}}},
resources: {
fr: {
translation: {
focus,
common,
securite,
router
}
}
},
nsSeparator: "🤷‍♂️"
});
numeral.locale("fr");
15 changes: 15 additions & 0 deletions src/locale/router.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const router = {
root: "Accueil",
profils: {
root: "Profils",
proId: {
root: "{{param}}"
}
},
utilisateurs: {
root: "Utilisateurs",
utiId: {
root: "{{param}}"
}
}
};
11 changes: 3 additions & 8 deletions src/views/__style__/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@
--focus-ring-color: white;
--input-outline-color: white;
--input-text-color: white;

--fil-ariane-item-color: white;
--fil-ariane-item-active-color: white;
}

.item {
display: flex;
align-items: center;
}

.item > span {
margin-right: 6px;
}

.item strong {
white-space: nowrap;
}

.item--user strong {
font-weight: 600;
margin-right: 5px;
Expand Down
12 changes: 7 additions & 5 deletions src/views/header.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import {useObserver} from "mobx-react";
import {ReactNode} from "react";

import {messageStore} from "@focus4/core";
import {HeaderItem, HeaderScrolling, HeaderTopRow} from "@focus4/layout";
import {FilAriane, HeaderItem, HeaderScrolling, HeaderTopRow} from "@focus4/layout";
import {colorScheme, toBem} from "@focus4/styling";
import {IconButton, Switch} from "@focus4/toolbox";
import {FontIcon, IconButton, Switch} from "@focus4/toolbox";

import {router} from "../router";

import css from "./__style__/header.css";

const theme = toBem(css);

export function Header({children}: {children?: ReactNode}) {
export function Header({icon, paramResolver}: {icon: string; paramResolver?: () => string}) {
return useObserver(() => (
<HeaderScrolling theme={{scrolling: theme.header()}}>
<HeaderTopRow>
<HeaderItem theme={{item: theme.item()}}>
<strong>Starter Kit Focus v4</strong>
</HeaderItem>
<HeaderItem fillWidth theme={{item: theme.item()}}>
{children}
<FontIcon>{icon}</FontIcon>
<FilAriane paramResolver={paramResolver} router={router} />
</HeaderItem>
<HeaderItem theme={{item: theme.item({user: true})}}>
<strong>Utilisateur connecté [Administrateur]</strong>
Expand Down
2 changes: 1 addition & 1 deletion src/views/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Header} from "./header";
export function Home() {
return (
<>
<Header />
<Header icon="home" />
<Content>
Bienvenue sur le starter kit de Focus v4 !<br />
<br />
Expand Down
11 changes: 1 addition & 10 deletions src/views/profils/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {useObserver} from "mobx-react";

import {FontIcon} from "@focus4/toolbox";

import {profilStore} from "../../stores/profil";

import {router} from "../../router";
Expand All @@ -13,14 +11,7 @@ import {ProfilTable} from "./table";
export function Profils() {
return useObserver(() => (
<>
<Header>
<FontIcon>settings</FontIcon>
<strong>
{!router.state.profils.proId
? "Profils"
: `Détail du profil : ${profilStore.profil.libelle.value ?? ""}`}
</strong>
</Header>
<Header icon="settings" paramResolver={() => profilStore.profil.libelle.value ?? ""} />
{router.state.profils.proId ? <ProfilDetail /> : <ProfilTable />}
</>
));
Expand Down
18 changes: 6 additions & 12 deletions src/views/utilisateurs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {useObserver} from "mobx-react";

import {Content} from "@focus4/layout";
import {FontIcon} from "@focus4/toolbox";

import {utilisateurStore} from "../../stores/utilisateur";

Expand All @@ -14,19 +13,14 @@ import {UtilisateurList} from "./list";
export function Utilisateurs() {
return useObserver(() => (
<>
<Header>
<FontIcon>group</FontIcon>
<strong>
{!router.state.utilisateurs.utiId
? "Utilisateurs"
: `Détail de l'utilisateur : ${utilisateurStore.utilisateur.prenom.value ?? ""} ${
utilisateurStore.utilisateur.nom.value ?? ""
}`}
</strong>
</Header>
<Header
icon="group"
paramResolver={() =>
`${utilisateurStore.utilisateur.prenom.value ?? ""} ${utilisateurStore.utilisateur.nom.value ?? ""}`
}
/>
{router.state.utilisateurs.utiId ? (
<Content>
{" "}
<UtilisateurDetail />
</Content>
) : (
Expand Down

0 comments on commit 08fe8a4

Please sign in to comment.