Skip to content

connection not there message for data resources #1131

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

Merged
merged 2 commits into from
Feb 26, 2025
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
9 changes: 7 additions & 2 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
border: 1px solid #d1d5db;
width: 95% !important;
}

.s3Container {
display: flex;
align-items: center;
Expand Down Expand Up @@ -335,7 +336,7 @@
.layout-wrapper{
display: grid;
grid-template-rows: auto;
grid-template-columns: 64px 1fr minmax(min-content,4fr) 1.1fr 64px;
grid-template-columns: 64px 1fr minmax(min-content, 4fr) 1.1fr 64px;
max-height: calc(100vh - 58px);
max-width: 100%;
}
Expand All @@ -361,6 +362,9 @@
min-height: 200px;
display: flex
}
.resource-sections.blur-sm {
filter: blur(2px);
}
.profile-container{
display:flex;
gap:4px;
Expand All @@ -371,4 +375,5 @@
.websource-btn-container{
display: flex;
gap: 10px;
}
}

94 changes: 50 additions & 44 deletions frontend/src/components/Layout/DrawerDropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const DrawerDropzone: React.FC<DrawerProps> = ({
isCloseable={false}
htmlAttributes={{ style: { height: 'initial' } }}
>
{connectionStatus ? (
{
!isReadOnlyUser ? (
<Drawer.Body className='overflow-hidden! w-[294px]!'>
{alertState.showAlert && (
Expand All @@ -70,41 +70,54 @@ const DrawerDropzone: React.FC<DrawerProps> = ({
</Typography>
</div>
)}
<Flex gap='6' className='h-full source-container'>
{APP_SOURCES.includes('local') && (
<div className='px-6 outline-dashed outline-2 outline-offset-2 outline-gray-100 mt-3 imageBg'>
<DropZone />
</div>
)}
{APP_SOURCES.some((source) => ['youtube', 'wiki', 'web'].includes(source)) && (
<div className='outline-dashed imageBg w-[245px]'>
<GenericButton openModal={toggleGenericModal} />
<GenericModal
isOnlyYoutube={isYoutubeOnly}
isOnlyWikipedia={isWikipediaOnly}
isOnlyWeb={isWebOnly}
open={showGenericModal}
closeHandler={toggleGenericModal}
/>
</div>
)}
{APP_SOURCES.includes('s3') && (
<div className='outline-dashed imageBg w-[245px]'>
<S3Component openModal={toggleS3Modal} />
<Suspense fallback={<FallBackDialog />}>
<S3Modal hideModal={toggleS3Modal} open={shows3Modal} />
</Suspense>
</div>
)}
{APP_SOURCES.includes('gcs') && (
<div className='outline-dashed imageBg w-[245px]'>
<GCSButton openModal={toggleGCSModal} />
<Suspense fallback={<FallBackDialog />}>
<GCSModal openGCSModal={toggleGCSModal} open={showGCSModal} hideModal={toggleGCSModal} />
</Suspense>
</div>
)}
</Flex>
{!connectionStatus && (
<div className='mx-6 flex items-center justify-between pb-6'>
<Typography variant='body-medium' className='flex items-center gap-1'>
<StatusIndicator type={connectionStatus ? 'success' : 'danger'} />
<span>Connect to Neo4j to upload documents</span>
</Typography>
</div>
)}
<div className={`${!connectionStatus ? 'cursor-not-allowed' : ''} h-full`}>
<div className={`resource-sections ${!connectionStatus ? 'blur-sm pointer-events-none' : ''}`}>
<Flex gap='6' className='h-full source-container'>
{APP_SOURCES.includes('local') && (
<div className='px-6 outline-dashed outline-2 outline-offset-2 outline-gray-100 mt-3 imageBg'>
<DropZone />
</div>
)}
{APP_SOURCES.some((source) => ['youtube', 'wiki', 'web'].includes(source)) && (
<div className='outline-dashed imageBg w-[245px]'>
<GenericButton openModal={toggleGenericModal} />
<GenericModal
isOnlyYoutube={isYoutubeOnly}
isOnlyWikipedia={isWikipediaOnly}
isOnlyWeb={isWebOnly}
open={showGenericModal}
closeHandler={toggleGenericModal}
/>
</div>
)}
{APP_SOURCES.includes('s3') && (
<div className='outline-dashed imageBg w-[245px]'>
<S3Component openModal={toggleS3Modal} />
<Suspense fallback={<FallBackDialog />}>
<S3Modal hideModal={toggleS3Modal} open={shows3Modal} />
</Suspense>
</div>
)}
{APP_SOURCES.includes('gcs') && (
<div className='outline-dashed imageBg w-[245px]'>
<GCSButton openModal={toggleGCSModal} />
<Suspense fallback={<FallBackDialog />}>
<GCSModal openGCSModal={toggleGCSModal} open={showGCSModal} hideModal={toggleGCSModal} />
</Suspense>
</div>
)}
</Flex>
</div>
</div>

</div>
</div>
</Drawer.Body>
Expand All @@ -114,14 +127,7 @@ const DrawerDropzone: React.FC<DrawerProps> = ({
This user account does not have permission to access or manage data sources.
</Typography>
</Drawer.Body>
)
) : (
<Drawer.Body className='overflow-hidden! w-[294px]!'>
<Typography variant='subheading-medium'>
You are not logged in. Please Connect to a database to access the content.
</Typography>
</Drawer.Body>
)}
)}
</Drawer>
</div>
);
Expand Down