Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ship analytics 2.0 #1332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/AnalyticsV2Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Skills from './tabs/Skills';
import { useEnterpriseAnalyticsAggregatesData } from './data/hooks';
import { GRANULARITY, CALCULATION } from './data/constants';

const PAGE_TITLE = 'AnalyticsV2';
const PAGE_TITLE = 'Analytics';

const AnalyticsV2Page = ({ enterpriseId }) => {
const [activeTab, setActiveTab] = useState('enrollments');
Expand Down
8 changes: 4 additions & 4 deletions src/components/EnterpriseApp/EnterpriseAppRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ const EnterpriseAppRoutes = ({
/>
)}

{enableAnalyticsPage && enterpriseAppPage === ROUTE_NAMES.analytics && (
{enableAnalyticsPage && enterpriseAppPage === ROUTE_NAMES.legacyAnalytics && (
<Route
key="analytics"
key="legacy-analytics"
path="/"
element={features.ANALYTICS_SUPPORTED ? <PlotlyAnalyticsPage /> : <FeatureNotSupportedPage />}
/>
)}

{enableAnalyticsPage && enterpriseAppPage === ROUTE_NAMES.analyticsv2 && (
{enableAnalyticsPage && enterpriseAppPage === ROUTE_NAMES.analytics && (
<Route
key="analyticsv2"
key="analytics"
path="/"
element={features.ANALYTICS_SUPPORTED
? <AnalyticsV2Page enterpriseId={enterpriseId} />
Expand Down
9 changes: 1 addition & 8 deletions src/components/EnterpriseApp/EnterpriseAppRoutes.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jest.mock('../PlotlyAnalytics', () => ({
PlotlyAnalyticsPage: () => <div>PlotlyAnalyticsPage Mock Component</div>,
}));

let mockEnterpriseAppPage = 'analyticsv2';
let mockEnterpriseAppPage = 'analytics';

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
Expand Down Expand Up @@ -67,11 +67,4 @@ describe('EnterpriseAppRoutes', () => {
renderWithProviders(defaultProps);
expect(screen.getByText('AdminPage Mock Component')).toBeInTheDocument();
});

it('renders Analytics when ANALYTICS_SUPPORTED is true', () => {
mockEnterpriseAppPage = 'analytics';
features.ANALYTICS_SUPPORTED = true;
renderWithProviders(defaultProps);
expect(screen.getByText('PlotlyAnalyticsPage Mock Component')).toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion src/components/EnterpriseApp/data/constants.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable import/prefer-default-export */

export const ROUTE_NAMES = {
legacyAnalytics: 'legacy-analytics',
analytics: 'analytics',
analyticsv2: 'analyticsv2',
appearance: 'appearance',
bulkEnrollment: 'enrollment',
bulkEnrollmentResults: 'bulk-enrollment-results',
Expand Down
6 changes: 0 additions & 6 deletions src/components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ const Sidebar = ({
icon: <Icon src={InsertChartOutlined} />,
hidden: !features.ANALYTICS || !enableAnalyticsScreen,
},
{
title: 'AnalyticsV2',
to: `${baseUrl}/admin/${ROUTE_NAMES.analyticsv2}`,
icon: <Icon src={InsertChartOutlined} />,
hidden: !features.ANALYTICS_V2,
},
{
title: 'Code Management',
to: `${baseUrl}/admin/${ROUTE_NAMES.codeManagement}`,
Expand Down
1 change: 0 additions & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const features = {
CODE_MANAGEMENT: process.env.FEATURE_CODE_MANAGEMENT || hasFeatureFlagEnabled('CODE_MANAGEMENT'),
REPORTING_CONFIGURATIONS: process.env.FEATURE_REPORTING_CONFIGURATIONS || hasFeatureFlagEnabled('REPORTING_CONFIGURATIONS'),
ANALYTICS: process.env.FEATURE_ANALYTICS || hasFeatureFlagEnabled('ANALYTICS'),
ANALYTICS_V2: process.env.FEATURE_ANALYTICS_V2 || hasFeatureFlagEnabled('ANALYTICS_V2'),
ANALYTICS_SUPPORTED: process.env.ANALYTICS_SUPPORTED || hasFeatureFlagEnabled('ANALYTICS_SUPPORTED'),
SAML_CONFIGURATION: process.env.FEATURE_SAML_CONFIGURATION || hasFeatureFlagEnabled('SAML_CONFIGURATION'),
SUPPORT: process.env.FEATURE_SUPPORT || hasFeatureFlagEnabled('SUPPORT'),
Expand Down