Fix of errors: automatic and some manual

This commit is contained in:
2024-11-04 19:56:03 +01:00
parent 90798b12e5
commit f05c25853c
41 changed files with 101 additions and 148 deletions

View File

@@ -68,10 +68,10 @@ window.addEventListener('DOMContentLoaded', () => {
upload_inputs.forEach((input: HTMLDivElement): void => {
// test for a parent to check if this is a collection entry
let collectionEntry: null|HTMLLIElement = null;
let parent = input.parentElement;
const parent = input.parentElement;
console.log('parent', parent);
if (null !== parent) {
let grandParent = parent.parentElement;
const grandParent = parent.parentElement;
console.log('grandParent', grandParent);
if (null !== grandParent) {
if (grandParent.tagName.toLowerCase() === 'li' && grandParent.classList.contains('entry')) {

View File

@@ -43,9 +43,7 @@ export interface StoredObjectStatusChange {
/**
* Function executed by the WopiEditButton component.
*/
export type WopiEditButtonExecutableBeforeLeaveFunction = {
(): Promise<void>
}
export type WopiEditButtonExecutableBeforeLeaveFunction = () => Promise<void>
/**
* Object containing information for performering a POST request to a swift object store

View File

@@ -73,9 +73,7 @@ interface DocumentActionButtonsGroupConfig {
davLinkExpiration?: number,
}
const emit = defineEmits<{
(e: 'onStoredObjectStatusChange', newStatus: StoredObjectStatusChange): void
}>();
const emit = defineEmits<(e: 'onStoredObjectStatusChange', newStatus: StoredObjectStatusChange) => void>();
const props = withDefaults(defineProps<DocumentActionButtonsGroupConfig>(), {
small: false,

View File

@@ -10,9 +10,7 @@ interface DropFileConfig {
const props = defineProps<DropFileConfig>();
const emit = defineEmits<{
(e: 'addDocument', stored_object: StoredObjectCreated): void,
}>();
const emit = defineEmits<(e: 'addDocument', stored_object: StoredObjectCreated) => void,>();
const is_dragging: Ref<boolean> = ref(false);
const uploading: Ref<boolean> = ref(false);

View File

@@ -14,7 +14,7 @@ import {StoredObject, StoredObjectCreated} from "../../types";
interface ConvertButtonConfig {
storedObject: StoredObject,
classes: { [key: string]: boolean},
classes: Record<string, boolean>,
filename?: string,
};

View File

@@ -5,7 +5,7 @@ import {computed, reactive} from "vue";
export interface DesktopEditButtonConfig {
editLink: null,
classes: { [k: string]: boolean },
classes: Record<string, boolean>,
expirationLink: number|Date,
}

View File

@@ -17,7 +17,7 @@ import {StoredObject, StoredObjectCreated} from "../../types";
interface DownloadButtonConfig {
storedObject: StoredObject|StoredObjectCreated,
classes: { [k: string]: boolean },
classes: Record<string, boolean>,
filename?: string,
}

View File

@@ -13,7 +13,7 @@ import {StoredObject, StoredObjectCreated, WopiEditButtonExecutableBeforeLeaveFu
interface WopiEditButtonConfig {
storedObject: StoredObject,
returnPath?: string,
classes: {[k: string] : boolean},
classes: Record<string, boolean>,
executeBeforeLeave?: WopiEditButtonExecutableBeforeLeaveFunction,
}

View File

@@ -11,8 +11,8 @@ const keyDefinition = {
};
const createFilename = (): string => {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let text = "";
const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < 7; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));