Skip to content

Commit

Permalink
Links & Docs to BoK on VC creation (#7365)
Browse files Browse the repository at this point in the history
* VC documents and links BoK - refactor the AddContent

* VC documents and links implementation without validation;

* resolve rabbit comments

---------

Co-authored-by: Petar Kolev <[email protected]>
Co-authored-by: reactoholic <[email protected]>
  • Loading branch information
3 people authored Dec 30, 2024
1 parent 60ab013 commit e3c092f
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 211 deletions.
9 changes: 9 additions & 0 deletions src/core/i18n/en/translation.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3168,6 +3168,15 @@
"initialPosts": "Initial Posts",
"delete": "Delete post"
},
"documents": {
"title": "Or add documents <tooltip><icon /></tooltip> to your Knowledge Subspace.",
"tooltip": "Supported file formats: Text on websites, .pdf, .doc(x), .xls(x). Maximum file size: 20mb",
"referenceTitle": "Reference Title",
"referenceUrl": "Url",
"addAnother": "Add another document",
"remove": "Remove document",
"initialDocuments": "Initial Links and Documents"
},
"submitDisabled": "Add at least one Post to continue"
},
"externalAI": {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { DialogContent } from '@mui/material';
import DialogHeader from '@/core/ui/dialog/DialogHeader';
import Gutters from '@/core/ui/grid/Gutters';
import { Caption } from '@/core/ui/typography';
import { gutters } from '@/core/ui/grid/utils';
import { AddContentForm } from './AddContentForm';
import { AddContentProps } from './AddContentProps';
import CancelDialog from '../CancelDialog';
import { StorageConfigContextProvider } from '@/domain/storage/StorageBucket/StorageConfigContext';

const AddContent = ({ onClose, onCreateVC, spaceId }: AddContentProps) => {
const { t } = useTranslation();
const [dialogOpen, setDialogOpen] = useState(false);

const onCancel = () => {
setDialogOpen(true);
};

return (
<StorageConfigContextProvider locationType="journey" spaceId={spaceId}>
<DialogHeader onClose={onCancel}>{t('createVirtualContributorWizard.addContent.title')}</DialogHeader>
<DialogContent>
<Gutters disablePadding paddingBottom={gutters(2)}>
<Caption>{t('createVirtualContributorWizard.addContent.description')}</Caption>
<Caption fontWeight="bold">{t('createVirtualContributorWizard.addContent.descriptionBold')}</Caption>
<AddContentForm onSubmit={onCreateVC} onCancel={onCancel} />
</Gutters>
</DialogContent>
<CancelDialog open={dialogOpen} onClose={() => setDialogOpen(false)} onConfirm={onClose} />
</StorageConfigContextProvider>
);
};

export default AddContent;
Loading

0 comments on commit e3c092f

Please sign in to comment.