Skip to content
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c1ed185
inital commit for context center
Rohit0301 May 10, 2026
8801693
import fixes
Rohit0301 May 10, 2026
023fcdb
fixed UI issues
Rohit0301 May 11, 2026
58872ab
integrate upload api and fixed ui bugs
Rohit0301 May 11, 2026
49f1e40
fixed article sidebar refresh
Rohit0301 May 11, 2026
4696aff
fixed document listing
Rohit0301 May 11, 2026
907a52b
fixed title breadcrum in all the pages
Rohit0301 May 12, 2026
5def031
removed unused route
Rohit0301 May 12, 2026
5c2888b
minor UI fixes
Rohit0301 May 12, 2026
46a5be8
addresssed gitar comment
Rohit0301 May 12, 2026
ff43c34
fixed ui issues
Rohit0301 May 12, 2026
d5b0d4a
addressed gitar comment
Rohit0301 May 12, 2026
4eb65c8
added context center playwright test
Rohit0301 May 12, 2026
e81b7a5
fixed knowledge center playwright
Rohit0301 May 12, 2026
3ba2f65
fixed playwright tests
Rohit0301 May 13, 2026
f83e62e
lint fix
Rohit0301 May 13, 2026
71e420b
added permission for action button
Rohit0301 May 13, 2026
f1c7fab
fixed existing unit test
Rohit0301 May 13, 2026
e3132ba
showing remaining count for tags in artcile tag
Rohit0301 May 13, 2026
105e40b
added dowload icon in dashboard card
Rohit0301 May 13, 2026
7ac8108
translated keys
Rohit0301 May 13, 2026
3138ec0
added unit test and addressed gitar comment
Rohit0301 May 13, 2026
c84eb62
lint fix
Rohit0301 May 13, 2026
01aac5d
fixed translations
Rohit0301 May 13, 2026
03c96f2
fixed import issue
Rohit0301 May 13, 2026
bc42560
minor fixes
Rohit0301 May 14, 2026
993b684
fixed unit test
Rohit0301 May 14, 2026
c9f5004
code refactoring
Rohit0301 May 14, 2026
b9e8d43
minor fixes
Rohit0301 May 14, 2026
c49d81b
added context center class changes
Rohit0301 May 14, 2026
f594514
fixed context center spec
Rohit0301 May 14, 2026
55c2c9b
added unit test
Rohit0301 May 14, 2026
d9aebc1
addressed gitar comment
Rohit0301 May 14, 2026
9a46d00
removed svg
Rohit0301 May 14, 2026
cb18b7a
fixed import issue
Rohit0301 May 14, 2026
7ab1761
fixed the page navigation
Rohit0301 May 14, 2026
96d283d
fixed unit test
Rohit0301 May 14, 2026
f7dd850
addressed copilot comments
Rohit0301 May 14, 2026
cf63d6d
lint fix
Rohit0301 May 14, 2026
50ae5ed
revert yarn.lock changes
Rohit0301 May 14, 2026
766a643
revert yarn.lock
Rohit0301 May 14, 2026
5a88443
addressed gitar comment
Rohit0301 May 14, 2026
4161b96
lint fix
Rohit0301 May 14, 2026
c6f0c38
unit test fix
Rohit0301 May 14, 2026
0556d7a
addressed co-pilot comments
Rohit0301 May 14, 2026
e442605
minor UI fix
Rohit0301 May 14, 2026
5159908
fixed knowledge center playwright
Rohit0301 May 15, 2026
6b5773c
lint fix
Rohit0301 May 15, 2026
1e1745a
import fix
Rohit0301 May 15, 2026
acd24ed
addressed gitar comment
Rohit0301 May 15, 2026
9b89e04
fixed unit test
Rohit0301 May 15, 2026
14a1432
addressed PR comment
Rohit0301 May 15, 2026
c49d555
lint fix
Rohit0301 May 15, 2026
ff934cc
minor fix
Rohit0301 May 15, 2026
cc6a89b
added missing translation
Rohit0301 May 15, 2026
26e01dc
showing activity feed count
Rohit0301 May 16, 2026
7c9e661
addressed gitar comment
Rohit0301 May 16, 2026
fe4b2bf
minor fix
Rohit0301 May 16, 2026
6f6db96
addressed gitar comment
Rohit0301 May 16, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@
* Source: https://github.com/untitleduico/react/blob/main/components/application/file-upload/file-upload-base.tsx
*/

