fix: empty state error handling added and page empty state key updated (#3915)

This commit is contained in:
Anmol Singh Bhatia 2024-03-08 17:57:48 +05:30 committed by GitHub
parent 2074bb97db
commit cc069b61aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -39,6 +39,10 @@ export const EmptyState: React.FC<EmptyStateProps> = (props) => {
} = useUser();
// theme
const { resolvedTheme } = useTheme();
// if empty state type is not found
if (!EMPTY_STATE_DETAILS[type]) return null;
// current empty state details
const { key, title, description, path, primaryButton, secondaryButton, accessType, access } =
EMPTY_STATE_DETAILS[type];

View File

@ -69,7 +69,7 @@ export enum EmptyStateType {
PROJECT_VIEW = "project-view",
PROJECT_PAGE = "project-page",
PROJECT_PAGE_ALL = "project-page-all",
PROJECT_PAGE_FAVORITE = "project-page-favorite",
PROJECT_PAGE_FAVORITE = "project-page-favorites",
PROJECT_PAGE_PRIVATE = "project-page-private",
PROJECT_PAGE_SHARED = "project-page-shared",
PROJECT_PAGE_ARCHIVED = "project-page-archived",
@ -475,8 +475,8 @@ const emptyStateDetails = {
"Pages help you organise your thoughts to create wikis, discussions or even document heated takes for your project. Use it wisely!",
path: "/empty-state/pages/all",
},
"project-page-favorite": {
key: "project-page-favorite",
"project-page-favorites": {
key: "project-page-favorites",
title: "No favorite pages yet",
description: "Favorites for quick access? mark them and find them right here.",
path: "/empty-state/pages/favorites",