From feed7114db16b1b44b9a06bba8ad20cbf9c7cda6 Mon Sep 17 00:00:00 2001 From: brysonjbest <103070659+brysonjbest@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:38:54 -0800 Subject: [PATCH] Fix linting issue. --- .../ScenarioHelper/ScenarioHelper.tsx | 28 +++---- .../ScenariosManager/ScenariosManager.tsx | 81 ++++++++----------- 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/app/components/ScenariosManager/ScenarioHelper/ScenarioHelper.tsx b/app/components/ScenariosManager/ScenarioHelper/ScenarioHelper.tsx index 8d02b08..07d4aa4 100644 --- a/app/components/ScenariosManager/ScenarioHelper/ScenarioHelper.tsx +++ b/app/components/ScenariosManager/ScenarioHelper/ScenarioHelper.tsx @@ -74,9 +74,9 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) { button.

- The scenario's saved inputs for the rule are shown in the 'Inputs' window, and the final results + The scenario's saved inputs for the rule are shown in the 'Inputs' window, and the final results will be processed in real time through the current visible version of the rule, and returned in the - 'Decision' window. + 'Decision' window.

By running rules individually, you can track their progress as the scenario is processed by the @@ -96,13 +96,13 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) { Scenarios can be managed by adding new scenarios, editing existing scenarios, or deleting scenarios from the rule.

-

To begin managing scenarios, click on the 'Manage Scenarios' button.

+

To begin managing scenarios, click on the 'Manage Scenarios' button.

This will enable three new functionalities. You will now be able to edit the scenario name, edit the scenario inputs, or delete a scenario.

- Clicking on the edit button will redirect you to the 'Simulate manual inputs' tab to update the + Clicking on the edit button will redirect you to the 'Simulate manual inputs' tab to update the inputs and expected results for a scenario.

@@ -111,7 +111,7 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) {

3. Editing Scenario Names

-

The 'Manage Scenarios' Button also enables the ability to rename existing scenarios.

+

The 'Manage Scenarios' Button also enables the ability to rename existing scenarios.

Scenarios can be renamed by clicking on the scenario name in the table, and editing the name.

Scenario names must be unique within a rule, and you will not be allowed to rename the scenario if @@ -191,8 +191,8 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) { Each input field has an associated info button that provides detailed information about the input.

- Clicking this button reveals the input's description and provides a direct link to its entry in - KLAMM, allowing you to quickly reference the input's full specification. + Clicking this button reveals the input's description and provides a direct link to its entry in + KLAMM, allowing you to quickly reference the input's full specification.

@@ -212,7 +212,7 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) {

The simulate button runs your current inputs through the rule to generate results.

- After a successful simulation, you'll have the option to save these inputs as a new scenario. This + After a successful simulation, you'll have the option to save these inputs as a new scenario. This includes a field to name your scenario and a save button to store it for future use.

@@ -227,7 +227,7 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) {

This view updates each time you run a simulation, allowing you to see how different inputs affect - the rule's output. + the rule's output.

@@ -296,7 +296,7 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) {

1. Re-Run Scenarios

- The 'Re-Run Scenarios' button allows you to run all saved scenarios against the current version of + The 'Re-Run Scenarios' button allows you to run all saved scenarios against the current version of the rule in view.

@@ -318,7 +318,7 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) {

  • No expected results were specified (default pass state)
  • -
  • A red X (✗) indicates the scenario's actual results don't match the expected results
  • +
  • A red X (✗) indicates the scenario's actual results don't match the expected results
  • @@ -340,15 +340,15 @@ export default function ScenariosHelper({ section }: ScenariosHelperProps) {

    The table provides several controls for managing the view of your scenarios:

    Additional filtering and sorting options:

    diff --git a/app/components/ScenariosManager/ScenariosManager.tsx b/app/components/ScenariosManager/ScenariosManager.tsx index c0b0375..25680aa 100644 --- a/app/components/ScenariosManager/ScenariosManager.tsx +++ b/app/components/ScenariosManager/ScenariosManager.tsx @@ -144,53 +144,42 @@ export default function ScenariosManager({ ); - const items: TabsProps["items"] = [ - { - key: ScenariosManagerTabs.ScenariosTab, - label: ( - - Simulate scenarios - - ), - children: scenariosTab, - disabled: false, - }, - { - key: ScenariosManagerTabs.InputsTab, - label: "Simulate manual inputs", - children: inputsTab, - disabled: false, - }, - { - key: ScenariosManagerTabs.ResultsTab, - label: "Scenario Results", - children: resultsTab, - disabled: !showAllScenarioTabs, - }, - { - key: ScenariosManagerTabs.CSVTab, - label: "CSV Tests", - children: csvTab, - disabled: !showAllScenarioTabs, - }, - { - key: ScenariosManagerTabs.IsolationTesterTab, - label: "Isolation Tester", - children: isolationTestTab, - disabled: !showAllScenarioTabs, - }, - ]; + const filteredItems = useMemo(() => { + const items: TabsProps["items"] = [ + { + key: ScenariosManagerTabs.ScenariosTab, + label: Simulate scenarios, + children: scenariosTab, + disabled: false, + }, + { + key: ScenariosManagerTabs.InputsTab, + label: "Simulate manual inputs", + children: inputsTab, + disabled: false, + }, + { + key: ScenariosManagerTabs.ResultsTab, + label: "Scenario Results", + children: resultsTab, + disabled: !showAllScenarioTabs, + }, + { + key: ScenariosManagerTabs.CSVTab, + label: "CSV Tests", + children: csvTab, + disabled: !showAllScenarioTabs, + }, + { + key: ScenariosManagerTabs.IsolationTesterTab, + label: "Isolation Tester", + children: isolationTestTab, + disabled: !showAllScenarioTabs, + }, + ]; - const filteredItems = useMemo( - () => (showAllScenarioTabs ? items : items.filter((item) => !item.disabled)), - [showAllScenarioTabs, items] - ); + return showAllScenarioTabs ? items : items.filter((item) => !item.disabled); + }, [showAllScenarioTabs, scenariosTab, inputsTab, resultsTab, csvTab, isolationTestTab]); return (