From 4356194b9f2de12a32671313f414a524f13e8a5e Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 9 Apr 2025 11:44:19 -0600 Subject: [PATCH 01/31] Test ruleset --- webpack.dev.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack.dev.js b/webpack.dev.js index d6095e280..0a8b4e283 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -9,6 +9,7 @@ module.exports = merge(common, { publicPath: "/", index: "slycat_projects.html", }, + // test // Only compiles on refresh, not on file change. But does not work, complains of running webpack twice. // lazy: true, From 28bf9c310464211da09ed92784c31e6d11be71cf Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 31 Jan 2025 13:34:41 -0700 Subject: [PATCH 02/31] start porting cca to reactjs --- .../slycat-cca/js/components/CCAWizard.tsx | 14 ++++++ .../js/components/CCAWizardContent.tsx | 47 +++++++++++++++++++ web-server/plugins/slycat-cca/js/wizard-ui.js | 25 ++++++++++ web-server/plugins/slycat-cca/slycat-cca.js | 5 +- web-server/plugins/slycat-cca/wizard-ui.html | 3 ++ 5 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 web-server/plugins/slycat-cca/js/components/CCAWizard.tsx create mode 100644 web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx create mode 100644 web-server/plugins/slycat-cca/js/wizard-ui.js create mode 100644 web-server/plugins/slycat-cca/wizard-ui.html diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx new file mode 100644 index 000000000..cdbd61923 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx @@ -0,0 +1,14 @@ +import * as React from "react"; +import { CCAModalContent} from "./CCAWizardContent"; + +export const CCAWizard = () =>{ + return ( + console.log('clean')} + title={"CCA Wizard"} + body={
Body
} + footer={[
Footer
]} + /> + ); +} \ No newline at end of file diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx new file mode 100644 index 000000000..c03dc4355 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx @@ -0,0 +1,47 @@ +import * as React from "react"; + +/** + * @member closingCallBack callback function for cleanup when closing the modal + * @member title test for the top of the modal + */ +export interface ModalContentProps { + modalId: string, + closingCallBack: Function; + title: string; + body: JSX.Element; + footer: JSX.Element[]; +} + + +export const CCAModalContent = (props:ModalContentProps) => { + + const {modalId, closingCallBack, title, body, footer} = props; + /** + *close the modal and call the cleanup function + * @memberof ModalContent + */ + const handleCloseModal = React.useCallback((e: React.MouseEvent): void => { + closingCallBack(); + ($("#" + modalId) as any).modal("hide"); + },[modalId, closingCallBack]) + + return ( +
+
+

{title}

+ +
+
+ {body} +
+
{footer}
+
+ ); +} diff --git a/web-server/plugins/slycat-cca/js/wizard-ui.js b/web-server/plugins/slycat-cca/js/wizard-ui.js new file mode 100644 index 000000000..0d66fa576 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/wizard-ui.js @@ -0,0 +1,25 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ +import React from "react"; +import { createRoot } from "react-dom/client"; +// import TimeseriesWizard from "components/timeseries-wizard/TimeseriesWizard.tsx"; +import markings from "js/slycat-selectable-markings"; +import { CCAWizard } from ".//components/CCAWizard.tsx" +import ccaWizardUI from "../wizard-ui.html"; + +function constructor(params) { + console.dir(params) + const react_wizard_root = createRoot(document.querySelector(".react-wizard")); + react_wizard_root.render( + + ); + + // return an empty component since we are just using it to render react + return {}; +} + +export default { + viewModel: constructor, + template: ccaWizardUI, +}; diff --git a/web-server/plugins/slycat-cca/slycat-cca.js b/web-server/plugins/slycat-cca/slycat-cca.js index 985652ea9..ec918878e 100644 --- a/web-server/plugins/slycat-cca/slycat-cca.js +++ b/web-server/plugins/slycat-cca/slycat-cca.js @@ -1,7 +1,8 @@ import ko from "knockout"; -import new_cca from 'plugins/slycat-cca/js/new-ui'; import rerun_cca from 'plugins/slycat-cca/js/rerun-ui'; -ko.components.register('new-cca', new_cca); +import cca_wizard from 'plugins/slycat-cca/js//wizard-ui'; + +ko.components.register('new-cca', cca_wizard); ko.components.register('rerun-cca', rerun_cca); \ No newline at end of file diff --git a/web-server/plugins/slycat-cca/wizard-ui.html b/web-server/plugins/slycat-cca/wizard-ui.html new file mode 100644 index 000000000..572e2ebb0 --- /dev/null +++ b/web-server/plugins/slycat-cca/wizard-ui.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 2a70150b106d73a645b71289684c6ec53bb69dfe Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 31 Jan 2025 13:54:29 -0700 Subject: [PATCH 03/31] adding child content modal body --- .../plugins/slycat-cca/js/components/CCAWizard.tsx | 14 +++++++++----- .../slycat-cca/js/components/CCAWizardContent.tsx | 7 +++---- .../slycat-cca/js/components/CCAWizardSteps.tsx | 7 +++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx index cdbd61923..f4e63b568 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx @@ -1,14 +1,18 @@ import * as React from "react"; import { CCAModalContent} from "./CCAWizardContent"; +import { CCAWizardSteps } from "./CCAWizardSteps" export const CCAWizard = () =>{ return ( console.log('clean')} - title={"CCA Wizard"} - body={
Body
} + key={'slycat-wizard'} + // slycat-wizard is the standard wizard id from knockout + modalId={'slycat-wizard'} + closingCallBack={()=>console.log('clean and delete model')} + title={"New CCA Model"} footer={[
Footer
]} - /> + > + +
); } \ No newline at end of file diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx index c03dc4355..caffe1af9 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx @@ -8,14 +8,13 @@ export interface ModalContentProps { modalId: string, closingCallBack: Function; title: string; - body: JSX.Element; footer: JSX.Element[]; } -export const CCAModalContent = (props:ModalContentProps) => { +export const CCAModalContent = (props:React.PropsWithChildren) => { - const {modalId, closingCallBack, title, body, footer} = props; + const {modalId, closingCallBack, title, children, footer} = props; /** *close the modal and call the cleanup function * @memberof ModalContent @@ -39,7 +38,7 @@ export const CCAModalContent = (props:ModalContentProps) => {
- {body} + {children}
{footer}
diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx new file mode 100644 index 000000000..54f0425a8 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx @@ -0,0 +1,7 @@ +import * as React from "react"; + +export const CCAWizardSteps = () =>{ + return ( +
Body
+ ); +} \ No newline at end of file From 605d29b6dae69ccf1b0e0b1ae17598c7cb6e4432 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 31 Jan 2025 15:39:09 -0700 Subject: [PATCH 04/31] moving footer to its own component --- .../plugins/slycat-cca/js/components/CCAWizard.tsx | 6 ++++-- .../slycat-cca/js/components/CCAWizardContent.tsx | 2 +- .../slycat-cca/js/components/CCAWizardUtils.tsx | 11 +++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx index f4e63b568..60643842b 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx @@ -1,8 +1,10 @@ import * as React from "react"; import { CCAModalContent} from "./CCAWizardContent"; import { CCAWizardSteps } from "./CCAWizardSteps" +import { useCCAWizardFooter } from "./CCAWizardUtils" export const CCAWizard = () =>{ + const cCAWizardFooter = useCCAWizardFooter(); return ( { modalId={'slycat-wizard'} closingCallBack={()=>console.log('clean and delete model')} title={"New CCA Model"} - footer={[
Footer
]} + footer={cCAWizardFooter} > - +
); } \ No newline at end of file diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx index caffe1af9..aca4608cb 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx @@ -8,7 +8,7 @@ export interface ModalContentProps { modalId: string, closingCallBack: Function; title: string; - footer: JSX.Element[]; + footer?: React.ReactNode[] | undefined; } diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx new file mode 100644 index 000000000..ff49528f1 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx @@ -0,0 +1,11 @@ +import * as React from "react"; + +export const useCCAWizardFooter = () => { + const backButton = () + const nextButton = () + return React.useMemo(()=>[backButton, nextButton],[]) +} \ No newline at end of file From f1aff504c0f6ecd6d589fc9505d5d3c5099e31b7 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 31 Jan 2025 16:59:26 -0700 Subject: [PATCH 05/31] start building the content --- .../slycat-cca/js/components/CCAWizard.tsx | 39 +++-- .../js/components/CCAWizardContent.tsx | 55 +++---- .../js/components/CCAWizardSteps.tsx | 155 +++++++++++++++++- .../js/components/CCAWizardUtils.tsx | 23 ++- web-server/plugins/slycat-cca/js/wizard-ui.js | 11 +- web-server/plugins/slycat-cca/wizard-ui.html | 2 +- 6 files changed, 218 insertions(+), 67 deletions(-) diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx index 60643842b..7155bcea6 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizard.tsx @@ -1,20 +1,23 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ import * as React from "react"; -import { CCAModalContent} from "./CCAWizardContent"; -import { CCAWizardSteps } from "./CCAWizardSteps" -import { useCCAWizardFooter } from "./CCAWizardUtils" +import { CCAModalContent } from "./CCAWizardContent"; +import { CCAWizardSteps } from "./CCAWizardSteps"; +import { useCCAWizardFooter } from "./CCAWizardUtils"; -export const CCAWizard = () =>{ - const cCAWizardFooter = useCCAWizardFooter(); - return ( - console.log('clean and delete model')} - title={"New CCA Model"} - footer={cCAWizardFooter} - > - - - ); -} \ No newline at end of file +export const CCAWizard = () => { + const cCAWizardFooter = useCCAWizardFooter(); + return ( + console.log("clean and delete model")} + title={"New CCA Model"} + footer={cCAWizardFooter} + > + + + ); +}; diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx index aca4608cb..b0752241e 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardContent.tsx @@ -1,3 +1,6 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ import * as React from "react"; /** @@ -5,42 +8,38 @@ import * as React from "react"; * @member title test for the top of the modal */ export interface ModalContentProps { - modalId: string, + modalId: string; closingCallBack: Function; title: string; footer?: React.ReactNode[] | undefined; } - -export const CCAModalContent = (props:React.PropsWithChildren) => { - - const {modalId, closingCallBack, title, children, footer} = props; +export const CCAModalContent = (props: React.PropsWithChildren) => { + const { modalId, closingCallBack, title, children, footer } = props; /** *close the modal and call the cleanup function * @memberof ModalContent */ - const handleCloseModal = React.useCallback((e: React.MouseEvent): void => { - closingCallBack(); - ($("#" + modalId) as any).modal("hide"); - },[modalId, closingCallBack]) + const handleCloseModal = React.useCallback( + (e: React.MouseEvent): void => { + closingCallBack(); + ($("#" + modalId) as any).modal("hide"); + }, + [modalId, closingCallBack], + ); - return ( -
-
-

{title}

- -
-
- {children} -
-
{footer}
+ return ( +
+
+

{title}

+
- ); -} +
+ {children} +
+
{footer}
+
+ ); +}; diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx index 54f0425a8..ed802237a 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx @@ -1,7 +1,152 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ import * as React from "react"; -export const CCAWizardSteps = () =>{ - return ( -
Body
- ); -} \ No newline at end of file +export const CCAWizardSteps = () => { + return ( +
+ + +
+ + + + + + + + + + + +
+
+ ); +}; diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx index ff49528f1..80d22fb18 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardUtils.tsx @@ -1,11 +1,18 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ import * as React from "react"; export const useCCAWizardFooter = () => { - const backButton = () - const nextButton = () - return React.useMemo(()=>[backButton, nextButton],[]) -} \ No newline at end of file + const backButton = ( + + ); + const nextButton = ( + + ); + return React.useMemo(() => [backButton, nextButton], []); +}; diff --git a/web-server/plugins/slycat-cca/js/wizard-ui.js b/web-server/plugins/slycat-cca/js/wizard-ui.js index 0d66fa576..46163a8b4 100644 --- a/web-server/plugins/slycat-cca/js/wizard-ui.js +++ b/web-server/plugins/slycat-cca/js/wizard-ui.js @@ -3,17 +3,14 @@ retains certain rights in this software. */ import React from "react"; import { createRoot } from "react-dom/client"; -// import TimeseriesWizard from "components/timeseries-wizard/TimeseriesWizard.tsx"; -import markings from "js/slycat-selectable-markings"; -import { CCAWizard } from ".//components/CCAWizard.tsx" +// import markings from "js/slycat-selectable-markings"; +import { CCAWizard } from ".//components/CCAWizard.tsx"; import ccaWizardUI from "../wizard-ui.html"; function constructor(params) { - console.dir(params) + console.dir(params); const react_wizard_root = createRoot(document.querySelector(".react-wizard")); - react_wizard_root.render( - - ); + react_wizard_root.render(); // return an empty component since we are just using it to render react return {}; diff --git a/web-server/plugins/slycat-cca/wizard-ui.html b/web-server/plugins/slycat-cca/wizard-ui.html index 572e2ebb0..34c39f0f3 100644 --- a/web-server/plugins/slycat-cca/wizard-ui.html +++ b/web-server/plugins/slycat-cca/wizard-ui.html @@ -1,3 +1,3 @@ - \ No newline at end of file + From 7e095f1c960c71365cf92a014a92e9c1b5f3f468 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 5 Feb 2025 10:45:56 -0700 Subject: [PATCH 06/31] Create SlycatLocalBrowser.tsx --- .../SlycatLocalBrowser.tsx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 web-server/plugins/slycat-cca/js/components/slycat-local-browser/SlycatLocalBrowser.tsx diff --git a/web-server/plugins/slycat-cca/js/components/slycat-local-browser/SlycatLocalBrowser.tsx b/web-server/plugins/slycat-cca/js/components/slycat-local-browser/SlycatLocalBrowser.tsx new file mode 100644 index 000000000..a201f73c3 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/slycat-local-browser/SlycatLocalBrowser.tsx @@ -0,0 +1,37 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ +import * as React from "react"; + +export const SlycatLocalBrowser = () => { + return ( +
+ +
+ +
+
+ Uploading +
+
+
+
+ ); +}; From 251ec7a84588c3e8f9e0e863e3f23a4e0f6c36f1 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 6 Feb 2025 10:24:16 -0700 Subject: [PATCH 07/31] adding nav items --- .../slycat-cca/js/components/CCANavItem.tsx | 19 ++++++ .../slycat-cca/js/components/CCANavItems.tsx | 18 ++++++ .../js/components/CCAWizardSelectionTab.tsx | 35 +++++++++++ .../js/components/CCAWizardSteps.tsx | 63 ++----------------- 4 files changed, 76 insertions(+), 59 deletions(-) create mode 100644 web-server/plugins/slycat-cca/js/components/CCANavItem.tsx create mode 100644 web-server/plugins/slycat-cca/js/components/CCANavItems.tsx create mode 100644 web-server/plugins/slycat-cca/js/components/CCAWizardSelectionTab.tsx diff --git a/web-server/plugins/slycat-cca/js/components/CCANavItem.tsx b/web-server/plugins/slycat-cca/js/components/CCANavItem.tsx new file mode 100644 index 000000000..0de7e0082 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCANavItem.tsx @@ -0,0 +1,19 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ +import * as React from "react"; + +interface CCANavItemProps { + name: string; + active?: boolean; + hidden?: boolean; +} + +export const CCANavItem = ({ name, active, hidden }: CCANavItemProps) => { + const classNames = "nav-item" + (active ? " active": ""); + return ( + + ); +}; diff --git a/web-server/plugins/slycat-cca/js/components/CCANavItems.tsx b/web-server/plugins/slycat-cca/js/components/CCANavItems.tsx new file mode 100644 index 000000000..994ad264f --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCANavItems.tsx @@ -0,0 +1,18 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ +import * as React from "react"; +import { CCANavItem } from "./CCANavItem"; + +export const CCAWizardNavItems = () => { + return ( +
    + +
+ ); +}; diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardSelectionTab.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardSelectionTab.tsx new file mode 100644 index 000000000..e47bfaa05 --- /dev/null +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardSelectionTab.tsx @@ -0,0 +1,35 @@ +/* Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract + DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government + retains certain rights in this software. */ +import * as React from "react"; + +export const CCAWizardSelectionTab = () => { + return ( +
+
+ +
+
+ +
+
+ ); +}; diff --git a/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx b/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx index ed802237a..2955cf6a7 100644 --- a/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx +++ b/web-server/plugins/slycat-cca/js/components/CCAWizardSteps.tsx @@ -2,71 +2,16 @@ DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government retains certain rights in this software. */ import * as React from "react"; +import { CCAWizardSelectionTab } from "./CCAWizardSelectionTab"; +import { CCAWizardNavItems } from "./CCANavItems"; export const CCAWizardSteps = () => { return (
- +
- - +