Skip to content

Commit

Permalink
Rough changes to the Javascript
Browse files Browse the repository at this point in the history
With these changes, it's possible to navigate down the directory hierarchy.
Navigating backwards on the "breadcrumb" line (still) doesn't quite work, but
I now believe that my URI change in the API hasn't made anything worse than it
was before.
  • Loading branch information
dbutenhof committed Jun 24, 2023
1 parent d00b7e4 commit d7d6ba2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion dashboard/src/actions/tableOfContentActions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as TYPES from "./types";
import API from "../utils/axiosInstance";
import { uriTemplate } from "../utils/helper";
import { showToast } from "./toastActions";
import { DANGER } from "assets/constants/toastConstants";

export const fetchTOC =
(param, parent, callForSubData) => async (dispatch, getState) => {
Expand All @@ -18,7 +20,8 @@ export const fetchTOC =
});
}
} catch (error) {
return error;
const msg = error.response?.data?.message;
dispatch(showToast(DANGER, msg ? msg : `Error response: ERROR_MSG`));
}
};

Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/modules/components/TableOfContent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const TableOfContent = () => {
? initialBreadcrumb(breadCrumbLabels)
: appGroupingBreadcrumb(false, breadCrumbLabels)
);
const dirPath = param.concat(`${firstHierarchyLevel ? "" : "/"}`, data);
const dirPath = param.concat(firstHierarchyLevel ? "" : "/", data);
setParam(dirPath);
setIsLoading(true);
getSubFolderData(dirPath);
Expand Down Expand Up @@ -288,7 +288,7 @@ const TableOfContent = () => {
}
>
<FolderIcon />
{data}
{data.name}
</MenuItem>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/reducers/tableOfContentReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const TableOfContentReducer = (state = initialState, action = {}) => {
stack: [...state.stack, payload],
searchSpace: payload.files,
tableData: payload.files,
currData: payload,
contentData: payload,
isLoading: false,
};

Expand Down

0 comments on commit d7d6ba2

Please sign in to comment.