feat(ItemsList): improve property addition validation
This commit is contained in:
parent
16b892b0e2
commit
e32dc05999
1 changed files with 9 additions and 2 deletions
|
@ -386,8 +386,15 @@ export function ItemsList({ url }: ItemsListProps) {
|
|||
console.log('Adding property:', property);
|
||||
const normalizedProperty = property.replace('http://www.wikidata.org/prop/', '');
|
||||
|
||||
if (!normalizedProperty || selectedProperties[normalizedProperty]) {
|
||||
console.log('Property already exists or invalid:', normalizedProperty);
|
||||
// Check if property is invalid,
|
||||
if (!normalizedProperty) {
|
||||
console.log('Property is invalid:', normalizedProperty);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if property is already in customProperties array (visible in UI)
|
||||
if (customProperties.includes(normalizedProperty)) {
|
||||
console.log('Property already visible in UI:', normalizedProperty);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue