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:
@@ -7,7 +7,7 @@
|
||||
map-id="unified-catalog-map"
|
||||
:point-color="mapPointColor"
|
||||
:items="currentSelectionItems"
|
||||
:hovered-id="hoveredItemId"
|
||||
:hovered-id="hoveredItemId ?? undefined"
|
||||
:show-panel="showPanel"
|
||||
:filter-by-bounds="filterByBounds"
|
||||
:related-points="relatedPoints"
|
||||
@@ -48,7 +48,7 @@
|
||||
@close="onInfoClose"
|
||||
@add-to-filter="onInfoAddToFilter"
|
||||
@open-info="onInfoOpenRelated"
|
||||
@select-product="selectInfoProduct"
|
||||
@select-product="(uuid: string | null) => uuid && selectInfoProduct(uuid)"
|
||||
/>
|
||||
|
||||
<!-- Quote results: show offers after search -->
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
>
|
||||
<Stack gap="3">
|
||||
<Stack gap="1">
|
||||
<Text size="lg" weight="semibold">{{ offer.title }}</Text>
|
||||
<Text size="lg" weight="semibold">{{ offer.productName }}</Text>
|
||||
<Stack direction="row" align="center" gap="2">
|
||||
<Icon name="lucide:map-pin" size="14" class="text-base-content/60" />
|
||||
<Text tone="muted">{{ offer.locationName }}, {{ offer.locationCountry }}</Text>
|
||||
@@ -231,7 +231,7 @@ const {
|
||||
|
||||
const isLoading = computed(() => productsPending.value || productOffersPending.value || suppliersPending.value)
|
||||
const product = computed(() => findProduct(productsData.value?.getProducts || []))
|
||||
const offers = computed(() => productOffersData.value?.getOffers || [])
|
||||
const offers = computed(() => (productOffersData.value?.getOffers || []).filter((o): o is NonNullable<typeof o> => !!o))
|
||||
const allSuppliers = computed(() => suppliersData.value?.getSupplierProfiles || [])
|
||||
|
||||
const productId = computed(() => route.params.id as string)
|
||||
@@ -247,7 +247,7 @@ const uniqueSuppliers = computed(() => {
|
||||
offers.value.forEach(offer => {
|
||||
if (offer.teamUuid) {
|
||||
const existing = suppliers.get(offer.teamUuid)
|
||||
const supplierInfo = allSuppliers.value.find(s => s.teamUuid === offer.teamUuid)
|
||||
const supplierInfo = allSuppliers.value.find(s => s && s.teamUuid === offer.teamUuid)
|
||||
if (existing) {
|
||||
existing.offersCount++
|
||||
} else if (supplierInfo?.uuid) {
|
||||
@@ -295,7 +295,7 @@ const mapLocations = computed(() => {
|
||||
const priceRange = computed(() => {
|
||||
const prices: number[] = []
|
||||
offers.value.forEach(offer => {
|
||||
offer.lines?.forEach((line: any) => {
|
||||
(offer as any).lines?.forEach((line: any) => {
|
||||
if (line?.productUuid === productId.value && line?.pricePerUnit) {
|
||||
prices.push(Number(line.pricePerUnit))
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -169,7 +169,12 @@ const route = useRoute()
|
||||
const localePath = useLocalePath()
|
||||
const { t } = useI18n()
|
||||
|
||||
const selectedServices = ref({
|
||||
const selectedServices = ref<{
|
||||
logistics: number | null
|
||||
financing: number | null
|
||||
insurance: number | null
|
||||
laboratory: number | null
|
||||
}>({
|
||||
logistics: null,
|
||||
financing: null,
|
||||
insurance: null,
|
||||
|
||||
Reference in New Issue
Block a user