diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/SessionsBy.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/SessionsBy.tsx index e1afe2265..2ce690680 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/SessionsBy.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/SessionsBy.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Button, Space } from 'antd'; import { filtersMap } from 'Types/filter/newFilter'; -import { Icon } from 'UI'; +// import { Icon } from 'UI'; import { Empty } from 'antd'; +import { Info } from 'lucide-react' import { ArrowRight } from 'lucide-react'; import CardSessionsByList from 'Components/Dashboard/Widgets/CardSessionsByList'; import { useModal } from 'Components/ModalContext'; @@ -57,10 +58,10 @@ function SessionsBy(props: Props) { image={null} style={{ minHeight: 220 }} className="flex flex-col items-center justify-center" - imageStyle={{ height: 60 }} + imageStyle={{ height: 0}} description={ -
- +
+ No data available for the selected period.
} diff --git a/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx b/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx index a59e7aaea..ca1a800b1 100644 --- a/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx +++ b/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx @@ -29,13 +29,13 @@ function AddCardSelectionModal(props: Props) { return ( <> - +
onClick(true)}> diff --git a/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx b/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx index 56c73b692..6be30c7b5 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/DashboardList.tsx @@ -30,7 +30,7 @@ function DashboardList({ siteId }: { siteId: string }) { title: 'Title', dataIndex: 'name', width: '25%', - render: (t) =>
{t}
, + render: (t) =>
{t}
, }, { title: 'Last Modified', @@ -46,6 +46,7 @@ function DashboardList({ siteId }: { siteId: string }) { width: '16.67%', sorter: (a, b) => a.owner?.localeCompare(b.owner), sortDirections: ['ascend', 'descend'], + render: (owner) =>
{owner}
, }, { title: ( @@ -63,7 +64,7 @@ function DashboardList({ siteId }: { siteId: string }) { width: '16.67%', dataIndex: 'isPublic', render: (isPublic: boolean) => ( - : }> + : } bordered={false} className='rounded-lg'> {isPublic ? 'Team' : 'Private'} ), @@ -103,16 +104,16 @@ function DashboardList({ siteId }: { siteId: string }) { return ( list.length === 0 && !dashboardStore.filter.showMine ? (
- } - imageStyle={{ - width: imageDimensions.width, - height: imageDimensions.height, - margin: 'auto', - padding: '2rem 0' - }} - description={emptyDescription} - /> + } + imageStyle={{ + width: imageDimensions.width, + height: imageDimensions.height, + margin: 'auto', + padding: '2rem 0' + }} + description={emptyDescription} + />
) : ( ) ); - } export default connect((state: any) => ({ diff --git a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/SelectCard.tsx b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/SelectCard.tsx index c200c4a82..bdc5dd0e6 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/SelectCard.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/SelectCard.tsx @@ -1,5 +1,6 @@ -import React, { useMemo } from 'react'; +import React, { useMemo, useState, useEffect } from 'react'; import { Button, Input, Segmented, Space } from 'antd'; +import { Info } from 'lucide-react'; import { CARD_LIST, CARD_CATEGORIES, CardType } from './ExampleCards'; import { useStore } from 'App/mstore'; import Option from './Option'; @@ -21,6 +22,15 @@ const SelectCard: React.FC = (props: SelectCardProps) => { const { metricStore, dashboardStore } = useStore(); const dashboardId = window.location.pathname.split('/')[3]; const [libraryQuery, setLibraryQuery] = React.useState(''); + const [headerText, setHeaderText] = useState(''); + + useEffect(() => { + if (dashboardId) { + setHeaderText(isLibrary ? 'Your Library' : 'Create Card'); + } else { + setHeaderText('Select a card template to start your dashboard'); + } + }, [dashboardId, isLibrary]); const handleCardSelection = (card: string) => { metricStore.init(); @@ -29,7 +39,7 @@ const SelectCard: React.FC = (props: SelectCardProps) => { const cardData: any = { metricType: selectedCard.cardType, name: selectedCard.title, - metricOf: selectedCard.metricOf + metricOf: selectedCard.metricOf, }; if (selectedCard.cardType === FUNNEL) { @@ -43,14 +53,16 @@ const SelectCard: React.FC = (props: SelectCardProps) => { }; const cardItems = useMemo(() => { - return CARD_LIST.filter((card) => card.category === selected && (!card.isEnterprise || card.isEnterprise && isEnterprise)) + return CARD_LIST.filter((card) => card.category === selected && (!card.isEnterprise || (card.isEnterprise && isEnterprise))) .map((card) => (
- +
)); }, [selected]); @@ -73,18 +85,22 @@ const SelectCard: React.FC = (props: SelectCardProps) => { return ( <> - +
- {dashboardId ? (isLibrary ? 'Your Library' : 'Create Card') : 'Select a template to create a card'} + {headerText} + {headerText === 'Select a card template to start your dashboard' && ( +
+ Following card previews are based on mock data for illustrative purposes only. +
+ )}
{isLibrary && ( - {selectedCards.length > 0 ? ( + {selectedCards.length > 0 && ( - ) : ''} - + )} setLibraryQuery(value.target.value)} @@ -93,15 +109,17 @@ const SelectCard: React.FC = (props: SelectCardProps) => { )}
- {!isLibrary && } - - {isLibrary ? - : - } + {isLibrary ? ( + + ) : ( + + )} ); }; @@ -115,11 +133,11 @@ const CategorySelector: React.FC = ({ setSelected, select ({ label: