Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper fix of model and function card truncation #2293

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/frontend-2/components/automate/function/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const { html: plaintextDescription } = useMarkdown(
)

const classes = computed(() => {
const classParts = ['rounded-lg truncate']
const classParts = ['rounded-lg']

if (props.selected) {
classParts.push('ring-2 ring-primary')
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend-2/components/automate/function/CardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const props = defineProps<{
const classes = computed(() => {
const classParts = ['grid gap-4 lg:gap-6']

if (!props.vertical) {
classParts.push('sm:grid-cols-2')

if (!props.smallView) {
classParts.push('lg:grid-cols-3')
}
if (props.vertical) {
classParts.push('grid-cols-1')
} else if (props.smallView) {
classParts.push('grid-cols-1 sm:grid-cols-2')
} else {
classParts.push('grid-cols-1 sm:grid-cols-2 lg:grid-cols-3')
}

return classParts.join(' ')
Expand Down
24 changes: 16 additions & 8 deletions packages/frontend-2/components/project/models/BasicCardView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<template>
<div
class="relative z-10 grid gap-3"
:class="[
smallView ? 'grid-cols-2 sm:grid-cols-3 md:grid-cols-4' : '',
!vertical ? 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4' : ''
]"
>
<div :class="classes">
<!-- Decrementing z-index necessary for the actions menu to render correctly. Each card has its own stacking context because of the scale property -->
<ProjectPageModelsCard
v-for="(item, i) in items"
Expand Down Expand Up @@ -34,7 +28,7 @@ defineEmits<{
(e: 'model-clicked', v: { id: string; e: MouseEvent | KeyboardEvent }): void
}>()

withDefaults(
const props = withDefaults(
defineProps<{
project: Optional<ProjectPageModelsCardProjectFragment>
items: Array<ProjectPageLatestItemsModelItemFragment | PendingFileUploadFragment>
Expand All @@ -50,4 +44,18 @@ withDefaults(
showVersions: true
}
)

const classes = computed(() => {
const classParts = ['relative z-10 grid gap-3']

if (props.vertical) {
classParts.push('grid-cols-1')
} else if (props.smallView) {
classParts.push('grid-cols-1 sm:grid-cols-2 lg:grid-cols-3')
} else {
classParts.push('grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4')
}

return classParts.join(' ')
})
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const hovered = ref(false)

const containerClasses = computed(() => {
const classParts = [
'group rounded-md bg-foundation shadow transition border-2 border-transparent truncate'
'group rounded-md bg-foundation shadow transition border-2 border-transparent'
]

if (!isPendingModelFragment(props.model)) {
Expand Down