Skip to content

Commit

Permalink
add initial placeholder on vc bok dialog (#7649)
Browse files Browse the repository at this point in the history
  • Loading branch information
reactoholic authored Feb 11, 2025
1 parent a49188d commit 372a44d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core/i18n/en/translation.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3064,6 +3064,7 @@
},
"name": "Name",
"bodyOfKnowledge": "Body Of Knowledge",
"placeholder": "Here you'll find a collection of documents and texts that are ingested to give this VC its insights and functionality.",
"infoTextBoK": "Select the Subspace you want as a body of knowledge for this Virtual Contributor",
"noSubspacesInfo": "Create a Subspace first, and populate it with the relevant information for your Virtual Contributor.",
"confirmDeletion": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ type KnowledgeBaseDialogProps = {
onClose: () => void;
title: string;
id: string;
placeholder: string;
};

const AVAILABLE_CALLOUT_TYPES = [CalloutType.Post, CalloutType.LinkCollection, CalloutType.PostCollection];

const KnowledgeBaseDialog = ({ onClose, title, id }: KnowledgeBaseDialogProps) => {
const KnowledgeBaseDialog = ({ onClose, title, id, placeholder }: KnowledgeBaseDialogProps) => {
const { t } = useTranslation();
const {
calloutsSetId,
Expand All @@ -37,6 +38,7 @@ const KnowledgeBaseDialog = ({ onClose, title, id }: KnowledgeBaseDialogProps) =
ingestKnowledge,
ingestLoading,
hasReadAccess,

loadingPrivileges,
} = useKnowledgeBase({ id });

Expand All @@ -60,9 +62,9 @@ const KnowledgeBaseDialog = ({ onClose, title, id }: KnowledgeBaseDialogProps) =
) : (
<StorageConfigContextProvider locationType="virtualContributor" virtualContributorId={id}>
<Gutters disablePadding>
{(knowledgeBaseDescription || canCreateCallout) && (
{(placeholder || knowledgeBaseDescription || canCreateCallout) && (
<DescriptionComponent
description={knowledgeBaseDescription}
description={knowledgeBaseDescription || placeholder}
canEdit={canCreateCallout}
onUpdate={updateDescription}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const VCProfileContentView = ({
<KnowledgeBaseDialog
id={virtualContributor?.id ?? ''}
title={`${name}: ${t('virtualContributorSpaceSettings.bodyOfKnowledge')}`}
placeholder={t('virtualContributorSpaceSettings.placeholder')}
onClose={onCloseKnowledgeBase}
/>
)}
Expand Down

0 comments on commit 372a44d

Please sign in to comment.