Skip to content

Commit

Permalink
Guide updates scripting (#273)
Browse files Browse the repository at this point in the history
* Fix multiple test results bug (#269)

* Fixed the bug with multiple results files and switching between

- The null pointer throws on redraw. All the calculations and freeing of memory must be done within a setState block while the data is static

* Updated eslint to include storybook

* Updated eslint to include storybook

* Fixed eslint files

* Michael/perf 1699 (#270)

* Updated Request tool to get it online

* Removed unused component

* Updates to remove lint errors

* PewPew improvements (#271)

* PewPew improvements

* Updated scripts for running locally

* Remove har to yaml from controller (#272)

* Removed the yamlwriter and all its components from the controller

* Changed the yamlwriter link in the layout to go to the guide yaml writer

* Removed Non Prod message for login

* Removed unneeded vars

---------

Co-authored-by: blonde-mike <[email protected]>
  • Loading branch information
tkmcmaster and blonde-mike authored Dec 6, 2024
1 parent 05bf5e8 commit 3328321
Show file tree
Hide file tree
Showing 59 changed files with 758 additions and 6,499 deletions.
20 changes: 10 additions & 10 deletions controller/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ const config: StorybookConfig = {
propFilter: prop => prop.parent ? !/node_modules/.test(prop.parent.fileName) : true
}
},
webpackFinal: (config: Configuration) => {
if (!config.resolve) { config.resolve = {}; }
config.resolve.fallback = {
...(config.resolve.fallback || {}),
webpackFinal: (webpackConfig: Configuration) => {
if (!webpackConfig.resolve) { webpackConfig.resolve = {}; }
webpackConfig.resolve.fallback = {
...(webpackConfig.resolve.fallback || {}),
"fs": false,
"util": false,
"path": false,
"assert": false,
"crypto": false,
"crypto": false
};
if (!config.experiments) { config.experiments = {}; }
config.experiments.asyncWebAssembly = true;
if (!config.output) { config.output = {}; }
if (!webpackConfig.experiments) { webpackConfig.experiments = {}; }
webpackConfig.experiments.asyncWebAssembly = true;
if (!webpackConfig.output) { webpackConfig.output = {}; }
// config.output.publicPath = "/";
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm';
return config;
webpackConfig.output.webassemblyModuleFilename = "static/wasm/[modulehash].wasm";
return webpackConfig;
},
framework: {
name: "@storybook/nextjs",
Expand Down
4 changes: 2 additions & 2 deletions controller/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { RouterContext } from "next/dist/shared/lib/router-context.shared-runtim
/** @type { import('@storybook/react').Preview } */
const preview = {
nextRouter: {
Provider: RouterContext.Provider,
},
Provider: RouterContext.Provider
}
// Can't get this to work
// https://storybook.js.org/blog/integrate-nextjs-and-storybook-automatically/
// nextjs: {
Expand Down
2 changes: 2 additions & 0 deletions controller/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"jsx": "react"
},
"include": [
"./*.ts",
"./*.js",
"../types/**/*.ts",
"../components/**/*.ts",
"../components/**/*.tsx"
Expand Down
7 changes: 4 additions & 3 deletions controller/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
PAGE_ADMIN,
PAGE_CALENDAR,
PAGE_START_TEST,
PAGE_TEST_HISTORY,
PAGE_YAML_WRITER
PAGE_TEST_HISTORY
} from "../../types";
import { Button, LinkButton, defaultButtonTheme } from "../LinkButton";
import React, { useEffect } from "react";
Expand All @@ -20,6 +19,8 @@ import getConfig from "next/config";
const publicRuntimeConfig: any = getConfig() && getConfig().publicRuntimeConfig ? getConfig().publicRuntimeConfig : process.env;
const HIDE_ENVIRONMENT: unknown = publicRuntimeConfig.HIDE_ENVIRONMENT;

export const PAGE_YAML_WRITER: string = "https://familysearch.github.io/pewpew/results-viewer-react/yaml.html";

export type OtherControllers = Record<string, {
url: string;
hover?: string;
Expand Down Expand Up @@ -154,7 +155,7 @@ export const Layout = ({
<LinkButton href={PAGE_CALENDAR} title="View the test calendar">Calendar</LinkButton>
</LinkDiv>
<LinkDiv>
<LinkButton href={PAGE_YAML_WRITER} title="Convert a HAR file to a YAML load test">Yaml Writer</LinkButton>
<LinkButton href={PAGE_YAML_WRITER} title="Create a PewPew YAML load test" target="_blank">Yaml Writer</LinkButton>
</LinkDiv>
{authPermission === AuthPermission.Admin &&
<LinkDiv>
Expand Down
6 changes: 4 additions & 2 deletions controller/components/LinkButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const defaultButtonTheme: LinkButtonTheme = { buttonFontSize: ".8rem", bu
export interface LinkButtonProps {
name?: string;
href: string;
target?: string;
title?: string;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
theme?: LinkButtonTheme;
Expand All @@ -33,6 +34,7 @@ export interface LinkButtonProps {
export const LinkButton = ({
name,
href,
target,
title,
onClick,
theme,
Expand All @@ -41,8 +43,8 @@ export const LinkButton = ({
return (
<React.Fragment>
{/* https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor */}
<Link href={href} as={formatPageHref(href)} title={title} legacyBehavior>
<a href={formatPageHref(href)} title={title}>
<Link href={href} as={formatPageHref(href)} title={title} passHref legacyBehavior>
<a href={formatPageHref(href)} title={title} target={target}>
<Button name={name} theme={{...defaultButtonTheme, ...theme}} onClick={onClick}>{children}</Button>
</a>
</Link>
Expand Down
214 changes: 0 additions & 214 deletions controller/components/Modal/index.tsx

This file was deleted.

Loading

0 comments on commit 3328321

Please sign in to comment.