• 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/workspace/WorkspaceItem.jsx
1
import { Braces, CircleOff, Users } from 'lucide-react'
×
2
import React from 'react'
×
3
import { useTranslation } from 'react-i18next'
×
4

5
import { useModal } from '../../hooks/modal.js'
×
6

7
import Button from '../Button.jsx'
×
8
import Field from '../Field.jsx'
×
9
import TimeAgo from '../TimeAgo.jsx'
×
10
import LeaveWorkspaceModal from './LeaveWorkspaceModal.jsx'
×
11
import WorkspaceManageMembersModal from './WorkspaceManageMembersModal.jsx'
×
12
import WorkspaceUpdateFormMetadataModal from './WorkspaceUpdateFormMetadataModal.jsx'
×
13

14
import styles from './workspaceItem.module.scss'
×
15

16
/**
17
 * @typedef {Object} WorkspaceItemProps
18
 * @property {{
19
 *   color: string,
20
 *   name: string,
21
 *   description: string,
22
 *   personal: boolean,
23
 *   articlesCount: number,
24
 *   creator: {
25
 *     displayName: string,
26
 *     username: string
27
 *   },
28
 *   formMetadata: {
29
 *     data: string,
30
 *     ui: string
31
 *   },
32
 *   createdAt: string,
33
 *   updatedAt: string
34
 * }} workspace
35
 */
36

37
/**
38
 * @param {WorkspaceItemProps} props
39
 * @returns {React.ReactHTMLElement}
40
 */
41
export default function WorkspaceItem({ workspace }) {
×
42
  const { t } = useTranslation()
×
43
  const workspaceLeaveModal = useModal()
×
44
  const workspaceManageMembersModal = useModal()
×
45
  const workspaceUpdateFormMetadataModal = useModal()
×
46

47
  const workspaceTitle = (
×
48
    <>
×
49
      <h2 className={styles.title}>
×
50
        <span
×
51
          className={styles.chip}
×
52
          style={{ backgroundColor: workspace.color }}
×
53
          role="presentation"
×
54
        ></span>
×
55

56
        <span>{workspace.name}</span>
×
UNCOV
57
      </h2>
×
UNCOV
58
    </>
×
59
  )
60

61
  return (
×
62
    <div className={styles.container}>
×
63
      {workspaceTitle}
×
64
      {workspace.personal && (
×
65
        <>
×
66
          <Field className={styles.field} label="Articles">
×
67
            <span>{workspace.articlesCount}</span>
×
UNCOV
68
          </Field>
×
69
        </>
×
70
      )}
71
      {!workspace.personal && (
×
72
        <>
×
73
          <div>
×
74
            {workspace.description && (
×
75
              <Field
×
UNCOV
76
                className={styles.field}
×
77
                label={t('workspace.description.label')}
×
78
              >
UNCOV
79
                <span>{workspace.description}</span>
×
80
              </Field>
×
81
            )}
82
            <Field
×
UNCOV
83
              className={styles.field}
×
84
              label={t('workspace.createdAt.label')}
×
85
            >
86
              <>
×
87
                <TimeAgo date={workspace.createdAt} />
×
88
                {workspace.creator && (
×
89
                  <>
×
90
                    {' '}
×
91
                    <span>{t('workspace.createdBy.label')}</span>{' '}
×
92
                    <span className={styles.creator}>
×
93
                      {workspace.creator.displayName ||
×
94
                        workspace.creator.username}
×
UNCOV
95
                    </span>
×
96
                  </>
×
97
                )}
98
              </>
×
99
            </Field>
×
100
            <Field
×
UNCOV
101
              className={styles.field}
×
102
              label={t('workspace.updatedAt.label')}
×
103
            >
104
              <TimeAgo date={workspace.updatedAt} />
×
105
            </Field>
×
106
            <Field
×
UNCOV
107
              className={styles.field}
×
108
              label={t('workspace.membersCount.label')}
×
109
            >
110
              <span>{workspace.stats.membersCount}</span>
×
111
            </Field>
×
112
            <Field
×
UNCOV
113
              className={styles.field}
×
114
              label={t('workspace.articlesCount.label')}
×
115
            >
116
              <span>{workspace.stats.articlesCount}</span>
×
117
            </Field>
×
118
          </div>
×
119
          <aside className={styles.actionButtons}>
×
120
            <div className={styles.primaryActionButtons}>
×
121
              <Button
×
UNCOV
122
                title={t('workspace.manageMember.title')}
×
123
                onClick={() => workspaceManageMembersModal.show()}
×
124
              >
125
                <Users /> {t('workspace.manageMember.button')}
×
126
              </Button>
×
127
              <Button
×
UNCOV
128
                title={t('workspace.updateFormMetadata.title')}
×
129
                onClick={() => workspaceUpdateFormMetadataModal.show()}
×
130
              >
131
                <Braces /> {t('workspace.updateFormMetadata.button')}
×
132
              </Button>
×
133
            </div>
×
134
            <Button
×
UNCOV
135
              title={t('workspace.leave.title')}
×
136
              onClick={() => workspaceLeaveModal.show()}
×
137
            >
138
              <CircleOff /> {t('workspace.leave.button')}
×
UNCOV
139
            </Button>
×
140
          </aside>
×
141

142
          <LeaveWorkspaceModal {...workspaceLeaveModal} workspace={workspace} />
×
143

144
          <WorkspaceManageMembersModal
×
145
            {...workspaceManageMembersModal}
×
UNCOV
146
            workspace={workspace}
×
147
          />
×
148

149
          <WorkspaceUpdateFormMetadataModal
×
150
            {...workspaceUpdateFormMetadataModal}
×
151
            workspace={workspace}
×
UNCOV
152
          />
×
153
        </>
×
154
      )}
155
    </div>
×
156
  )
UNCOV
157
}
×
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