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

added documentation comments to the storybook elements of the app #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
27 changes: 27 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
/**
*
* This configuration object defines how Storybook should discover stories,
* which addons to include, and some core framework options.
*
* @module StorybookConfig
*/

import type { StorybookConfig } from "@storybook/react-vite";

/**
* Configuration object for Storybook.
*
* @type {StorybookConfig}
* @property {string[]} stories - Patterns to locate story files within the project.
* Includes `.mdx` files and various script extensions such as
* `.js`, `.jsx`, `.mjs`, `.ts`, and `.tsx` within the `src` directory.
* @property {string[]} addons - List of Storybook addons for functionality.
* - `@storybook/addon-onboarding`: Assists with onboarding users to Storybook.
* - `@storybook/addon-links`: Enables linking between stories.
* - `@storybook/addon-essentials`: Includes essential Storybook addons.
* - `@chromatic-com/storybook`: Chromatic integration for visual testing.
* - `@storybook/addon-interactions`: Enables testing interactions in components.
* @property {Object} framework - Framework-specific configuration for Storybook.
* - `name`: Specifies the React-Vite framework for Storybook.
* - `options`: Reserved for future framework-specific options (currently empty).
* @property {Object} core - Core settings for Storybook.
* - `disableTelemetry`: Disables telemetry to avoid sending usage data.
*/
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
Expand Down
22 changes: 21 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
*
* This file configures global settings for Storybook, including controls, decorators,
* and custom parameters. It also integrates the Mantine library for consistent theming.
*
* @module StorybookPreview
*/

import React from "react";

import type { Preview } from "@storybook/react";
Expand All @@ -6,6 +14,18 @@ import "@mantine/core/styles.css";

import { theme } from "../src/theme";

/**
* Storybook preview configuration object.
*
* @type {Preview}
* @property {Object} parameters - Defines global configuration for Storybook controls.
* - `controls.matchers.color`: Regex to match color-related properties.
* - `controls.matchers.date`: Regex to match date-related properties.
* @property {Function[]} decorators - Array of decorators to wrap all rendered stories.
* - Wraps all stories with MantineProvider to apply theming.
* @property {string[]} tags - Tags to identify metadata or features.
* - Includes `autodocs` for automatic documentation generation.
*/
const preview: Preview = {
parameters: {
controls: {
Expand All @@ -23,4 +43,4 @@ const preview: Preview = {
tags: ["autodocs"],
};

export default preview;
export default preview;
27 changes: 22 additions & 5 deletions src/data/dataFilters.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/**
* Represents the list of event types.
*
* These are predefined categories used to describe different types of automotive events.
* This constant can be used in forms, filters, or data validation in Storybook components.
*/
export const eventType: string[] = [
"Acceleration",
"Endurance",
"Skidpad",
"Autocross",
"Acceleration", // Event type for acceleration tests.
"Endurance", // Event type for endurance tests.
"Skidpad", // Event type for skidpad tests.
"Autocross", // Event type for autocross tests.
];

export const location: string[] = ["MRDC", "Michigan", "Rome", "SCC"];
/**
* Represents the list of possible locations.
*
* These are predefined locations where events have occurred.
* This constant can be used for filtering data or displaying location options in Storybook components.
*/
export const location: string[] = [
"MRDC", // Location for the MRDC event.
"Michigan", // Location for the Michigan event.
"Rome", // Location for the Rome event.
"SCC", // Location for the SCC event.
];
15 changes: 15 additions & 0 deletions src/data/sampledata.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Represents information about an MCAP (Model, Configuration, and Analysis Protocol) file and its associated data.
* Each entry in the array corresponds to a specific event, containing metadata about files, content, and event details.
*
* @typedef {Object} MCAPFileInformationNew
* @property {string} id - A unique identifier for the event.
* @property {Array<{file_name: string, signed_url: string}>} mcap_files - A list of MCAP files related to the event. Each file is represented by its name and a signed URL to access the file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our index.d.ts file we have a type called FileType. I think it would be easier to say that mcap_files is an Array.

* @property {Array<{file_name: string, signed_url: string}>} mat_files - A list of MAT files associated with the event. Similar to `mcap_files`, each MAT file has a file name and signed URL.
Copy link
Contributor

@jjoel1630 jjoel1630 Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing for mat_files

* @property {Array<{content: string, signed_url: string}>} content_files - A list of content files, each having a name (`content`) and a signed URL for access.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we have a type called ContentFileType, so maybe saying Array is better?

* @property {string} date - The date when the event occurred, formatted as MM-DD-YYYY.
* @property {string} location - The location where the event took place.
* @property {string} notes - Additional notes or comments about the event.
* @property {string} event_type - The type of event (e.g., "acceleration", "endurance").
* @property {Object} schema - An object containing versioning information for the event's schema. Each schema property represents a version string.
*/
export const data: MCAPFileInformationNew[] = [
{
id: "505deb4b-44a8-48dd-9da6-a671c1d3eccd",
Expand Down
Loading
Loading