Fix all TypeScript errors and remove Storybook
All checks were successful
Build Docker Image / build (push) Successful in 5m8s
All checks were successful
Build Docker Image / build (push) Successful in 5m8s
- Remove all Storybook files and configuration - Add type declarations for @vueuse/core, @formkit/core, vue3-apexcharts - Fix TypeScript configuration (typeRoots, include paths) - Fix Sentry config - move settings to plugin - Fix nullable prop assignments with ?? operator - Fix type narrowing issues with explicit type assertions - Fix Card component linkable computed properties - Update codegen with operationResultSuffix - Fix GraphQL operation type definitions
This commit is contained in:
@@ -137,9 +137,9 @@ const loadAddress = async () => {
|
||||
uuid: found.uuid,
|
||||
name: found.name || '',
|
||||
address: found.address || '',
|
||||
latitude: found.latitude,
|
||||
longitude: found.longitude,
|
||||
countryCode: found.countryCode
|
||||
latitude: found.latitude ?? null,
|
||||
longitude: found.longitude ?? null,
|
||||
countryCode: found.countryCode ?? null
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -195,7 +195,7 @@ const loadData = async () => {
|
||||
throw new Error(t('clientOfferForm.errors.productNotFound', { uuid: productUuid.value }))
|
||||
}
|
||||
|
||||
productName.value = product.name
|
||||
productName.value = product.name || ''
|
||||
schemaId.value = product.terminusSchemaId || null
|
||||
|
||||
if (!schemaId.value) {
|
||||
@@ -212,7 +212,7 @@ const loadData = async () => {
|
||||
}
|
||||
|
||||
// Save description
|
||||
schemaDescription.value = terminusClass['@documentation']?.['@comment'] || null
|
||||
schemaDescription.value = (terminusClass as Record<string, any>)['@documentation']?.['@comment'] || null
|
||||
|
||||
// 3. Load enums and convert to FormKit schema
|
||||
const enums = await getEnums()
|
||||
@@ -254,10 +254,10 @@ const handleSubmit = async (data: Record<string, unknown>) => {
|
||||
locationLatitude: selectedAddress.latitude,
|
||||
locationLongitude: selectedAddress.longitude,
|
||||
quantity: data.quantity || 0,
|
||||
unit: data.unit || 'ton',
|
||||
unit: String(data.unit || 'ton'),
|
||||
pricePerUnit: data.price_per_unit || data.pricePerUnit || null,
|
||||
currency: data.currency || 'USD',
|
||||
description: data.description || '',
|
||||
currency: String(data.currency || 'USD'),
|
||||
description: String(data.description || ''),
|
||||
validUntil: data.valid_until || data.validUntil || null,
|
||||
terminusSchemaId: schemaId.value,
|
||||
terminusPayload: JSON.stringify(data),
|
||||
|
||||
@@ -220,7 +220,7 @@ const getOrderDuration = () => {
|
||||
})
|
||||
})
|
||||
if (!minDate || !maxDate) return 0
|
||||
const diffTime = Math.abs(maxDate.getTime() - minDate.getTime())
|
||||
const diffTime = Math.abs((maxDate as Date).getTime() - (minDate as Date).getTime())
|
||||
return Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
||||
}
|
||||
|
||||
@@ -236,8 +236,8 @@ const getStageDateRange = (stage: any) => {
|
||||
})
|
||||
if (!minDate || !maxDate) return t('ordersDetail.labels.dates_undefined')
|
||||
const formatDate = (date: Date) => date.toLocaleDateString('ru-RU', { day: 'numeric', month: 'short' })
|
||||
if (minDate.toDateString() === maxDate.toDateString()) return formatDate(minDate)
|
||||
return `${formatDate(minDate)} - ${formatDate(maxDate)}`
|
||||
if ((minDate as Date).toDateString() === (maxDate as Date).toDateString()) return formatDate(minDate as Date)
|
||||
return `${formatDate(minDate as Date)} - ${formatDate(maxDate as Date)}`
|
||||
}
|
||||
|
||||
await loadOrder()
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
<Stack gap="3" align="center">
|
||||
<Heading :level="3">{{ $t('profile.avatar') }}</Heading>
|
||||
<UserAvatar
|
||||
:userId="userData?.id"
|
||||
:firstName="userData?.firstName"
|
||||
:lastName="userData?.lastName"
|
||||
:avatarId="userData?.avatarId"
|
||||
:userId="userData?.id ?? undefined"
|
||||
:firstName="userData?.firstName ?? undefined"
|
||||
:lastName="userData?.lastName ?? undefined"
|
||||
:avatarId="userData?.avatarId ?? undefined"
|
||||
@avatar-changed="handleAvatarChange"
|
||||
/>
|
||||
</Stack>
|
||||
@@ -123,6 +123,10 @@ const updateProfile = async () => {
|
||||
try {
|
||||
isUpdating.value = true
|
||||
|
||||
if (!userData.value?.id) {
|
||||
throw new Error(t('clientProfile.error.load'))
|
||||
}
|
||||
|
||||
const { UpdateUserDocument } = await import('~/composables/graphql/user/teams-generated')
|
||||
const result = await mutate(UpdateUserDocument, {
|
||||
userId: userData.value.id,
|
||||
@@ -135,12 +139,19 @@ const updateProfile = async () => {
|
||||
}, 'user', 'teams')
|
||||
|
||||
if (result?.updateUser?.user) {
|
||||
userData.value = { ...(userData.value || {}), ...result.updateUser.user }
|
||||
const user = result.updateUser.user
|
||||
userData.value = {
|
||||
id: user.id ?? undefined,
|
||||
firstName: user.firstName ?? undefined,
|
||||
lastName: user.lastName ?? undefined,
|
||||
phone: user.phone,
|
||||
avatarId: user.avatarId
|
||||
}
|
||||
avatarDraftId.value = userData.value.avatarId || avatarDraftId.value
|
||||
}
|
||||
} catch (err) {
|
||||
} catch (err: unknown) {
|
||||
hasError.value = true
|
||||
error.value = err?.message || t('clientProfile.error.save')
|
||||
error.value = (err as Error)?.message || t('clientProfile.error.save')
|
||||
} finally {
|
||||
isUpdating.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user