Skip to content

Follow up insights - user metrics#8016

Merged
PeerRich merged 111 commits intomainfrom
6507-cal-803-analytics
Apr 4, 2023
Merged

Follow up insights - user metrics#8016
PeerRich merged 111 commits intomainfrom
6507-cal-803-analytics

Conversation

@alannnc
Copy link
Copy Markdown
Contributor

@alannnc alannnc commented Mar 29, 2023

What does this PR do?

  • Add single team members bookings that don't belong to team to any metric.

https://www.loom.com/share/30c75cb2e5234b2dac6fc0af896d1bfa

Environment: Staging(main branch)

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Move to packages/prisma, run yarn seed-insights couple times.
  • Enter with desired user member or admin account.
  • Use filters and see numbers change.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

Validate we have everything in this comment:
#7922 (comment)

</div>
<small className="block text-center text-gray-600">
{t("looking_for_more_analytics")}
{t("looking_for_more_insights")}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style or text changes.

colors={["blue"]}
valueFormatter={valueFormatter}
/>
)}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added logic components to display if data is empty.


if (!isSuccess || !startDate || !endDate || !teamId || data?.empty) return null;
if (isLoading) {
return <LoadingKPICards categories={categories} />;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show while loading.

<path
className="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component that can be reused inside every card from insights while loading.

setSelectedUserId(parsedUserId);
setSelectedTeamId(null);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaning url and context state.

import dayjs from "@calcom/dayjs";
import { hashPassword } from "@calcom/features/auth/lib/hashPassword";

const shuffle = (
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a reusable function.

},
});

if (userSingleEventsAdmin.length === 0 && userSingleEvents.length === 0) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added bookins and event types that belong to team members but they don't belong to the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only High priority Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants