Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide updates scripting #273

Merged
merged 5 commits into from
Dec 6, 2024
Merged
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
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
Loading