Skip to content

Commit 728d1ef

Browse files
Merge branch 'apache:master' into ATLAS-5149
2 parents eb6abc8 + 364f332 commit 728d1ef

File tree

78 files changed

+3010
-5001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3010
-5001
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"patches": [
3+
{
4+
"id": "TYPEDEF_PATCH_0007_001",
5+
"description": "Add additional operations in Atlas",
6+
"action": "UPDATE_ENUMDEF",
7+
"typeName": "atlas_operation",
8+
"applyToVersion": "1.1",
9+
"updateToVersion": "1.2",
10+
"params": null,
11+
"elementDefs": [
12+
{
13+
"ordinal": 10,
14+
"value": "AUTO_PURGE"
15+
}
16+
]
17+
}
18+
]
19+
}

dashboard/package-lock.json

Lines changed: 686 additions & 1081 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dashboard/package.json

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,62 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@dnd-kit/core": "^6.1.0",
14-
"@dnd-kit/modifiers": "^7.0.0",
15-
"@dnd-kit/sortable": "^8.0.0",
16-
"@emotion/react": "^11.11.4",
17-
"@emotion/styled": "^11.11.0",
18-
"@mui/icons-material": "^5.15.13",
19-
"@mui/material": "^5.15.13",
20-
"@mui/x-tree-view": "^7.0.0",
21-
"@react-querybuilder/material": "^8.0.0",
22-
"@reduxjs/toolkit": "^2.2.6",
23-
"@tanstack/react-table": "^8.15.3",
24-
"@types/react-redux": "^7.1.33",
25-
"@types/sanitize-html": "^2.13.0",
26-
"autosuggest-highlight": "^3.3.4",
27-
"axios": "^1.8.4",
28-
"d3": "^5.14.2",
29-
"d3-tip": "^0.7.1",
30-
"dagre-d3": "^0.6.4",
31-
"dayjs": "^1.11.13",
32-
"isomorphic-dompurify": "^2.14.0",
33-
"lodash": "^4.17.21",
34-
"moment-timezone": "^0.5.45",
35-
"platform": "^1.3.4",
36-
"react": "^18.3.1",
37-
"react-datepicker": "^8.4.0",
38-
"react-dom": "^18.2.0",
39-
"react-dropzone": "^14.2.3",
40-
"react-hook-form": "^7.53.0",
41-
"react-idle-timer": "^5.7.2",
42-
"react-querybuilder": "^8.0.0",
43-
"react-quill-new": "^3.4.1",
44-
"react-redux": "^9.1.0",
45-
"react-router-dom": "^6.22.3",
46-
"react-toastify": "^10.0.5",
47-
"redux": "^5.0.1",
48-
"sanitize-html": "^2.13.0",
49-
"underscore": "^1.13.1",
50-
"xlsx": "^0.18.5"
13+
"@dnd-kit/core": "6.1.0",
14+
"@dnd-kit/modifiers": "7.0.0",
15+
"@dnd-kit/sortable": "8.0.0",
16+
"@emotion/react": "11.11.4",
17+
"@emotion/styled": "11.11.0",
18+
"@mui/icons-material": "5.15.15",
19+
"@mui/material": "5.15.15",
20+
"@mui/x-tree-view": "7.0.0",
21+
"@react-querybuilder/material": "8.0.0",
22+
"@reduxjs/toolkit": "2.2.6",
23+
"@tanstack/react-table": "8.15.3",
24+
"@types/react-redux": "7.1.33",
25+
"@types/sanitize-html": "2.13.0",
26+
"autosuggest-highlight": "3.3.4",
27+
"axios": "1.8.4",
28+
"d3": "5.14.2",
29+
"d3-tip": "0.7.1",
30+
"dagre-d3": "0.6.4",
31+
"dayjs": "1.11.13",
32+
"isomorphic-dompurify": "2.14.0",
33+
"lodash": "4.17.21",
34+
"moment-timezone": "0.5.45",
35+
"platform": "1.3.4",
36+
"react": "18.3.1",
37+
"react-datepicker": "8.4.0",
38+
"react-dom": "18.2.0",
39+
"react-dropzone": "14.2.3",
40+
"react-hook-form": "7.53.0",
41+
"react-idle-timer": "5.7.2",
42+
"react-querybuilder": "8.0.0",
43+
"react-quill-new": "3.4.1",
44+
"react-redux": "9.1.0",
45+
"react-router-dom": "6.22.3",
46+
"react-toastify": "10.0.5",
47+
"redux": "5.0.1",
48+
"sanitize-html": "2.13.0",
49+
"underscore": "1.13.1",
50+
"xlsx": "0.18.5"
5151
},
5252
"devDependencies": {
53-
"@types/autosuggest-highlight": "^3.2.3",
54-
"@types/d3": "^7.4.3",
55-
"@types/node": "^20.11.25",
56-
"@types/react": "^18.2.56",
57-
"@types/react-dom": "^18.2.19",
58-
"@types/react-router-dom": "^5.3.3",
59-
"@typescript-eslint/eslint-plugin": "^7.0.2",
60-
"@typescript-eslint/parser": "^7.0.2",
61-
"@vitejs/plugin-react-swc": "^3.9.0",
62-
"eslint": "^8.56.0",
63-
"eslint-plugin-react-hooks": "^4.6.0",
64-
"eslint-plugin-react-refresh": "^0.4.5",
65-
"npm-check-updates": "^16.14.17",
66-
"recharts": "^2.15.1",
67-
"sass": "^1.74.1",
68-
"typescript": "^5.2.2",
69-
"vite": "^6.2.4"
53+
"@types/autosuggest-highlight": "3.2.3",
54+
"@types/d3": "7.4.3",
55+
"@types/node": "20.11.25",
56+
"@types/react": "18.2.56",
57+
"@types/react-dom": "18.2.19",
58+
"@types/react-router-dom": "5.3.3",
59+
"@typescript-eslint/eslint-plugin": "7.0.2",
60+
"@typescript-eslint/parser": "7.0.2",
61+
"@vitejs/plugin-react-swc": "3.9.0",
62+
"eslint": "8.56.0",
63+
"eslint-plugin-react-hooks": "4.6.0",
64+
"eslint-plugin-react-refresh": "0.4.5",
65+
"npm-check-updates": "16.14.17",
66+
"recharts": "2.15.1",
67+
"sass": "1.74.1",
68+
"typescript": "5.2.2",
69+
"vite": "6.2.4"
7070
}
7171
}

