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 fix/dsc-namespace into develop #668

Merged
merged 25 commits into from
Feb 28, 2024
Merged

Pulling fix/dsc-namespace into develop #668

merged 25 commits into from
Feb 28, 2024

Conversation

github-actions[bot]
Copy link
Contributor

No description provided.

…k for reusability

The container styles in the HeaderRow component have been extracted into a makeStyles hook called "container" to improve code organization and reusability. This allows for easier customization of the container styles and promotes consistency throughout the application.
…nter" for better clarity and consistency

The NAMESPACE value has been changed from "dsc" to "stockcenter" to provide better clarity and consistency in the codebase.
Copy link

coderabbitai bot commented Feb 28, 2024

Important

Auto Review Skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.73%. Comparing base (5de4ad6) to head (a2e6c44).
Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #668      +/-   ##
===========================================
- Coverage    94.74%   94.73%   -0.01%     
===========================================
  Files          190      190              
  Lines        14203    14199       -4     
  Branches       492      492              
===========================================
- Hits         13456    13452       -4     
  Misses         747      747              
Files Coverage Δ
...ckages/ui-common/src/EditablePages/ContentView.tsx 100.00% <100.00%> (ø)
...kages/ui-common/src/EditablePages/EditableView.tsx 100.00% <100.00%> (ø)

The import statement for the Container component from "@material-ui/core" has been removed as it is no longer used in the code. Additionally, the wrapping Container component has been removed from the JSX structure as it is no longer necessary. This improves the code by removing unnecessary dependencies and simplifying the component structure.
… container component

The import statement for the `Container` component from `@material-ui/core` is removed as it is not being used in the component. Additionally, the unnecessary wrapping `Container` component is removed to simplify the structure of the component.
…r component with a fragment

The import statement for the Container component from "@material-ui/core" is removed as it is not being used in the code. The Container component is replaced with a fragment (<>) to avoid unnecessary wrapping of the components.
The Container component from the Material-UI library is no longer needed in the AddPageView component. It has been removed to simplify the code and improve readability.
The home page has been moved under the directory pages/index. This allows us to add subpaths for editable / edit versions of the homepage.
… result

The Homepage component now makes use of the useContentBySlugQuery hook from the dicty-graphql-schema package to fetch content based on a specific slug. The result of the query is then matched using the ts-pattern library to conditionally render different components based on the query result. This allows for dynamic rendering of content on the homepage. Additionally, there was a fix in the import statement for the FileLinks component to ensure proper functionality.
… module

The unused import statement for IntroEditor has been removed to clean up the code. An import statement for the ACCESS constant from the "auth" module has been added to enable access control functionality.
The editable.tsx file is a new component that is added to the index page of the stock-center application. This component is responsible for rendering the main homepage content and provides an editable view for content administration. It fetches the content data by slug using the useContentBySlugQuery hook from the dicty-graphql-schema package. The component also includes various UI elements such as Grid, Title, Heading, Slide, CatalogLinks, and FileLinks from the @dictybase/ui-dsc package. The component handles different scenarios based on the result of the query, including rendering the editable view, displaying a loading indicator, showing an error message, or rendering a fallback message. The component is exported as the default export and has private access with the "content-admin" role.
…ge content

The EditHomepage component is added to allow editing of the homepage content in the stock-center application. This component fetches the content by slug and displays it in an EditView component. It also includes additional UI components such as Title, Heading, Slide, CatalogLinks, and FileLinks. The component is only accessible to users with the "content-admin" role.
… fetching user token and information

The code in the edit.tsx file has been refactored to use the useTokenAndUser hook from the "auth" module. This hook simplifies the process of fetching the user token and information by abstracting away the need to manually handle the authentication state and token retrieval. This improves code readability and maintainability.
…trieval

The useTokenAndUser hook is added to handle the retrieval of token and user data. This hook utilizes the useLogto hook from the @logto/react package to fetch the user info and access token. The token and user data are stored in state variables and can be accessed by components that use this hook. This hook is useful for managing authentication and authorization in the application.
…dUser hook for fetching token and user data

The code in Edit.tsx has been refactored to use the useTokenAndUser hook instead of the useState and useEffect hooks to fetch the token and user data. This improves code readability and reduces duplication by encapsulating the logic in a custom hook.
…or container to prevent overflow issues

The height CSS property for the editor container has been changed to maxHeight to prevent potential overflow issues. This change ensures that the container's height is limited to 70vh when it is editable, while allowing it to adjust its height automatically when it is not editable.
…in authNavbarData.json

The link for the "Stock Center Home" item in the authNavbarData.json file has been updated from "/stockcenter" to "/stockcenter/editable". This change reflects a modification in the routing structure of the application.
The ShowHomepage component is added to serve as the main homepage for the DSC (Stock Center) application. It imports various UI components from the "@dictybase/ui-dsc" and "@dictybase/ui-common" packages to build the homepage layout. The component also uses the "useContentBySlugQuery" hook from the "dicty-graphql-schema" package to fetch content data based on a specific slug. The component handles different scenarios such as loading, error, and successful data retrieval to display the appropriate UI components. The component is exported as the default export and also exports an "access" constant for public access.
…mmon" to fix error display

The import statement for the OtherError component from "@dictybase/ui-common" was added to fix the error display. The Homepage component was renamed to EditableHomepage to improve clarity and consistency with the naming conventions.
…" to display error message

The import statement for the OtherError component from "@dictybase/ui-common" was added to the file. This allows the error message to be displayed properly when there is an error.
…for fetching user token and information

The code in addpage.tsx has been refactored to use the useTokenAndUser hook from the "auth" module. This hook simplifies the process of fetching the user token and information by abstracting away the logic for fetching the access token and user data. This improves code readability and maintainability.
…useTokenAndUser for fetching token and user data

The AddPage component has been refactored to use the custom hook useTokenAndUser instead of the useState and useEffect hooks to fetch the token and user data. This improves code readability and reduces duplication of code.
…better layout responsiveness

The maxWidth value for the Container component in FrontPageApp.tsx has been changed from "xl" to "lg" to improve the responsiveness of the layout.
@pull-request-size pull-request-size bot added size/L and removed size/S labels Feb 28, 2024
…epage, and ShowHomepage components

The error handling in the EditHomepage, EditableHomepage, and ShowHomepage components has been simplified by removing unnecessary code. The error handling now uses a single line of code to render the <OtherError /> component when an error occurs. This improves code readability and reduces redundancy.
…omepage and EditableHomepage

The CatalogLinks component in both EditHomepage and EditableHomepage now receives an isAuthorized prop. This change allows the CatalogLinks component to conditionally render content based on the authorization status, improving the functionality and user experience of the application.
… files

The files `home/edit.tsx` and `home/editable.tsx` have been deleted. These files contained unused components and were no longer needed in the project. Removing them helps to keep the codebase clean and reduces unnecessary complexity.
@ktun95 ktun95 merged commit 1eebb49 into develop Feb 28, 2024
5 checks passed
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