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

Pulling feat/strains-catalog into develop #437

Merged
merged 265 commits into from
Aug 22, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

No description provided.

@ktun95
Copy link
Collaborator

ktun95 commented Jul 28, 2023

flowchart TD

X([Strains])
A[Catalog Wrapper]
B1[StrainCatalogContainer]
C[StrainDetailsContainer]


X -->|"/strains\nstockType={strain}"| A
A -->|"stockType === 'strain'"| B1
B1 -->|strains/:id|C

classDef state fill:#ab3017
class A,B1,B2 state
Loading

@ktun95
Copy link
Collaborator

ktun95 commented Jul 28, 2023

StrainDetailsContainer

ktun95 and others added 27 commits August 3, 2023 08:26
This commit adds unit tests for the GenesDisplay component. The first test checks if the component renders the correct number of LinkTags based on the provided genes array. It also checks if the LinkTags have the correct text content. The second test checks if no LinkTags are rendered when the genes array is empty. These tests ensure that the GenesDisplay component behaves as expected and displays the correct information.
The LinkTag component is added to the catalog directory in the ui-dsc package. This component is a tag-style display for showing links. It takes in two properties: item (the item to link to) and route (the subroute to use, such as publication or gene). The component renders a Button component with a link to the specified route and item. It also includes an external link icon from the FontAwesomeIcon component.
The ts-pattern package is added as a dependency to the ui-dsc package. This package provides a set of utilities for working with patterns and pattern matching in TypeScript.
The StrainPhenotypeListItem component is added to the ui-dsc package. This component renders a list item for displaying information about a strain's phenotype. It includes the strain's label, associated genes, and a link to a publication if available. The component also has tests to ensure that the expected list items are included and that publications are not displayed when not passed as a prop.
The StrainPhenotypeListHeader component is added to the catalog directory in the ui-dsc package. This component represents the list of headers at the top of the phenotype display. It includes four columns: Phenotype, Notes, Assay & Environment, and Reference(s).
…enotypeListHeader component

This commit adds a new unit test file, `StrainPhenotypeListHeader.test.tsx`, which tests the rendering of the `StrainPhenotypeListHeader` component. The test verifies that the component renders the expected text for "Phenotype", "Notes", and "Assay".
This commit adds the mockStrain.ts file to the ui-dsc package. This file contains mock data for the Strain type, including examples of available strains, unavailable strains, strains with phenotypes, strains from the Genome Wide Dictyostelium Insertion bank (GWDI), and catalog available strains. The mock data is used for testing and development purposes.
The mockStrain.ts file provides a convenient way to generate realistic and consistent mock data for the Strain type, which helps in simulating different scenarios and testing various functionalities of the application.
The DetailsHeader component is added to the catalog module in the ui-dsc package. This component is used as the header at the top of every stock details page. It displays the name and ID of the stock, and includes a copy icon for the ID.
…en while fetching stock data

The DetailsLoader component is added to the catalog directory in the ui-dsc package. This component is used to display a loading screen while fetching stock data. It uses the Skeleton component from the react-loading-skeleton library to show placeholders for the content that is being loaded.
This commit adds a new file `styles.tsx` in the `catalog` directory of the `ui-dsc` package. The file contains styles for the catalog component. The styles include CSS properties for various elements such as card headers, details, list items, IDs, copy icons, and error messages. The `makeStyles` function from `@material-ui/core/styles` is used to define the styles.
The phenotypeStyles.tsx file is added to the catalog folder in the ui-dsc package. This file contains the makeStyles function from the @material-ui/core/styles library, along with styles for various elements such as paper, row, item, listHeaders, list, and button. These styles are used for the phenotype catalog component in the UI.
The new file `SearchPhenotypeListItem.test.tsx` contains unit tests for the `SearchPhenotypeListItem` component. The tests ensure that the component renders the expected list items, including the strain descriptor, associated genes, and publication link. It also includes a test to verify that the component does not include publications when not passed as a prop. These tests help ensure the correctness and reliability of the component.
… results for phenotypes

The SearchPhenotypeListItem component is added to the ui-dsc package. This component is responsible for rendering a single item in the search results for phenotypes. It displays information about a strain, including its label, associated genes, and a publication. The component also includes styling using Material-UI.
…-center repo

Previously, the incorrect file was copied from the dicty-stock-center repository and renamed StrainPhenotypeListItem. This commit brings in the correct file associated withe displaying the strain phenotype details in the StrainDetailsContainer.
…order

This commit adds a new test file, StrainPhenotypeList.test.tsx, which tests the rendering of phenotype links in alphabetical order. The test cases include different phenotypes and their expected indices in the rendered list. The test uses the render function from @testing-library/react and the MemoryRouter component from react-router-dom to render the StrainPhenotypeList component with the provided phenotypes. It then checks if the rendered phenotype links match the expected indices.
The StrainPhenotypeList component is added to the ui-dsc package. This component provides a list of phenotypes for a given strain. It uses the Material-UI Paper component for styling and renders a header component (StrainPhenotypeListHeader) and a list of phenotype items (StrainPhenotypeListItem). The phenotypes are sorted alphabetically by phenotype name using the fp-ts library.
…tem component

This commit adds a new unit test file for the StrainPhenotypeListItem component. The test ensures that the component renders correctly by checking if the expected elements and data are present in the rendered output.
The console.log statement was removed as it was no longer needed for debugging purposes.
The fp-ts dependency is added to the package.json file in the ui-dsc package. This dependency is required for some functional programming utilities and types used in the codebase.
…l' in data array

The 'name' property in the data array has been renamed to 'label' to improve clarity and consistency with the naming conventions. This change ensures that the property name accurately reflects its purpose, which is to represent the label or name of an item.
The AddToCartDialog component is added to the catalog package in the ui-dsc package. This component is responsible for displaying a dialog box when an item is added to the cart. It receives various properties such as the strain data, functions to handle checked items, show/hide the dialog, and toggle hover state. The dialog box includes a title, content, and actions.
…onality

This commit adds a new unit test for the close button functionality in the AddToCartDialog component. The test verifies that the setCheckedItems and setShowDialog functions are called when the "View Cart" button is clicked.
The test case now includes a test for the setHover function. This ensures that the setHoverSpy function is called once when clicking the close button.
This commit adds a new file `mockPhenotype.ts` which contains an array of mock data for phenotypes. Each phenotype object includes properties such as phenotype, note, assay, environment, and publication. This mock data will be used for testing and development purposes.
The StrainDetailsContainer component now includes a conditional render, indicating that it will render different components based on the stockType. Additionally, two new components, DetailsListItem and PhenotypeList, have been added to the diagram. This update improves the clarity and accuracy of the diagram by reflecting the changes made to the code.
The fees module is added to the ui-dsc package, which exports an object containing different fee values. This module will be used to calculate fees in the application.
In addition, the types export in the types.ts file is updated to include an alias for the StrainItem type as CartItem. This provides more clarity and consistency when using the types in the codebase.
The export statement for the OutlinedDropdown component is changed from default export to named export. This improves consistency with the codebase and allows for better import syntax when using the component in other files.
Added unit tests for the CartIcon component to ensure that it correctly indicates the number of items in the cart and displays a notice if the cart is full. The tests cover scenarios where there are items in the cart, no items in the cart, and when the cart is full.
The BreadcrumbsLink component is added to handle the display of breadcrumbs for routes that are not the final list item. It takes in the pathname from the URL and renders either a clickable link or non-clickable text based on the pathname. The component also includes a mapping of route names for display purposes.
…mponent

This commit adds unit tests for the BreadcrumbsLink component. The tests cover both non-clickable breadcrumbs and breadcrumb links for different paths. It ensures that the component renders the correct text content for each path and that the links are rendered correctly. It also includes a test for non-existent routes, where an empty link should be rendered.
…ation breadcrumbs in the DSC app

The Breadcrumbs component is added to the DSC app to display navigation breadcrumbs. It uses Material-UI components such as Breadcrumbs, Link, and Typography to create the breadcrumb structure. The component also includes a helper function, convertBreadcrumbTitle, to convert specific breadcrumb titles into the desired format.
The Breadcrumbs component is being tested to ensure that it correctly displays the breadcrumb links based on the current route. The tests cover various subpages and edge cases, such as removing extra characters from the breadcrumb text and not rendering breadcrumbs on the homepage.
The HeaderRow component is added to the project. It is a cart component that displays between the Navbar and body content on every page. It consists of a Breadcrumbs component and a CartIcon component that shows the current number of added items.
The unused import of `Navigate` from `react-router-dom` has been removed. Additionally, a new component called `HeaderRow` has been added to the main content of the application. This component is responsible for rendering a header row in the UI.
…e/free-solid-svg-icons

The import statement for the copy icon has been updated to import the faCopy icon from the @fortawesome/free-solid-svg-icons package. This ensures that the correct icon is used for the copy functionality in the DetailsHeaderCopyIcon component.
…rray syntax to using the generic Array type for publications, genes, and genotypes variables

The type casting for the publications, genes, and genotypes variables has been updated to use the generic Array type instead of the array syntax. This improves readability and consistency with the rest of the codebase.
The listContent query is added to retrieve a list of content items with a specified limit. This allows for pagination and fetching a subset of content items at a time. The ListNewsContent query is specifically added to retrieve a list of news content items with a specified limit. This query includes the id, slug, content, name, updated_by (including first_name and last_name), and updated_at fields for each news content item.
…omponent

The property names in the RecentNewsPreview and RecentNewsPreviewMetadata components have been updated to match the naming conventions. The "updatedBy" property is now "updated_by" and "updatedAt" is now "updated_at". This improves consistency and readability in the codebase.
…ult-export

The eslint-disable-next-line import/no-default-export comment is removed to ensure that the codebase adheres to the linting rules and promotes better code organization and maintainability.
…slug

The deleteContentBySlug mutation has been added to the GraphQL schema and generated code. This mutation allows deleting content by providing the slug as an input parameter. This provides a more convenient way to delete content based on its slug instead of its ID.
… assertion

The property names in the getByText assertion have been updated to match the actual property names in the test data. This ensures that the test accurately checks for the presence of the correct data in the UI.
The import and usage of the `CartHeader` component has been removed from the `EmptyCart` component as it is no longer needed. This improves code cleanliness and removes unnecessary dependencies.
The CartHeader component is added to the cart page to provide a header section for the cart. This improves the overall layout and user experience of the cart page.
The test case for the `in_stock` property is added to the `StrainDetailsCardHeader` component. This ensures that the component correctly handles the `in_stock` property and displays the appropriate UI based on its value.
…o snake_case

The property names in the depositor object have been changed from camelCase (firstName, lastName) to snake_case (first_name, last_name) to align with the naming conventions used in the codebase.
…elCase to snake_case

The eslint rule for camelcase is disabled in the PublicationDisplay.test.tsx file to allow the use of snake_case property names. The property names in the publication object and authors array are updated from camelCase to snake_case to align with the naming conventions. This improves consistency and readability in the codebase.
…ry component

The calculation of the total fee for each item in the OrderSummary component has been simplified. The quantity calculation has been removed as it is no longer necessary. The fee is now displayed as a fixed value without multiplication.
To match the field names of the graphql schema, some of the property names of the mock strains were changed from camelCase to snake_case.
… to reflect the correct total

The quantity value in the test case has been updated from 2 to 1 to reflect the actual quantity of the item. The expected total value in the test case has been updated from $75.00 to $45.00 to reflect the correct total based on the updated quantity.
…Function test

The eslint camelcase rule is disabled in the CatalogTableDisplay.test.tsx file to allow the use of snake_case variable names. The path in the Route component is updated to "/strains/:id" in the cellFunction and rowFunction tests to match the expected route. The in_stock property is added to the testStrain object in the cellFunction test and to the testListStrains objects in the rowFunction test to reflect the updated data structure.
The rowFunction export is no longer used in the CatalogTableDisplay component, so it has been removed to improve code cleanliness and remove unnecessary exports.
…export comment

The eslint-disable-next-line import/no-default-export comment is removed to ensure adherence to the linting rules and maintain code consistency.
The import statement for the Paper component is removed as it is no longer being used in the file. This improves code cleanliness and removes unnecessary dependencies.
The file App.test.tsx was removed as it was no longer needed.
The shouldFocusError option is removed from the useForm hook in both PaymentPage.tsx and ShippingPage.tsx components. This option was unnecessary and not being used, so it was removed to simplify the code and improve readability.
@ktun95 ktun95 merged commit 2fb4cfa into develop Aug 22, 2023
3 checks passed
@ktun95 ktun95 deleted the feat/strains-catalog branch August 22, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant