Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 10 additions & 8 deletions web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const useUploadTableFile = () => {
const mid = useAppSelector(selectMid);
const fileName = useAppSelector(selectFileName);
const scaleInputs = useAppSelector(selectScaleInputs);

return React.useCallback((fullPath:string) => {
if (currentTab === TabNames.CCA_HDF5_INPUT_SELECTION_TAB) {
client.post_hdf5_table({
Expand Down Expand Up @@ -393,6 +393,7 @@ export const useHandleRemoteFileSubmit = () => {
const progress = useAppSelector(selectProgress);
const progressStatus = useAppSelector(selectProgressStatus);
const fileUploadSuccess = useFileUploadSuccess();
const setUploadStatus = useSetUploadStatus();
return React.useCallback(() => {
dispatch(setLoading(true));
if (!fileDescriptor?.path) {
Expand Down Expand Up @@ -462,11 +463,11 @@ export const useHandleRemoteFileSubmit = () => {
setProgressStatus("File upload complete");
dispatch(setLoading(false));
dispatch(setTabName(TabNames.CCA_TABLE_INGESTION));
// setUploadStatus(true);
setUploadStatus(true);
fileUploadSuccess(autoParser, setProgress, setProgressStatus, (status) => console.log(status));
},
error: function () {
// setUploadStatus(false);
setUploadStatus(false);
dispatch(setLoading(false));
dialog.ajax_error(
"Did you choose the correct file and filetype? There was a problem parsing the file: ",
Expand Down Expand Up @@ -606,15 +607,16 @@ export const useHandleTableIngestionOnChange = (attributes: Attribute[]) => {
return React.useCallback(
(input: any) => {
// this function is overloaded to handle batching so we need to check for target or batchTarget
if (input?.target && (input as any)?.target?.name && (input as any)?.target?.value) {
if (input?.currentTarget && (input as any)?.currentTarget?.name && (input as any)?.currentTarget?.value) {
const nextAttributes = produce(attributes, (draftState) => {
draftState[input?.target?.name] = {
...draftState[input?.target?.name],
"Axis Type": input?.target?.value,
draftState[input?.currentTarget?.name] = {
...draftState[input?.currentTarget?.name],
"Axis Type": input?.currentTarget?.value,
};
});
dispatch(setAttributes(nextAttributes));
} else if (input?.batchTarget && input?.batchTarget?.length > 0) {
}
else if (input?.batchTarget && input?.batchTarget?.length > 0) {
const nextAttributes = produce(attributes, (draftState) => {
input?.batchTarget.forEach((row: any) => {
draftState[row?.name] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const CCAHDF5InputSelectionTab = (props: { hidden?: boolean }) => {

return (
<div hidden={hidden}>
<HDF5Browser
{!hidden && <HDF5Browser
onSelectFileCallBack={handleTablePath}
onReauthCallBack={OnReauth}
hostname={hostname}
pid={pid}
mid={mid}
fileUploaded={fileUploaded}
/>
/>}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const CCAHDF5OutputSelectionTab = (props: { hidden?: boolean }) => {

return (
<div hidden={hidden}>
<HDF5Browser
{!hidden && <HDF5Browser
onSelectFileCallBack={handleTablePath}
onReauthCallBack={OnReauth}
hostname={hostname}
pid={pid}
mid={mid}
fileUploaded={fileUploaded}
/>
/>}
</div>
);
};