mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:45:24 +02:00
feat: simplify Product Descriptions tabs
This commit is contained in:
@@ -10,7 +10,7 @@ interface ProductDescriptionsProps {
|
|||||||
rowStatuses: Record<string, string>;
|
rowStatuses: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
type TabType = 'all' | 'missingLongDE' | 'missingLongEN' | 'missingLongAny' | 'missingShortDE' | 'missingShortEN' | 'missingShortAny' | 'complete' | 'incomplete';
|
type TabType = 'all' | 'missingLongDE' | 'missingLongEN' | 'missingShortDE' | 'missingShortEN' | 'complete' | 'incomplete';
|
||||||
|
|
||||||
// Description columns that should only have Present/Missing filters
|
// Description columns that should only have Present/Missing filters
|
||||||
const DESCRIPTION_COLUMNS = [COLUMNS.LONG_DE, COLUMNS.LONG_EN, COLUMNS.SHORT_DE, COLUMNS.SHORT_EN];
|
const DESCRIPTION_COLUMNS = [COLUMNS.LONG_DE, COLUMNS.LONG_EN, COLUMNS.SHORT_DE, COLUMNS.SHORT_EN];
|
||||||
@@ -47,10 +47,8 @@ export function ProductDescriptions({ data, onEdit, rowStatuses }: ProductDescri
|
|||||||
// Tab filter
|
// Tab filter
|
||||||
if (activeTab === 'missingLongDE') result = result.filter(r => !r.row[COLUMNS.LONG_DE]);
|
if (activeTab === 'missingLongDE') result = result.filter(r => !r.row[COLUMNS.LONG_DE]);
|
||||||
if (activeTab === 'missingLongEN') result = result.filter(r => !r.row[COLUMNS.LONG_EN]);
|
if (activeTab === 'missingLongEN') result = result.filter(r => !r.row[COLUMNS.LONG_EN]);
|
||||||
if (activeTab === 'missingLongAny') result = result.filter(r => !r.row[COLUMNS.LONG_DE] || !r.row[COLUMNS.LONG_EN]);
|
|
||||||
if (activeTab === 'missingShortDE') result = result.filter(r => !r.row[COLUMNS.SHORT_DE]);
|
if (activeTab === 'missingShortDE') result = result.filter(r => !r.row[COLUMNS.SHORT_DE]);
|
||||||
if (activeTab === 'missingShortEN') result = result.filter(r => !r.row[COLUMNS.SHORT_EN]);
|
if (activeTab === 'missingShortEN') result = result.filter(r => !r.row[COLUMNS.SHORT_EN]);
|
||||||
if (activeTab === 'missingShortAny') result = result.filter(r => !r.row[COLUMNS.SHORT_DE] || !r.row[COLUMNS.SHORT_EN]);
|
|
||||||
|
|
||||||
if (activeTab === 'complete') result = result.filter(r =>
|
if (activeTab === 'complete') result = result.filter(r =>
|
||||||
r.row[COLUMNS.LONG_DE] && r.row[COLUMNS.LONG_EN] &&
|
r.row[COLUMNS.LONG_DE] && r.row[COLUMNS.LONG_EN] &&
|
||||||
@@ -212,10 +210,8 @@ export function ProductDescriptions({ data, onEdit, rowStatuses }: ProductDescri
|
|||||||
{ id: 'all', label: 'All Products' },
|
{ id: 'all', label: 'All Products' },
|
||||||
{ id: 'missingLongDE', label: 'Missing Long DE' },
|
{ id: 'missingLongDE', label: 'Missing Long DE' },
|
||||||
{ id: 'missingLongEN', label: 'Missing Long EN' },
|
{ id: 'missingLongEN', label: 'Missing Long EN' },
|
||||||
{ id: 'missingLongAny', label: 'Missing Long DE/EN' },
|
|
||||||
{ id: 'missingShortDE', label: 'Missing Short DE' },
|
{ id: 'missingShortDE', label: 'Missing Short DE' },
|
||||||
{ id: 'missingShortEN', label: 'Missing Short EN' },
|
{ id: 'missingShortEN', label: 'Missing Short EN' },
|
||||||
{ id: 'missingShortAny', label: 'Missing Short DE/EN' },
|
|
||||||
{ id: 'complete', label: 'Complete' },
|
{ id: 'complete', label: 'Complete' },
|
||||||
{ id: 'incomplete', label: 'Incomplete' },
|
{ id: 'incomplete', label: 'Incomplete' },
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user