π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): show deleted field properly in ai prompt input
Ramesh Manebcf2b6ada679
diff --git a/packages/nc-gui/components/ai/PromptWithFields.vue b/packages/nc-gui/components/ai/PromptWithFields.vueindex 7b8ec72a12..38a6ab9014 100644--- a/packages/nc-gui/components/ai/PromptWithFields.vue+++ b/packages/nc-gui/components/ai/PromptWithFields.vue@@ -80,12 +80,16 @@ const editor = useEditor({renderHTML: ({ node }) => {const matchedOption = props.options?.find((option) => option.title === node.attrs.id)const isAttachment = matchedOption?.uidt === UITypes.Attachment+return ['span',{- 'class': `prompt-field-tag ${isAttachment ? '!bg-green-200' : ''} ${props.promptFieldTagClassName}`,+ 'class': `prompt-field-tag ${isAttachment ? '!bg-green-200' : ''} ${!matchedOption ? 'line-through' : ''} ${+ props.promptFieldTagClassName+ }`,'style': 'max-width: 200px; white-space: nowrap; overflow: hidden; display: inline-block; text-overflow: ellipsis;', // Enforces truncation'data-tooltip': node.attrs.id, // Tooltip content+ 'data-deleted-tooltip': !matchedOption ? 'This field has been deleted' : '',},`${node.attrs.id}`,]@@ -168,10 +172,14 @@ const tooltipInstances: any[] = []function loadMentionFieldTagTooltip() {document.querySelectorAll('.nc-ai-prompt-with-fields .prompt-field-tag').forEach((el) => {const tooltip = Object.values(el.attributes).find((attr) => attr.name === 'data-tooltip')- if (!tooltip || el.scrollWidth <= el.clientWidth) return+ const deletedTooltip = Object.values(el.attributes).find((attr) => attr.name === 'data-deleted-tooltip')++ if (!tooltip || (el.scrollWidth <= el.clientWidth && !deletedTooltip?.value)) return// Show tooltip only on truncateconst instance = tippy(el, {- content: `<div class="tooltip nc-ai-prompt-with-fields-tooltip">${tooltip.value}</div>`,+ content: `<div class="tooltip nc-ai-prompt-with-fields-tooltip">${+ deletedTooltip?.value ? deletedTooltip.value : tooltip.value+ }</div>`,placement: 'top',allowHTML: true,arrow: true,diff --git a/packages/nc-gui/components/smartsheet/column/AiButtonOptions.vue b/packages/nc-gui/components/smartsheet/column/AiButtonOptions.vueindex 79b79a9b7d..6926e037e3 100644--- a/packages/nc-gui/components/smartsheet/column/AiButtonOptions.vue+++ b/packages/nc-gui/components/smartsheet/column/AiButtonOptions.vue@@ -138,7 +138,7 @@ const outputFieldOptions = computed(() => {!c.system &&!c.pk &&c.id !== column.value?.id &&- ![UITypes.Attachment, UITypes.Button, UITypes.Links].includes(c.uidt) &&+ ![UITypes.Attachment, UITypes.Button, UITypes.Links, UITypes.LinkToAnotherRecord].includes(c.uidt) &&!isReadOnlyVirtualCell(c),)})