feat: dashboard v2, esm, upgrades (#211)
* esm * wip * wip * wip * wip * wip * wip * subscription notice * wip * wip * wip * fix envs * fix: update docker build * fix * esm/types * delete dashboard :D * add patches to dockerfiles * update packages + catalogs + ts * wip * remove native libs * ts * improvements * fix redirects and fetching session * try fix favicon * fixes * fix * order and resize reportds within a dashboard * improvements * wip * added userjot to dashboard * fix * add op * wip * different cache key * improve date picker * fix table * event details loading * redo onboarding completely * fix login * fix * fix * extend session, billing and improve bars * fix * reduce price on 10M
This commit is contained in:
committed by
GitHub
parent
436e81ecc9
commit
81a7e5d62e
125
apps/start/src/utils/title.ts
Normal file
125
apps/start/src/utils/title.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
* Utility functions for generating page titles
|
||||
*/
|
||||
|
||||
const BASE_TITLE = 'OpenPanel.dev';
|
||||
|
||||
/**
|
||||
* Creates a hierarchical title with the format: "Page Title | Section | OpenPanel.dev"
|
||||
*/
|
||||
export function createTitle(
|
||||
pageTitle: string,
|
||||
section?: string,
|
||||
baseTitle = BASE_TITLE,
|
||||
): string {
|
||||
const parts = [pageTitle];
|
||||
if (section) {
|
||||
parts.push(section);
|
||||
}
|
||||
parts.push(baseTitle);
|
||||
return parts.join(' | ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a title for organization-level pages
|
||||
*/
|
||||
export function createOrganizationTitle(
|
||||
pageTitle: string,
|
||||
organizationName?: string,
|
||||
): string {
|
||||
if (organizationName) {
|
||||
return createTitle(pageTitle, organizationName);
|
||||
}
|
||||
return createTitle(pageTitle, 'Organization');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a title for project-level pages
|
||||
*/
|
||||
export function createProjectTitle(
|
||||
pageTitle: string,
|
||||
projectName?: string,
|
||||
organizationName?: string,
|
||||
): string {
|
||||
const parts = [pageTitle];
|
||||
if (projectName) {
|
||||
parts.push(projectName);
|
||||
}
|
||||
if (organizationName) {
|
||||
parts.push(organizationName);
|
||||
}
|
||||
parts.push(BASE_TITLE);
|
||||
return parts.join(' | ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a title for specific entity pages (reports, sessions, etc.)
|
||||
*/
|
||||
export function createEntityTitle(
|
||||
entityName: string,
|
||||
entityType: string,
|
||||
projectName?: string,
|
||||
organizationName?: string,
|
||||
): string {
|
||||
const parts = [entityName, entityType];
|
||||
if (projectName) {
|
||||
parts.push(projectName);
|
||||
}
|
||||
if (organizationName) {
|
||||
parts.push(organizationName);
|
||||
}
|
||||
parts.push(BASE_TITLE);
|
||||
return parts.join(' | ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Common page titles
|
||||
*/
|
||||
export const PAGE_TITLES = {
|
||||
// Main sections
|
||||
DASHBOARD: 'Dashboard',
|
||||
EVENTS: 'Events',
|
||||
SESSIONS: 'Sessions',
|
||||
PROFILES: 'Profiles',
|
||||
PAGES: 'Pages',
|
||||
REPORTS: 'Reports',
|
||||
NOTIFICATIONS: 'Notifications',
|
||||
SETTINGS: 'Settings',
|
||||
INTEGRATIONS: 'Integrations',
|
||||
MEMBERS: 'Members',
|
||||
BILLING: 'Billing',
|
||||
CHAT: 'AI Assistant',
|
||||
REALTIME: 'Realtime',
|
||||
REFERENCES: 'References',
|
||||
|
||||
// Sub-sections
|
||||
CONVERSIONS: 'Conversions',
|
||||
STATS: 'Statistics',
|
||||
ANONYMOUS: 'Anonymous',
|
||||
IDENTIFIED: 'Identified',
|
||||
POWER_USERS: 'Power Users',
|
||||
CLIENTS: 'Clients',
|
||||
DETAILS: 'Details',
|
||||
AVAILABLE: 'Available',
|
||||
INSTALLED: 'Installed',
|
||||
INVITATIONS: 'Invitations',
|
||||
|
||||
// Actions
|
||||
CREATE: 'Create',
|
||||
EDIT: 'Edit',
|
||||
DELETE: 'Delete',
|
||||
|
||||
// Onboarding
|
||||
ONBOARDING: 'Getting Started',
|
||||
CONNECT: 'Connect',
|
||||
VERIFY: 'Verify',
|
||||
PROJECT: 'Project',
|
||||
PROJECTS: 'Projects',
|
||||
|
||||
// Auth
|
||||
LOGIN: 'Login',
|
||||
RESET_PASSWORD: 'Reset Password',
|
||||
|
||||
// Share
|
||||
SHARE: 'Shared Dashboard',
|
||||
} as const;
|
||||
Reference in New Issue
Block a user