change(ui): fix labels, small refactoring

This commit is contained in:
sylenien 2022-12-26 15:14:21 +01:00
parent 87c23310ed
commit 9ff3b2f017
3 changed files with 4 additions and 22 deletions

View file

@ -22,23 +22,12 @@ function WidgetPreview(props: Props) {
const metric: any = metricStore.instance;
const isTimeSeries = metric.metricType === TIMESERIES;
const isTable = metric.metricType === TABLE;
const drillDownFilter = dashboardStore.drillDownFilter;
const disableVisualization = metric.metricOf === FilterKey.SESSIONS || metric.metricOf === FilterKey.ERRORS;
// const period = dashboardStore.drillDownPeriod;
const chagneViewType = (e, { name, value }: any) => {
const changeViewType = (_, { name, value }: any) => {
metric.update({ [ name ]: value });
}
// const onChangePeriod = (period: any) => {
// dashboardStore.setDrillDownPeriod(period);
// const periodTimestamps = period.toTimestamps();
// drillDownFilter.merge({
// startTimestamp: periodTimestamps.startTimestamp,
// endTimestamp: periodTimestamps.endTimestamp,
// })
// }
const canAddToDashboard = metric.exists() && dashboards.length > 0;
return (
@ -57,7 +46,7 @@ function WidgetPreview(props: Props) {
className="my-3"
primary
icons={true}
onSelect={ chagneViewType }
onSelect={ changeViewType }
value={{ value: metric.viewType }}
list={ [
{ value: 'lineChart', name: 'Chart', icon: 'graph-up-arrow' },
@ -75,7 +64,7 @@ function WidgetPreview(props: Props) {
className="my-3"
primary={true}
icons={true}
onSelect={ chagneViewType }
onSelect={ changeViewType }
value={{ value: metric.viewType }}
list={[
{ value: 'table', name: 'Table', icon: 'table' },

View file

@ -90,15 +90,13 @@ function WidgetSessions(props: Props) {
}
}, [filter.startTimestamp, filter.endTimestamp, filter.filters, depsString, metricStore.sessionsPage, metricStore.clickMapSearch]);
return (
<div className={cn(className, "bg-white p-3 pb-0 rounded border")}>
<div className="flex items-center justify-between">
<div className="flex items-baseline">
<h2 className="text-xl">{metricStore.clickMapSearch ? 'Clicks' : 'Sessions'}</h2>
<div className="ml-2 color-gray-medium">
{metricStore.clickMapLabel ? `"${metricStore.clickMapLabel}" ` : null}
{metricStore.clickMapLabel ? `on "${metricStore.clickMapLabel}" ` : null}
between <span className="font-medium color-gray-darkest">{startTime}</span> and{' '}
<span className="font-medium color-gray-darkest">{endTime}</span>{' '}
</div>

View file

@ -21,7 +21,6 @@ const PUSH_NEW_SITE = 'user/PUSH_NEW_SITE';
const SET_ONBOARDING = 'user/SET_ONBOARDING';
const initialState = Map({
// client: Client(),
account: Account(),
siteId: null,
passwordRequestError: false,
@ -121,10 +120,6 @@ export const fetchUserInfo = () => dispatch => Promise.all([
types: FETCH_ACCOUNT.toArray(),
call: client => client.get('/account'),
}),
// dispatch({
// types: FETCH_CLIENT.toArray(),
// call: client => client.get('/client'),
// }),
]);
export function logout() {