dashboard/src/components/DialogShowMoreLess.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ const DialogShowMoreLess = ({
540540
button2Label="Remove"
541541
button2Handler={handleRemove}
542542
disableButton2={removeLoader}
543+
isDirty={true}
543544
>
544545
{relatedTerm ? (
545546
<Typography fontSize={15}>

dashboard/src/components/Forms/FormTreeView.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,21 @@ const FormTreeView: React.FC<{
222222
node?.id && (
223223
<CustomTreeItem
224224
key={node.id}
225-
itemId={node.types != "parent" ? `${node.id}@${node?.parent}` : node.id}
225+
itemId={
226+
node.types != "parent"
227+
? node.id === "No Records Found"
228+
? node.id
229+
: `${node.id}@${node?.parent}`
230+
: node.id
231+
}
226232
label={
227233
<div
228234
onClick={(_event: React.MouseEvent<HTMLElement>) => {
235+
if (node.id === "No Records Found") {
236+
toast.dismiss(toastId.current);
237+
toastId.current = toast.info("No terms present");
238+
return;
239+
}
229240
if (node.types == "parent" && isEmpty(node.children)) {
230241
toast.dismiss(toastId.current);
231242
toastId.current = toast.warning(`No ${treeName}`);

dashboard/src/components/ImportDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const ImportDialog: React.FC<CustomModalProps> = ({
7878
if (fileData) {
7979
try {
8080
let apiMethod =
81-
title == "Import Business Template"
81+
title == "Import Business Metadata"
8282
? getBusinessMetadataImport
8383
: getGlossaryImport;
8484
let formData = new FormData();

dashboard/src/components/Modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ export const CustomModal: React.FC<CustomModalProps> = ({
171171
})
172172
}}
173173
startIcon={
174-
disableButton2 && (
174+
disableButton2 && isDirty ? (
175175
<CircularProgress
176176
sx={{ color: "white", fontWeight: "600" }}
177177
size="14px"
178178
/>
179-
)
179+
) : undefined
180180
}
181181
onClick={(e: Event) => {
182182
e.stopPropagation();

dashboard/src/components/Table/TableLayout.tsx

Lines changed: 68 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const Row = ({
192192
);
193193
};
194194

195-
const DraggableTableHeader = ({ header }: { header: any }) => {
195+
const DraggableTableHeader = ({ header, isEmptyRows }: { header: any; isEmptyRows?: boolean }) => {
196196
const { attributes, isDragging, listeners, setNodeRef, transform } =
197197
useSortable({
198198
id: header.column.id
@@ -204,10 +204,11 @@ const DraggableTableHeader = ({ header }: { header: any }) => {
204204
transform: CSS.Translate.toString(transform),
205205
transition: "width transform 0.2s ease-in-out",
206206
whiteSpace: "nowrap",
207-
width:
208-
header.column.columnDef?.width != undefined
209-
? header.column.columnDef?.width
210-
: header.column.getSize(),
207+
width: isEmptyRows
208+
? undefined
209+
: header.column.columnDef?.width != undefined
210+
? header.column.columnDef?.width
211+
: header.column.getSize(),
211212
zIndex: isDragging ? 1 : 0
212213
};
213214

@@ -221,14 +222,9 @@ const DraggableTableHeader = ({ header }: { header: any }) => {
221222
>
222223
{header.isPlaceholder ? null : (
223224
<div
224-
className={
225+
className={`${
225226
header.column.getCanSort() ? "cursor-pointer select-none" : ""
226-
}
227-
style={{
228-
display: "flex",
229-
alignItems: "center",
230-
gap: "0.125rem"
231-
}}
227+
} table-header-wrap`}
232228
onClick={header.column.getToggleSortingHandler()}
233229
title={
234230
header.column.getCanSort()
@@ -241,10 +237,7 @@ const DraggableTableHeader = ({ header }: { header: any }) => {
241237
}
242238
>
243239
<span
244-
style={{
245-
display: "inline-block",
246-
lineHeight: "20px"
247-
}}
240+
className="table-header-text"
248241
{...attributes}
249242
{...listeners}
250243
>
@@ -374,14 +367,40 @@ const TableLayout: FC<TableProps> = ({
374367
const [goToPageVal, setGoToPageVal] = useState<any>("");
375368

376369
const [rowSelection, setRowSelection] = useState({});
377-
const [sorting, setSorting] = useState<SortingState>(
378-
!isEmpty(defaultSortCol) ? defaultSortCol : []
370+
const existingColumnIds = useMemo(
371+
() =>
372+
(!isEmpty(memoizedColumns)
373+
? memoizedColumns.map((c: any) => c.id || c.accessorKey)
374+
: []) as string[],
375+
[memoizedColumns]
379376
);
377+
378+
const sanitizeSorting = (sortingState: SortingState) => {
379+
if (isEmpty(sortingState)) return [] as SortingState;
380+
return sortingState.filter(
381+
(s: any) => s && existingColumnIds.includes(s.id)
382+
);
383+
};
384+
385+
const [sorting, setSorting] = useState<SortingState>(() => []);
386+
380387
const [columnOrder, setColumnOrder] = useState<any>(() =>
381388
!isEmpty(memoizedColumns)
382-
? memoizedColumns.map((c: any) => c.accessorKey)
389+
? memoizedColumns
390+
.map((c: any) => c.id || c.accessorKey)
391+
.filter(Boolean)
383392
: []
384393
);
394+
395+
useEffect(() => {
396+
setColumnOrder(
397+
!isEmpty(memoizedColumns)
398+
? memoizedColumns
399+
.map((c: any) => c.id || c.accessorKey)
400+
.filter(Boolean)
401+
: []
402+
)
403+
}, [memoizedColumns])
385404
const [columnVisibility, setColumnVisibility] = useState(defaultHideColumns);
386405
const [tagModal, setTagModal] = useState<boolean>(false);
387406
let currentParams = searchParams;
@@ -390,6 +409,9 @@ const TableLayout: FC<TableProps> = ({
390409
currentParams.forEach((value, key) => {
391410
params[key] = value;
392411
});
412+
// Total number of visible table columns including selection/expand controls
413+
const totalVisibleColumns =
414+
(showRowSelection ? 1 : 0) + (expandRow ? 1 : 0) + columnOrder.length;
393415
const {
394416
getHeaderGroups,
395417
getRowModel,
@@ -426,7 +448,7 @@ const TableLayout: FC<TableProps> = ({
426448
columnVisibility: columnVisibilityParams
427449
? defaultHideColumns
428450
: columnVisibility,
429-
sorting,
451+
sorting: sanitizeSorting(sorting),
430452
pagination,
431453
rowSelection,
432454
columnOrder
@@ -437,6 +459,17 @@ const TableLayout: FC<TableProps> = ({
437459
autoResetPageIndex: false
438460
});
439461

462+
useEffect(() => {
463+
setSorting((prev) => sanitizeSorting(prev));
464+
setColumnOrder(
465+
!isEmpty(memoizedColumns)
466+
? memoizedColumns
467+
.map((c: any) => c.id || c.accessorKey)
468+
.filter(Boolean)
469+
: []
470+
);
471+
}, [existingColumnIds]);
472+
440473
useEffect(() => {
441474
if (typeof fetchData === "function") {
442475
fetchData({
@@ -474,7 +507,8 @@ const TableLayout: FC<TableProps> = ({
474507
resetSorting(true);
475508
resetRowSelection(true);
476509
setRowSelection({});
477-
setSorting(!isEmpty(defaultSortCol) ? defaultSortCol : []);
510+
const candidate = !isEmpty(defaultSortCol) ? defaultSortCol : []
511+
setSorting(sanitizeSorting(candidate));
478512
}, [typeParam, defaultSortCol, setSearchParams]);
479513

480514
const handleCloseTagModal = () => {
@@ -592,9 +626,17 @@ const TableLayout: FC<TableProps> = ({
592626
>
593627
<MuiTable
594628
size="small"
595-
className="table expand-row-table"
596-
sx={{ tableLayout: "fixed", width: "100%" }}
629+
className={`table ${expandRow ? "expand-row-table" : ""} ${
630+
memoizedData && memoizedData.length > 0 && expandRow
631+
? "has-expanded-rows"
632+
: ""
633+
}`}
634+
sx={{
635+
tableLayout: memoizedData.length > 0 ? "fixed" : "auto",
636+
width: "100%"
637+
}}
597638
>
639+
{/* remove dynamic colgroup for empty state */}
598640
{!isFetching && (
599641
<TableHead>
600642
{getHeaderGroups().map((headerGroup) => (
@@ -619,12 +661,13 @@ const TableLayout: FC<TableProps> = ({
619661
items={columnOrder}
620662
strategy={horizontalListSortingStrategy}
621663
>
622-
{" "}
664+
623665
{headerGroup.headers.map((header) =>
624666
header.isPlaceholder ? null : (
625667
<DraggableTableHeader
626668
key={header.id}
627669
header={header}
670+
isEmptyRows={!isFetching && memoizedData.length === 0}
628671
/>
629672
)
630673
)}
@@ -638,7 +681,7 @@ const TableLayout: FC<TableProps> = ({
638681
<TableRowsLoader rowsNum={10} />
639682
) : memoizedData.length === 0 && isFetching == false ? (
640683
<TableRow>
641-
<TableCell colSpan={columns.length + 1}>
684+
<TableCell colSpan={Math.max(1, totalVisibleColumns)}>
642685
<Stack textAlign="center">
643686
<Typography fontWeight="600" color="text.secondary">
644687
{emptyText}

0 commit comments

Comments
 (0)