fix further type problems

This commit is contained in:
2025-06-10 14:33:40 +02:00
parent e4d74e4331
commit 07247486ab
10 changed files with 15 additions and 63 deletions

View File

@@ -55,22 +55,22 @@
<div>
<label for="description" class="block text-sm font-medium leading-6 text-gray-900"
><span class="flex"
>{#if form?.error?.description}
>{#if form?.description}
<span class="inline-block mr-1"><Exclamation /></span>
{/if} Beschreibung</span
></label
>
<div class="mt-2">
<textarea
value={form?.description ?? ''}
value={form?.description?.toString() ?? ''}
id="description"
name="description"
rows="3"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
></textarea>
</div>
{#if form?.error?.description}
<p class="block text-sm leading-6 text-red-900 mt-2">{form.error.description}</p>
{#if form?.error}
<p class="block text-sm leading-6 text-red-900 mt-2">{form.description}</p>
{/if}
</div>
</div>

View File

@@ -10,7 +10,6 @@ const isRequiredFieldValid = (value: unknown) => {
return true;
}
/** @type {import('./$types').Actions} */
export const actions = {
url: async ({ request }: {request: Request}) => {
const data = await request.formData();
@@ -62,11 +61,9 @@ export const actions = {
const data = Object.fromEntries(requestData);
const vorgang = data.vorgang;
const name = data.name;
console.log('I:', vorgang, name);
const url = await client.presignedPutObject('tatort', `${vorgang}/${name}`, 60);
console.log('O:', url);
return { url };
},
upload3: async ({ request }: {request: Request}) => {
@@ -74,7 +71,6 @@ export const actions = {
const data = Object.fromEntries(requestData);
const name = data.name;
const stream = data.file.stream();
console.log('Data:', stream);
const metaData = { 'Content-Type': 'model-gtlf-binary', 'X-VorgangsNr': '4711' };
const result = new Promise((resolve, reject) => {
client.putObject('tatort', name, Readable.from(stream), metaData, function (err, etag) {
@@ -86,7 +82,6 @@ export const actions = {
let error = null;
try {
etag = await result;
console.log(etag);
} catch (err) {
error = err;
console.log('Error:', err);

View File

@@ -20,8 +20,7 @@
$: inProgress = form === null;
/** @type {?Record<string,any>}*/
let formErrors;
let formErrors: Record<string,any> | null;
async function validateForm() {
let data = new FormData();
@@ -39,7 +38,6 @@
success = false;
}
console.log('File', files);
if (!files?.length) {
formErrors = { file: 'Sie haben keine Datei ausgewählt.', ...formErrors };
success = false;
@@ -75,7 +73,6 @@
return;
}
const url = await getUrl();
console.log('URL', url);
open = true;
inProgress = true;
@@ -83,7 +80,6 @@
.then((response) => {
inProgress = false;
etag = '123';
console.log('SUCCESS', response);
})
.catch((err) => {
inProgress = false;
@@ -93,7 +89,6 @@
}
function uploadSuccessful() {
console.log('reset');
open = false;
vorgang = '';
name = '';

View File

@@ -28,9 +28,6 @@
$: style = `width: ${progress}%`;
/**
* @param {any} detail
*/
const onProgress = ({ detail }) => {
progress = Math.ceil(detail.totalProgress * 100.0);
if (progress == 100) {
@@ -41,21 +38,6 @@
}
function onResetView() {
console.log(
'show cameraOrbit:',
modelViewer.getCameraOrbit(),
modelViewer.cameraOrbit,
modelViewer.getDimensions()
);
console.log(
'Camera-orbit: ',
modelViewer.getAttribute('camera-orbit'),
'camera-target: ',
modelViewer.getAttribute('camera-target'),
'object-rotation: ',
modelViewer.getAttribute('rotation')
);
cameraAzimuth = 0;
cameraPolar = 0;
cameraZoom = 100;
@@ -69,12 +51,7 @@
fieldOfView = '10deg';
}
/**
* @param {number} azimuth
* @param {number} polar
* @param {number} zoom
*/
function updateCameraOrbit(azimuth, polar, zoom) {
function updateCameraOrbit(azimuth: number, polar: number, zoom: number) {
cameraAzimuth = azimuth;
cameraPolar = polar;
cameraZoom = zoom;