Skip to content

Commit

Permalink
Merge pull request #43 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Jul 24, 2023
2 parents 6680fbc + 4cc4564 commit 9056da5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [6.1.2](https://github.com/eea/volto-slate-footnote/compare/6.1.1...6.1.2) - 24 July 2023

### [6.1.1](https://github.com/eea/volto-slate-footnote/compare/6.1.0...6.1.1) - 12 June 2023

#### :house: Internal changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-slate-footnote",
"version": "6.1.1",
"version": "6.1.2",
"description": "volto-slate-footnote: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
5 changes: 1 addition & 4 deletions src/editor/MultiSelectSearchWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ const MultiSelectSearchWidget = injectLazyLibs('reactSelectAsyncCreateable')(
const isMatch = (result) => re.test(result.value);
const resultsFiltered = filter(props.choices, isMatch);

return new Promise((resolve, reject) => {
resolve(resultsFiltered);
});
return Promise.resolve(resultsFiltered);
};

/**
Expand Down Expand Up @@ -110,7 +108,6 @@ const MultiSelectSearchWidget = injectLazyLibs('reactSelectAsyncCreateable')(
...item,
footnote: item.value,
};

const { __isNew__: remove, extra, ...rest } = obj;
return rest;
});
Expand Down
30 changes: 16 additions & 14 deletions src/editor/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,23 @@ export const FootnoteElement = (props) => {

// will cosider zotero citations and footnote
// notesObjResult contains all zotero/footnote as unique, and contain refs for other zotero/footnote
const indiceIfZoteroId = data.extra
? [
`[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`, // parent footnote
...data.extra.map(
// citations from extra
(zoteroObj, _index) =>
// all zotero citation are indexed by zoteroId in notesObjResult
`[${
Object.keys(notesObjResult).indexOf(zoteroObj.zoteroId) + 1
}]`,
),
].join('')
: // no extra citations (no multiples)
`[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`;

const indice = zoteroId // ZOTERO
? data.extra
? [
`[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`, // parent footnote
...data.extra.map(
// citations from extra
(zoteroObj, _index) =>
// all zotero citation are indexed by zoteroId in notesObjResult
`[${
Object.keys(notesObjResult).indexOf(zoteroObj.zoteroId) + 1
}]`,
),
].join('')
: // no extra citations (no multiples)
`[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`
? indiceIfZoteroId
: // FOOTNOTES
// parent footnote
[data, ...(data.extra || [])]
Expand Down

0 comments on commit 9056da5

Please sign in to comment.