• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EcrituresNumeriques / stylo / 18488516340

14 Oct 2025 07:12AM UTC coverage: 39.528% (+0.1%) from 39.427%
18488516340

push

github

web-flow
feat(metadata): Ajout d'un formulaire pour les notes de réunion (#1697)

598 of 846 branches covered (70.69%)

Branch coverage included in aggregate %.

33 of 45 new or added lines in 1 file covered. (73.33%)

111 existing lines in 5 files now uncovered.

5938 of 15689 relevant lines covered (37.85%)

2.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/front/src/components/Header.jsx
1
import clsx from 'clsx'
×
2
import { Menu } from 'lucide-react'
×
3
import React, { useMemo } from 'react'
×
4
import { useTranslation } from 'react-i18next'
×
5
import { Link, NavLink, useLocation, useRouteLoaderData } from 'react-router'
×
6

7
import logoContent from '/images/logo.svg?inline'
×
8

9
import useComponentVisible from '../hooks/componentVisible.js'
×
10
import { useActiveWorkspaceId } from '../hooks/workspace.js'
×
11

12
import LanguagesMenu from './header/LanguagesMenu.jsx'
×
13
import UserMenu from './header/UserMenu.jsx'
×
14
import WorkspacesMenu from './workspace/WorkspacesMenu.jsx'
×
15

16
import styles from './header.module.scss'
×
17

18
export default function Header() {
×
19
  const { t } = useTranslation()
×
20
  const activeWorkspaceId = useActiveWorkspaceId()
×
21
  const { user } = useRouteLoaderData('app')
×
22
  const location = useLocation()
×
23
  const activeTool = location.pathname.includes('/corpus')
×
24
    ? 'corpus'
×
25
    : 'articles'
×
26
  const userId = user?._id
×
27
  const baseUrl = useMemo(
×
28
    () => (activeWorkspaceId ? `/workspaces/${activeWorkspaceId}` : ''),
×
29
    [activeWorkspaceId]
×
30
  )
×
31
  const {
×
32
    ref: workspacesRef,
×
33
    isComponentVisible: areWorkspacesVisible,
×
34
    toggleComponentIsVisible: toggleWorkspaces,
×
35
  } = useComponentVisible(false, 'workspaces')
×
36
  const {
×
37
    ref: toolsRef,
×
38
    isComponentVisible: areToolsVisible,
×
39
    toggleComponentIsVisible: toggleTools,
×
40
  } = useComponentVisible(false, 'tools')
×
41

42
  return (
×
43
    <header className={styles.header} role="banner">
×
44
      <div className={styles.container}>
×
45
        <NavLink to="/" rel="home"  className={styles.logo}>
×
46
          <img src={logoContent} alt="Stylo" aria-hidden />
×
47
          <span className="sr-only">{t('header.home')}</span>
×
48
        </NavLink>
×
49

50
        {userId && (
×
UNCOV
51
          <nav
×
52
            role="navigation"
×
53
            id="main-navigation"
×
54
            ref={toolsRef}
×
55
            className={styles.navigation}
×
56
            aria-label={t('header.mainMenu.list')}
×
57
            aria-description={t('header.mainMenu.description')}
×
58
          >
59
            <button
×
UNCOV
60
              className={styles.menuButton}
×
61
              aria-controls="app-menu"
×
62
              aria-pressed={areToolsVisible}
×
63
              onClick={toggleTools}
×
64
            >
65
              <Menu className="icon" aria-hidden />
×
UNCOV
66
              {t('header.mainMenu.button')}
×
67
            </button>
×
68

69
            <div
×
UNCOV
70
              className={clsx(areToolsVisible && styles.menuLinksMobileVisible)}
×
71
              id="app-menu"
×
72
            >
73
              <ul
×
UNCOV
74
                className={styles.menuLinks}
×
75
                aria-label={t('header.mainMenu.list')}
×
76
              >
77
                <li hidden={!userId}>
×
UNCOV
78
                  <NavLink to={`${baseUrl}/articles`} prefetch="intent">
×
79
                    {t('header.mainMenu.articles')}
×
80
                  </NavLink>
×
81
                </li>
×
82
                <li hidden={!userId}>
×
83
                  <NavLink to={`${baseUrl}/corpus`}>
×
84
                    {t('header.mainMenu.corpus')}
×
85
                  </NavLink>
×
86
                </li>
×
87
                <li
×
88
                  hidden={!userId}
×
89
                  ref={workspacesRef}
×
90
                  className={styles.toggleMenu}
×
91
                >
92
                  <button
×
UNCOV
93
                    aria-controls="header-workspaces-list"
×
94
                    aria-expanded={areWorkspacesVisible}
×
95
                    onClick={toggleWorkspaces}
×
96
                  >
97
                    {t('header.mainMenu.workspaces')}
×
UNCOV
98
                  </button>
×
99

100
                  <div
×
UNCOV
101
                    className={styles.toggleMenuContainer}
×
102
                    id="header-workspaces-list"
×
103
                    hidden={!areWorkspacesVisible}
×
104
                  >
105
                    <ul
×
UNCOV
106
                      className={styles.toggleMenuList}
×
107
                      aria-label={t('header.mainMenu.workspaces.list')}
×
108
                    >
109
                      <li>
×
UNCOV
110
                        <Link
×
111
                          to={`/${activeTool}`}
×
112
                          aria-current={!activeWorkspaceId ? 'page' : false}
×
113
                        >
114
                          <span
×
UNCOV
115
                            className={styles.chip}
×
116
                            style={{ backgroundColor: '#ccc' }}
×
117
                          />
×
118
                          {t('workspace.myspace')}
×
119
                        </Link>
×
120
                      </li>
×
121

122
                      <WorkspacesMenu activeTool={activeTool} />
×
123

124
                      <li>
×
UNCOV
125
                        <NavLink to={`/workspaces`} end>
×
126
                          {t('workspace.all')}
×
127
                        </NavLink>
×
128
                      </li>
×
129
                    </ul>
×
130
                  </div>
×
131
                </li>
×
132
              </ul>
×
133
            </div>
×
134
          </nav>
×
135
        )}
136

UNCOV
137
        <UserMenu />
×
UNCOV
138
        <LanguagesMenu />
×
139
      </div>
×
140
    </header>
×
141
  )
142
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc