Skip to content

Commit

Permalink
feat(#77): filterable flag even for unique attributes with side note
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashornych committed Dec 6, 2023
1 parent 456c061 commit a76fb34
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/components/base/VPropertiesTable.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import VPropertyTableValue from '@/components/base/VPropertyTableValue.vue'
import VPropertiesTableValue from '@/components/base/VPropertiesTableValue.vue'
import { Property } from '@/model/properties-table'
Expand All @@ -16,8 +16,8 @@ const props = defineProps<{
class="properties-table__row"
>
<td class="text-medium-emphasis">{{ property.name }}</td>
<td>
<VPropertyTableValue :property="property" :property-value="property.value" />
<td class="d-flex align-center">
<VPropertiesTableValue :property="property" :property-value="property.value" />
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const props = defineProps<{
disabled
density="compact"
hide-details
class="flex-grow-0"
@click="propertyValue.action?.(undefined)"
/>

Expand Down Expand Up @@ -81,13 +82,14 @@ const props = defineProps<{
</span>

<!-- side note for the value -->
<span v-if="propertyValue.note">
<VIcon icon="mdi-alert-outline">
<div v-if="propertyValue.note">
<span>
<VIcon icon="mdi-alert-outline" color="warning" />
<VTooltip activator="parent">
{{ propertyValue.note }}
<span>{{ propertyValue.note }}</span>
</VTooltip>
</VIcon>
</span>
</span>
</div>
</template>

</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,20 @@ if (globalAttribute) {
break
}
}
properties.push({ name: 'Filterable', value: new PropertyValue(props.schema.filterable as boolean) })
properties.push({
name: 'Filterable',
value: new PropertyValue(
(globalAttribute && (props.schema as GlobalAttributeSchema).globalUniquenessType != GlobalAttributeUniquenessType.NotUnique) ||
props.schema.uniquenessType != AttributeUniquenessType.NotUnique ||
props.schema.filterable,
(
(globalAttribute && (props.schema as GlobalAttributeSchema).globalUniquenessType != GlobalAttributeUniquenessType.NotUnique) ||
props.schema.uniquenessType != AttributeUniquenessType.NotUnique
)
? 'The attribute is automatically filterable because it is unique.'
: undefined
)
})
properties.push({ name: 'Sortable', value: new PropertyValue(props.schema.sortable as boolean) })
properties.push({ name: 'Localized', value: new PropertyValue(props.schema.localized as boolean) })
properties.push({ name: 'Nullable', value: new PropertyValue(props.schema.nullable as boolean) })
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default createVuetify({
'primary-dark': '#131323',
'primary-light': '#23355C',
'primary-lightest': '#21BFE3',
'gray-light' : '#A5ACBC'
'gray-light' : '#A5ACBC',
warning: '#f7a729'
},
}
}
Expand Down

0 comments on commit a76fb34

Please sign in to comment.