import { UploadCloud02 } from '@untitledui/icons';
import type { DragEvent, ChangeEvent } from 'react';
import { useId, useRef, useState } from 'react';
import { Button } from '@/components/base/buttons/button';
import { ButtonUtility } from '@/components/base/buttons/button-utility';
import { ProgressBar } from '@/components/base/progress-indicators/progress-indicators';
import { FeaturedIcon } from '@/components/foundations/featured-icon/featured-icon';
import { cx } from '@/utils/cx';
import {
CheckCircle,
Trash01,
UploadCloud02,
XCircle,
} from '@untitledui/icons';
import type { ChangeEvent, ComponentPropsWithRef, DragEvent } from 'react';
import { useId, useRef, useState } from 'react';

export const getReadableFileSize = (bytes: number): string => {
if (bytes === 0) {
Expand Down Expand Up @@ -240,3 +247,236 @@ export const FileUploadDropZone = ({
};

FileUploadDropZone.displayName = 'FileUploadDropZone';

export interface FileListItemProps {
name: string;
size: number;
progress: number;
failed?: boolean;
className?: string;
completeLabel?: string;
uploadingLabel?: string;
failedLabel?: string;
tryAgainLabel?: string;
deleteLabel?: string;
onDelete?: () => void;
onRetry?: () => void;
}

export const FileListItemProgressBar = ({
className,
completeLabel = 'Complete',
deleteLabel = 'Delete',
failed,
failedLabel = 'Failed',
name,
onDelete,
onRetry,
progress,
size,
tryAgainLabel = 'Try again',
uploadingLabel = 'Uploading...',
}: FileListItemProps) => {
const isComplete = progress === 100;

return (
<li
className={cx(
'tw:relative tw:flex tw:gap-3 tw:rounded-xl tw:bg-primary tw:p-4 tw:ring-1 tw:ring-secondary tw:transition-shadow tw:duration-100 tw:ease-linear tw:ring-inset',
failed && 'tw:ring-2 tw:ring-error',
className
)}>
<div className="tw:flex tw:size-10 tw:shrink-0 tw:items-center tw:justify-center tw:rounded-lg tw:bg-secondary">
<UploadCloud02
className="tw:size-5 tw:text-tertiary"
strokeWidth={1.5}
/>
</div>

<div className="tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:items-start">
<div className="tw:flex tw:w-full tw:min-w-0 tw:max-w-full tw:flex-1">
<div className="tw:min-w-0 tw:flex-1">
<p className="tw:truncate tw:text-sm tw:font-medium tw:text-secondary">
{name}
</p>
<div className="tw:mt-0.5 tw:flex tw:items-center tw:gap-2">
<p className="tw:truncate tw:whitespace-nowrap tw:text-sm tw:text-tertiary">
{getReadableFileSize(size)}
</p>
<hr className="tw:h-3 tw:w-px tw:rounded-full tw:border-none tw:bg-border-primary" />
<div className="tw:flex tw:items-center tw:gap-1">
{isComplete && !failed && (
<>
<CheckCircle className="tw:size-4 tw:stroke-[2.5px] tw:text-fg-success-primary" />
<p className="tw:text-sm tw:font-medium tw:text-success-primary">
{completeLabel}
</p>
</>
)}
{!isComplete && !failed && (
<>
<UploadCloud02 className="tw:size-4 tw:stroke-[2.5px] tw:text-fg-quaternary" />
<p className="tw:text-sm tw:font-medium tw:text-quaternary">
{uploadingLabel}
</p>
</>
)}
{failed && (
<>
Comment thread
gitar-bot[bot] marked this conversation as resolved.
<XCircle className="tw:size-4 tw:text-fg-error-primary" />
<p className="tw:text-sm tw:font-medium tw:text-error-primary">
{failedLabel}
</p>
</>
)}
</div>
</div>
</div>
<ButtonUtility
className="tw:-mr-2 tw:-mt-2 tw:self-start"
color="tertiary"
icon={Trash01}
size="xs"
tooltip={deleteLabel}
onClick={onDelete}
/>
</div>

{!failed && (
<div className="tw:mt-1 tw:w-full">
<ProgressBar
labelPosition="right"
max={100}
min={0}
value={progress}
/>
</div>
)}

{failed && (
<Button
className="tw:mt-1.5"
color="link-destructive"
size="sm"
onClick={onRetry}>
{tryAgainLabel}
</Button>
)}
</div>
</li>
);
};

export const FileListItemProgressFill = ({
className,
deleteLabel = 'Delete',
failed,
failedLabel = 'Upload failed, please try again',
name,
onDelete,
onRetry,
progress,
size,
tryAgainLabel = 'Try again',
}: FileListItemProps) => {
const isComplete = progress === 100;

return (
<li
className={cx(
'tw:relative tw:flex tw:gap-3 tw:overflow-hidden tw:rounded-xl tw:bg-primary tw:p-4',
className
)}>
<div
aria-valuemax={100}
aria-valuemin={0}
aria-valuenow={progress}
className={cx(
'tw:absolute tw:inset-0 tw:size-full tw:bg-secondary tw:transition tw:duration-75 tw:ease-linear',
isComplete && 'tw:opacity-0'
)}
role="progressbar"
style={{ transform: `translateX(-${100 - progress}%)` }}
/>
<div
className={cx(
'tw:absolute tw:inset-0 tw:size-full tw:rounded-[inherit] tw:ring-1 tw:ring-secondary tw:transition tw:duration-100 tw:ease-linear tw:ring-inset',
failed && 'tw:ring-2 tw:ring-error'
)}
/>
<div className="tw:relative tw:flex tw:size-10 tw:shrink-0 tw:items-center tw:justify-center tw:rounded-lg tw:bg-secondary">
<UploadCloud02
className="tw:size-5 tw:text-tertiary"
strokeWidth={1.5}
/>
</div>

<div className="tw:relative tw:flex tw:min-w-0 tw:flex-1">
<div className="tw:relative tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:items-start">
<div className="tw:w-full tw:min-w-0 tw:flex-1">
<p className="tw:truncate tw:text-sm tw:font-medium tw:text-secondary">
{name}
</p>
<div className="tw:mt-0.5 tw:flex tw:items-center tw:gap-2">
<p className="tw:text-sm tw:text-tertiary">
{failed ? failedLabel : getReadableFileSize(size)}
</p>
{!failed && (
<>
<hr className="tw:h-3 tw:w-px tw:rounded-full tw:border-none tw:bg-border-primary" />
<div className="tw:flex tw:items-center tw:gap-1">
{isComplete ? (
<CheckCircle className="tw:size-4 tw:stroke-[2.5px] tw:text-fg-success-primary" />
) : (
<UploadCloud02 className="tw:size-4 tw:stroke-[2.5px] tw:text-fg-quaternary" />
)}
<p className="tw:text-sm tw:text-tertiary">{progress}%</p>
</div>
</>
)}
</div>
</div>
{failed && (
<Button
className="tw:mt-1.5"
color="link-destructive"
size="sm"
onClick={onRetry}>
{tryAgainLabel}
</Button>
)}
</div>
<ButtonUtility
className="tw:-mr-2 tw:-mt-2 tw:self-start"
color="tertiary"
icon={Trash01}
size="xs"
tooltip={deleteLabel}
onClick={onDelete}
/>
</div>
</li>
);
};

const FileUploadRoot = (props: ComponentPropsWithRef<'div'>) => (
<div
{...props}
className={cx('tw:flex tw:flex-col tw:gap-4', props.className)}
/>
);

const FileUploadList = (props: ComponentPropsWithRef<'ul'>) => (
<ul
{...props}
className={cx('tw:flex tw:flex-col tw:gap-3', props.className)}
/>
);

export const FileUpload = {
DropZone: FileUploadDropZone,
List: FileUploadList,
ListItemProgressBar: FileListItemProgressBar,
ListItemProgressFill: FileListItemProgressFill,
Root: FileUploadRoot,
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { HTMLAttributes } from 'react';

const sizes = {
xs: {
wh: 6,
c: 3,
r: 2,
},
sm: {
wh: 8,
c: 4,
Expand All @@ -16,7 +21,7 @@ const sizes = {
export const Dot = ({
size = 'md',
...props
}: HTMLAttributes<HTMLOrSVGElement> & { size?: 'sm' | 'md' }) => {
}: HTMLAttributes<HTMLOrSVGElement> & { size?: 'sm' | 'md' | 'xs' }) => {
return (
<svg
fill="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export enum SidebarItem {
LINEAGE = 'lineage',
COLUMN_BULK_OPERATIONS = 'column-bulk-operations',
DATA_MARKETPLACE = 'data-marketplace',
KNOWLEDGE_CENTER = 'knowledge-center',
CONTEXT_CENTER = 'context-center',
ARTICLE = 'articles',
}

export const SIDEBAR_LIST_ITEMS = {
Expand Down Expand Up @@ -70,6 +71,7 @@ export const SIDEBAR_LIST_ITEMS = {
SidebarItem.GOVERNANCE,
SidebarItem.COLUMN_BULK_OPERATIONS,
],
[SidebarItem.ARTICLE]: [SidebarItem.CONTEXT_CENTER, SidebarItem.ARTICLE],

// Profile Dropdown
'user-name': ['dropdown-profile', 'user-name'],
Expand Down
Loading
Loading