-
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/dsc-namespace into develop #668
Conversation
…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.
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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
|
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.
…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.
No description provided.