Skip to content

Commit 9eaab87

Browse files
Aleksy Lisowskipiotrczarnas
Aleksy Lisowski
authored andcommitted
Merged PR 2819: 12453 not refetching data when firstActiveLevelTab is changed, fixed closing Delete...
not refetching data when firstActiveLevelTab is changed, fixed closing DeleteData in userhome popup
2 parents aa0c0ec + 05945f2 commit 9eaab87

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

dqops/src/main/frontend/src/components/Connection/ConnectionView/ConnectionDetail.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const ConnectionDetail = () => {
7676

7777
useEffect(() => {
7878
dispatch(getConnectionBasic(checkTypes, activeTab, connection));
79-
}, [checkTypes, activeTab, connection]);
79+
}, [checkTypes, connection]);
8080

8181
const onChange = (obj: any) => {
8282
dispatch(

dqops/src/main/frontend/src/components/Connection/TableView/TableDetails.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const TableDetails = () => {
8181
const firstLevelActiveTab = useSelector(getFirstLevelActiveTab(checkTypes));
8282
const { userProfile } = useSelector((state: IRootState) => state.job || {});
8383
useEffect(() => {
84+
console.log(checkTypes, firstLevelActiveTab, connection, schema, table);
8485
dispatch(
8586
getTableBasic(checkTypes, firstLevelActiveTab, connection, schema, table)
8687
);
@@ -90,7 +91,7 @@ const TableDetails = () => {
9091
);
9192
};
9293
getConnectionBasic();
93-
}, [checkTypes, firstLevelActiveTab, connection, schema, table]);
94+
}, [checkTypes, connection, schema, table]);
9495

9596
const handleChange = (obj: any) => {
9697
dispatch(

dqops/src/main/frontend/src/components/ConnectionLayout/index.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,12 @@ const ConnectionLayout = ({ route }: ConnectionLayoutProps) => {
199199
open={objectNotFound}
200200
onConfirm={() =>
201201
new Promise(() => {
202-
dispatch(closeFirstLevelTab(checkTypes, firstLevelActiveTab)),
203-
setObjectNotFound(false);
202+
setObjectNotFound(false), closeTab(firstLevelActiveTab);
204203
})
205204
}
206205
isCancelExcluded={true}
207206
onClose={() => {
208-
dispatch(closeFirstLevelTab(checkTypes, firstLevelActiveTab)),
209-
setObjectNotFound(false);
207+
setObjectNotFound(false), closeTab(firstLevelActiveTab);
210208
}}
211209
message="The definition of this object was deleted in the DQOps user home. The tab will be closed."
212210
/>

dqops/src/main/frontend/src/pages/ColumnView/ColumnDetails.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ const TableDetails = ({
7171
columnName
7272
)
7373
);
74-
}, [
75-
checkTypes,
76-
firstLevelActiveTab,
77-
connectionName,
78-
schemaName,
79-
columnName,
80-
tableName
81-
]);
74+
}, [checkTypes, connectionName, schemaName, columnName, tableName]);
8275

8376
const onUpdate = async () => {
8477
if (!columnBasic) {

dqops/src/main/frontend/src/redux/reducers/source.reducer.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,16 @@ const connectionReducer = (state = initialState, action: Action) => {
207207
(item) => item.value === action.data
208208
);
209209
let activeTab = state[action.checkType].activeTab;
210-
211210
if (state[action.checkType].activeTab === action.data) {
212211
if (index > 0) {
213212
activeTab = state[action.checkType]?.tabs[index - 1].value;
214213
} else if (index < state[action.checkType]?.tabs.length - 1) {
215214
activeTab = state[action.checkType]?.tabs[index + 1].value;
216215
}
216+
if (index === 0 && state[action.checkType]?.tabs.length === 1) {
217+
activeTab = undefined;
218+
}
217219
}
218-
219220
return {
220221
...state,
221222
[action.checkType]: {

0 commit comments

Comments
 (0)