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

EcrituresNumeriques / stylo / 13796429024

11 Mar 2025 07:22PM UTC coverage: 28.543% (+0.009%) from 28.534%
13796429024

push

github

web-flow
Correctifs dans la gestion des imports par URL Zotero (#1328)

* fix(zotero): corrige la sauvegarde du jeton Zotero

Régression introduite dans 92d1ba29f / #1272

* fix: traduction dynamique de la pagination de bibliographie

* fix(zotero): convertit en URL d'API Zotero lors de l'import

Gère quelques cas à la marge en plus, dont la sauvegarde d'article individuel.

---------

Co-authored-by: Thomas Parisot <thom4parisot@users.noreply.github.com>

403 of 603 branches covered (66.83%)

Branch coverage included in aggregate %.

10 of 12 new or added lines in 3 files covered. (83.33%)

3917 of 14532 relevant lines covered (26.95%)

1.94 hits per line

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

0.0
/front/src/components/Write/ReferenceList.jsx
1
import React, { useCallback, useState } from 'react'
×
2
import { shallowEqual, useSelector } from 'react-redux'
×
3
import { Search } from 'react-feather'
×
4
import { useTranslation } from 'react-i18next'
×
5

6
import Reference from './Reference'
×
7
import styles from './ReferenceList.module.scss'
×
8
import Field from '../Field'
×
9
import Button from '../Button'
×
10

11
export default function ReferenceList() {
×
12
  const bibliographyEntries = useSelector(
×
13
    (state) => state.workingArticle.bibliography.entries,
×
14
    shallowEqual
×
15
  )
×
16
  const [filter, setFilter] = useState('')
×
17
  const [showAll, setShowAll] = useState(false)
×
18
  let bibTeXFound
×
19
  if (filter) {
×
20
    bibTeXFound = bibliographyEntries.filter(
×
21
      (entry) => entry.key.toLowerCase().indexOf(filter.toLowerCase()) > -1
×
22
    )
×
23
  } else {
×
24
    if (showAll) {
×
25
      bibTeXFound = bibliographyEntries
×
26
    } else {
×
27
      bibTeXFound = bibliographyEntries.slice(0, 25)
×
28
    }
×
29
  }
×
30
  const handleShowAll = useCallback(() => setShowAll(true), [])
×
31
  const { t } = useTranslation()
×
32
  return (
×
33
    <>
×
34
      <Field
×
35
        className={styles.searchField}
×
36
        type="text"
×
37
        icon={Search}
×
38
        value={filter}
×
39
        placeholder={t('write.searchFieldBiblio.placeholder')}
×
40
        onChange={(e) => setFilter(e.target.value)}
×
41
      />
×
42
      {filter && (
×
43
        <span className={styles.resultFoundCount}>
×
44
          {bibTeXFound.length} found
×
45
        </span>
×
46
      )}
47
      {bibTeXFound.map((entry, index) => (
×
48
        <Reference key={`ref-${entry.key}-${index}`} entry={entry} />
×
49
      ))}
×
50
      {!showAll && bibliographyEntries.length > 25 && (
×
51
        <Button className={styles.showAll} onClick={handleShowAll}>
×
NEW
52
          {t('write.showBiblio.button', { length: bibliographyEntries.length })}
×
53
        </Button>
×
54
      )}
55
    </>
×
56
  )
57
}
×
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