Remove unused import, nicer plurals, lint
This commit is contained in:
parent
a6042d3958
commit
5e2507041d
2 changed files with 9 additions and 5 deletions
|
@ -11,7 +11,7 @@ Services.scriptloader.loadSubScript("chrome://zotero/content/import/mendeley/men
|
||||||
|
|
||||||
const importerVersion = 1;
|
const importerVersion = 1;
|
||||||
const { apiTypeToDBType, apiFieldToDBField } = mendeleyOnlineMappings;
|
const { apiTypeToDBType, apiFieldToDBField } = mendeleyOnlineMappings;
|
||||||
const { apiFetch, codeAuth, directAuth, get, getAll } = mendeleyAPIUtils;
|
const { apiFetch, codeAuth, get, getAll } = mendeleyAPIUtils;
|
||||||
|
|
||||||
const colorMap = new Map();
|
const colorMap = new Map();
|
||||||
colorMap.set('rgb(255, 245, 173)', '#ffd400');
|
colorMap.set('rgb(255, 245, 173)', '#ffd400');
|
||||||
|
@ -140,7 +140,7 @@ Zotero_Import_Mendeley.prototype.translate = async function (options = {}) {
|
||||||
this._itemDone();
|
this._itemDone();
|
||||||
|
|
||||||
let folderKeys = new Map();
|
let folderKeys = new Map();
|
||||||
if(!this.relinkOnly) {
|
if (!this.relinkOnly) {
|
||||||
const folders = this._tokens
|
const folders = this._tokens
|
||||||
? await this._getFoldersAPI(mendeleyGroupID)
|
? await this._getFoldersAPI(mendeleyGroupID)
|
||||||
: await this._getFoldersDB(mendeleyGroupID);
|
: await this._getFoldersDB(mendeleyGroupID);
|
||||||
|
@ -182,12 +182,14 @@ Zotero_Import_Mendeley.prototype.translate = async function (options = {}) {
|
||||||
|
|
||||||
this._interruptChecker(true);
|
this._interruptChecker(true);
|
||||||
|
|
||||||
|
// eslint-disable-next-line multiline-ternary
|
||||||
let collections = this.relinkOnly ? new Map() : this._tokens
|
let collections = this.relinkOnly ? new Map() : this._tokens
|
||||||
? await this._getDocumentCollectionsAPI(documents, rootCollectionKey, folderKeys)
|
? await this._getDocumentCollectionsAPI(documents, rootCollectionKey, folderKeys)
|
||||||
: await this._getDocumentCollectionsDB(mendeleyGroupID, documents, rootCollectionKey, folderKeys);
|
: await this._getDocumentCollectionsDB(mendeleyGroupID, documents, rootCollectionKey, folderKeys);
|
||||||
|
|
||||||
this._interruptChecker(true);
|
this._interruptChecker(true);
|
||||||
|
|
||||||
|
// eslint-disable-next-line multiline-ternary
|
||||||
let files = this.relinkOnly ? new Map() : this._tokens
|
let files = this.relinkOnly ? new Map() : this._tokens
|
||||||
? await this._getDocumentFilesAPI(documents)
|
? await this._getDocumentFilesAPI(documents)
|
||||||
: await this._getDocumentFilesDB(mendeleyGroupID);
|
: await this._getDocumentFilesDB(mendeleyGroupID);
|
||||||
|
@ -562,7 +564,7 @@ Zotero_Import_Mendeley.prototype._getDocumentsAPI = async function (groupID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (await getAll(this._tokens, 'documents', params, headers, {}, this._interruptChecker)).map(d => {
|
return (await getAll(this._tokens, 'documents', params, headers, {}, this._interruptChecker)).map((d) => {
|
||||||
const processedDocument = { ...d, remoteUuid: d.id };
|
const processedDocument = { ...d, remoteUuid: d.id };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -47,11 +47,13 @@ general-error = Error
|
||||||
file-interface-import-error = An error occurred while trying to import the selected file. Please ensure that the file is valid and try again.
|
file-interface-import-error = An error occurred while trying to import the selected file. Please ensure that the file is valid and try again.
|
||||||
file-interface-import-complete = Import Complete
|
file-interface-import-complete = Import Complete
|
||||||
file-interface-items-were-imported = { $numItems ->
|
file-interface-items-were-imported = { $numItems ->
|
||||||
[one] item was imported
|
[0] No items were imported
|
||||||
|
[one] One item was imported
|
||||||
*[other] { $numItems } items were imported
|
*[other] { $numItems } items were imported
|
||||||
}
|
}
|
||||||
file-interface-items-were-relinked = { $numRelinked ->
|
file-interface-items-were-relinked = { $numRelinked ->
|
||||||
[one] item was relinked
|
[0] No items were relinked
|
||||||
|
[one] One item was relinked
|
||||||
*[other] { $numRelinked } items were relinked
|
*[other] { $numRelinked } items were relinked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue