-
Notifications
You must be signed in to change notification settings - Fork 1
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 fix/genome-page-linting into develop #676
Conversation
…string The eslint rule sonarjs/no-duplicate-string is disabled in the mockOntologyData.ts file. This is done to allow duplicate strings in the file, which may be necessary for mocking purposes.
…ties for single quotes The string in the Typography component has been updated to use HTML entities (') for single quotes instead of regular single quotes. This is done to ensure proper rendering of the string in the UI.
…n syntax The Loader components in the genome-page application have been refactored to use a more concise syntax for creating arrays. Instead of using the spread operator with new Array(), the new Array() syntax is used directly. This improves code readability and reduces unnecessary code duplication.
…r import/no-default-export The default export is added to the next.config.mjs file to comply with the ES module syntax. The eslint rule import/no-default-export is disabled to allow the default export.
The changes were made to update the import paths and export statements in various files. This was done to improve the organization and structure of the codebase, ensuring that the correct components are exported as default.
Important Auto Review SkippedBot user detected. To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
…peScript version The react-markdown mock file "react-markdown.js" has been deleted and replaced with a TypeScript version "react-markdown.tsx". This change was made to improve the codebase by using TypeScript instead of JavaScript for better type safety and development experience.
…o point to the correct file extension The moduleNameMapper in the jest.config.js file has been updated to point to the correct file extension for the "react-markdown" module. It was previously pointing to a .js file, but it has been changed to point to a .tsx file. This change ensures that the correct file is used for mocking the "react-markdown" module during testing.
…d withDataFilter The export statements for emptyArray and withDataFilter in withDataFilter.ts have been combined into a single export statement. This improves code readability and reduces redundancy.
…sRow for clarity and consistency The component name "PhenotypeRow" has been changed to "OrthologsRow" to accurately reflect its purpose and improve code readability. The import statement in "RenderOrthologs.tsx" has been updated to use destructuring to match the export statement in "OrthologsRow.tsx".
…nent to render the Protein Information page for a given gene id The ProteinInformationPageWrapper component is added to render the Protein Information page for a specific gene id. It uses the useRouter hook from Next.js to get the gene id from the query parameters. It then uses the useGeneQuery hook from the dicty-graphql-schema package to fetch the gene data. The component conditionally renders a loading spinner, an error page if there is an error, or the ProteinInfoContainer component if the data is available.
The import statement for the Login component was updated to import it as a named export instead of a default export. This ensures that the correct component is imported and used in the test file.
…fig from "./clientConfig" to import { clientConfig } from "./clientConfig" The import statement has been updated to use the named import syntax instead of the default import syntax. This change improves clarity and consistency in the codebase.
… from common/utils/clientConfig to fix import error The import statement for clientConfig in OauthSignHandler.test.tsx has been updated to use a named import instead of a default import. This fixes an import error and ensures that the correct module is imported.
…icCoordsTable component The import statement for the GenomicCoordsTable component has been updated to import the TableDisplay component from the GenomicCoordsTable file. This change improves the clarity and consistency of the code.
… camelcase naming convention The eslint-disable comment was removed to enforce the camelcase naming convention consistently throughout the codebase.
… conditionally The code has been refactored to activate MSW and enable the mock server conditionally. The `enableMock` function is now awaited to ensure that the mock server is properly enabled. The `main` function is called to activate MSW and enable the mock server based on the value of the `NEXT_PUBLIC_MOCK_SERVER` environment variable. This allows for easy switching between using the mock server or the actual server for testing and development purposes.
…arameter names in onChange event handlers, and update key prop in option elements The commit removes unused imports and variables in the BlastDatabaseRow component. It also fixes the parameter names in the onChange event handlers to match the expected types. Additionally, it updates the key prop in the option elements to use the actual value instead of the index.
…nk_genomic_fragment and genbank_mrna properties The null values for the genbank_genomic_fragment and genbank_mrna properties have been changed to undefined. This change improves consistency and aligns with the use of undefined for other properties in the mockAssociatedAda2 object.
The package.json file now includes a configuration for msw (Mock Service Worker) to specify the worker directory as "public". This configuration allows msw to correctly locate and serve the mock service worker files from the specified directory.
…issing ContentId types The switch statement in the `returnPanelContentById` function had several redundant cases that were not being used. These cases included "Gene Name", "Gene ID", "Gene Product", "Description", "Protein Length", "Molecular Weight", "Subcellular location", and "Protein existence". These cases were removed as they were not necessary. Additionally, the missing ContentId types were added to the `ContentId` union type to ensure type safety and improve code readability.
…nctions The index variables in the map functions for "Name Description", "Alternative Gene Names", and "Expression" panels were not being used and have been removed to improve code readability.
The returnPanelContentById function has been reorganized to be defined before it is called.
…nPanelContentById function The 'gene' parameter in the returnPanelContentById function is currently not used, so it has been removed to improve code readability and eliminate unnecessary complexity.
…hen the section does not exist The panelGenerator function now returns an empty array instead of undefined when the section does not exist. This change improves the consistency of the return value and allows for easier handling of the result in the calling code.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #676 +/- ##
===========================================
- Coverage 94.75% 94.75% -0.01%
===========================================
Files 192 192
Lines 14249 14241 -8
Branches 494 494
===========================================
- Hits 13502 13494 -8
Misses 747 747
|
… file The eslint rule for array index key is disabled in the WikiLoader.tsx file. This is done to suppress the warning generated by the rule and allow the usage of array index as keys in the component.
… data available for the requested gene The 'res' parameter in the handler function for the "Gene" query has been renamed to 'response' to improve clarity and consistency with the naming conventions. Additionally, an error response has been added for cases where there is no mock data available for the requested gene, providing a helpful error message indicating that there is no mock data available for the specified gene.
…defined for consistency The genbank_mrna property is now set to undefined instead of null to maintain consistency with the rest of the codebase.
… of 'new Array<Gene>()' with '[] as Array<Gene>' for related_genes property The usage of 'new Array<Gene>()' to initialize the related_genes property is replaced with '[] as Array<Gene>'. This change improves code readability and follows a more concise syntax for creating an empty array.
In many React components, array indices were improperly used as keys. In these cases, a more suitable, unique value of the array item was used as a key instead. In the case of loaders or other components that had no unique identifies, the rule was disabled for that line or file.
…nt variables The turbo.json file now includes a "globalEnv" configuration section that lists the required environment variables for the application. This ensures that the application has access to the necessary environment variables for proper functionality.
In test files run by jest, import cannot be used, so require is fine.
… spyOn The import of useRouter in the ReferencesContainer test file has been refactored to use Jest's spyOn function instead of the dynamic import. This change improves the readability and maintainability of the code.
This change was made to align with the unicorn/filecase name rule. The corresponding imports were also updated to reflect the change.
…to anchor tag for better accessibility The hover effect on the link has been removed to improve the overall styling consistency. Additionally, the span element has been replaced with an anchor tag to enhance accessibility and provide better semantics for screen readers.
…tyles' to improve code readability The variable 'persistencePluginStyles' is currently not being used in the code. By commenting it out, we improve the code's readability and make it clear that this variable is not currently needed.
The eslint-disable camelcase comments have been removed from multiple files to ensure consistent coding style and adherence to the camelCase naming convention.
…improve code cleanliness and reduce clutter The commit removes unused imports and unused variables in the citation.ts file. This improves the code cleanliness and reduces clutter, making the code easier to read and maintain.
…ed test content with actual data content The import statement for the unused variable 'x' has been removed to clean up the code. The hardcoded test content has been replaced with the actual content from the 'data' object to ensure that the correct content is displayed in the editor.
…sEnv for better readability and adherence to naming conventions The ProcessEnvironment interface has been renamed to ProcessEnv to improve code readability and adhere to common naming conventions. This change helps to make the code more understandable and maintainable.
…rocess.env variables The type casting for process.env.NEXT_PUBLIC_GRAPHQL_SERVER and process.env.NEXT_PUBLIC_DEPLOY_ENV variables is removed as it is unnecessary. The variables are already of type string and do not require explicit casting.
The NODE_ENV environment variable is added to the globalEnv array in turbo.json. This allows the application to access and utilize the NODE_ENV variable for environment-specific configurations and optimizations.
…ared-env-vars in OauthCallback.test.tsx The eslint-disable comments for turbo/no-undeclared-env-vars and camelcase have been removed from multiple files. This ensures that the code follows the linting rules consistently and improves code quality.
The eslint-disable-next-line comments were removed as they were unnecessary and no longer needed. This improves code readability and maintainability.
The eslint rule `jsx-a11y/anchor-is-valid` is disabled for the `PanelWrapper.tsx` file. This is done to allow the usage of anchor elements without href attributes, which is a common pattern in Next.js applications.
…configuration in oauthConfig The clientConfig file is no longer needed and has been removed. The configuration for OAuth clients has been consolidated into the oauthConfig file. This is a temporary measure to allow testing and linting to pass until the previous auth code can be removed.
No description provided.