From 0dfaa2221ec47e8c79695a2c29f803ffffab4bb1 Mon Sep 17 00:00:00 2001 From: Eugen Neuber <eugen.neuber@tugraz.at> Date: Wed, 24 Mar 2021 15:45:50 +0100 Subject: [PATCH] Fix linting errors and warnings --- src/dbp-official-signature-pdf-upload.js | 1 + src/dbp-signature-lit-element.js | 4 ++-- src/utils.js | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/dbp-official-signature-pdf-upload.js b/src/dbp-official-signature-pdf-upload.js index 2eb9eb6..8482484 100644 --- a/src/dbp-official-signature-pdf-upload.js +++ b/src/dbp-official-signature-pdf-upload.js @@ -780,6 +780,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem /** * Returns the list of files of annotations of a queued file * + * @param key * @returns {*[]} Array of html templates */ getAnnotationsHtml(key) { diff --git a/src/dbp-signature-lit-element.js b/src/dbp-signature-lit-element.js index 65af583..464b102 100644 --- a/src/dbp-signature-lit-element.js +++ b/src/dbp-signature-lit-element.js @@ -89,7 +89,7 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement { /** * @param file - * @returns key of the queued item + * @returns {string} key of the queued item */ queueFile(file) { this._queueKey++; @@ -136,7 +136,7 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement { * * @param file * @param annotations - * @returns {File} + * @returns {File} file given as parameter, but with annotations */ async addAnnotationsToFile(file, annotations) { // We need to work with the AnnotationFactory because the pdf file is broken if diff --git a/src/utils.js b/src/utils.js index cc7c91c..e0648f7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,6 @@ import {AnnotationFactory} from '@digital-blueprint/annotpdf/_bundles/pdfAnnotate.js'; import {html} from "lit-element"; -import {humanFileSize} from "@dbp-toolkit/common/i18next"; +//import {humanFileSize} from "@dbp-toolkit/common/i18next"; /** * Finds an object in a JSON result by identifier @@ -153,7 +153,7 @@ export const getPDFSignatureCount = async (file) => { * @param personName * @param key * @param value - * @returns {File} + * @returns {File} file given as parameter, but with annotations */ export const addKeyValuePdfAnnotation = async (file, activityNameDE, activityNameEN, personName, key, value) => { key = key.trim(); @@ -176,19 +176,19 @@ export const addKeyValuePdfAnnotation = async (file, activityNameDE, activityNam * * @param annotationFactory * @param file - * @returns {File} + * @returns {File} file given as parameter, but with annotations */ export const writeAnnotationFactoryToFile = (annotationFactory, file) => { const blob = annotationFactory.write(); return new File([blob], file.name, { type: file.type }); -} +}; /** * Creates an AnnotationFactory from a File * * @param file - * @returns AnnotationFactory + * @returns {AnnotationFactory} from given file */ export const getAnnotationFactoryFromFile = async (file) => { const data = await readArrayBufferFileContent(file); @@ -208,7 +208,7 @@ export const getAnnotationFactoryFromFile = async (file) => { * @param annotationTypeNameEN * @param organizationNumber * @param value - * @returns PdfFactory + * @returns {AnnotationFactory} prepared to annotate */ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory, activityNameDE, activityNameEN, personName, annotationType, annotationTypeNameDE, annotationTypeNameEN, organizationNumber, value) => { @@ -267,7 +267,7 @@ export const addPdfAnnotationToAnnotationFactory = (annotationFactory, author, c * Returns an object with all annotations types or only the values for one type * * @param key - * @returns {} + * @returns {object} describing the annotation type named key */ export const getAnnotationTypes = (key = null) => { const types = { @@ -279,7 +279,7 @@ export const getAnnotationTypes = (key = null) => { 'de': 'Andere Zahl', 'en': 'Other number', } - } + }; return key === null ? types : types[key] || {}; }; @@ -287,7 +287,9 @@ export const getAnnotationTypes = (key = null) => { /** * Returns the html for the annotation type select * - * @returns {*[]} Array of html templates + * @param selectedKey + * @param lang + * * @returns {*[]} Array of html templates */ export const getAnnotationTypeSelectOptionsHtml = (selectedKey, lang) => { const annotationTypes = getAnnotationTypes(); -- GitLab