fix: style

This commit is contained in:
2026-03-12 14:07:55 +01:00
parent bc7eb7122c
commit 1e6f3c46d1
5 changed files with 32 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
<script setup lang="ts">
import ProductsView from '@/views/customer/ProductsView.vue';
import LangSwitch from './inner/langSwitch.vue'
import ThemeSwitch from './inner/themeSwitch.vue'
import { useAuthStore } from '@/stores/auth'

View File

@@ -26,10 +26,10 @@ export interface PagingParams {
pageSize?: number
}
export async function getRepos(): Promise<any> {
const result = await useFetchJson<number[]>(`${API_PREFIX}/get-repos`)
return result
}
// export async function getRepos(): Promise<any> {
// const result = await useFetchJson<number[]>(`${API_PREFIX}/get-repos`)
// return result
// }
// export async function getYears(repoID: number): Promise<any> {
// return useFetchJson<number[]>(`${API_PREFIX}/get-years?repoID=${repoID}`)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, computed, watch, onMounted, type Ref } from 'vue'
import { ref, computed, watch, type Ref } from 'vue'
import { Bar } from 'vue-chartjs'
import {
Chart as ChartJS,
@@ -10,7 +10,7 @@ import {
CategoryScale,
LinearScale,
} from 'chart.js'
import { getRepos, getYears, getQuarters, getIssues, type QuarterData, type IssueTimeSummary } from '@/composable/useRepoApi'
import { getYears, getQuarters, getIssues, type QuarterData, type IssueTimeSummary } from '@/composable/useRepoApi'
import { useAuthStore } from '@/stores/auth'
import { i18n } from '@/plugins/02_i18n'
import type { TableColumn } from '@nuxt/ui'
@@ -49,7 +49,7 @@ async function loadData<T>(fetchFn: () => Promise<any>, target: Ref<T[]>, errorM
}
}
onMounted(() => loadData(() => getRepos(), repos, t('repo_chart.failed_to_load_repositories')))
// onMounted(() => loadData(() => getRepos(), repos, t('repo_chart.failed_to_load_repositories')))
watch(selectedRepo, async (newRepo) => {
selectedYear.value = null

View File

@@ -83,6 +83,14 @@ const columns = computed<TableColumn<Product>[]>(() => [
accessorKey: 'code',
header: t('products.product_code'),
},
{
accessorKey: 'description',
header: t('products.description'),
cell: ({ row }) => {
const desc = row.getValue('description') as string
return h('span', { class: 'text-sm text-gray-500 dark:text-gray-400' }, desc?.substring(0, 50) + (desc && desc.length > 50 ? '...' : ''))
}
},
{
accessorKey: 'inStock',
header: t('products.in_stock'),
@@ -99,7 +107,7 @@ const columns = computed<TableColumn<Product>[]>(() => [
cell: ({ row }) => {
const priceFromVal = row.original.priceFrom
const priceToVal = row.original.priceTo
return `$${priceFromVal} - $${priceToVal}`
return `${priceFromVal} - ${priceToVal}`
}
},
{

View File

@@ -1,4 +1,14 @@
-- +goose Up
Repository Work Chart
Repository
Select a repository
Year
Select a year
Quarter
All Quarters
Please select a repository to view work data.-- +goose Up
-- Add translations for products and navigation
-- Register new components
@@ -30,6 +40,7 @@ INSERT IGNORE b2b_translations (lang_id, scope_id, component_id, `key`, data) VA
(1, 3, 304, 'yes', 'Yes'),
(1, 3, 304, 'no', 'No'),
(1, 3, 304, 'added_to_cart', 'Added to cart'),
(1, 3, 304, 'description', 'Description'),
-- Polish (lang_id = 2)
(2, 3, 304, 'title', 'Produkty'),
(2, 3, 304, 'image', 'Obrazek'),
@@ -53,6 +64,7 @@ INSERT IGNORE b2b_translations (lang_id, scope_id, component_id, `key`, data) VA
(2, 3, 304, 'yes', 'Tak'),
(2, 3, 304, 'no', 'Nie'),
(2, 3, 304, 'added_to_cart', 'Dodano do koszyka'),
(2, 3, 304, 'description', 'Opis'),
-- Czech (lang_id = 3)
(3, 3, 304, 'title', 'Produkty'),
(3, 3, 304, 'image', 'Obrázek'),
@@ -75,7 +87,8 @@ INSERT IGNORE b2b_translations (lang_id, scope_id, component_id, `key`, data) VA
(3, 3, 304, 'products', 'produktů'),
(3, 3, 304, 'yes', 'Ano'),
(3, 3, 304, 'no', 'Ne'),
(3, 3, 304, 'added_to_cart', 'Přidáno do košíku');
(3, 3, 304, 'added_to_cart', 'Přidáno do košíku'),
(3, 3, 304, 'description', 'Popis');
-- Component: nav (component_id = 305)
INSERT IGNORE b2b_translations (lang_id, scope_id, component_id, `key`, data) VALUES