Skip to content

Commit 9bb93bf

Browse files
committed
add location for the remote browser tab and update continue and back buttons
1 parent 7bde842 commit 9bb93bf

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

web-server/plugins/slycat-cca/js/components/CCANavItems.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const CCAWizardNavItems = () => {
1818
<CCANavItem
1919
key={"Upload Table"}
2020
name={"Upload Table"}
21-
active={tabName === TabNames.CCA_LOCAL_BROWSER_TAB}
21+
active={
22+
tabName === TabNames.CCA_LOCAL_BROWSER_TAB || tabName === TabNames.CCA_REMOTE_BROWSER_TAB
23+
}
2224
hidden={tabName === TabNames.CCA_DATA_WIZARD_SELECTION_TAB}
2325
/>
2426
<CCANavItem
@@ -27,7 +29,8 @@ export const CCAWizardNavItems = () => {
2729
active={tabName === TabNames.CCA_TABLE_INGESTION}
2830
hidden={
2931
tabName === TabNames.CCA_DATA_WIZARD_SELECTION_TAB ||
30-
tabName === TabNames.CCA_LOCAL_BROWSER_TAB
32+
tabName === TabNames.CCA_LOCAL_BROWSER_TAB ||
33+
tabName === TabNames.CCA_REMOTE_BROWSER_TAB
3134
}
3235
/>
3336
<CCANavItem

web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { selectTab, TabNames } from "./wizard-store/reducers/cCAWizardSlice";
99
import { CCALocalBrowserTab } from "./wizard-tabs/CCALocalBrowserTab";
1010
import { CCATableIngestion } from "./wizard-tabs/CCATableIngestion";
1111
import { CCAModelCreation } from "./wizard-tabs/CCAModelCreation";
12+
import { CCARemoteBrowserTab } from "./wizard-tabs/CCARemoteBrowser";
1213

1314
export const CCAWizardSteps = () => {
1415
// The `state` arg is correctly typed as `RootState` already
@@ -19,6 +20,7 @@ export const CCAWizardSteps = () => {
1920
<div className="tab-content">
2021
<CCAWizardDataSelectionTab hidden={!(tabName === TabNames.CCA_DATA_WIZARD_SELECTION_TAB)} />
2122
<CCALocalBrowserTab hidden={!(tabName === TabNames.CCA_LOCAL_BROWSER_TAB)} />
23+
<CCARemoteBrowserTab hidden={!(tabName === TabNames.CCA_REMOTE_BROWSER_TAB)} />
2224
<CCATableIngestion hidden={!(tabName === TabNames.CCA_TABLE_INGESTION)} />
2325
<CCAModelCreation hidden={!(tabName === TabNames.CCA_FINISH_MODEL)}/>
2426
<div hidden={true}>

web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ export const useCCAWizardFooter = () => {
4545
* handle continue operation
4646
*/
4747
const handleContinue = React.useCallback(() => {
48-
if (tabName === TabNames.CCA_DATA_WIZARD_SELECTION_TAB && dataLocation) {
48+
if (tabName === TabNames.CCA_DATA_WIZARD_SELECTION_TAB && dataLocation === "local") {
49+
console.log(dataLocation);
4950
dispatch(setTabName(TabNames.CCA_LOCAL_BROWSER_TAB));
5051
}
52+
if (tabName === TabNames.CCA_DATA_WIZARD_SELECTION_TAB && dataLocation === "remote") {
53+
console.log(dataLocation);
54+
dispatch(setTabName(TabNames.CCA_REMOTE_BROWSER_TAB));
55+
}
5156
if (tabName === TabNames.CCA_LOCAL_BROWSER_TAB && fileUploaded) {
5257
dispatch(setTabName(TabNames.CCA_TABLE_INGESTION));
5358
}
@@ -57,13 +62,13 @@ export const useCCAWizardFooter = () => {
5762
if (tabName === TabNames.CCA_FINISH_MODEL) {
5863
finishModel();
5964
}
60-
}, [dispatch, uploadSelection, fileUploaded, setTabName, tabName]);
65+
}, [dispatch, uploadSelection, fileUploaded, setTabName, tabName, dataLocation]);
6166

6267
/**
6368
* handle back operation
6469
*/
6570
const handleBack = React.useCallback(() => {
66-
if (tabName === TabNames.CCA_LOCAL_BROWSER_TAB) {
71+
if (tabName === TabNames.CCA_LOCAL_BROWSER_TAB || tabName === TabNames.CCA_REMOTE_BROWSER_TAB) {
6772
dispatch(setTabName(TabNames.CCA_DATA_WIZARD_SELECTION_TAB));
6873
}
6974
if (tabName === TabNames.CCA_TABLE_INGESTION) {
@@ -94,7 +99,7 @@ export const useCCAWizardFooter = () => {
9499
onClick={handleContinue}
95100
disabled={tabName === TabNames.CCA_LOCAL_BROWSER_TAB && !fileUploaded}
96101
>
97-
Continue {fileUploaded.toString()}
102+
Continue
98103
</button>
99104
);
100105
return React.useMemo(

web-server/plugins/slycat-cca/js/components/wizard-store/reducers/cCAWizardSlice.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract
2+
DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government
3+
retains certain rights in this software. */
14
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
25
import { RootState } from "../store";
36

47
export enum TabNames {
58
CCA_DATA_WIZARD_SELECTION_TAB = "CCADataWizardSelectionTab",
69
CCA_LOCAL_BROWSER_TAB = "CCSLocalBrowserTab",
10+
CCA_REMOTE_BROWSER_TAB = "CCSRemoteBrowserTab",
711
CCA_TABLE_INGESTION = "CCATableIngestion",
812
CCA_FINISH_MODEL = "CCAFinishModel",
913
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract
2+
DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government
3+
retains certain rights in this software. */
4+
import * as React from "react";
5+
import { useSetUploadStatus } from "../CCAWizardUtils";
6+
7+
export const CCARemoteBrowserTab = (props: { hidden?: boolean }) => {
8+
const { hidden = false } = props;
9+
const setUploadStatus = useSetUploadStatus();
10+
return <div hidden={hidden}>REMOTE</div>;
11+
};

0 commit comments

Comments
 (0)