diff --git a/web/src/components/Empty/Empty.styled.ts b/web/src/components/Empty/Empty.styled.ts index c967cda8f5..23a14630d4 100644 --- a/web/src/components/Empty/Empty.styled.ts +++ b/web/src/components/Empty/Empty.styled.ts @@ -1,16 +1,23 @@ import {Row} from 'antd'; import styled from 'styled-components'; +export const ActionContainer = styled.div` + align-items: center; + display: flex; + justify-content: center; +`; + export const Container = styled(Row)` height: calc(100% - 130px); `; export const Content = styled.div` + margin-bottom: 24px; text-align: center; `; export const Icon = styled.img` margin-bottom: 25px; - height: 115px; - width: 115px; + height: auto; + width: 140px; `; diff --git a/web/src/components/Empty/Empty.tsx b/web/src/components/Empty/Empty.tsx index 8a28e412d5..b6df19cdbe 100644 --- a/web/src/components/Empty/Empty.tsx +++ b/web/src/components/Empty/Empty.tsx @@ -6,11 +6,12 @@ import * as S from './Empty.styled'; interface IProps { message?: React.ReactNode; title?: string; + action?: React.ReactNode; } -const Empty = ({message = '', title = ''}: IProps) => ( +const Empty = ({message = '', title = '', action}: IProps) => ( - +
@@ -18,6 +19,7 @@ const Empty = ({message = '', title = ''}: IProps) => ( {title} {message} + {action} ); diff --git a/web/src/constants/Common.constants.ts b/web/src/constants/Common.constants.ts index 5d316de2b3..8d3a991c9e 100644 --- a/web/src/constants/Common.constants.ts +++ b/web/src/constants/Common.constants.ts @@ -20,6 +20,7 @@ export const RESOURCE_SEMANTIC_CONVENTIONS_URL = export const TRACE_DOCUMENTATION_URL = 'https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md'; +export const OPENING_TRACETEST_URL = 'https://docs.tracetest.io/getting-started/open/'; export const ADD_TEST_URL = 'https://docs.tracetest.io/web-ui/creating-tests'; export const ADD_TEST_SUITE_URL = 'https://docs.tracetest.io/web-ui/creating-test-suites'; export const ADD_TEST_OUTPUTS_DOCUMENTATION_URL = 'https://docs.tracetest.io/web-ui/creating-test-outputs'; diff --git a/web/src/gateways/TestRun.gateway.ts b/web/src/gateways/TestRun.gateway.ts index 8cbb29935a..6ef695260f 100644 --- a/web/src/gateways/TestRun.gateway.ts +++ b/web/src/gateways/TestRun.gateway.ts @@ -1,7 +1,6 @@ import TracetestAPI from 'redux/apis/Tracetest'; import {TRawTestSpecs} from 'models/TestSpecs.model'; - const TestRunGateway = () => ({ get(testId: string, take = 25, skip = 0) { return TracetestAPI.instance.endpoints.getRunList.initiate({testId, take, skip}); diff --git a/web/src/pages/Home/CreateButton.tsx b/web/src/pages/Home/CreateButton.tsx index 37c38e70e6..c15c00c347 100644 --- a/web/src/pages/Home/CreateButton.tsx +++ b/web/src/pages/Home/CreateButton.tsx @@ -3,16 +3,15 @@ import * as S from '../TestSuites/TestSuites.styled'; interface IProps { onCreate(): void; + title?: string; } -const CreateButton = ({onCreate}: IProps) => { - return ( - - - Create - - - ); -}; +const CreateButton = ({onCreate, title}: IProps) => ( + + + {title || 'Create'} + + +); export default CreateButton; diff --git a/web/src/pages/Home/Home.styled.tsx b/web/src/pages/Home/Home.styled.tsx index dd3c80e612..395fb7295b 100644 --- a/web/src/pages/Home/Home.styled.tsx +++ b/web/src/pages/Home/Home.styled.tsx @@ -74,3 +74,8 @@ export const ConfigIcon = styled.img` export const ConfigFooter = styled.div` margin: 20px 0; `; + +export const Link = styled.a` + color: ${({theme}) => theme.color.primary}; + font-weight: 600; +`; diff --git a/web/src/pages/Home/TestsList.tsx b/web/src/pages/Home/TestsList.tsx index ba2c12f044..6cda18aafc 100644 --- a/web/src/pages/Home/TestsList.tsx +++ b/web/src/pages/Home/TestsList.tsx @@ -7,7 +7,7 @@ import usePagination from 'hooks/usePagination'; import useTestCrud from 'providers/Test/hooks/useTestCrud'; import {useCallback, useState} from 'react'; import TracetestAPI from 'redux/apis/Tracetest'; -import {ADD_TEST_URL} from 'constants/Common.constants'; +import {ADD_TEST_URL, OPENING_TRACETEST_URL} from 'constants/Common.constants'; import HomeAnalyticsService from 'services/Analytics/HomeAnalytics.service'; import useDeleteResource from 'hooks/useDeleteResource'; import {useDashboard} from 'providers/Dashboard/Dashboard.provider'; @@ -73,15 +73,22 @@ const Tests = () => { emptyComponent={ - Use the Create button to create your first test. Learn more about test{' '} - - here. - + Hit the 'Create' button below to kickstart your testing adventure. Want to learn more about + tests? Just click{' '} + + here + + . If you don’t have an app that’s generating OpenTelemetry traces we have a demo for you. Follow these{' '} + + instructions + + ! } + action={ setIsCreateTestOpen(true)} title="Create Your First Test" />} /> } loadingComponent={} diff --git a/web/src/pages/TestSuites/TestSuites.styled.tsx b/web/src/pages/TestSuites/TestSuites.styled.tsx index 5eede5ba11..5db25d6a80 100644 --- a/web/src/pages/TestSuites/TestSuites.styled.tsx +++ b/web/src/pages/TestSuites/TestSuites.styled.tsx @@ -1,7 +1,16 @@ -import {Dropdown, Row, Space, Typography} from 'antd'; +import {Button as AntdButton, Dropdown, Row, Space, Typography} from 'antd'; import AllowButton from 'components/AllowButton'; import styled from 'styled-components'; +export const Button = styled(AntdButton)` + font-weight: 600; +`; + +export const Link = styled.a` + color: ${({theme}) => theme.color.primary}; + font-weight: 600; +`; + export const CreateTestButton = styled(AllowButton)` font-weight: 600; `; diff --git a/web/src/pages/TestSuites/TestSuitesList.tsx b/web/src/pages/TestSuites/TestSuitesList.tsx index 74f17d1758..a044783f4f 100644 --- a/web/src/pages/TestSuites/TestSuitesList.tsx +++ b/web/src/pages/TestSuites/TestSuitesList.tsx @@ -18,7 +18,7 @@ import CreateButton from '../Home/CreateButton'; import HomeFilters from '../Home/HomeFilters'; import Loading from '../Home/Loading'; -const {useGetTestSuiteListQuery} = TracetestAPI.instance; +const {useGetTestListQuery, useGetTestSuiteListQuery} = TracetestAPI.instance; const {onTestClick} = HomeAnalyticsService; type TParameters = {sortBy: SortBy; sortDirection: SortDirection}; @@ -28,6 +28,7 @@ const Resources = () => { const [isCreateTestSuiteOpen, setIsCreateTestSuiteOpen] = useState(false); const [parameters, setParameters] = useState(defaultSort); + const {data: testListData} = useGetTestListQuery({}); const pagination = usePagination(useGetTestSuiteListQuery, parameters); const onDelete = useDeleteResource(); const {runTestSuite} = useTestSuiteCrud(); @@ -70,17 +71,34 @@ const Resources = () => { emptyComponent={ - - Use the Create button to create your first test. Learn more about test suites{' '} - - here. - - - } - /> + !testListData?.total ? ( + navigate('/')} type="primary"> + Go To Tests Page + + } + /> + ) : ( + + It looks a bit empty here, doesn't it? Let's start by adding your first test suites. If + you want to learn more about test suits just click{' '} + + here + + . + + } + action={ + setIsCreateTestSuiteOpen(true)} title="Create Your First Test Suite" /> + } + /> + ) } loadingComponent={} {...pagination} diff --git a/web/src/pages/VariableSet/VariableSet.styled.tsx b/web/src/pages/VariableSet/VariableSet.styled.tsx index f821c5d564..7ff0be771e 100644 --- a/web/src/pages/VariableSet/VariableSet.styled.tsx +++ b/web/src/pages/VariableSet/VariableSet.styled.tsx @@ -118,3 +118,8 @@ export const InfoIcon = styled(CheckCircleOutlined)` cursor: pointer; margin: 4px; `; + +export const Link = styled.a` + color: ${({theme}) => theme.color.primary}; + font-weight: 600; +`; diff --git a/web/src/pages/VariableSet/VariableSetList.tsx b/web/src/pages/VariableSet/VariableSetList.tsx index b34a79e843..062931e461 100644 --- a/web/src/pages/VariableSet/VariableSetList.tsx +++ b/web/src/pages/VariableSet/VariableSetList.tsx @@ -23,11 +23,14 @@ const VariableSetList = ({onDelete, onEdit, query}: IProps) => { - Use the Create button to create your first variable set. Learn more about variable sets{' '} - here. + Hit the 'Create' button to create your first variable set. Want to learn more about + VariableSets? Just click{' '} + + here. + } />