Skip to content

Commit 8891a0f

Browse files
authored
Merge branch 'apache:master' into ATLAS-5049
2 parents 0d5f21a + 25e35e6 commit 8891a0f

File tree

19 files changed

+405
-195
lines changed

19 files changed

+405
-195
lines changed

addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@ private AtlasEntityWithExtInfo toTableEntity(AtlasEntity database, Table hiveTab
711711
private AtlasEntityWithExtInfo toTableEntity(AtlasEntity database, final Table hiveTable, AtlasEntityWithExtInfo table) throws AtlasHookException {
712712
if (table == null) {
713713
table = new AtlasEntityWithExtInfo(new AtlasEntity(HiveDataTypes.HIVE_TABLE.getName()));
714+
} else if (table.getEntity().getAttribute(ATTRIBUTE_NAME) == null) {
715+
table.getEntity().setAttribute(ATTRIBUTE_NAME, hiveTable.getTableName().toLowerCase());
714716
}
717+
table.getEntity().setIsIncomplete(false);
715718

716719
AtlasEntity tableEntity = table.getEntity();
717720
String tableQualifiedName = getTableQualifiedName(metadataNamespace, hiveTable);

dashboard/package-lock.json

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

dashboard/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"@emotion/styled": "^11.11.0",
1818
"@mui/icons-material": "^5.15.13",
1919
"@mui/material": "^5.15.13",
20-
"@mui/x-date-pickers": "^7.16.0",
2120
"@mui/x-tree-view": "^7.0.0",
2221
"@react-querybuilder/material": "^8.0.0",
2322
"@reduxjs/toolkit": "^2.2.6",
@@ -35,7 +34,7 @@
3534
"moment-timezone": "^0.5.45",
3635
"platform": "^1.3.4",
3736
"react": "^18.3.1",
38-
"react-datepicker": "^7.5.0",
37+
"react-datepicker": "^8.4.0",
3938
"react-dom": "^18.2.0",
4039
"react-dropzone": "^14.2.3",
4140
"react-hook-form": "^7.53.0",
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import DatePicker from "react-datepicker";
19+
import "react-datepicker/dist/react-datepicker.css";
20+
import CustomHeader from "./CustomHeader";
21+
22+
const CustomDatepicker = (props: {
23+
[x: string]: any;
24+
selected?: any;
25+
onChange?: any;
26+
}) => {
27+
const { selected, onChange, ...rest } = props;
28+
29+
return (
30+
<DatePicker
31+
selected={selected}
32+
onChange={onChange}
33+
timeInputLabel=""
34+
renderCustomHeader={(headerProps) => <CustomHeader {...headerProps} />}
35+
dateFormat="MM/dd/yyyy h:mm:ss aa"
36+
{...rest}
37+
/>
38+
);
39+
};
40+
41+
export default CustomDatepicker;
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import { FormControl, IconButton, NativeSelect, Stack } from "@mui/material";
19+
import { getYear, getMonth } from "date-fns";
20+
import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
21+
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
22+
23+
const years = Array.from(
24+
{ length: 100 },
25+
(_, i) => new Date().getFullYear() - 50 + i
26+
);
27+
const months = [
28+
"January",
29+
"February",
30+
"March",
31+
"April",
32+
"May",
33+
"June",
34+
"July",
35+
"August",
36+
"September",
37+
"October",
38+
"November",
39+
"December"
40+
];
41+
42+
type CustomHeaderProps = {
43+
date: Date;
44+
changeYear: (year: number) => void;
45+
changeMonth: (month: number) => void;
46+
decreaseMonth: () => void;
47+
increaseMonth: () => void;
48+
prevMonthButtonDisabled: boolean;
49+
nextMonthButtonDisabled: boolean;
50+
};
51+
52+
const CustomHeader = ({
53+
date,
54+
changeYear,
55+
changeMonth,
56+
decreaseMonth,
57+
increaseMonth,
58+
prevMonthButtonDisabled,
59+
nextMonthButtonDisabled
60+
}: CustomHeaderProps) => {
61+
return (
62+
<Stack
63+
direction="row"
64+
spacing={1}
65+
alignItems="center"
66+
justifyContent="center"
67+
sx={{ margin: 1 }}
68+
>
69+
<IconButton
70+
size="small"
71+
onClick={decreaseMonth}
72+
disabled={prevMonthButtonDisabled}
73+
>
74+
<ArrowBackIosIcon fontSize="inherit" />
75+
</IconButton>
76+
<Stack minWidth={"60px"}>
77+
<FormControl fullWidth>
78+
<NativeSelect
79+
value={getYear(date)}
80+
onChange={({ target: { value } }) => changeYear(parseInt(value))}
81+
>
82+
{" "}
83+
{years.map((year) => (
84+
<option className="text-center" key={year} value={year}>
85+
{year}
86+
</option>
87+
))}
88+
</NativeSelect>
89+
</FormControl>
90+
</Stack>
91+
92+
<FormControl fullWidth>
93+
<NativeSelect
94+
value={months[getMonth(date)]}
95+
onChange={({ target: { value } }) =>
96+
changeMonth(months.indexOf(value))
97+
}
98+
>
99+
{months.map((month) => (
100+
<option className="text-center" key={month} value={month}>
101+
{month}
102+
</option>
103+
))}
104+
</NativeSelect>
105+
</FormControl>
106+
107+
<IconButton
108+
size="small"
109+
onClick={increaseMonth}
110+
disabled={nextMonthButtonDisabled}
111+
>
112+
<ArrowForwardIosIcon fontSize="inherit" />
113+
</IconButton>
114+
</Stack>
115+
);
116+
};
117+
118+
export default CustomHeader;

dashboard/src/components/Forms/FormDatepicker.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Controller } from "react-hook-form";
2121
import { LightTooltip } from "@components/muiComponents";
2222
import moment from "moment-timezone";
2323
import { useEffect, useState } from "react";
24-
import DatePicker from "react-datepicker";
24+
import CustomDatepicker from "@components/DatePicker/CustomDatePicker";
2525

2626
const FormDatepicker = ({ data, control, fieldName }: any) => {
2727
const { name, isOptional, typeName } = data;
@@ -71,17 +71,15 @@ const FormDatepicker = ({ data, control, fieldName }: any) => {
7171
</LightTooltip>
7272
</div>
7373
<div className="w-100">
74-
<DatePicker
74+
<CustomDatepicker
7575
showPopperArrow={false}
7676
popperProps={{ strategy: "fixed" }}
77-
showYearDropdown
78-
showMonthDropdown
7977
selected={
8078
value && moment(value).isValid()
8179
? moment(value).toDate()
8280
: moment().toDate()
8381
}
84-
onChange={(date) => {
82+
onChange={(date: { getTime: () => any }) => {
8583
onChange(date ? date.getTime() : null);
8684
}}
8785
ref={ref}

0 commit comments

Comments
 (0)